@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/README.md +113 -45
- package/dist/bootstrap.d.ts +15 -10
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +18 -11
- package/dist/compat.d.ts +16 -1
- package/dist/compat.d.ts.map +1 -1
- package/dist/compat.js +15 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -10
- package/dist/interface.d.ts +231 -28
- package/dist/interface.d.ts.map +1 -1
- package/dist/interface.js +36 -13
- package/dist/interface_gate.d.ts +2 -1
- package/dist/interface_gate.d.ts.map +1 -1
- package/dist/interface_gate.js +14 -6
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +3 -3
- package/dist/kit/typert.d.ts +1 -1
- package/dist/preset.d.ts +2 -2
- package/dist/preset.d.ts.map +1 -1
- package/dist/preset.js +15 -9
- package/package.json +1 -1
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
|
|
11
|
-
*
|
|
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
|
|
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.
|
package/dist/kit/typert.d.ts
CHANGED
|
@@ -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
|
|
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 `
|
|
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 (`
|
|
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[];
|
package/dist/preset.d.ts.map
CHANGED
|
@@ -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,
|
|
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,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,oDAAoD;IACpD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,qCAAqC;IACrC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;IACvC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;CACrB;AAqED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CA0H/E;AAED,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE/D;AAED,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,wEAAwE;IACxE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7C;AAED,gHAAgH;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/
|
|
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
|
|
125
|
-
const declaredRange = typeof
|
|
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/
|
|
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/
|
|
138
|
+
out.pass('preset/dependency-range-declared', `dependencies["${FRAMEWORK_PACKAGE}"] = ${declaredRange}`);
|
|
133
139
|
}
|
|
134
140
|
catch (error) {
|
|
135
|
-
out.fail('preset/
|
|
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 ?? '(缺失)'},应与
|
|
147
|
+
rangeProblems.push(`devDependencies 是 ${devRange ?? '(缺失)'},应与 dependencies 同区间`);
|
|
142
148
|
if (options.range !== undefined && options.range !== declaredRange) {
|
|
143
|
-
rangeProblems.push(`传入的 range 是 ${options.range},应等于
|
|
149
|
+
rangeProblems.push(`传入的 range 是 ${options.range},应等于 dependencies`);
|
|
144
150
|
}
|
|
145
151
|
if (rangeProblems.length === 0) {
|
|
146
|
-
out.pass('preset/range-single-source', `
|
|
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.
|
|
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",
|