@vmz/vmz 0.3.6 → 0.3.8

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.
@@ -4,30 +4,57 @@
4
4
  import { existsSync } from 'node:fs';
5
5
  import path from 'node:path';
6
6
  import { pathToFileURL } from 'node:url';
7
- import { createJiti } from 'jiti';
8
7
  import { PLUGIN_PROTOCOL as PLUGIN_PROTOCOL_PKG, contentHash, defineConfig, definePlugin } from '@vmz/plugin';
9
8
  import { log } from './log.js';
10
9
  import { resolveWorkspacePackages } from './packages.js';
11
10
  export { contentHash, defineConfig, definePlugin };
12
11
  export const PLUGIN_PROTOCOL = PLUGIN_PROTOCOL_PKG;
13
- const CONFIG_NAMES = ['vmz.config.ts', 'vmz.config.mts', 'vmz.config.mjs', 'vmz.config.js'];
12
+ export const CONFIG_NAMES = ['vmz.config.ts', 'vmz.config.mts', 'vmz.config.mjs', 'vmz.config.js'];
14
13
  const ROOT_PLUGIN_NAMES = ['vmz.plugin.ts', 'vmz.plugin.mts', 'vmz.plugin.mjs', 'vmz.plugin.js'];
14
+ export const CONFIG_LOAD_FAILED = 'vmz::config::load_failed';
15
+ export const PLUGIN_ENTRY_INVALID = 'vmz::plugin::invalid_entry';
15
16
  /**
17
+ * Load an ES module through the Node host (native `import()`).
18
+ * Project config and plugin entries must be erasable TS or JS: the host never
19
+ * runs a runtime TypeScript transpiler.
16
20
  * @param {string} full
17
21
  * @returns {Promise<any>}
18
22
  */
