Skip to content

Commit 29ebb3e

Browse files
author
fanwenjie
committed
chore: use rush change in pre-commit hook
1 parent 398d9ff commit 29ebb3e

File tree

13 files changed

+119
-5
lines changed

13 files changed

+119
-5
lines changed

common/autoinstallers/plugins/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
],
99
"dependencies": {
10+
"@coze-infra/rush-publish-plugin": "../../../packages/rush-plugins/publish",
1011
"@coze-infra/rush-run-tsc-plugin": "../../../packages/rush-plugins/run-tsc-plugin",
1112
"json5": "^2.2.3",
1213
"rush-init-project-plugin": "^0.11.0",

common/autoinstallers/plugins/pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
3+
"commands": [
4+
{
5+
"name": "change-x",
6+
"commandKind": "global",
7+
"summary": "⭐️️ generate change log",
8+
"shellCommand": "rush-publish change",
9+
"safeForSimultaneousRushProcesses": true
10+
}
11+
],
12+
"parameters": [
13+
{
14+
"parameterKind": "flag",
15+
"longName": "--amend-commit",
16+
"shortName": "-a",
17+
"description": "是否 amend commit 阶段",
18+
"associatedCommands": ["change-x"]
19+
},
20+
{
21+
"parameterKind": "flag",
22+
"longName": "--ci",
23+
"shortName": "-i",
24+
"description": "是否在 CI 环境",
25+
"associatedCommands": ["change-x"]
26+
},
27+
{
28+
"parameterKind": "string",
29+
"argumentName": "COMMIT_MSG",
30+
"longName": "--commit-msg",
31+
"shortName": "-c",
32+
"description": "本次提交信息,默认读取 .git/COMMIT_EDITMSG",
33+
"associatedCommands": ["change-x"]
34+
}
35+
]
36+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugin-manifest.schema.json",
3+
"plugins": [
4+
{
5+
"pluginName": "@coze-infra/rush-publish-plugin",
6+
"description": "rush plugin to generate change log and publish packages",
7+
"commandLineJsonFilePath": "./command-line.json"
8+
}
9+
]
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-infra/rush-publish-plugin",
5+
"comment": "use rush change in pre-commit hook",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-infra/rush-publish-plugin",
10+
"email": "[email protected]"
11+
}

common/config/rush/rush-plugins.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
"packageName": "@coze-infra/rush-run-tsc-plugin",
3535
"pluginName": "@coze-infra/rush-run-tsc-plugin",
3636
"autoinstallerName": "plugins"
37+
},
38+
{
39+
"packageName": "@coze-infra/rush-publish-plugin",
40+
"pluginName": "@coze-infra/rush-publish-plugin",
41+
"autoinstallerName": "plugins"
3742
}
3843
]
3944
}

common/config/subspaces/default/pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/git-hooks/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ else
3434
node common/scripts/install-run-rush.js -q commitlint \
3535
--config common/autoinstallers/rush-commitlint/commitlint.config.js \
3636
--edit "$1" || exit 1
37+
38+
node common/scripts/install-run-rush.js change-x || exit 1
3739
fi

common/git-hooks/post-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
node common/scripts/install-run-rush.js change-x -a || exit 1

packages/rush-plugins/publish/command-line.json

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,35 @@
22
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
33
"commands": [
44
{
5-
"shellCommand": "change",
6-
"description": "Generate changes in a simple way."
5+
"name": "change-x",
6+
"commandKind": "global",
7+
"summary": "⭐️️ generate change log",
8+
"shellCommand": "rush-publish change",
9+
"safeForSimultaneousRushProcesses": true
710
}
811
],
9-
"parameters": []
12+
"parameters": [
13+
{
14+
"parameterKind": "flag",
15+
"longName": "--amend-commit",
16+
"shortName": "-a",
17+
"description": "是否 amend commit 阶段",
18+
"associatedCommands": ["change-x"]
19+
},
20+
{
21+
"parameterKind": "flag",
22+
"longName": "--ci",
23+
"shortName": "-i",
24+
"description": "是否在 CI 环境",
25+
"associatedCommands": ["change-x"]
26+
},
27+
{
28+
"parameterKind": "string",
29+
"argumentName": "COMMIT_MSG",
30+
"longName": "--commit-msg",
31+
"shortName": "-c",
32+
"description": "本次提交信息,默认读取 .git/COMMIT_EDITMSG",
33+
"associatedCommands": ["change-x"]
34+
}
35+
]
1036
}

0 commit comments

Comments
 (0)