@bovinphang/craft-common 1.0.0 → 1.0.1

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/dist/index.js CHANGED
@@ -481,9 +481,7 @@ function validateJournal(value, target, ledgerDir, productRoots) {
481
481
  validateDestination(entry.path, target, ledgerDir, productRoots);
482
482
  for (const side of ["before", "after"]) {
483
483
  const bytes = entry[side], hash2 = entry[`${side}Hash`];
484
- if (bytes === null ? hash2 !== null : typeof bytes !== "string" || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
485
- bytes
486
- ) || hashBytes(Buffer.from(bytes, "base64")) !== hash2)
484
+ if (bytes === null ? hash2 !== null : typeof bytes !== "string" || Buffer.from(bytes, "base64").toString("base64") !== bytes || hashBytes(Buffer.from(bytes, "base64")) !== hash2)
487
485
  throw new Error("\u516C\u5171\u4E8B\u52A1\u5185\u5BB9\u6458\u8981\u65E0\u6548");
488
486
  }
489
487
  }
@@ -545,14 +543,16 @@ function normalizeProductPath(file, roots) {
545
543
  if (!relative || relative === ".." || relative.startsWith(`..${path5.sep}`) || path5.isAbsolute(relative))
546
544
  continue;
547
545
  let current = absolute;
548
- while (current !== boundary) {
546
+ while ((process.platform === "win32" ? current.toLowerCase() : current) !== (process.platform === "win32" ? boundary.toLowerCase() : boundary)) {
549
547
  try {
550
548
  if (fs5.lstatSync(current).isSymbolicLink())
551
549
  throw new Error(`\u4EA7\u54C1\u6258\u7BA1\u8DEF\u5F84\u4E0D\u5141\u8BB8\u7B26\u53F7\u94FE\u63A5\uFF1A${current}`);
552
550
  } catch (error) {
553
551
  if (error.code !== "ENOENT") throw error;
554
552
  }
555
- current = path5.dirname(current);
553
+ const parent = path5.dirname(current);
554
+ if (parent === current) throw new Error("\u4EA7\u54C1\u8DEF\u5F84\u672A\u5230\u8FBE\u58F0\u660E\u8FB9\u754C");
555
+ current = parent;
556
556
  }
557
557
  return safeManagedPath(real, relative.split(path5.sep).join("/"));
558
558
  }
@@ -1,6 +1,6 @@
1
1
  # 消费 craft-common
2
2
 
3
- 公共包首版为 `@bovinphang/craft-common@1.0.0`,要求 Node >=22、ESM。消费者精确固定版本,公共内容在本仓库维护,产品只维护自动生成的分发副本。公共源码不依赖 frontend-craft。
3
+ 公共包当前修复版为 `@bovinphang/craft-common@1.0.1`(首版 1.0.0),要求 Node >=22、ESM。1.0.1 修复较大事务日志恢复的正则栈溢出及 Windows 等价大小写路径的遍历挂起,并固定分发文本换行。消费者精确固定版本,公共内容在本仓库维护,产品只维护自动生成的分发副本。公共源码不依赖 frontend-craft。
4
4
 
5
5
  ## 内容与分发
6
6
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  `readMethodResource(packageRoot, method, language)` 提供源码核验、文档同步、诊断、重构、TDD 的通用方法字节。领域 Skill 将方法内嵌为本地 references,独立发布时不依赖相邻 Skill。修改 methods 后运行 `pnpm run sync:methods` 更新公共入口引用;评估样例独立维护。
10
10
 
11
- frontend-craft 的 `pnpm run sync:common` 生成中英文公共快照、领域方法副本和来源锁;`pnpm run check:common` 只读比对。Git 原生插件也携带这些生成快照,不要求用户执行构建。禁止手工修改生成文件。公共独立包用 1.0.0,领域独立包跟随其产品版本。
11
+ frontend-craft / backend-craft 的 `pnpm run sync:common` 生成中英文公共快照、领域方法副本和来源锁;`pnpm run check:common` 只读比对。Git 原生插件也携带这些生成快照,不要求用户执行构建。禁止手工修改生成文件。公共独立包用 1.0.1,领域独立包跟随其产品版本。两个消费者需使用相同版本、语言及精确内容摘要;升级前先通过旧产品卸载退出旧公共引用并处理保留的用户修改。
12
12
 
13
13
  检查覆盖完整公共文件集合;同步仅清理旧锁认领且哈希未变的过期文件。额外未知文件和手工修改会阻断同步并保留原文件。组合索引中的产品自有条目仍在产品维护,公共条目来自本包。
14
14
 
@@ -9,7 +9,7 @@
9
9
  "root-cause"
10
10
  ],
11
11
  "summary": "证据驱动诊断",
12
- "version": "1.0.0",
12
+ "version": "1.0.1",
13
13
  "license": "MIT",
14
14
  "homepage": "https://github.com/bovinphang/craft-common",
15
15
  "repository": "https://github.com/bovinphang/craft-common",
@@ -40,7 +40,7 @@
40
40
  "i18n"
41
41
  ],
