Skip to content

Commit

Permalink
feat: initialize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudvanbuul committed Jun 21, 2023
1 parent 93e7936 commit 3448f07
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 241 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
pull_request:
'on':
push: null
pull_request: null
jobs:
commit-check:
name: Check Conventional Commit
Expand All @@ -26,10 +26,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: './.github/actions/ci-node-setup'
uses: ./.github/actions/ci-node-setup
with:
node-version-file: .nvmrc

- name: Build
run: npm run build
- name: Upload build artifacts
Expand All @@ -44,10 +43,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: './.github/actions/ci-node-setup'
uses: ./.github/actions/ci-node-setup
with:
node-version-file: .nvmrc

- name: Lint
run: npm run lint
- name: Format
Expand All @@ -57,7 +55,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [18, lts/*, latest]
version:
- 18
- lts/*
- latest
include:
- version: 18
name: 18
Expand All @@ -71,13 +72,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node (${{ matrix.version }})
uses: './.github/actions/ci-node-setup'
uses: ./.github/actions/ci-node-setup
with:
node-version: ${{ matrix.version }}

- name: Test (With Coverage)
run: npm run test:coverage

- name: Upload test artifacts
uses: actions/upload-artifact@v3
if: success() || failure()
Expand All @@ -90,12 +89,11 @@ jobs:
with:
name: test-coverage-${{ matrix.name }}
path: coverage/cobertura-coverage.xml

- name: Upload coverage reports to Code Climate
uses: paambaati/[email protected]
if: ${{ matrix.name == 'lts' }}
env:
CC_TEST_REPORTER_ID: 58fee0878c31e85a459cb081232fb69f843bf41b49d4ddf5bfd89373bbba0e81
CC_TEST_REPORTER_ID: 035f1781dd52b769641df927fa8372bed53568164644fb445c2e0d023f12442c
with:
coverageLocations: |
coverage/cobertura-coverage.xml:cobertura
112 changes: 0 additions & 112 deletions CHANGELOG.md

This file was deleted.

114 changes: 8 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,10 @@
[![NPM Version](https://img.shields.io/npm/v/@bed-and-breakfast/templates-open-source)](https://www.npmjs.com/package/@bed-and-breakfast/templates-open-source)
[![CI](https://github.com/bed-and-breakfast/templates-open-source/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bed-and-breakfast/templates-open-source/actions/workflows/ci.yml)
[![Release](https://github.com/bed-and-breakfast/templates-open-source/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/bed-and-breakfast/templates-open-source/actions/workflows/release.yml)
[![Code Climate](https://codeclimate.com/github/bed-and-breakfast/templates-open-source/badges/gpa.svg)](https://codeclimate.com/github/bed-and-breakfast/templates-open-source)
[![Code Coverage](https://codeclimate.com/github/bed-and-breakfast/templates-open-source/badges/coverage.svg)](https://codeclimate.com/github/bed-and-breakfast/templates-open-source)
[![Known Vulnerabilities](https://snyk.io/test/github/bed-and-breakfast/templates-open-source/badge.svg?targetFile=package.json)](https://snyk.io/test/github/bed-and-breakfast/templates-open-source?targetFile=package.json)
# Improved NestJS HttpModule

[![NPM Version](https://img.shields.io/npm/v/@bed-and-breakfast/nestjs-improved-http-module)](https://www.npmjs.com/package/@bed-and-breakfast/nestjs-improved-http-module)
[![CI](https://github.com/bed-and-breakfast/nestjs-improved-http-module/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bed-and-breakfast/nestjs-improved-http-module/actions/workflows/ci.yml)
[![Release](https://github.com/bed-and-breakfast/nestjs-improved-http-module/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/bed-and-breakfast/nestjs-improved-http-module/actions/workflows/release.yml)
[![Code Climate](https://codeclimate.com/github/bed-and-breakfast/nestjs-improved-http-module/badges/gpa.svg)](https://codeclimate.com/github/bed-and-breakfast/nestjs-improved-http-module)
[![Code Coverage](https://codeclimate.com/github/bed-and-breakfast/nestjs-improved-http-module/badges/coverage.svg)](https://codeclimate.com/github/bed-and-breakfast/nestjs-improved-http-module)
[![Known Vulnerabilities](https://snyk.io/test/github/bed-and-breakfast/nestjs-improved-http-module/badge.svg?targetFile=package.json)](https://snyk.io/test/github/bed-and-breakfast/nestjs-improved-http-module?targetFile=package.json)
[![Semantic Release: Conventional Commits](https://img.shields.io/badge/semantic--release-conventional--commits-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

# Bed & Breakfast Open Source Repository Template

GitHub repository template to make developing typescript packages easier. Creates an out-of-the-box environment for best code practices and project management.

# Features

- Complete GitHub CI/CD process
- Typescript builds for ESM and CommonJS
- Validate commit format ([conventional commits](https://www.conventionalcommits.org/en/v1.0.0/))
- Check for broken Markdown links ([markdown-link-check](https://github.com/tcort/markdown-link-check))
- Validate linting ([typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)) and formatting ([prettier](https://github.com/prettier/prettier))
- Test integration
- Test against all major node versions (18, LTS, latest)
- Test reports in all CI workflows (including PRs)
- Coverage reports in all CI workflows (including PRs)
- Coverage history and code quality analysis ([Code Climate](https://codeclimate.com/))
- Automatic releases based on git log ([semantic-release](https://github.com/semantic-release/semantic-release))
- Only release when CI is successful
- Automatically creates semver versions
- Generates changelog
- Releases npm package
- Releases GitHub release
- Improved development
- Force [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) in pre-commit and CI
- Ability to use [comittizen](https://github.com/commitizen/cz-cli) for guided commit messages
- Repository management
- Automatic PRs for dependency updates ([renovate](https://github.com/renovatebot/renovate))
- _Todo issue bot ([todobot](https://github.com/apps/todobot))_
- _Automatic issue labelling ([issue-label-bot](https://github.com/marketplace/issue-label-bot))_
- _Stale bot ([stale](https://github.com/actions/stale))_
- Documentation and templates
- README stub with configured badges
- _Issue templates_
- _PR template_
- _CODEOWNERS, CODE_OF_CONDUCT, CONTRIBUTING, LICENSE, SECURITY, SUPPORT_

# Getting Started

Create a new repository using this [template](https://github.com/bed-and-breakfast/templates-open-source) ([instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)).

## Initialize the repository

We can use @bed-and-breakfast/template-tools to initialize the repository. Execute the following command and follow the instructions on the screen.

```sh
npx template-init
```

## Adding a remote to pull updates

Bed & Breakfast repository templates will be updated over time. Start by setting up a remote with the template-add-remote command.

```sh
npx template-add-remote
```

## Pulling updates from the template

You can then use the following command to pull these changes into an existing repository:

```sh
npx template-pull
```

> **Note**
> Be careful resolving conflicts when pulling from a template. Files like package.json, README.md, CHANGELOG.md etc. will have changes you don't want to accept.
# Development

## Making commits

| Action | Command |
| -------------- | ------------------------------------------------------------- |
| Build | `npm run build` |
| Test | `npm run test`, `npm run test:coverage`, `npm run test:watch` |
| Lint | `npm run lint`, `npm run lint:fix` |
| Format | `npm run format`, `npm run format:fix` |
| Format Package | `npm run format:package` |
| Check Markdown | `npm run check:md` |

### Using commitizen

```sh
npm i -g commitizen
```

```sh
npm run commit
```

# Releasing

Releasing is completely automated and is as simple as:

```sh
git push
```

It will create a new release based on all commits since the last release.
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"name": "@bed-and-breakfast/templates-open-source",
"version": "4.2.18",
"description": "Bed & Breakfast Open Source Template",
"name": "@bed-and-breakfast/nestjs-improved-http-module",
"version": "0.0.0",
"description": "Improved NestJS HttpModule",
"private": false,
"engines": {
"node": ">=18.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/bed-and-breakfast/templates-open-source.git"
"url": "https://github.com/bed-and-breakfast/nestjs-improved-http-module.git"
},
"bugs": "https://github.com/bed-and-breakfast/templates-open-source/issues",
"homepage": "https://github.com/bed-and-breakfast/templates-open-source",
"bugs": "https://github.com/bed-and-breakfast/nestjs-improved-http-module/issues",
"homepage": "https://github.com/bed-and-breakfast/nestjs-improved-http-module",
"author": "Bed & Breakfast",
"keywords": [
"bed",
"breakfast",
"package",
"template",
"open source"
"nestjs",
"http",
"module",
"httpmodule",
"timeout",
"network"
],
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down

0 comments on commit 3448f07

Please sign in to comment.