@avantf/dsh-plugin-base 0.4.1 → 0.5.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/internal.js CHANGED
@@ -7,8 +7,8 @@
7
7
  * - the framework's own seams (fs, locks, archives, layout, lint, semver …), and
8
8
  * - the **composition pieces** of the pieces `.` does export: the individual probes and evidence
9
9
  * helpers `compat.gatherEvidence` is built from, the provisioner's policy helpers and constants,
10
- * the npm-package provider, and the Typert symbol kit whose symbols/wire helpers the two plugins
11
- * keep as LOCAL mirrors by design (they are assembled at module load, before any base can be
10
+ * the npm-package provider, and the Typert symbol kit whose symbols/wire helpers every plugin
11
+ * keeps as a LOCAL mirror by design (they are assembled at module load, before any base can be
12
12
  * imported).
13
13
  *
14
14
  * Generation v3 moved exactly those zero-consumer names here (INTERFACE.md §9). `./internal` is NOT
@@ -32,7 +32,7 @@ export { candidateUrls, downloadBytes, fetchImplOf, platformKey, readCapped, rea
32
32
  export { CONTROL_DIR, assertSafeRelativePath, assertSafeRelativeRoot, controlRoot, declaredPath, layoutPath, lockPath, quarantineRoot, stagingDir, statusLockPath, statusPath, tempRoot, versionSegment, } from './layout.js';
33
33
  export { BOOTSTRAP_SUBPATH, FRAMEWORK_INLINING_BEACONS, FRAMEWORK_PACKAGE, MIN_INLINING_BEACONS, findFrameworkImports, findInliningBeacons, isBootstrapSpecifier, } from './artifact.js';
34
34
  // ── generation v3: the names `.` shed ────────────────────────────────────────────────────────────
35
- // Each of these has zero consumers across the two plugin trees' non-test source and scripts
35
+ // Each of these has zero consumers across every discovered plugin tree's non-test source and scripts
36
36
  // (`test/public-surface.spec.ts` re-proves that mechanically). They are composition pieces of the
37
37
  // members `.` still exports, or kit mirrors the plugins keep locally on purpose — never a plugin's
38
38
  // entry point. Their canonical home is here; INTERFACE.md §9 records why each one moved.
@@ -9,7 +9,7 @@
9
9
  * of switches would be worse than the duplication it removes.
10
10
  *
11
11
  * The type-symbol convention is `<package>#<namespace>/<method>:<field>`; the probe, the runtime
12
- * registry and the report all key off it, so it must not drift between the two plugins.
12
+ * registry and the report all key off it, so it must not drift between plugin trees.
13
13
  *
14
14
  * @module @avantf/dsh-plugin-base/kit/typert
15
15
  */
package/dist/preset.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface EnvinitPresetOptions {
10
10
  readonly cwd?: string;
11
11
  /** Extra module names that must stay external (the plugin's own whitelist). */
12
12
  readonly external?: readonly string[];
13
- /** The declared framework range; when given it must equal `peerDependencies`. */
13
+ /** The declared framework range; when given it must equal `dependencies`. */
14
14
  readonly range?: string;
15
15
  /** Assert against this framework copy instead of resolving one from `cwd`. */
16
16
  readonly frameworkDir?: string;
@@ -20,7 +20,7 @@ export interface EnvinitPreset {
20
20
  readonly frameworkDir: string;
21
21
  /** The framework package version found there. */
22
22
  readonly frameworkVersion: string;
23
- /** The plugin's declared range (`peerDependencies`). */
23
+ /** The plugin's declared range (`dependencies`). */
24
24
  readonly declaredRange: string;
25
25
  /** Names the bundler must keep external. */
26
26
  readonly external: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAExD,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,8EAA8E;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AAgH;AAChH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,qBAAqB,GAAG,SAAS,WAAW,EAAE,CAqD7F;AAED,wDAAwD;AACxD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAI9E"}
package/dist/preset.js CHANGED
@@ -116,34 +116,40 @@ export function envinitPreset(options = {}) {
116
116
  out.fail('preset/framework-self-contained', `框架包必须自包含:dependencies 必须为空(现有 ${String(runtimeDeps)} 条);peerDependencies 只允许 zod(现有多余 ${unexpectedPeers.join(', ') || '(无)'})`);
117
117
  }
118
118
  // ── declared range ─────────────────────────────────────────────────────────
119
+ // The base is an ORDINARY dependency of a plugin, not a peer: the host provides only the DSH
120
+ // packages, and a dsh profile is written with `autoInstallPeers: false`, so a peer would simply
121
+ // never be installed. Installing the plugin must therefore bring the base along — the install-time
122
+ // range lives in `dependencies` (root `AGENTS.md` 「发布面」, `scripts/release-check.mjs`). The
123
+ // `devDependencies` entry carries the SAME range so the repo's own `pnpm install` links the
124
+ // workspace `base/`; the two must stay literally identical or pnpm can resolve a second copy.
119
125
  const pluginPkg = readJson(join(cwd, 'package.json'));
120
126
  if (pluginPkg === undefined) {
121
- out.fail('preset/peer-range-declared', `${join(cwd, 'package.json')} 不可读`);
127
+ out.fail('preset/dependency-range-declared', `${join(cwd, 'package.json')} 不可读`);
122
128
  return { frameworkDir, frameworkVersion, declaredRange: '', external, noExternal, checks: out.checks, ok: false };
123
129
  }
124
- const peer = pluginPkg['peerDependencies'];
125
- const declaredRange = typeof peer === 'object' && peer !== null ? str(peer[FRAMEWORK_PACKAGE]) : undefined;
130
+ const deps = pluginPkg['dependencies'];
131
+ const declaredRange = typeof deps === 'object' && deps !== null ? str(deps[FRAMEWORK_PACKAGE]) : undefined;
126
132
  if (declaredRange === undefined) {
127
- out.fail('preset/peer-range-declared', `插件必须在 peerDependencies 声明 ${FRAMEWORK_PACKAGE} 的区间`);
133
+ out.fail('preset/dependency-range-declared', `插件必须在 dependencies 声明 ${FRAMEWORK_PACKAGE} 的区间`);
128
134
  return { frameworkDir, frameworkVersion, declaredRange: '', external, noExternal, checks: out.checks, ok: false };
129
135
  }
130
136
  try {
131
137
  assertRange(declaredRange);
132
- out.pass('preset/peer-range-declared', `peerDependencies["${FRAMEWORK_PACKAGE}"] = ${declaredRange}`);
138
+ out.pass('preset/dependency-range-declared', `dependencies["${FRAMEWORK_PACKAGE}"] = ${declaredRange}`);
133
139
  }
134
140
  catch (error) {
135
- out.fail('preset/peer-range-declared', `区间不在支持的 semver 子集内:${declaredRange}(${error instanceof Error ? error.message : String(error)})`);
141
+ out.fail('preset/dependency-range-declared', `区间不在支持的 semver 子集内:${declaredRange}(${error instanceof Error ? error.message : String(error)})`);
136
142
  }
137
143
  const dev = pluginPkg['devDependencies'];
138
144
  const devRange = typeof dev === 'object' && dev !== null ? str(dev[FRAMEWORK_PACKAGE]) : undefined;
139
145
  const rangeProblems = [];
140
146
  if (devRange !== declaredRange)
141
- rangeProblems.push(`devDependencies 是 ${devRange ?? '(缺失)'},应与 peerDependencies 同区间`);
147
+ rangeProblems.push(`devDependencies 是 ${devRange ?? '(缺失)'},应与 dependencies 同区间`);
142
148
  if (options.range !== undefined && options.range !== declaredRange) {
143
- rangeProblems.push(`传入的 range 是 ${options.range},应等于 peerDependencies`);
149
+ rangeProblems.push(`传入的 range 是 ${options.range},应等于 dependencies`);
144
150
  }
145
151
  if (rangeProblems.length === 0) {
146
- out.pass('preset/range-single-source', `peerDependencies ≡ devDependencies = ${declaredRange}`);
152
+ out.pass('preset/range-single-source', `dependencies ≡ devDependencies = ${declaredRange}`);
147
153
  }
148
154
  else {
149
155
  out.fail('preset/range-single-source', rangeProblems.join(';'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avantf/dsh-plugin-base",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "The @avantf family base for DSH plugins: startup environment initialisation (declare → probe → fetch → verify → report) plus the host compatibility gate (provision / verdictOf / probes / report / post-registration verification). One package, loaded by the plugins through the inlined bootstrap.",
5
5
  "keywords": [
6
6
  "dsh",