@routerhub/agent-rules 1.5.32 → 1.5.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.base.md +1 -0
- package/package.json +1 -1
- package/postinstall.js +12 -0
- package/rules/global.md +1 -0
package/AGENTS.base.md
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
## Git 规范
|
|
13
13
|
|
|
14
14
|
- 分支用 Git Flow(`feature/`、`bugfix/`、`hotfix/`、`refactor/`、`chore/`、`docs/`、`test/`),英文小写中划线分隔。
|
|
15
|
+
- `test` 分支为测试环境专用分支,禁止直接在 `test` 分支上提交代码;所有代码必须在功能分支上开发完成后,通过 PR 合入 `test` 分支。合入后部署 `test` 分支到测试环境,实现单一测试环境共用。
|
|
15
16
|
- commit 信息必须中文,禁止 `git push --force`。
|
|
16
17
|
|
|
17
18
|
## PR 提交、评审与合入规范
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -16,6 +16,18 @@ if (projectRoot.includes("node_modules")) {
|
|
|
16
16
|
process.exit(0);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
// 确保下游项目 .npmrc 中关闭 frozen-lockfile,让 pnpm install 能直接在版本更新后执行
|
|
20
|
+
const npmrcPath = path.join(projectRoot, ".npmrc");
|
|
21
|
+
let npmrcContent = "";
|
|
22
|
+
if (fs.existsSync(npmrcPath)) {
|
|
23
|
+
npmrcContent = fs.readFileSync(npmrcPath, "utf-8");
|
|
24
|
+
}
|
|
25
|
+
if (!npmrcContent.includes("frozen-lockfile")) {
|
|
26
|
+
const newEntry = "\n# 允许 pnpm install 在依赖版本更新后直接执行(由 agent-rules 自动添加)\nfrozen-lockfile=false\n";
|
|
27
|
+
fs.appendFileSync(npmrcPath, newEntry);
|
|
28
|
+
console.log("[agent-rules] 已配置 .npmrc: frozen-lockfile=false");
|
|
29
|
+
}
|
|
30
|
+
|
|
19
31
|
console.log("");
|
|
20
32
|
console.log("[agent-rules] 安装完成,正在同步规则文件...");
|
|
21
33
|
|
package/rules/global.md
CHANGED
|
@@ -12,6 +12,7 @@ name: "通用规则"
|
|
|
12
12
|
## Git 规范
|
|
13
13
|
|
|
14
14
|
- 分支用 Git Flow(`feature/`、`bugfix/`、`hotfix/`、`refactor/`、`chore/`、`docs/`、`test/`),英文小写中划线分隔。
|
|
15
|
+
- `test` 分支为测试环境专用分支,禁止直接在 `test` 分支上提交代码;所有代码必须在功能分支上开发完成后,通过 PR 合入 `test` 分支。合入后部署 `test` 分支到测试环境,实现单一测试环境共用。
|
|
15
16
|
- commit 信息必须中文,禁止 `git push --force`。
|
|
16
17
|
|
|
17
18
|
## PR 提交、评审与合入规范
|