19
- export async function importMaybeTs(full) {
20
- const ext = path.extname(full).toLowerCase();
21
- if (ext === '.ts' || ext === '.mts') {
22
- const jiti = createJiti(import.meta.url, {
23
- interopDefault: true,
24
- moduleCache: false,
25
- });
26
- return jiti(full);
27
- }
23
+ async function importHostModule(full) {
28
24
  const mod = await import(pathToFileURL(full).href);
29
25
  return mod.default ?? mod;
30
26
  }
27
+ function errorDetail(err) {
28
+ const parts = [];
29
+ let cur = err;
30
+ for (let i = 0; cur && i < 4; i += 1) {
31
+ const message = cur instanceof Error ? cur.message : String(cur);
32
+ if (message && !parts.includes(message))
33
+ parts.push(message);
34
+ cur = cur && typeof cur === 'object' && 'cause' in cur ? cur.cause : null;
35
+ }
36
+ return parts.join(' ← ') || 'unknown error';
37
+ }
38
+ /**
39
+ * Build a host error carrying a product diagnostic (one print at the CLI boundary).
40
+ * @param {string} code
41
+ * @param {string} sourcePath
42
+ * @param {unknown} err
43
+ */
44
+ function configDiagnosticError(code, sourcePath, err) {
45
+ const detail = errorDetail(err);
46
+ const error = new Error(detail);
47
+ if (err instanceof Error)
48
+ error.cause = err;
49
+ return Object.assign(error, {
50
+ diagnostic: {
51
+ code,
52
+ severity: 'error',
53
+ path: sourcePath,
54
+ args: { detail },
55
+ },
56
+ });
57
+ }
31
58
  /**
32
59
  * Load `vmz.config.*` from project root (+ optional root `vmz.plugin.*`).
33
60
  * @param {string} project
@@ -61,7 +88,13 @@ export async function loadVmzConfig(project) {
61
88
  if (!existsSync(full))
62
89
  continue;
63
90
  configPath = full;
64
- const cfg = await importMaybeTs(full);
91
+ let cfg;
92
+ try {
93
+ cfg = await importHostModule(full);
94
+ }
95
+ catch (err) {
96
+ throw configDiagnosticError(CONFIG_LOAD_FAILED, full, err);
97
+ }
65
98
  const raw = cfg?.plugins ?? [];
66
99
  engines = cfg?.engines && typeof cfg.engines === 'object' ? { ...cfg.engines } : {};
67
100
  if (cfg?.delivery && typeof cfg.delivery === 'object') {
@@ -96,9 +129,11 @@ async function resolvePluginEntry(project, entry) {
96
129
  let value = entry;
97
130
  if (typeof value === 'string') {
98
131
  const resolved = path.isAbsolute(value) ? value : path.join(project, value);
99
- value = await importMaybeTs(resolved);
100
- if (value && typeof value === 'object' && 'default' in value && value.default) {
101
- value = value.default;
132
+ try {
133
+ value = await importHostModule(resolved);
134
+ }
135
+ catch (err) {
136
+ throw configDiagnosticError(PLUGIN_ENTRY_INVALID, resolved, err);
102
137
  }
103
138
  }
104
139
  value = await value;
@@ -106,7 +141,8 @@ async function resolvePluginEntry(project, entry) {
106
141
  return value;
107
142
  if (value?.name && value?.stages)
108
143
  return definePlugin(value);
109
- throw new Error(`invalid vmz plugin entry: ${String(entry)}`);
144
+ const sourcePath = typeof entry === 'string' ? (path.isAbsolute(entry) ? entry : path.join(project, entry)) : '';
145
+ throw configDiagnosticError(PLUGIN_ENTRY_INVALID, sourcePath, new Error(`invalid vmz plugin entry: ${String(entry)}`));
110
146
  }
111
147
  /**
112
148
  * Collect + apply contribution batches for the given stages onto a Workspace.
@@ -289,17 +325,17 @@ function buildMathFacade(defaultEngine, engines) {
289
325
  return ` <${tag} ${kw}="(engine || ${defaultLit}) === ${engLit}" :tex="tex" :display="display" />`;
290
326
  })
291
327
  .join('\n');
292
- return `<template>
293
- ${branches}
294
- </template>
295
-
296
- <script client>
297
- export default class Math {
298
- public tex: string = '';
299
- public display: boolean = false;
300
- public engine: string | null = null;
301
- }
302
- </script>
328
+ return `<template>
329
+ ${branches}
330
+ </template>
331
+
332
+ <script client>
333
+ export default class Math {
334
+ public tex: string = '';
335
+ public display: boolean = false;
336
+ public engine: string | null = null;
337
+ }
338
+ </script>
303
339
  `;
304
340
  }
305
341
  /**
@@ -316,18 +352,18 @@ function buildCodeFacade(defaultEngine, engines) {
316
352
  return ` <${tag} ${kw}="(engine || ${defaultLit}) === ${engLit}" :code="code" :lang="lang" :theme="theme" />`;
317
353
  })
318
354
  .join('\n');
319
- return `<template>
320
- ${branches}
321
- </template>
322
-
323
- <script client>
324
- export default class Code {
325
- public code: string = '';
326
- public lang: string = 'text';
327
- public theme: string | null = null;
328
- public engine: string | null = null;
329
- }
330
- </script>
355
+ return `<template>
356
+ ${branches}
357
+ </template>
358
+
359
+ <script client>
360
+ export default class Code {
361
+ public code: string = '';
362
+ public lang: string = 'text';
363
+ public theme: string | null = null;
364
+ public engine: string | null = null;
365
+ }
366
+ </script>
331
367
  `;
332
368
  }
333
369
  /**
@@ -344,16 +380,16 @@ function buildMarkdownFacade(defaultEngine, engines) {
344
380
  return ` <${tag} ${kw}="(engine || ${defaultLit}) === ${engLit}" :source="source" />`;
345
381
  })
346
382
  .join('\n');
347
- return `<template>
348
- ${branches}
349
- </template>
350
-
351
- <script client>
352
- export default class Markdown {
353
- public source: string = '';
354
- public engine: string | null = null;
355
- }
356
- </script>
383
+ return `<template>
384
+ ${branches}
385
+ </template>
386
+
387
+ <script client>
388
+ export default class Markdown {
389
+ public source: string = '';
390
+ public engine: string | null = null;
391
+ }
392
+ </script>
357
393
  `;
358
394
  }
359
395
  /** Embed a JS string literal inside a double-quoted Vue attribute. */
@@ -46,6 +46,10 @@ export declare function lowerMiniprogramBindingEventJson(rootPath: string): stri
46
46
  export declare function lowerMiniprogramStructureJson(rootPath: string): string;
47
47
  export declare function lowerMiniprogramRouteServerStyleJson(rootPath: string): string;
48
48
  export declare function lowerMiniprogramToolingDeployJson(rootPath: string): string;
49
+ /**
50
+ * Consume the prepared `dist/_vmz/wechat-packaging.json` snapshot.
51
+ * Callers that start from a config must `await prepareWechatPackaging(rootPath)` first.
52
+ */
49
53
  export declare function lowerMiniprogramWechatPackagingJson(rootPath: string): string;
50
54
  export declare function lowerMiniprogramMultiAdapterJson(rootPath: string): string;
51
55
  import { createMiniHost } from './mini-host.js';
@@ -99,7 +103,7 @@ export { CDN_POLICY_MANIFEST_SCHEMA, CDN_ADAPTER_PROJECTION_SCHEMA, CACHE_HTML,
99
103
  export { SITE_DELIVERY_CONTRACT_SCHEMA, SITE_DELIVERY_RESOLUTION_SCHEMA, defineSite, normalizeSiteDelivery, normalizeSourceProbe, resolveSiteRelease, probeReleaseDirectory, emitSiteDelivery, } from './site-delivery.js';
100
104
  export { EMBEDDED_RESOURCE_INDEX_SCHEMA, emitEmbeddedPackaging } from './embedded-packaging.js';
101
105
  export { SERVER_LANG_IDS, SERVER_LANG_ALIASES, SERVER_LANGUAGE_BACKENDS, resolveServerLanguage, assertLangRuntimePair, } from './server-language-backend.js';
102
- export { WECHAT_PACKAGING_SCHEMA, WECHAT_PACKAGING_REL, wechatPackagingFromDelivery, materializeWechatPackaging } from './wechat-packaging.js';
106
+ export { WECHAT_PACKAGING_SCHEMA, WECHAT_PACKAGING_REL, wechatPackagingFromDelivery, materializeWechatPackaging, prepareWechatPackaging, } from './wechat-packaging.js';
103
107
  export { DELIVERY_PROFILE_AUTHORING_SCHEMA, BUILD_PROFILE_SELECTION_SCHEMA, ASSEMBLIES, SERVER_RUNTIMES, BUILTIN_PROFILES, pickSiteAuthoring, pickDeliveryPackaging, normalizeProfileArtifactName, resolveProfileArtifactDir, normalizeDeliveryAuthoring, selectBuildProfile, semanticIdsForAssembly, } from '../delivery/delivery-profile.js';
104
108
  export { PACK_MANIFEST_SCHEMA, packFromDeploymentIr, ensureRuntimeCompanions } from './pack.js';
105
109
  export { SERVER_ARTIFACT_SCHEMA, HTTP_CONTRACT_SCHEMA, SERVER_RUNTIME_ADAPTER_SCHEMA, emitServerArtifact, projectServerRuntimeAdapter, } from './server-artifact.js';
@@ -8,7 +8,6 @@ import path from 'node:path';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import { materializeServeHostRuntime, SERVE_HOST_RUNTIME_FILES } from '../host-materialize/serve-host-runtime.js';
10
10
  import { resolveCoreRuntimeDist } from './runtime-dist.js';
11
- import { materializeWechatPackaging } from './wechat-packaging.js';
12
11
  export { resolveCoreRuntimeDist } from './runtime-dist.js';
13
12
  export { loadHostRuntimeFilesManifest, serveHostRuntimeFilePairs } from '../host-materialize/host-runtime-files.js';
14
13
  export { materializeServeHostRuntime, SERVE_HOST_RUNTIME_FILES } from '../host-materialize/serve-host-runtime.js';
@@ -125,25 +124,7 @@ export function createWorkspace(options) {
125
124
  pluginProtocol: protocol.pluginProtocol,
126
125
  },
127
126
  });
