From 00b556a9c85ad10f2659ca5105af8f628f97bfa3 Mon Sep 17 00:00:00 2001 From: zhaohappy <2281756061@qq.com> Date: Fri, 13 Dec 2024 20:10:56 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=96=B0=E5=A2=9E=20scripts=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=EF=BC=8C=E6=B7=BB=E5=8A=A0=20git=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 - .github/commit-convention.md | 91 +++++++++++++++++++++++ package-lock.json | 37 ++++----- package.json | 10 ++- {build => scripts}/build-package.js | 0 scripts/pre-commit.js | 25 +++++++ {build => scripts}/update-dependencies.js | 0 scripts/verify-commit.js | 26 +++++++ src/cheap | 2 +- 9 files changed, 163 insertions(+), 29 deletions(-) create mode 100644 .github/commit-convention.md rename {build => scripts}/build-package.js (100%) create mode 100644 scripts/pre-commit.js rename {build => scripts}/update-dependencies.js (100%) create mode 100644 scripts/verify-commit.js diff --git a/.eslintignore b/.eslintignore index cffdc171..31cca6bb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,2 @@ -*.js *.d.ts *.test.ts diff --git a/.github/commit-convention.md b/.github/commit-convention.md new file mode 100644 index 00000000..6ad05f54 --- /dev/null +++ b/.github/commit-convention.md @@ -0,0 +1,91 @@ +## Git Commit Message Convention + +> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). + +#### TL;DR: + +Messages must be matched by the following regex: + +```js +/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .+/; +``` + +#### Examples + +Appears under "Features" header, `avformat` subheader: + +``` +feat(avformat): add 'IMp4Format' feature +``` + +Appears under "Bug Fixes" header, `avcodec` subheader, with a link to issue #00: + +``` +fix(avcodec): when stop reset subTaskId and subtitleTaskId + +close #00 +``` + +Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: + +``` +perf(avrender): improve performance by utilizing WebGL + +BREAKING CHANGE: The performance enhancement now relies on WebGL. +``` + +The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. + +``` +revert: feat(avutil): add 'av1syntax' feature + +This reverts commit 667ecc1654a317a13331b17617d973392f415f02. +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +