Skip to content

Commit

Permalink
Merge 0390b71 into 2875efc
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Apr 19, 2024
2 parents 2875efc + 0390b71 commit 4a3c708
Show file tree
Hide file tree
Showing 10 changed files with 1,409 additions and 94 deletions.
29 changes: 29 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import scopes from '@commitlint/config-pnpm-scopes'

export default {
extends: [
'@commitlint/config-conventional',
'@commitlint/config-pnpm-scopes'
],
rules: {
'body-max-line-length': [0],
'scope-enum': async (ctx) => {
const scopeEnum = await scopes.rules['scope-enum'](ctx)

return [
scopeEnum[0],
scopeEnum[1],
[
...scopeEnum[2],
'deps',
'dev-deps'
]
]
}
},
prompt: {
settings: {
enableMultipleScopes: true
}
}
}
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "@commitlint/cz-commitlint"
}
9 changes: 9 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"config:base",
":preserveSemverRanges"
],
"constraints": {
"pnpm": "^8.7.5"
}
}
66 changes: 0 additions & 66 deletions .github/workflows/ci.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Commit
on:
push:
jobs:
commitlint:
runs-on: ubuntu-latest
name: commitlint
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run commitlint
run: pnpm commitlint --from=HEAD~1
116 changes: 116 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
types:
runs-on: ubuntu-latest
name: types
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check types
run: pnpm test:types
lint:
runs-on: ubuntu-latest
name: lint
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Lint files
run: pnpm lint
unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 18
- 20
name: Node.js ${{ matrix.node-version }} / unit
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: git config --global user.name 'CI'
- run: git config --global user.email 'dummy@example.org'
- name: Run tests
run: pnpm test
- name: Collect coverage
uses: coverallsapp/github-action@main
with:
flag-name: actions ${{ matrix.node-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
fail-on-error: false
unit-windows:
runs-on: windows-latest
name: Windows / unit
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: git config --global user.name 'CI'
- run: git config --global user.email 'dummy@example.org'
- name: Run tests
run: pnpm test -- --test-timeout=60000
- name: Collect coverage
uses: coverallsapp/github-action@main
with:
flag-name: actions windows
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
fail-on-error: false
finish:
needs: [unit, unit-windows]
runs-on: ubuntu-latest
steps:
- name: Upload collected coverage
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
3 changes: 3 additions & 0 deletions .nano-staged.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,cjs,ts}": "eslint --fix"
}
4 changes: 4 additions & 0 deletions .simple-git-hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"commit-msg": "pnpm commitlint --edit \"$1\"",
"pre-commit": "pnpm nano-staged"
}
29 changes: 13 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,43 @@
"main": "",
"name": "conventional-changelog-monorepo",
"private": true,
"renovate": {
"extends": [
"config:base",
":maintainLockFilesWeekly",
":rebaseStalePrs",
":automergeDigest",
":gitSignOff",
":preserveSemverRanges"
],
"constraints": {
"pnpm": "^8.7.5"
}
},
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
},
"scripts": {
"clear": "pnpm -r --parallel --if-present clear && del ./coverage",
"build": "pnpm -r --parallel --if-present build",
"lint": "eslint . --cache --cache-location ./node_modules/.cache/ --ignore-path .gitignore",
"fix": "eslint . --fix --cache --cache-location ./node_modules/.cache/ --ignore-path .gitignore",
"lint": "eslint '*.{js,cjs}' 'packages/**/*.{js,cjs,ts}'",
"format": "pnpm lint --fix",
"test:types": "pnpm -r --parallel --if-present test:types",
"test:watch": "vitest watch",
"test": "vitest run --coverage",
"test:types": "pnpm -r --parallel --if-present test:types"
"commit": "cz",
"updateGitHooks": "simple-git-hooks"
},
"version": "1.0.0",
"devDependencies": {
"@commitlint/cli": "^19.2.2",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/config-pnpm-scopes": "^19.1.0",
"@commitlint/cz-commitlint": "^19.2.0",
"@trigen/eslint-config": "8.0.0-alpha.32",
"@types/node": "^20.5.9",
"@vitest/coverage-v8": "^1.0.0",
"better-than-before": "^1.0.0",
"commitizen": "^4.3.0",
"conventional-changelog-core": "workspace:^",
"del-cli": "^5.1.0",
"eslint": "^8.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-promise": "^6.0.0",
"inquirer": "^9.2.19",
"nano-staged": "^0.8.0",
"safe-buffer": "5.2.1",
"simple-git-hooks": "^2.11.1",
"tsm": "^2.3.0",
"typescript": "^5.2.2",
"vinyl": "^3.0.0",
Expand Down

0 comments on commit 4a3c708

Please sign in to comment.