@dsh-workbench/module-tools 0.1.12 → 0.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/module-tools",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "模块包的构建与门禁工具:build(单文件 ESM 宿主侧 + 套 loader 壳的浏览器侧)、check(契约/产物边界/源码边界/卡片渲染)。模块包不再各带一份构建脚本。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,8 +22,16 @@ function walk(dir, acc = []) {
22
22
  return acc;
23
23
  }
24
24
 
25
+ // 只扫**工作台自己会发出去的**包:声明了 `dsh.workbench` 的模块,或 `@dsh-workbench/*` 名下的。
26
+ // 不能照搬"本 workspace 里所有 access=public 的包" —— 在外壳仓里等价,但把这个工具拿到
27
+ // 别人的 monorepo(例如 pdv2)里跑时,那条会把人家二十几个自家 SDK 包一起判了。
28
+ const OWN_SCOPE = '@dsh-workbench/';
29
+ const isOurs = (pkg) =>
30
+ pkg.manifest.dsh?.workbench !== void 0 ||
31
+ String(pkg.manifest.name ?? '').startsWith(OWN_SCOPE);
32
+
25
33
  const publicPackages = discoverPackages({ root: process.cwd() }).filter(
26
- (pkg) => pkg.manifest.publishConfig?.access === 'public',
34
+ (pkg) => isOurs(pkg) && pkg.manifest.publishConfig?.access === 'public',
27
35
  );
28
36
  const problems = [];
29
37
  for (const pkg of publicPackages) {