@vmz/vmz 0.1.31 → 0.2.0
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/bin/vmz.js +1 -1
- package/dist/{application-cmd.js → cli/application-cmd.js} +4 -4
- package/dist/{cli-localize.js → cli/cli-localize.js} +1 -1
- package/dist/{cli.js → cli/cli.js} +18 -18
- package/dist/{explain-cmd.js → cli/explain-cmd.js} +3 -3
- package/dist/{github-actions-cmd.js → cli/github-actions-cmd.js} +3 -3
- package/dist/{plan-cmd.js → cli/plan-cmd.js} +3 -3
- package/dist/{refactor-cmd.js → cli/refactor-cmd.js} +3 -3
- package/dist/{release-cmd.js → cli/release-cmd.js} +2 -2
- package/dist/{test-cmd.js → cli/test-cmd.js} +4 -4
- package/dist/{dev-session.d.ts → dev/dev-session.d.ts} +1 -1
- package/dist/{dev-session.js → dev/dev-session.js} +7 -7
- package/dist/{dev-watch-roots.js → dev/dev-watch-roots.js} +1 -1
- package/dist/{document-build.js → document/document-build.js} +3 -3
- package/dist/{document-check.d.ts → document/document-check.d.ts} +1 -1
- package/dist/{document-check.js → document/document-check.js} +1 -1
- package/dist/{document-cmd.js → document/document-cmd.js} +3 -3
- package/dist/{document-integrate.js → document/document-integrate.js} +3 -3
- package/dist/{document-markdown.js → document/document-markdown.js} +1 -1
- package/dist/{document-routing-config.js → document/document-routing-config.js} +1 -1
- package/dist/host-materialize/host-runtime-files.d.ts +19 -0
- package/dist/host-materialize/host-runtime-files.js +35 -0
- package/dist/host-materialize/serve-host-runtime.d.ts +9 -0
- package/dist/host-materialize/serve-host-runtime.js +37 -0
- package/dist/index.d.ts +3 -332
- package/dist/index.js +3 -582
- package/dist/{locale-check.js → locale/locale-check.js} +3 -3
- package/dist/{locale-cmd.js → locale/locale-cmd.js} +3 -3
- package/dist/{locale-route-emit.js → locale/locale-route-emit.js} +2 -2
- package/dist/{build-assemble.js → workspace/build-assemble.js} +1 -1
- package/dist/{cdn-policy.js → workspace/cdn-policy.js} +1 -1
- package/dist/{invocation.js → workspace/invocation.js} +11 -1
- package/dist/{log.js → workspace/log.js} +1 -1
- package/dist/{project-build.js → workspace/project-build.js} +5 -5
- package/dist/workspace/public-api.d.ts +333 -0
- package/dist/workspace/public-api.js +540 -0
- package/dist/workspace/runtime-dist.d.ts +4 -0
- package/dist/workspace/runtime-dist.js +26 -0
- package/dist/{static-emit.js → workspace/static-emit.js} +2 -2
- package/dist/{wechat-packaging.js → workspace/wechat-packaging.js} +1 -1
- package/package.json +31 -31
- /package/dist/{application-cmd.d.ts → cli/application-cmd.d.ts} +0 -0
- /package/dist/{cli-localize.d.ts → cli/cli-localize.d.ts} +0 -0
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{explain-cmd.d.ts → cli/explain-cmd.d.ts} +0 -0
- /package/dist/{github-actions-cmd.d.ts → cli/github-actions-cmd.d.ts} +0 -0
- /package/dist/{plan-cmd.d.ts → cli/plan-cmd.d.ts} +0 -0
- /package/dist/{refactor-cmd.d.ts → cli/refactor-cmd.d.ts} +0 -0
- /package/dist/{release-cmd.d.ts → cli/release-cmd.d.ts} +0 -0
- /package/dist/{test-cmd.d.ts → cli/test-cmd.d.ts} +0 -0
- /package/dist/{test-compile.d.ts → cli/test-compile.d.ts} +0 -0
- /package/dist/{test-compile.js → cli/test-compile.js} +0 -0
- /package/dist/{test-discover.d.ts → cli/test-discover.d.ts} +0 -0
- /package/dist/{test-discover.js → cli/test-discover.js} +0 -0
- /package/dist/{test-logic.d.ts → cli/test-logic.d.ts} +0 -0
- /package/dist/{test-logic.js → cli/test-logic.js} +0 -0
- /package/dist/{test-protocol.d.ts → cli/test-protocol.d.ts} +0 -0
- /package/dist/{test-protocol.js → cli/test-protocol.js} +0 -0
- /package/dist/{toolchain-dx.d.ts → cli/toolchain-dx.d.ts} +0 -0
- /package/dist/{toolchain-dx.js → cli/toolchain-dx.js} +0 -0
- /package/dist/{delivery-profile.d.ts → delivery/delivery-profile.d.ts} +0 -0
- /package/dist/{delivery-profile.js → delivery/delivery-profile.js} +0 -0
- /package/dist/{dev-incremental.d.ts → dev/dev-incremental.d.ts} +0 -0
- /package/dist/{dev-incremental.js → dev/dev-incremental.js} +0 -0
- /package/dist/{dev-watch-roots.d.ts → dev/dev-watch-roots.d.ts} +0 -0
- /package/dist/{document-build.d.ts → document/document-build.d.ts} +0 -0
- /package/dist/{document-cmd.d.ts → document/document-cmd.d.ts} +0 -0
- /package/dist/{document-designs.d.ts → document/document-designs.d.ts} +0 -0
- /package/dist/{document-designs.js → document/document-designs.js} +0 -0
- /package/dist/{document-enrich.d.ts → document/document-enrich.d.ts} +0 -0
- /package/dist/{document-enrich.js → document/document-enrich.js} +0 -0
- /package/dist/{document-evidence.d.ts → document/document-evidence.d.ts} +0 -0
- /package/dist/{document-evidence.js → document/document-evidence.js} +0 -0
- /package/dist/{document-integrate.d.ts → document/document-integrate.d.ts} +0 -0
- /package/dist/{document-interactive.d.ts → document/document-interactive.d.ts} +0 -0
- /package/dist/{document-interactive.js → document/document-interactive.js} +0 -0
- /package/dist/{document-layout-render.d.ts → document/document-layout-render.d.ts} +0 -0
- /package/dist/{document-layout-render.js → document/document-layout-render.js} +0 -0
- /package/dist/{document-locale.d.ts → document/document-locale.d.ts} +0 -0
- /package/dist/{document-locale.js → document/document-locale.js} +0 -0
- /package/dist/{document-markdown.d.ts → document/document-markdown.d.ts} +0 -0
- /package/dist/{document-routing-config.d.ts → document/document-routing-config.d.ts} +0 -0
- /package/dist/{document-scan.d.ts → document/document-scan.d.ts} +0 -0
- /package/dist/{document-scan.js → document/document-scan.js} +0 -0
- /package/dist/{document-schema.d.ts → document/document-schema.d.ts} +0 -0
- /package/dist/{document-schema.js → document/document-schema.js} +0 -0
- /package/dist/{locale-check.d.ts → locale/locale-check.d.ts} +0 -0
- /package/dist/{locale-cmd.d.ts → locale/locale-cmd.d.ts} +0 -0
- /package/dist/{locale-delivery.d.ts → locale/locale-delivery.d.ts} +0 -0
- /package/dist/{locale-delivery.js → locale/locale-delivery.js} +0 -0
- /package/dist/{locale-route-emit.d.ts → locale/locale-route-emit.d.ts} +0 -0
- /package/dist/{locale-router.d.ts → locale/locale-router.d.ts} +0 -0
- /package/dist/{locale-router.js → locale/locale-router.js} +0 -0
- /package/dist/{locale-runtime.d.ts → locale/locale-runtime.d.ts} +0 -0
- /package/dist/{locale-runtime.js → locale/locale-runtime.js} +0 -0
- /package/dist/{locale-schema.d.ts → locale/locale-schema.d.ts} +0 -0
- /package/dist/{locale-schema.js → locale/locale-schema.js} +0 -0
- /package/dist/{locale-tooling.d.ts → locale/locale-tooling.d.ts} +0 -0
- /package/dist/{locale-tooling.js → locale/locale-tooling.js} +0 -0
- /package/dist/{author-input.d.ts → workspace/author-input.d.ts} +0 -0
- /package/dist/{author-input.js → workspace/author-input.js} +0 -0
- /package/dist/{build-assemble.d.ts → workspace/build-assemble.d.ts} +0 -0
- /package/dist/{bundler-adapter.d.ts → workspace/bundler-adapter.d.ts} +0 -0
- /package/dist/{bundler-adapter.js → workspace/bundler-adapter.js} +0 -0
- /package/dist/{cdn-policy.d.ts → workspace/cdn-policy.d.ts} +0 -0
- /package/dist/{content-addressed-assets.d.ts → workspace/content-addressed-assets.d.ts} +0 -0
- /package/dist/{content-addressed-assets.js → workspace/content-addressed-assets.js} +0 -0
- /package/dist/{embedded-packaging.d.ts → workspace/embedded-packaging.d.ts} +0 -0
- /package/dist/{embedded-packaging.js → workspace/embedded-packaging.js} +0 -0
- /package/dist/{invocation.d.ts → workspace/invocation.d.ts} +0 -0
- /package/dist/{log.d.ts → workspace/log.d.ts} +0 -0
- /package/dist/{mini-host.d.ts → workspace/mini-host.d.ts} +0 -0
- /package/dist/{mini-host.js → workspace/mini-host.js} +0 -0
- /package/dist/{native-addon.d.ts → workspace/native-addon.d.ts} +0 -0
- /package/dist/{native-addon.js → workspace/native-addon.js} +0 -0
- /package/dist/{pack-client-packages.d.ts → workspace/pack-client-packages.d.ts} +0 -0
- /package/dist/{pack-client-packages.js → workspace/pack-client-packages.js} +0 -0
- /package/dist/{pack.d.ts → workspace/pack.d.ts} +0 -0
- /package/dist/{pack.js → workspace/pack.js} +0 -0
- /package/dist/{packages.d.ts → workspace/packages.d.ts} +0 -0
- /package/dist/{packages.js → workspace/packages.js} +0 -0
- /package/dist/{plugin-host.d.ts → workspace/plugin-host.d.ts} +0 -0
- /package/dist/{plugin-host.js → workspace/plugin-host.js} +0 -0
- /package/dist/{port.d.ts → workspace/port.d.ts} +0 -0
- /package/dist/{port.js → workspace/port.js} +0 -0
- /package/dist/{pretty-json.d.ts → workspace/pretty-json.d.ts} +0 -0
- /package/dist/{pretty-json.js → workspace/pretty-json.js} +0 -0
- /package/dist/{production-observability.d.ts → workspace/production-observability.d.ts} +0 -0
- /package/dist/{production-observability.js → workspace/production-observability.js} +0 -0
- /package/dist/{production-test-pack.d.ts → workspace/production-test-pack.d.ts} +0 -0
- /package/dist/{production-test-pack.js → workspace/production-test-pack.js} +0 -0
- /package/dist/{project-build.d.ts → workspace/project-build.d.ts} +0 -0
- /package/dist/{public-static-assets.d.ts → workspace/public-static-assets.d.ts} +0 -0
- /package/dist/{public-static-assets.js → workspace/public-static-assets.js} +0 -0
- /package/dist/{release-pack.d.ts → workspace/release-pack.d.ts} +0 -0
- /package/dist/{release-pack.js → workspace/release-pack.js} +0 -0
- /package/dist/{resolve.d.ts → workspace/resolve.d.ts} +0 -0
- /package/dist/{resolve.js → workspace/resolve.js} +0 -0
- /package/dist/{route-catalog-emit.d.ts → workspace/route-catalog-emit.d.ts} +0 -0
- /package/dist/{route-catalog-emit.js → workspace/route-catalog-emit.js} +0 -0
- /package/dist/{route-path.d.ts → workspace/route-path.d.ts} +0 -0
- /package/dist/{route-path.js → workspace/route-path.js} +0 -0
- /package/dist/{server-artifact.d.ts → workspace/server-artifact.d.ts} +0 -0
- /package/dist/{server-artifact.js → workspace/server-artifact.js} +0 -0
- /package/dist/{server-language-backend.d.ts → workspace/server-language-backend.d.ts} +0 -0
- /package/dist/{server-language-backend.js → workspace/server-language-backend.js} +0 -0
- /package/dist/{site-delivery.d.ts → workspace/site-delivery.d.ts} +0 -0
- /package/dist/{site-delivery.js → workspace/site-delivery.js} +0 -0
- /package/dist/{site-favicon.d.ts → workspace/site-favicon.d.ts} +0 -0
- /package/dist/{site-favicon.js → workspace/site-favicon.js} +0 -0
- /package/dist/{static-emit.d.ts → workspace/static-emit.d.ts} +0 -0
- /package/dist/{watch-diff.d.ts → workspace/watch-diff.d.ts} +0 -0
- /package/dist/{watch-diff.js → workspace/watch-diff.js} +0 -0
- /package/dist/{wechat-packaging.d.ts → workspace/wechat-packaging.d.ts} +0 -0
package/bin/vmz.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import { loadNative } from '
|
|
7
|
-
import { log } from '
|
|
8
|
-
import { resolveWorkspacePackages } from '
|
|
9
|
-
import { resolveWorkspaceDirs } from '
|
|
6
|
+
import { loadNative } from '../workspace/public-api.js';
|
|
7
|
+
import { log } from '../workspace/log.js';
|
|
8
|
+
import { resolveWorkspacePackages } from '../workspace/packages.js';
|
|
9
|
+
import { resolveWorkspaceDirs } from '../workspace/resolve.js';
|
|
10
10
|
export function registerApplicationCommands(parent) {
|
|
11
11
|
const withCommon = (cmd) => cmd.option('--json [file]', 'cli.opt.json').option('--base <path>', 'cli.opt.base').option('--dirty <path>...', 'cli.opt.dirty');
|
|
12
12
|
withCommon(parent.command('check', 'cli.cmd.application.check')).action((o) => cmdCheck(o));
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { createLocalizeFromLocales, flattenCatalog, loadCatalog, loadLocalesManifest, resolveLocale, translate, } from '@vmz/commander';
|
|
10
|
-
const LOCALES_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'locales');
|
|
10
|
+
const LOCALES_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'locales');
|
|
11
11
|
const VMZ_ENV_KEYS = ['VMZ_LOCALE', 'LOCALE', 'LANG', 'LC_ALL'];
|
|
12
12
|
/** Package `locales/` root (shipped next to `dist/`). */
|
|
13
13
|
export function resolveCliLocalesRoot() {
|
|
@@ -6,28 +6,28 @@ import { existsSync } from 'node:fs';
|
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { createCli } from '@vmz/commander';
|
|
8
8
|
import { registerApplicationCommands } from './application-cmd.js';
|
|
9
|
-
import { assembleDelivery, emitBuildProof } from '
|
|
9
|
+
import { assembleDelivery, emitBuildProof } from '../workspace/build-assemble.js';
|
|
10
10
|
import { resolveCliLocalesRoot } from './cli-localize.js';
|
|
11
|
-
import { normalizeDeliveryAuthoring, resolveProfileArtifactDir, selectBuildProfile } from '
|
|
12
|
-
import { createDevSession } from '
|
|
13
|
-
import { registerDocumentCommands } from '
|
|
14
|
-
import { buildIntegratedDocuments, projectHasDocuments } from '
|
|
11
|
+
import { normalizeDeliveryAuthoring, resolveProfileArtifactDir, selectBuildProfile } from '../delivery/delivery-profile.js';
|
|
12
|
+
import { createDevSession } from '../dev/dev-session.js';
|
|
13
|
+
import { registerDocumentCommands } from '../document/document-cmd.js';
|
|
14
|
+
import { buildIntegratedDocuments, projectHasDocuments } from '../document/document-integrate.js';
|
|
15
15
|
import { registerExplainCommand } from './explain-cmd.js';
|
|
16
16
|
import { registerGithubActionsCommand } from './github-actions-cmd.js';
|
|
17
|
-
import { createWorkspace, getProtocolVersions, HOST_PROTOCOL, materializeServeHostRuntime, resolveCoreRuntimeDist, resolveNativePath, } from '
|
|
18
|
-
import { gateGlobalProjectCommand, getInvocationContext, isGlobalAllowedCommand } from '
|
|
19
|
-
import { emitLocaleRuntimeModules, localeHasErrors } from '
|
|
20
|
-
import { registerLocaleCommands } from '
|
|
21
|
-
import { emitLocaleRouteRealization } from '
|
|
22
|
-
import { log } from '
|
|
23
|
-
import { packFromDeploymentIr } from '
|
|
17
|
+
import { createWorkspace, getProtocolVersions, HOST_PROTOCOL, materializeServeHostRuntime, resolveCoreRuntimeDist, resolveNativePath, } from '../workspace/public-api.js';
|
|
18
|
+
import { gateGlobalProjectCommand, getInvocationContext, isGlobalAllowedCommand } from '../workspace/invocation.js';
|
|
19
|
+
import { emitLocaleRuntimeModules, localeHasErrors } from '../locale/locale-check.js';
|
|
20
|
+
import { registerLocaleCommands } from '../locale/locale-cmd.js';
|
|
21
|
+
import { emitLocaleRouteRealization } from '../locale/locale-route-emit.js';
|
|
22
|
+
import { log } from '../workspace/log.js';
|
|
23
|
+
import { packFromDeploymentIr } from '../workspace/pack.js';
|
|
24
24
|
import { registerPlanCommands } from './plan-cmd.js';
|
|
25
|
-
import { loadVmzConfig } from '
|
|
26
|
-
import { findAvailablePort } from '
|
|
25
|
+
import { loadVmzConfig } from '../workspace/plugin-host.js';
|
|
26
|
+
import { findAvailablePort } from '../workspace/port.js';
|
|
27
27
|
import { registerRefactorCommands } from './refactor-cmd.js';
|
|
28
28
|
import { registerArtifactCommands } from './release-cmd.js';
|
|
29
|
-
import { readPackageMeta, resolveWorkspaceDirs } from '
|
|
30
|
-
import { emitRouteCatalog } from '
|
|
29
|
+
import { readPackageMeta, resolveWorkspaceDirs } from '../workspace/resolve.js';
|
|
30
|
+
import { emitRouteCatalog } from '../workspace/route-catalog-emit.js';
|
|
31
31
|
import { registerTestCommand } from './test-cmd.js';
|
|
32
32
|
export function printGlobalHelp() {
|
|
33
33
|
return buildProductCli({ mode: 'global' }).parse(['help']);
|
|
@@ -125,7 +125,7 @@ async function cmdCheck(args) {
|
|
|
125
125
|
try {
|
|
126
126
|
return runWithPlugins(ws, project, outDir, async () => {
|
|
127
127
|
const report = ws.check();
|
|
128
|
-
const { checkLocales, localeHasErrors } = await import('
|
|
128
|
+
const { checkLocales, localeHasErrors } = await import('../locale/locale-check.js');
|
|
129
129
|
const localeReport = checkLocales({ projectRoot: project, checkUnused: false });
|
|
130
130
|
// Locale policy is first-class: missing /locales is warning (not silent), hard errors still fail.
|
|
131
131
|
const errors = log.diagnostics([...(report.diagnostics ?? []), ...(localeReport.diagnostics ?? [])]) ||
|
|
@@ -152,7 +152,7 @@ function dedupeDiagnostics(list) {
|
|
|
152
152
|
return out;
|
|
153
153
|
}
|
|
154
154
|
async function runWithPlugins(ws, project, outDir, fn) {
|
|
155
|
-
const { loadVmzConfig, applyPlugins } = await import('
|
|
155
|
+
const { loadVmzConfig, applyPlugins } = await import('../workspace/plugin-host.js');
|
|
156
156
|
const { plugins, engines } = await loadVmzConfig(project);
|
|
157
157
|
if (plugins.length) {
|
|
158
158
|
await applyPlugins(ws, plugins, { project, outDir, engines });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `vmz explain` — DX causal explain; registered on `@vmz/commander`.
|
|
3
3
|
*/
|
|
4
|
-
import { createWorkspace } from '
|
|
5
|
-
import { log } from '
|
|
6
|
-
import { resolveWorkspaceDirs } from '
|
|
4
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
5
|
+
import { log } from '../workspace/log.js';
|
|
6
|
+
import { resolveWorkspaceDirs } from '../workspace/resolve.js';
|
|
7
7
|
export function registerExplainCommand(cli) {
|
|
8
8
|
cli.command('explain', 'cli.cmd.explain')
|
|
9
9
|
.option('--json', 'cli.opt.json')
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `vmz github-actions` — monitor workflow runs via N-API → Rust `vmz-github` (octocrab).
|
|
3
3
|
*/
|
|
4
|
-
import { loadNative } from '
|
|
5
|
-
import { log } from '
|
|
6
|
-
import { emitPrettyJson } from '
|
|
4
|
+
import { loadNative } from '../workspace/public-api.js';
|
|
5
|
+
import { log } from '../workspace/log.js';
|
|
6
|
+
import { emitPrettyJson } from '../workspace/pretty-json.js';
|
|
7
7
|
export function registerGithubActionsCommand(cli) {
|
|
8
8
|
cli.command('github-actions|gha', 'cli.cmd.github-actions')
|
|
9
9
|
.option('--mode <mode>', 'cli.opt.gha.mode')
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* `vmz plan` — dump frozen Rust plans via N-API; registered on `@vmz/commander`.
|
|
3
3
|
*/
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { loadDocumentRoutePlan, loadLocalePlan, mapPlanDiagnostics } from '
|
|
6
|
-
import { log } from '
|
|
7
|
-
import { emitPrettyJson } from '
|
|
5
|
+
import { loadDocumentRoutePlan, loadLocalePlan, mapPlanDiagnostics } from '../workspace/author-input.js';
|
|
6
|
+
import { log } from '../workspace/log.js';
|
|
7
|
+
import { emitPrettyJson } from '../workspace/pretty-json.js';
|
|
8
8
|
export function registerPlanCommands(parent) {
|
|
9
9
|
const withJson = (cmd) => cmd.option('--json [file]', 'cli.opt.json');
|
|
10
10
|
withJson(parent.command('locale', 'cli.cmd.plan.locale')).action((options) => runPlanKind('locale', options));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `vmz refactor` — registered on `@vmz/commander`.
|
|
3
3
|
*/
|
|
4
|
-
import { createWorkspace } from '
|
|
5
|
-
import { log } from '
|
|
6
|
-
import { resolveWorkspaceDirs } from '
|
|
4
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
5
|
+
import { log } from '../workspace/log.js';
|
|
6
|
+
import { resolveWorkspaceDirs } from '../workspace/resolve.js';
|
|
7
7
|
export function registerRefactorCommands(parent) {
|
|
8
8
|
parent
|
|
9
9
|
.command('rename', 'cli.cmd.refactor.rename')
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `vmz artifact` — pack / publish / rollback / diff; registered on `@vmz/commander`.
|
|
3
3
|
*/
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { log } from '
|
|
6
|
-
import { diffArtifacts, loadReleaseEnvelope, packRelease, publishRelease, readPointer, rollbackRelease } from '
|
|
5
|
+
import { log } from '../workspace/log.js';
|
|
6
|
+
import { diffArtifacts, loadReleaseEnvelope, packRelease, publishRelease, readPointer, rollbackRelease } from '../workspace/release-pack.js';
|
|
7
7
|
export function registerArtifactCommands(parent) {
|
|
8
8
|
const withOpts = (cmd) => cmd.option('--releases <dir>', 'cli.opt.releases').option('--app-id <id>', 'cli.opt.app-id').option('--json', 'cli.opt.json');
|
|
9
9
|
withOpts(parent.command('pack', 'cli.cmd.artifact.pack')).action((o) => runArtifact('pack', o));
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import os from 'node:os';
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import { createWorkspace } from '
|
|
9
|
-
import { buildProjectToOutDirRoot } from '
|
|
10
|
-
import { log } from '
|
|
11
|
-
import { generatePrettyJson } from '
|
|
8
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
9
|
+
import { buildProjectToOutDirRoot } from '../workspace/project-build.js';
|
|
10
|
+
import { log } from '../workspace/log.js';
|
|
11
|
+
import { generatePrettyJson } from '../workspace/pretty-json.js';
|
|
12
12
|
export function registerTestCommand(cli) {
|
|
13
13
|
cli.command('test', 'cli.cmd.test')
|
|
14
14
|
.option('--out-dir, -o <dir>', 'cli.opt.out-dir')
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 2. Soft reload only re-imports affected pages unless shared `lib/` / full rebuild.
|
|
10
10
|
* 3. Soft reload failure → **auto-respawn** serve-host (fresh ESM graph), not "keep broken host".
|
|
11
11
|
*/
|
|
12
|
-
import { createWorkspace } from '
|
|
12
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
13
13
|
interface DevSessionOptions {
|
|
14
14
|
project: string;
|
|
15
15
|
outDir: string;
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
import { spawn } from 'node:child_process';
|
|
13
13
|
import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
14
14
|
import path from 'node:path';
|
|
15
|
-
import { buildIntegratedDocuments, projectHasDocuments } from '
|
|
16
|
-
import { createWorkspace, resolveNativePath } from '
|
|
17
|
-
import { emitLocaleRuntimeModules, localeHasErrors } from '
|
|
18
|
-
import { log } from '
|
|
15
|
+
import { buildIntegratedDocuments, projectHasDocuments } from '../document/document-integrate.js';
|
|
16
|
+
import { createWorkspace, resolveNativePath } from '../workspace/public-api.js';
|
|
17
|
+
import { emitLocaleRuntimeModules, localeHasErrors } from '../locale/locale-check.js';
|
|
18
|
+
import { log } from '../workspace/log.js';
|
|
19
19
|
import { coalesceRootBurst, collectDevWatchRoots, classifyWatchRoot, isDependencyPath, mergeDirtySets, collectDevConfigPaths, configFingerprintMap, } from './dev-watch-roots.js';
|
|
20
20
|
import { buildReloadPayload, filterGenerationIgnore, parseHmrPlan, registerWrittenOutputsIgnore, shouldSoftReload, staticRevisionFromArtifact, } from './dev-incremental.js';
|
|
21
|
-
import { diffFingerprints, fileFingerprintMap } from '
|
|
21
|
+
import { diffFingerprints, fileFingerprintMap } from '../workspace/watch-diff.js';
|
|
22
22
|
/** Track serve-host so a failed/killed launcher cannot leave an orphan port. */
|
|
23
23
|
const DEV_HOST_PID = '.vmz-dev-host.pid';
|
|
24
24
|
export function createDevSession(options) {
|
|
@@ -56,7 +56,7 @@ export function createDevSession(options) {
|
|
|
56
56
|
return planAndRebuild(changes).report;
|
|
57
57
|
}
|
|
58
58
|
async function emitPublicAndTrack() {
|
|
59
|
-
const { emitPublicStaticAssets } = await import('
|
|
59
|
+
const { emitPublicStaticAssets } = await import('../workspace/public-static-assets.js');
|
|
60
60
|
const artifact = emitPublicStaticAssets(outDir, { projectRoot: project });
|
|
61
61
|
lastStaticRevision = staticRevisionFromArtifact(artifact);
|
|
62
62
|
return artifact;
|
|
@@ -195,7 +195,7 @@ export function createDevSession(options) {
|
|
|
195
195
|
// Soft rebuilds reuse the workspace; config/plugin changes still need a process restart
|
|
196
196
|
// until `vmz.config.*` is watched.
|
|
197
197
|
{
|
|
198
|
-
const { loadVmzConfig, applyPlugins } = await import('
|
|
198
|
+
const { loadVmzConfig, applyPlugins } = await import('../workspace/plugin-host.js');
|
|
199
199
|
const { plugins, engines } = await loadVmzConfig(project);
|
|
200
200
|
if (plugins.length) {
|
|
201
201
|
await applyPlugins(ws, plugins, { project, outDir, engines });
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import { diffFingerprints, fileFingerprintMap } from '
|
|
10
|
+
import { diffFingerprints, fileFingerprintMap } from '../workspace/watch-diff.js';
|
|
11
11
|
const CONFIG_BASENAMES = ['vmz.config.ts', 'vmz.config.js', 'vmz.config.mjs', 'vmz.config.cjs'];
|
|
12
12
|
/** `vmz.config.*` at project root (devControl). */
|
|
13
13
|
export function collectDevConfigPaths(project) {
|
|
@@ -12,9 +12,9 @@ import { assertIntegratedDistReady, renderCompiledDocumentLayout } from './docum
|
|
|
12
12
|
import { resolveMarkdownEngine } from './document-markdown.js';
|
|
13
13
|
import { loadLocalesRouting } from './document-routing-config.js';
|
|
14
14
|
import { DOCUMENT_VIEW_SCHEMA } from './document-schema.js';
|
|
15
|
-
import { createWorkspace } from '
|
|
16
|
-
import { requireNativeAddon } from '
|
|
17
|
-
import { writePrettyJsonFile } from '
|
|
15
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
16
|
+
import { requireNativeAddon } from '../workspace/native-addon.js';
|
|
17
|
+
import { writePrettyJsonFile } from '../workspace/pretty-json.js';
|
|
18
18
|
export async function buildDocuments(opts) {
|
|
19
19
|
const projectRoot = path.resolve(opts.projectRoot);
|
|
20
20
|
const outDir = path.resolve(opts.outDir || path.join(projectRoot, 'dist', 'documents'));
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Author documents config is parsed by Rust DocumentRoutePlan; TS only
|
|
5
5
|
* merges filesystem scan (pageKeys) and coverage diagnostics.
|
|
6
6
|
*/
|
|
7
|
-
import { type DocumentRoutePlan } from '
|
|
7
|
+
import { type DocumentRoutePlan } from '../workspace/author-input.js';
|
|
8
8
|
import { type DocumentDiagnostic, type DocumentManifest } from './document-schema.js';
|
|
9
9
|
export interface DocumentsConfigShape {
|
|
10
10
|
defaultLocale?: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* merges filesystem scan (pageKeys) and coverage diagnostics.
|
|
6
6
|
*/
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import { loadDocumentRoutePlan, mapPlanDiagnostics } from '
|
|
8
|
+
import { loadDocumentRoutePlan, mapPlanDiagnostics } from '../workspace/author-input.js';
|
|
9
9
|
import { scanDocumentsTree } from './document-scan.js';
|
|
10
10
|
import { DIAG, DOCUMENT_MANIFEST_SCHEMA, } from './document-schema.js';
|
|
11
11
|
/** Resolve project documents root. */
|
|
@@ -7,9 +7,9 @@ import { checkDocuments, manifestHasErrors } from './document-check.js';
|
|
|
7
7
|
import { enrichDocumentContent } from './document-enrich.js';
|
|
8
8
|
import { enrichDocumentEvidence } from './document-evidence.js';
|
|
9
9
|
import { resolveMarkdownEngine } from './document-markdown.js';
|
|
10
|
-
import { createWorkspace } from '
|
|
11
|
-
import { log } from '
|
|
12
|
-
import { emitPrettyJson } from '
|
|
10
|
+
import { createWorkspace } from '../workspace/public-api.js';
|
|
11
|
+
import { log } from '../workspace/log.js';
|
|
12
|
+
import { emitPrettyJson } from '../workspace/pretty-json.js';
|
|
13
13
|
export function registerDocumentCommands(parent) {
|
|
14
14
|
const withOpts = (cmd) => cmd
|
|
15
15
|
.option('--root <dir>', 'cli.opt.root')
|
|
@@ -8,9 +8,9 @@ import { buildDocuments } from './document-build.js';
|
|
|
8
8
|
import { resolveDocumentsRoot } from './document-check.js';
|
|
9
9
|
import { pageHtmlRel } from './document-enrich.js';
|
|
10
10
|
import { loadLocalesRouting } from './document-routing-config.js';
|
|
11
|
-
import { ensureLocaleImportsRewritten } from '
|
|
12
|
-
import { log } from '
|
|
13
|
-
import { requireNativeAddon } from '
|
|
11
|
+
import { ensureLocaleImportsRewritten } from '../locale/locale-check.js';
|
|
12
|
+
import { log } from '../workspace/log.js';
|
|
13
|
+
import { requireNativeAddon } from '../workspace/native-addon.js';
|
|
14
14
|
export function projectHasDocuments(projectRoot) {
|
|
15
15
|
const root = resolveDocumentsRoot(projectRoot);
|
|
16
16
|
return fs.existsSync(root) && fs.statSync(root).isDirectory();
|
|
@@ -5,7 +5,7 @@ import { createRequire } from 'node:module';
|
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import { importMaybeTs } from '
|
|
8
|
+
import { importMaybeTs } from '../workspace/plugin-host.js';
|
|
9
9
|
const require = createRequire(import.meta.url);
|
|
10
10
|
export async function resolveMarkdownEngine(opts = {}) {
|
|
11
11
|
const id = opts.engines?.markdown || 'markdown-it';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project locale routing — consume Rust LocalePlan (no author JSON5 in TS).
|
|
3
3
|
*/
|
|
4
|
-
import { loadLocalePlan } from '
|
|
4
|
+
import { loadLocalePlan } from '../workspace/author-input.js';
|
|
5
5
|
export function loadLocalesRouting(projectRoot) {
|
|
6
6
|
const plan = loadLocalePlan(projectRoot);
|
|
7
7
|
if (!plan || plan.diagnostics?.some((d) => d.code === 'vmz::locale::manifest_missing')) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load packages/runtimes/vmz/host-runtime-files.json — sole host companion copy list.
|
|
3
|
+
*/
|
|
4
|
+
export type HostRuntimeFileEntry = {
|
|
5
|
+
src: string;
|
|
6
|
+
out: string;
|
|
7
|
+
rewriteVmzRuntimeImport?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type HostRuntimeFilesManifest = {
|
|
10
|
+
schema: string;
|
|
11
|
+
files: HostRuntimeFileEntry[];
|
|
12
|
+
launcherStub: {
|
|
13
|
+
out: string;
|
|
14
|
+
body: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare function loadHostRuntimeFilesManifest(pathOverride?: string): HostRuntimeFilesManifest;
|
|
18
|
+
/** Flat [src, out] pairs for materialize / export compatibility. */
|
|
19
|
+
export declare function serveHostRuntimeFilePairs(manifest?: HostRuntimeFilesManifest): ReadonlyArray<readonly [string, string]>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load packages/runtimes/vmz/host-runtime-files.json — sole host companion copy list.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
const MANIFEST_BASENAME = 'host-runtime-files.json';
|
|
8
|
+
function manifestPathFromHere() {
|
|
9
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
// src/host-materialize or dist/host-materialize → package root
|
|
11
|
+
return join(here, '..', '..', MANIFEST_BASENAME);
|
|
12
|
+
}
|
|
13
|
+
let cached = null;
|
|
14
|
+
export function loadHostRuntimeFilesManifest(pathOverride) {
|
|
15
|
+
if (!pathOverride && cached)
|
|
16
|
+
return cached;
|
|
17
|
+
const p = pathOverride || manifestPathFromHere();
|
|
18
|
+
const raw = JSON.parse(readFileSync(p, 'utf8'));
|
|
19
|
+
if (raw.schema !== 'vmz.host-runtime-files.v0') {
|
|
20
|
+
throw new Error(`host-runtime-files: unexpected schema ${raw.schema}`);
|
|
21
|
+
}
|
|
22
|
+
if (!Array.isArray(raw.files) || !raw.files.length) {
|
|
23
|
+
throw new Error('host-runtime-files: files empty');
|
|
24
|
+
}
|
|
25
|
+
if (!raw.launcherStub?.out || typeof raw.launcherStub.body !== 'string') {
|
|
26
|
+
throw new Error('host-runtime-files: launcherStub missing');
|
|
27
|
+
}
|
|
28
|
+
if (!pathOverride)
|
|
29
|
+
cached = raw;
|
|
30
|
+
return raw;
|
|
31
|
+
}
|
|
32
|
+
/** Flat [src, out] pairs for materialize / export compatibility. */
|
|
33
|
+
export function serveHostRuntimeFilePairs(manifest = loadHostRuntimeFilesManifest()) {
|
|
34
|
+
return manifest.files.map((f) => [f.src, f.out]);
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy `@vmz/core` host companions into delivery `_vmz/host/` per host-runtime-files.json.
|
|
3
|
+
*/
|
|
4
|
+
import { serveHostRuntimeFilePairs } from './host-runtime-files.js';
|
|
5
|
+
export { serveHostRuntimeFilePairs };
|
|
6
|
+
/** Runtime companions required by dist/_vmz/host/vmz-serve-host.mjs relative imports. */
|
|
7
|
+
export declare const SERVE_HOST_RUNTIME_FILES: ReadonlyArray<readonly [string, string]>;
|
|
8
|
+
/** Copy serve-host + registry bootstrap modules from `@vmz/core` into `_vmz/host/`. */
|
|
9
|
+
export declare function materializeServeHostRuntime(outDir: string, coreDist?: string | null): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy `@vmz/core` host companions into delivery `_vmz/host/` per host-runtime-files.json.
|
|
3
|
+
*/
|
|
4
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { loadHostRuntimeFilesManifest, serveHostRuntimeFilePairs } from './host-runtime-files.js';
|
|
7
|
+
import { resolveCoreRuntimeDist } from '../workspace/runtime-dist.js';
|
|
8
|
+
export { serveHostRuntimeFilePairs };
|
|
9
|
+
/** Runtime companions required by dist/_vmz/host/vmz-serve-host.mjs relative imports. */
|
|
10
|
+
export const SERVE_HOST_RUNTIME_FILES = serveHostRuntimeFilePairs();
|
|
11
|
+
/** Copy serve-host + registry bootstrap modules from `@vmz/core` into `_vmz/host/`. */
|
|
12
|
+
export function materializeServeHostRuntime(outDir, coreDist = resolveCoreRuntimeDist()) {
|
|
13
|
+
if (!coreDist) {
|
|
14
|
+
throw new Error('materializeServeHostRuntime: @vmz/core dist not found');
|
|
15
|
+
}
|
|
16
|
+
const manifest = loadHostRuntimeFilesManifest();
|
|
17
|
+
for (const entry of manifest.files) {
|
|
18
|
+
const src = path.join(coreDist, entry.src);
|
|
19
|
+
const dst = path.join(outDir, entry.out);
|
|
20
|
+
if (!existsSync(src)) {
|
|
21
|
+
throw new Error(`materializeServeHostRuntime: missing ${src}`);
|
|
22
|
+
}
|
|
23
|
+
mkdirSync(path.dirname(dst), { recursive: true });
|
|
24
|
+
if (entry.rewriteVmzRuntimeImport) {
|
|
25
|
+
const text = readFileSync(src, 'utf8')
|
|
26
|
+
.replace(/from\s+(['"])\.\/vmz-runtime\.js\1/g, 'from $1../../vmz-runtime.js$1')
|
|
27
|
+
.replace(/from\s+(['"])\.\.\/faces\/vmz-runtime\.js\1/g, 'from $1../../vmz-runtime.js$1')
|
|
28
|
+
.replace(/from\s+(['"])\.\.\/faces\/server\.js\1/g, 'from $1../../vmz-runtime.js$1');
|
|
29
|
+
writeFileSync(dst, text, 'utf8');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
copyFileSync(src, dst);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const stub = path.join(outDir, manifest.launcherStub.out);
|
|
36
|
+
writeFileSync(stub, manifest.launcherStub.body, 'utf8');
|
|
37
|
+
}
|