diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index db785b10..00000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.git/ -.vscode -/build/ -/dist/ -/coverage/ -/LICENSE.md -/modules/ -/node_modules/ -/worktrees/ -!.* diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 6313b56c..00000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/.github/husky/pre-commit b/.github/husky/pre-commit index d37daa07..95456c4e 100755 --- a/.github/husky/pre-commit +++ b/.github/husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx --no-install lint-staged +npx --no-install lint-staged --config .github/lint-staged.js diff --git a/.github/lint-staged.js b/.github/lint-staged.js new file mode 100644 index 00000000..3da022b4 --- /dev/null +++ b/.github/lint-staged.js @@ -0,0 +1,9 @@ +module.exports = { + '*.{ts,tsx,js,jsx}': [ + 'prettier --write', + 'npm run lint-es:file:fix', + () => 'npm run test', + ], + '*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}': + 'prettier --write', +}; diff --git a/.github/renovate.json b/.github/renovate.json index ef739afe..a57391f3 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -5,7 +5,7 @@ { "description": "Disable updates for aliased commitlint packages with a final version", "packagePatterns": [ - "^@commitlint/(lint|load)\\-(9|10|11|12|13|14|15)\\.x" + "^@commitlint/(lint|load)\\-(9|10|11|12|13|14|15|16)\\.x" ], "depTypeList": ["devDependencies"], "enabled": false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 401c5c3c..680a3745 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,70 +3,36 @@ on: push: branches: - main + - beta - 'renovate/**' - - 'github-renovate/**' pull_request: jobs: lint: uses: vidavidorra/.github/.github/workflows/node-lint.yml@831cdfeaf21957af495b3d518c1a877d5ffd3253 # v2.1.1 build: - name: Build (Node.js v${{ matrix.node }}) - runs-on: ubuntu-latest - timeout-minutes: 5 + name: Build (Node.js ${{ matrix.nodeVersion }}) strategy: fail-fast: false matrix: - node: [12, 14, 16] - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: Setup node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ matrix.node }} - - name: Install project - run: npm ci --ignore-scripts - - name: Build - run: npm run build + nodeVersion: [16, 18, 19] + uses: vidavidorra/.github/.github/workflows/node-build.yml@831cdfeaf21957af495b3d518c1a877d5ffd3253 # v2.1.1 + with: + nodeVersion: ${{ matrix.nodeVersion }} test: name: Test (Node.js v${{ matrix.node }}) - runs-on: ubuntu-latest - timeout-minutes: 5 strategy: fail-fast: false matrix: - node: [12, 14, 16] - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: Setup node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: ${{ matrix.node }} - - name: Install project - run: npm ci --ignore-scripts - - name: Test - run: npm test + node: [16, 18, 19] + uses: vidavidorra/.github/.github/workflows/node-test.yml@831cdfeaf21957af495b3d518c1a877d5ffd3253 # v2.1.1 + with: + nodeVersion: ${{ matrix.node }} code-coverage: + name: Test coverage needs: [lint, build, test] - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: Setup node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - with: - node-version: 14 - - name: Install project - run: npm ci --ignore-scripts - - name: Test - run: npm test - - name: Upload coverage to Codecov - uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865 # v3.1.2 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage/cobertura-coverage.xml + uses: vidavidorra/.github/.github/workflows/node-test-coverage.yml@v2.1.0 + secrets: + codecovToken: ${{ secrets.CODECOV_TOKEN }} release: needs: [lint, build, test, code-coverage] runs-on: ubuntu-latest diff --git a/.github/workflows/lint-commit-messages.yml b/.github/workflows/lint-commit-messages.yml index b3966961..bbbcb02d 100644 --- a/.github/workflows/lint-commit-messages.yml +++ b/.github/workflows/lint-commit-messages.yml @@ -3,8 +3,8 @@ on: push: branches: - main + - beta - 'renovate/**' - - 'github-renovate/**' pull_request: jobs: lint-commit-messages: diff --git a/.lintstagedrc.js b/.lintstagedrc.js deleted file mode 100644 index 4c86a3ff..00000000 --- a/.lintstagedrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - '*.{ts,tsx,js,jsx,json}': [ - 'npm run format:file', - 'npm run lint-es:file:fix', - () => 'npm run test', - ], - '*.{vue,css,less,scss,html,htm,md,markdown,yml,yaml}': [ - 'npm run format:file', - ], -}; diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index de2f53cd..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - singleQuote: true, - trailingComma: 'all', -}; diff --git a/.releaserc.js b/.releaserc.js deleted file mode 100644 index eb4b2b57..00000000 --- a/.releaserc.js +++ /dev/null @@ -1,60 +0,0 @@ -module.exports = { - branches: ['main'], - plugins: [ - [ - '@semantic-release/commit-analyzer', - { - releaseRules: [ - { type: 'perf', release: 'patch' }, - { type: 'revert', release: 'patch' }, - { type: 'docs', release: 'patch' }, - { type: 'chore', release: false }, - { type: 'refactor', release: 'patch' }, - { type: 'test', release: 'patch' }, - { type: 'build', release: 'patch' }, - { type: 'ci', release: 'patch' }, - ], - }, - ], - '@semantic-release/release-notes-generator', - '@semantic-release/changelog', - [ - '@semantic-release/exec', - { - prepareCmd: 'npm run format:file CHANGELOG.md', - }, - ], - ['@semantic-release/npm', { tarballDir: 'dist' }], - '@semantic-release/git', - [ - '@semantic-release/github', - { - assets: 'dist/*.tgz', - }, - ], - ], - preset: 'conventionalcommits', - presetConfig: { - /** - * Types from the Conventional Changelog conventionalcommits.org convention. - * The types are used as they were in version 4.5.0, of which the link to - * the exact location is shown below. The only change to the types array is - * whether some types are hidden or not. - * - * https://github.com/conventional-changelog/conventional-changelog/blob/conventional-changelog-conventionalcommits%404.5.0/packages/conventional-changelog-conventionalcommits/writer-opts.js#L169 - */ - types: [ - { type: 'feat', section: 'Features' }, - { type: 'fix', section: 'Bug Fixes' }, - { type: 'perf', section: 'Performance Improvements' }, - { type: 'revert', section: 'Reverts' }, - { type: 'docs', section: 'Documentation' }, - { type: 'style', section: 'Styles' }, - { type: 'chore', section: 'Miscellaneous Chores', hidden: true }, - { type: 'refactor', section: 'Code Refactoring' }, - { type: 'test', section: 'Tests' }, - { type: 'build', section: 'Build System' }, - { type: 'ci', section: 'Continuous Integration' }, - ], - }, -}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ffb2ba..f1b0d4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## [2.0.0-beta.2](https://github.com/vidavidorra/commitlint-plugin-function-rules/compare/v2.0.0-beta.1...v2.0.0-beta.2) (2023-06-19) + +### Continuous Integration + +- **renovate:** disable for commitlint v16 final version ([7cb48af](https://github.com/vidavidorra/commitlint-plugin-function-rules/commit/7cb48af598025adc12ad8b54c0a2da3511ad49d4)) + +## [2.0.0-beta.1](https://github.com/vidavidorra/commitlint-plugin-function-rules/compare/v1.7.1...v2.0.0-beta.1) (2023-04-17) + +### ⚠ BREAKING CHANGES + +- drop support for Node.js v12, which is EOL, and v14, which is EOL in a couple days + +### Features + +- drop support for Node.js v12, which is EOL, and v14, which is EOL in a couple days ([91c872b](https://github.com/vidavidorra/commitlint-plugin-function-rules/commit/91c872b77560fbe79008536ae6a7f2ba2808442b)) + ### [1.7.1](https://github.com/vidavidorra/commitlint-plugin-function-rules/compare/v1.7.0...v1.7.1) (2022-05-22) ### Tests diff --git a/LICENSE.md b/LICENSE.md index 51bbbe9e..94c926de 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -217,23 +217,23 @@ produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: -- a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. -- b) The work must carry prominent notices stating that it is - released under this License and any conditions added under - section 7. This requirement modifies the requirement in section 4 - to "keep intact all notices". -- c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. -- d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, @@ -252,42 +252,42 @@ sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: -- a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. -- b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the Corresponding - Source from a network server at no charge. -- c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. -- d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. -- e) Convey the object code using peer-to-peer transmission, - provided you inform other peers where the object code and - Corresponding Source of the work are being offered to the general - public at no charge under subsection 6d. +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be @@ -363,23 +363,23 @@ Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: -- a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or -- b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or -- c) Prohibiting misrepresentation of the origin of that material, - or requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or -- d) Limiting the use for publicity purposes of names of licensors - or authors of the material; or -- e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or -- f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions - of it) with contractual assumptions of liability to the recipient, - for any liability that these contractual assumptions directly - impose on those licensors and authors. +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you diff --git a/README.md b/README.md index 3f543bf1..0d0ad214 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Please refer to the [Security Policy on GitHub](https://github.com/vidavidorra/c This project is licensed under the [GPLv3 license](https://www.gnu.org/licenses/gpl.html). -Copyright © 2020-2021 Jeroen de Bruijn +Copyright © 2020-2023 Jeroen de Bruijn
License details.

diff --git a/package-lock.json b/package-lock.json index 55504f41..c65701ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "commitlint-plugin-function-rules", - "version": "1.7.1", + "version": "2.0.0-beta.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "commitlint-plugin-function-rules", - "version": "1.7.1", + "version": "2.0.0-beta.2", "license": "GPL-3.0-or-later", "devDependencies": { "@ava/typescript": "3.0.1", @@ -53,7 +53,7 @@ "typescript": "4.8.4" }, "engines": { - "node": ">=12" + "node": ">=16" }, "peerDependencies": { "@commitlint/lint": ">=9.1.2 <18" diff --git a/package.json b/package.json index 96ee107b..58528072 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "commitlint-plugin-function-rules", - "version": "1.7.1", + "version": "2.0.0-beta.2", "description": "commitlint plugin to define rules as functions.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -15,13 +15,9 @@ "lint-es:file": "eslint --ext .ts,.tsx,.js,.jsx,.json", "lint-es:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix .", "lint-es:file:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix", - "format": "prettier --ignore-path .eslintignore --write \"**/*.{js,jsx,vue,ts,css,less,scss,html,htm,json,md,markdown,yml,yaml}\"", - "format:check": "prettier --ignore-path .eslintignore --check \"**/*.{js,jsx,vue,ts,css,less,scss,html,htm,json,md,markdown,yml,yaml}\"", - "format:file": "prettier --write", + "format:check": "prettier --ignore-path .gitignore --check \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --loglevel warn", + "format": "prettier --ignore-path .gitignore --write \"**/*.{vue,css,less,scss,html,htm,json,md,markdown,yml,yaml}\" --loglevel warn", "build": "tsc", - "build:check": "tsc --noEmit", - "build:clean-first": "run-s clean build", - "clean": "rm -rf ./dist", "test": "c8 ava" }, "repository": { @@ -41,7 +37,7 @@ }, "homepage": "https://github.com/vidavidorra/commitlint-plugin-function-rules#readme", "engines": { - "node": ">=12" + "node": ">=16" }, "peerDependencies": { "@commitlint/lint": ">=9.1.2 <18" @@ -107,5 +103,130 @@ "include": [ "dist/**/*.js" ] + }, + "prettier": { + "singleQuote": true, + "trailingComma": "all" + }, + "release": { + "branches": [ + "main", + { + "name": "beta", + "prerelease": true + } + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "releaseRules": [ + { + "type": "perf", + "release": "patch" + }, + { + "type": "revert", + "release": "patch" + }, + { + "type": "docs", + "release": "patch" + }, + { + "type": "chore", + "release": false + }, + { + "type": "refactor", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "build", + "release": "patch" + }, + { + "type": "ci", + "release": "patch" + } + ] + } + ], + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + [ + "@semantic-release/exec", + { + "prepareCmd": "prettier --write CHANGELOG.md" + } + ], + [ + "@semantic-release/npm", + { + "tarballDir": "dist" + } + ], + "@semantic-release/git", + [ + "@semantic-release/github", + { + "assets": "dist/*.tgz" + } + ] + ], + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": true + }, + { + "type": "refactor", + "section": "Code Refactoring" + }, + { + "type": "test", + "section": "Tests" + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration" + } + ] + } } }