42
42
  "summary": "文档事实同步",
43
- "version": "1.0.0",
43
+ "version": "1.0.1",
44
44
  "license": "MIT",
45
45
  "homepage": "https://github.com/bovinphang/craft-common",
46
46
  "repository": "https://github.com/bovinphang/craft-common",
@@ -72,7 +72,7 @@
72
72
  "architecture"
73
73
  ],
74
74
  "summary": "可编辑技术图",
75
- "version": "1.0.0",
75
+ "version": "1.0.1",
76
76
  "license": "MIT",
77
77
  "homepage": "https://github.com/bovinphang/craft-common",
78
78
  "repository": "https://github.com/bovinphang/craft-common",
@@ -104,7 +104,7 @@
104
104
  "baseline"
105
105
  ],
106
106
  "summary": "保持行为的重构",
107
- "version": "1.0.0",
107
+ "version": "1.0.1",
108
108
  "license": "MIT",
109
109
  "homepage": "https://github.com/bovinphang/craft-common",
110
110
  "repository": "https://github.com/bovinphang/craft-common",
@@ -135,7 +135,7 @@
135
135
  "local-knowledge"
136
136
  ],
137
137
  "summary": "以事实来源驱动开发",
138
- "version": "1.0.0",
138
+ "version": "1.0.1",
139
139
  "license": "MIT",
140
140
  "homepage": "https://github.com/bovinphang/craft-common",
141
141
  "repository": "https://github.com/bovinphang/craft-common",
@@ -166,7 +166,7 @@
166
166
  "red-green-refactor"
167
167
  ],
168
168
  "summary": "测试驱动开发",
169
- "version": "1.0.0",
169
+ "version": "1.0.1",
170
170
  "license": "MIT",
171
171
  "homepage": "https://github.com/bovinphang/craft-common",
172
172
  "repository": "https://github.com/bovinphang/craft-common",
@@ -198,7 +198,7 @@
198
198
  "png-qa"
199
199
  ],
200
200
  "summary": "结构化技术图表",
201
- "version": "1.0.0",
201
+ "version": "1.0.1",
202
202
  "license": "MIT",
203
203
  "homepage": "https://github.com/bovinphang/craft-common",
204
204
  "repository": "https://github.com/bovinphang/craft-common",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bovinphang/craft-common",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Craft AI Coding 的公共技能、研发方法与共享安装协议",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "root-cause"
10
10
  ],
11
11
  "summary": "Evidence-driven diagnosis",
12
- "version": "1.0.0",
12
+ "version": "1.0.1",
13
13
  "license": "MIT",
14
14
  "homepage": "https://github.com/bovinphang/craft-common",
15
15
  "repository": "https://github.com/bovinphang/craft-common",
@@ -40,7 +40,7 @@
40
40
  "i18n"
41
41
  ],
42
42
  "summary": "Documentation synchronization",
43
- "version": "1.0.0",
43
+ "version": "1.0.1",
44
44
  "license": "MIT",
45
45
  "homepage": "https://github.com/bovinphang/craft-common",
46
46
  "repository": "https://github.com/bovinphang/craft-common",
@@ -72,7 +72,7 @@
72
72
  "architecture"
73
73
  ],
74
74
  "summary": "Editable technical diagrams",
75
- "version": "1.0.0",
75
+ "version": "1.0.1",
76
76
  "license": "MIT",
77
77
  "homepage": "https://github.com/bovinphang/craft-common",
78
78
  "repository": "https://github.com/bovinphang/craft-common",
@@ -104,7 +104,7 @@
104
104
  "baseline"
105
105
  ],
106
106
  "summary": "Behavior-preserving refactoring",
107
- "version": "1.0.0",
107
+ "version": "1.0.1",
108
108
  "license": "MIT",
109
109
  "homepage": "https://github.com/bovinphang/craft-common",
110
110
  "repository": "https://github.com/bovinphang/craft-common",
@@ -135,7 +135,7 @@
135
135
  "local-knowledge"
136
136
  ],
137
137
  "summary": "Source-driven development",
138
- "version": "1.0.0",
138
+ "version": "1.0.1",
139
139
  "license": "MIT",
140
140
  "homepage": "https://github.com/bovinphang/craft-common",
141
141
  "repository": "https://github.com/bovinphang/craft-common",
@@ -166,7 +166,7 @@
166
166
  "red-green-refactor"
167
167
  ],
168
168
  "summary": "Test-driven development",
169
- "version": "1.0.0",
169
+ "version": "1.0.1",
170
170
  "license": "MIT",
171
171
  "homepage": "https://github.com/bovinphang/craft-common",
172
172
  "repository": "https://github.com/bovinphang/craft-common",
@@ -198,7 +198,7 @@
198
198
  "png-qa"
199
199
  ],
200
200
  "summary": "Structured technical diagrams",
201
- "version": "1.0.0",
201
+ "version": "1.0.1",
202
202
  "license": "MIT",
203
203
  "homepage": "https://github.com/bovinphang/craft-common",
204
204
  "repository": "https://github.com/bovinphang/craft-common",