@routerhub/agent-rules 1.5.33 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routerhub/agent-rules",
3
- "version": "1.5.33",
3
+ "version": "1.5.34",
4
4
  "description": "Shared Copilot agent rules and guidelines for RouterHub projects",
5
5
  "main": "AGENTS.base.md",
6
6
  "bin": {
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