128
- const pack = ws.lowerMiniprogramWechatPackaging.bind(ws);
129
- const wrappedPack = () => {
130
- materializeWechatPackaging(options.root);
131
- return pack();
132
- };
133
- try {
134
- ws.lowerMiniprogramWechatPackaging = wrappedPack;
135
- return ws;
136
- }
137
- catch {
138
- return new Proxy(ws, {
139
- get(target, prop, receiver) {
140
- if (prop === 'lowerMiniprogramWechatPackaging')
141
- return wrappedPack;
142
- const value = Reflect.get(target, prop, receiver);
143
- return typeof value === 'function' ? value.bind(target) : value;
144
- },
145
- });
146
- }
127
+ return ws;
147
128
  }
148
129
  /** frozen application composition protocol catalog. */
149
130
  export function queryApplicationProtocolCatalog() {
@@ -183,9 +164,12 @@ export function lowerMiniprogramToolingDeployJson(rootPath) {
183
164
  const native = loadNative();
184
165
  return native.lowerMiniprogramToolingDeployJson(rootPath);
185
166
  }
167
+ /**
168
+ * Consume the prepared `dist/_vmz/wechat-packaging.json` snapshot.
169
+ * Callers that start from a config must `await prepareWechatPackaging(rootPath)` first.
170
+ */
186
171
  export function lowerMiniprogramWechatPackagingJson(rootPath) {
187
172
  const native = loadNative();
188
- materializeWechatPackaging(rootPath);
189
173
  return native.lowerMiniprogramWechatPackagingJson(rootPath);
190
174
  }
191
175
  export function lowerMiniprogramMultiAdapterJson(rootPath) {
@@ -307,7 +291,7 @@ export { CDN_POLICY_MANIFEST_SCHEMA, CDN_ADAPTER_PROJECTION_SCHEMA, CACHE_HTML,
307
291
  export { SITE_DELIVERY_CONTRACT_SCHEMA, SITE_DELIVERY_RESOLUTION_SCHEMA, defineSite, normalizeSiteDelivery, normalizeSourceProbe, resolveSiteRelease, probeReleaseDirectory, emitSiteDelivery, } from './site-delivery.js';
308
292
  export { EMBEDDED_RESOURCE_INDEX_SCHEMA, emitEmbeddedPackaging } from './embedded-packaging.js';
309
293
  export { SERVER_LANG_IDS, SERVER_LANG_ALIASES, SERVER_LANGUAGE_BACKENDS, resolveServerLanguage, assertLangRuntimePair, } from './server-language-backend.js';
310
- export { WECHAT_PACKAGING_SCHEMA, WECHAT_PACKAGING_REL, wechatPackagingFromDelivery, materializeWechatPackaging } from './wechat-packaging.js';
294
+ export { WECHAT_PACKAGING_SCHEMA, WECHAT_PACKAGING_REL, wechatPackagingFromDelivery, materializeWechatPackaging, prepareWechatPackaging, } from './wechat-packaging.js';
311
295
  export { DELIVERY_PROFILE_AUTHORING_SCHEMA, BUILD_PROFILE_SELECTION_SCHEMA, ASSEMBLIES, SERVER_RUNTIMES, BUILTIN_PROFILES, pickSiteAuthoring, pickDeliveryPackaging, normalizeProfileArtifactName, resolveProfileArtifactDir, normalizeDeliveryAuthoring, selectBuildProfile, semanticIdsForAssembly, } from '../delivery/delivery-profile.js';
312
296
  export { PACK_MANIFEST_SCHEMA, packFromDeploymentIr, ensureRuntimeCompanions } from './pack.js';
313
297
  export { SERVER_ARTIFACT_SCHEMA, HTTP_CONTRACT_SCHEMA, SERVER_RUNTIME_ADAPTER_SCHEMA, emitServerArtifact, projectServerRuntimeAdapter, } from './server-artifact.js';
@@ -16,8 +16,15 @@ interface WechatPackagingSpec {
16
16
  }
17
17
  export declare function wechatPackagingFromDelivery(delivery: unknown): WechatPackagingSpec;
18
18
  /**
19
- * Load `vmz.config.*` and write the WeChat packaging contract for the Rust packer.
19
+ * Write the WeChat packaging contract from an already-evaluated delivery snapshot.
20
+ * Sync by contract: the native packer must consume prepared data, never read a config.
21
+ * @param {string} project
22
+ * @param {unknown} delivery
23
+ */
24
+ export declare function materializeWechatPackaging(project: string, delivery: unknown): WechatPackagingSpec;
25
+ /**
26
+ * Async host entry: evaluate `vmz.config.*` once, then prepare the packaging snapshot.
20
27
  * @param {string} project
21
28
  */
22
- export declare function materializeWechatPackaging(project: any): WechatPackagingSpec;
29
+ export declare function prepareWechatPackaging(project: string): Promise<WechatPackagingSpec>;
23
30
  export {};
@@ -2,27 +2,13 @@
2
2
  * Materialize `defineConfig({ delivery: { packaging: { wechat } } })` for wechat_pack.
3
3
  * Pure data only. Writes `dist/_vmz/wechat-packaging.json` (not a second config entry).
4
4
  */
5
- import { existsSync, mkdirSync } from 'node:fs';
5
+ import { mkdirSync } from 'node:fs';
6
6
  import path from 'node:path';
7
- import { createJiti } from 'jiti';
8
7
  import { pickDeliveryPackaging } from '../delivery/delivery-profile.js';
9
8
  import { writePrettyJsonFile } from './pretty-json.js';
9
+ import { loadVmzConfig } from './plugin-host.js';
10
10
  export const WECHAT_PACKAGING_SCHEMA = 'vmz.target.wechat_packaging.v0';
11
11
  export const WECHAT_PACKAGING_REL = 'dist/_vmz/wechat-packaging.json';
12
- const CONFIG_NAMES = ['vmz.config.ts', 'vmz.config.mts', 'vmz.config.mjs', 'vmz.config.js'];
13
- function loadConfigSync(project) {
14
- for (const name of CONFIG_NAMES) {
15
- const full = path.join(project, name);
16
- if (!existsSync(full))
17
- continue;
18
- const jiti = createJiti(import.meta.url, {
19
- interopDefault: true,
20
- moduleCache: false,
21
- });
22
- return jiti(full);
23
- }
24
- return null;
25
- }
26
12
  export function wechatPackagingFromDelivery(delivery) {
27
13
  const diagnostics = [];
28
14
  const packaging = pickDeliveryPackaging(delivery && typeof delivery === 'object' ? delivery : {}, diagnostics);
@@ -40,14 +26,23 @@ export function wechatPackagingFromDelivery(delivery) {
40
26
  return out;
41
27
  }
42
28
  /**
43
- * Load `vmz.config.*` and write the WeChat packaging contract for the Rust packer.
29
+ * Write the WeChat packaging contract from an already-evaluated delivery snapshot.
30
+ * Sync by contract: the native packer must consume prepared data, never read a config.
44
31
  * @param {string} project
32
+ * @param {unknown} delivery
45
33
  */
46
- export function materializeWechatPackaging(project) {
47
- const cfg = loadConfigSync(project);
48
- const spec = wechatPackagingFromDelivery(cfg?.delivery);
34
+ export function materializeWechatPackaging(project, delivery) {
35
+ const spec = wechatPackagingFromDelivery(delivery);
49
36
  const abs = path.join(project, WECHAT_PACKAGING_REL);
50
37
  mkdirSync(path.dirname(abs), { recursive: true });
51
38
  writePrettyJsonFile(abs, spec);
52
39
  return spec;
53
40
  }
41
+ /**
42
+ * Async host entry: evaluate `vmz.config.*` once, then prepare the packaging snapshot.
43
+ * @param {string} project
44
+ */
45
+ export async function prepareWechatPackaging(project) {
46
+ const cfg = await loadVmzConfig(project);
47
+ return materializeWechatPackaging(project, cfg.delivery);
48
+ }
@@ -1,126 +1,126 @@
1
- {
2
- "cli.intro.project": "vmz — Node toolchain host (`@vmz/vmz`, N-API)",
3
- "cli.intro.global": "vmz — global install (help/version only). Pin `@vmz/vmz` in the app (`pnpm add -D @vmz/vmz`) and run `pnpm exec vmz <command>`. A global `vmz` re-execs the nearest project bin when present.",
4
- "cli.cmd.check": "Check project via Workspace",
5
- "cli.cmd.build": "Build project via Workspace",
6
- "cli.cmd.serve": "Serve dist (optional --build)",
7
- "cli.cmd.dev": "Rebuild session",
8
- "cli.cmd.format": "Format workspace surfaces and .vmz via vmz.config format",
9
- "cli.opt.format-no-javascript": "Skip JS/TS workspace format",
10
- "cli.opt.format-no-rust": "Skip cargo fmt",
11
- "cli.opt.format-no-vmz": "Skip .vmz author format",
12
- "cli.cmd.lint": "Lint (= check) via N-API",
13
- "cli.cmd.test": "Native test discover / report",
14
- "cli.cmd.document": "Project /documents domain",
15
- "cli.cmd.document.check": "Check locale tree + links/anchors + evidence",
16
- "cli.cmd.document.build": "Static HTML + view + evidence + designs CSS",
17
- "cli.cmd.locale": "Locale domain",
18
- "cli.cmd.locale.check": "Check locales.json5 + catalogs + param contracts",
19
- "cli.cmd.locale.list": "List LocaleIds",
20
- "cli.cmd.locale.emit-types": "Emit #locales/* .d.ts stubs",
21
- "cli.cmd.locale.rename": "MessageId rename plan",
22
- "cli.cmd.locale.runtime-check": "LocaleContext / FormatterContext / SSR parity",
23
- "cli.cmd.locale.router-check": "Route realization / canonical / hreflang",
24
- "cli.cmd.locale.delivery-check": "Multi-host LocaleDeliveryResolution",
25
- "cli.cmd.locale.explain": "Explain MessageId",
26
- "cli.cmd.locale.diff": "Diff two locales",
27
- "cli.cmd.locale.extract": "Hardcoded text sink check",
28
- "cli.cmd.locale.pseudo": "Pseudo-localize catalog",
29
- "cli.cmd.locale.conformance": "Cross-host MessageId/hash conformance",
30
- "cli.cmd.application": "Application Collection / Mount",
31
- "cli.cmd.application.check": "Validate descriptors + applications.config.json5",
32
- "cli.cmd.application.list": "List ApplicationIds / collections / mounts",
33
- "cli.cmd.application.schemas": "Print frozen protocol catalog JSON",
34
- "cli.cmd.application.relocatable": "ApplicationBase / non_relocatable_url proof",
35
- "cli.cmd.application.relocate": "Apply ApplicationBase to relocation manifest",
36
- "cli.cmd.application.artifacts": "ApplicationArtifact + MountTable boundary",
37
- "cli.cmd.application.isolation": "Isolation namespaces + failure containment",
38
- "cli.cmd.application.composition": "Catalog consumption + cross-app Link hrefs",
39
- "cli.cmd.application.dev": "Sessions / affected / proxy / mounted tests",
40
- "cli.cmd.artifact": "Release pack / publish / rollback / diff",
41
- "cli.cmd.artifact.pack": "Write dist/_vmz manifests + envelope",
42
- "cli.cmd.artifact.publish": "Pack + publish under dist/releases",
43
- "cli.cmd.artifact.rollback": "Restore PREVIOUS pointer",
44
- "cli.cmd.artifact.current": "Print CURRENT digest",
45
- "cli.cmd.artifact.diff": "Structured file digest diff",
46
- "cli.cmd.refactor": "DX rename plans / apply",
47
- "cli.cmd.refactor.rename": "Plan or apply a workspace rename",
48
- "cli.cmd.explain": "DX causal explain",
49
- "cli.cmd.github-actions": "Monitor GitHub Actions via Rust GitHub REST monitor (status|wait)",
50
- "cli.cmd.plan": "Dump frozen Rust plans via N-API",
51
- "cli.cmd.plan.locale": "LocalePlan from locales/",
52
- "cli.cmd.plan.document-route": "DocumentRoutePlan from documents/",
53
- "cli.cmd.version": "Show host + native protocol versions",
54
- "cli.opt.out-dir": "Workspace output root (default: dist)",
55
- "cli.opt.release": "Release build (omit serve-host; pack minify; proof)",
56
- "cli.opt.profile": "Delivery profile id",
57
- "cli.opt.target": "browser | mini-program-wechat (or test affected alias)",
58
- "cli.opt.origin": "Site origin for web-static",
59
- "cli.opt.host": "Listen host",
60
- "cli.opt.port": "Listen port",
61
- "cli.opt.poll-ms": "Dev watch poll interval",
62
- "cli.opt.build": "Build before serve",
63
- "cli.opt.check": "Format check-only / extract fail on CJK",
64
- "cli.opt.deny-warnings": "Treat warnings as errors",
65
- "cli.opt.level": "Diagnostic verbosity: error | warn | info (default warn)",
66
- "cli.opt.info-level": "Show advice diagnostics and progress (same as --level info)",
67
- "cli.opt.diag-style": "Diagnostic layout: pretty | compact (default pretty)",
68
- "cli.opt.json": "Write JSON to stdout or file",
69
- "cli.opt.root": "Project root",
70
- "cli.opt.out": "Output directory",
71
- "cli.opt.strict": "Strict coverage / require defaultLocale",
72
- "cli.opt.list": "List discovered tests",
73
- "cli.opt.mode": "compile|logic|browser|ssr|resume|deployment|all",
74
- "cli.opt.filter": "Filter by test id or file",
75
- "cli.opt.application": "Run only tests for ApplicationId",
76
- "cli.opt.mounted": "Relocation + host-boundary tests for ApplicationId",
77
- "cli.opt.affected": "Select tests from dirty VPG units",
78
- "cli.opt.locale": "Requested locale id",
79
- "cli.opt.delivery": "Delivery id",
80
- "cli.opt.timezone": "Formatter time zone",
81
- "cli.opt.production": "Fail pseudo in production",
82
- "cli.opt.base": "ApplicationBase path",
83
- "cli.opt.dirty": "Dirty file path for affected planning (repeatable)",
84
- "cli.opt.releases": "Releases root directory",
85
- "cli.opt.app-id": "applicationId for envelope",
86
- "cli.opt.refactor.kind": "route_id|field|method|component|capability",
87
- "cli.opt.refactor.from": "Rename from id",
88
- "cli.opt.refactor.to": "Rename to id",
89
- "cli.opt.refactor.scope": "Optional chunk scope",
90
- "cli.opt.apply": "Apply workspace edit plan",
91
- "cli.opt.explain": "Include rename explain chain",
92
- "cli.opt.explain.target": "Generic Workspace.explain target",
93
- "cli.opt.gha.mode": "status (one-shot) or wait (poll until completed)",
94
- "cli.opt.gha.workflow": "Workflow file name (e.g. ci.yml) or numeric id",
95
- "cli.opt.gha.run-id": "Watch a specific workflow run id",
96
- "cli.opt.gha.ref": "Commit SHA filter (head_sha)",
97
- "cli.opt.gha.branch": "Branch name filter",
98
- "cli.opt.gha.owner": "Repository owner (default GITHUB_REPOSITORY)",
99
- "cli.opt.gha.repo": "Repository name (default GITHUB_REPOSITORY)",
100
- "cli.opt.gha.token": "GitHub token (default GITHUB_TOKEN / GH_TOKEN)",
101
- "cli.opt.gha.timeout-minutes": "Max wait minutes for mode=wait",
102
- "cli.opt.gha.interval-seconds": "Poll interval seconds for mode=wait",
103
- "cli.opt.gha.required-conclusion": "Required conclusion when mode=wait (default success)",
104
- "cli.err.unknown_plan_kind": "unknown plan kind `{kind}` (locale | document-route)",
105
- "cli.err.gha.mode": "unknown --mode {mode} (status | wait)",
106
- "cli.err.gha.repo": "set --owner/--repo or GITHUB_REPOSITORY (owner/repo)",
107
- "cli.err.invalid_level": "unknown --level `{level}` (error | warn | info)",
108
- "cli.err.invalid_style": "unknown --style `{style}` (pretty | compact)",
109
- "cli.err.unknown_target": "unknown --target {target} (browser | mini-program-wechat)",
110
- "cli.err.document_build_aborted": "document build aborted due to diagnostics",
111
- "cli.err.locale_rename_usage": "usage: vmz locale rename <from-message-id> <to-message-id>",
112
- "cli.err.locale_explain_usage": "usage: vmz locale explain <message-id> [project]",
113
- "cli.err.locale_diff_usage": "usage: vmz locale diff <base-locale> <target-locale> [project]",
114
- "cli.err.locale_pseudo_usage": "usage: vmz locale pseudo <source-locale> [project]",
115
- "cli.err.application_relocate_manifest": "relocate requires a relocation manifest JSON path",
116
- "cli.err.application_relocate_base": "relocate requires --base <ApplicationBase>",
117
- "cli.err.artifact_diff_usage": "artifact diff requires <aDigest> <bDigest>",
118
- "cli.err.refactor_rename_usage": "rename requires --kind, --from, and --to",
119
- "cli.err.explain_style_usage": "usage: vmz explain style <node> [path]",
120
- "cli.err.explain_usage": "usage: vmz explain style <node> [path] | vmz explain <target> [path]",
121
- "cli.err.project_bin_missing": "found project `vmz` / `@vmz/vmz` but bin/vmz.js is missing.",
122
- "cli.err.global_needs_project": "this `vmz` is a global install (mode=global); project commands need a project install.",
123
- "cli.err.global_install_hint": "Install in the app: pnpm add -D @vmz/vmz",
124
- "cli.err.global_run_hint": "Then run: pnpm exec vmz <command>",
125
- "cli.err.global_developer_hint": "(developer mode: run from vmz-framework packages/runtimes/vmz source — full CLI)"
126
- }
1
+ {
2
+ "cli.intro.project": "vmz — Node toolchain host (`@vmz/vmz`, N-API)",
3
+ "cli.intro.global": "vmz — global install (help/version only). Pin `@vmz/vmz` in the app (`pnpm add -D @vmz/vmz`) and run `pnpm exec vmz <command>`. A global `vmz` re-execs the nearest project bin when present.",
4
+ "cli.cmd.check": "Check project via Workspace",
5
+ "cli.cmd.build": "Build project via Workspace",
6
+ "cli.cmd.serve": "Serve dist (optional --build)",
7
+ "cli.cmd.dev": "Rebuild session",
8
+ "cli.cmd.format": "Format workspace surfaces and .vmz via vmz.config format",
9
+ "cli.opt.format-no-javascript": "Skip JS/TS workspace format",
10
+ "cli.opt.format-no-rust": "Skip cargo fmt",
11
+ "cli.opt.format-no-vmz": "Skip .vmz author format",
12
+ "cli.cmd.lint": "Lint (= check) via N-API",
13
+ "cli.cmd.test": "Native test discover / report",
14
+ "cli.cmd.document": "Project /documents domain",
15
+ "cli.cmd.document.check": "Check locale tree + links/anchors + evidence",
16
+ "cli.cmd.document.build": "Static HTML + view + evidence + designs CSS",
17
+ "cli.cmd.locale": "Locale domain",
18
+ "cli.cmd.locale.check": "Check locales.json5 + catalogs + param contracts",
19
+ "cli.cmd.locale.list": "List LocaleIds",
20
+ "cli.cmd.locale.emit-types": "Emit #locales/* .d.ts stubs",
21
+ "cli.cmd.locale.rename": "MessageId rename plan",
22
+ "cli.cmd.locale.runtime-check": "LocaleContext / FormatterContext / SSR parity",
23
+ "cli.cmd.locale.router-check": "Route realization / canonical / hreflang",
24
+ "cli.cmd.locale.delivery-check": "Multi-host LocaleDeliveryResolution",
25
+ "cli.cmd.locale.explain": "Explain MessageId",
26
+ "cli.cmd.locale.diff": "Diff two locales",
27
+ "cli.cmd.locale.extract": "Hardcoded text sink check",
28
+ "cli.cmd.locale.pseudo": "Pseudo-localize catalog",
29
+ "cli.cmd.locale.conformance": "Cross-host MessageId/hash conformance",
30
+ "cli.cmd.application": "Application Collection / Mount",
31
+ "cli.cmd.application.check": "Validate descriptors + applications.config.json5",
32
+ "cli.cmd.application.list": "List ApplicationIds / collections / mounts",
33
+ "cli.cmd.application.schemas": "Print frozen protocol catalog JSON",
34
+ "cli.cmd.application.relocatable": "ApplicationBase / non_relocatable_url proof",
35
+ "cli.cmd.application.relocate": "Apply ApplicationBase to relocation manifest",
36
+ "cli.cmd.application.artifacts": "ApplicationArtifact + MountTable boundary",
37
+ "cli.cmd.application.isolation": "Isolation namespaces + failure containment",
38
+ "cli.cmd.application.composition": "Catalog consumption + cross-app Link hrefs",
39
+ "cli.cmd.application.dev": "Sessions / affected / proxy / mounted tests",
40
+ "cli.cmd.artifact": "Release pack / publish / rollback / diff",
41
+ "cli.cmd.artifact.pack": "Write dist/_vmz manifests + envelope",
42
+ "cli.cmd.artifact.publish": "Pack + publish under dist/releases",
43
+ "cli.cmd.artifact.rollback": "Restore PREVIOUS pointer",
44
+ "cli.cmd.artifact.current": "Print CURRENT digest",
45
+ "cli.cmd.artifact.diff": "Structured file digest diff",
46
+ "cli.cmd.refactor": "DX rename plans / apply",
47
+ "cli.cmd.refactor.rename": "Plan or apply a workspace rename",
48
+ "cli.cmd.explain": "DX causal explain",
49
+ "cli.cmd.github-actions": "Monitor GitHub Actions via Rust GitHub REST monitor (status|wait)",
50
+ "cli.cmd.plan": "Dump frozen Rust plans via N-API",
51
+ "cli.cmd.plan.locale": "LocalePlan from locales/",
52
+ "cli.cmd.plan.document-route": "DocumentRoutePlan from documents/",
53
+ "cli.cmd.version": "Show host + native protocol versions",
54
+ "cli.opt.out-dir": "Workspace output root (default: dist)",
55
+ "cli.opt.release": "Release build (omit serve-host; pack minify; proof)",
56
+ "cli.opt.profile": "Delivery profile id",
57
+ "cli.opt.target": "browser | mini-program-wechat (or test affected alias)",
58
+ "cli.opt.origin": "Site origin for web-static",
59
+ "cli.opt.host": "Listen host",
60
+ "cli.opt.port": "Listen port",
61
+ "cli.opt.poll-ms": "Dev watch poll interval",
62
+ "cli.opt.build": "Build before serve",
63
+ "cli.opt.check": "Format check-only / extract fail on CJK",
64
+ "cli.opt.deny-warnings": "Treat warnings as errors",
65
+ "cli.opt.level": "Diagnostic verbosity: error | warn | info (default warn)",
66
+ "cli.opt.info-level": "Show advice diagnostics and progress (same as --level info)",
67
+ "cli.opt.diag-style": "Diagnostic layout: pretty | compact (default pretty)",
68
+ "cli.opt.json": "Write JSON to stdout or file",
69
+ "cli.opt.root": "Project root",
70
+ "cli.opt.out": "Output directory",
71
+ "cli.opt.strict": "Strict coverage / require defaultLocale",
72
+ "cli.opt.list": "List discovered tests",
73
+ "cli.opt.mode": "compile|logic|browser|ssr|resume|deployment|all",
74
+ "cli.opt.filter": "Filter by test id or file",
75
+ "cli.opt.application": "Run only tests for ApplicationId",
76
+ "cli.opt.mounted": "Relocation + host-boundary tests for ApplicationId",
77
+ "cli.opt.affected": "Select tests from dirty VPG units",
78
+ "cli.opt.locale": "Requested locale id",
79
+ "cli.opt.delivery": "Delivery id",
80
+ "cli.opt.timezone": "Formatter time zone",
81
+ "cli.opt.production": "Fail pseudo in production",
82
+ "cli.opt.base": "ApplicationBase path",
83
+ "cli.opt.dirty": "Dirty file path for affected planning (repeatable)",
84
+ "cli.opt.releases": "Releases root directory",
85
+ "cli.opt.app-id": "applicationId for envelope",
86
+ "cli.opt.refactor.kind": "route_id|field|method|component|capability",
87
+ "cli.opt.refactor.from": "Rename from id",
88
+ "cli.opt.refactor.to": "Rename to id",
89
+ "cli.opt.refactor.scope": "Optional chunk scope",
90
+ "cli.opt.apply": "Apply workspace edit plan",
91
+ "cli.opt.explain": "Include rename explain chain",
92
+ "cli.opt.explain.target": "Generic Workspace.explain target",
93
+ "cli.opt.gha.mode": "status (one-shot) or wait (poll until completed)",
94
+ "cli.opt.gha.workflow": "Workflow file name (e.g. ci.yml) or numeric id",
95
+ "cli.opt.gha.run-id": "Watch a specific workflow run id",
96
+ "cli.opt.gha.ref": "Commit SHA filter (head_sha)",
97
+ "cli.opt.gha.branch": "Branch name filter",
98
+ "cli.opt.gha.owner": "Repository owner (default GITHUB_REPOSITORY)",
99
+ "cli.opt.gha.repo": "Repository name (default GITHUB_REPOSITORY)",
100
+ "cli.opt.gha.token": "GitHub token (default GITHUB_TOKEN / GH_TOKEN)",
101
+ "cli.opt.gha.timeout-minutes": "Max wait minutes for mode=wait",
102
+ "cli.opt.gha.interval-seconds": "Poll interval seconds for mode=wait",
103
+ "cli.opt.gha.required-conclusion": "Required conclusion when mode=wait (default success)",
104
+ "cli.err.unknown_plan_kind": "unknown plan kind `{kind}` (locale | document-route)",
105
+ "cli.err.gha.mode": "unknown --mode {mode} (status | wait)",
106
+ "cli.err.gha.repo": "set --owner/--repo or GITHUB_REPOSITORY (owner/repo)",
107
+ "cli.err.invalid_level": "unknown --level `{level}` (error | warn | info)",
108
+ "cli.err.invalid_style": "unknown --style `{style}` (pretty | compact)",
109
+ "cli.err.unknown_target": "unknown --target {target} (browser | mini-program-wechat)",
110
+ "cli.err.document_build_aborted": "document build aborted due to diagnostics",
111
+ "cli.err.locale_rename_usage": "usage: vmz locale rename <from-message-id> <to-message-id>",
112
+ "cli.err.locale_explain_usage": "usage: vmz locale explain <message-id> [project]",
113
+ "cli.err.locale_diff_usage": "usage: vmz locale diff <base-locale> <target-locale> [project]",
114
+ "cli.err.locale_pseudo_usage": "usage: vmz locale pseudo <source-locale> [project]",
115
+ "cli.err.application_relocate_manifest": "relocate requires a relocation manifest JSON path",
116
+ "cli.err.application_relocate_base": "relocate requires --base <ApplicationBase>",
117
+ "cli.err.artifact_diff_usage": "artifact diff requires <aDigest> <bDigest>",
118
+ "cli.err.refactor_rename_usage": "rename requires --kind, --from, and --to",
119
+ "cli.err.explain_style_usage": "usage: vmz explain style <node> [path]",
120
+ "cli.err.explain_usage": "usage: vmz explain style <node> [path] | vmz explain <target> [path]",
121
+ "cli.err.project_bin_missing": "found project `vmz` / `@vmz/vmz` but bin/vmz.js is missing.",
122
+ "cli.err.global_needs_project": "this `vmz` is a global install (mode=global); project commands need a project install.",
123
+ "cli.err.global_install_hint": "Install in the app: pnpm add -D @vmz/vmz",
124
+ "cli.err.global_run_hint": "Then run: pnpm exec vmz <command>",
125
+ "cli.err.global_developer_hint": "(developer mode: run from vmz-framework packages/runtimes/vmz source — full CLI)"
126
+ }
@@ -2,6 +2,10 @@
2
2
  "diag.message": "{message}",
3
3
  "diag.detail": "{detail}",
4
4
  "commander::action_failed": "Command failed: {message}",
5
+ "commander::unknown_command": "Unknown command `{cmd}`.",
6
+ "commander::unknown_option": "Unknown option `{option}`.",
7
+ "commander::missing_option_value": "Missing value for option `{option}`.",
8
+ "commander::parse_failed": "Parse failed: {detail}",
5
9
 
6
10
  "vmz::template::illegal_directive": "Illegal or unsupported directive in `<template>`: {detail}",
7
11
  "vmz::template::parse_failed": "Failed to parse `<template>`: {detail}",
@@ -150,5 +154,7 @@
150
154
  "vmz::target::mini_platform_private_schema": "{detail}",
151
155
  "vmz::target::mini_shared_fork": "{detail}",
152
156
  "vmz::target::mini_static_slice_catalog_only": "{detail}",
153
- "vmz::target::mini_route_server_style_catalog_only": "{detail}"
157
+ "vmz::target::mini_route_server_style_catalog_only": "{detail}",
158
+ "vmz::config::load_failed": "failed to load project config: {detail}",
159
+ "vmz::plugin::invalid_entry": "invalid plugin entry: {detail}"
154
160
  }