@vmz/vmz 0.1.7 → 0.1.9

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.
@@ -86,7 +86,7 @@ export function buildCdnPolicyManifest(staticManifest, opts = {}) {
86
86
  const body = {
87
87
  schema: CDN_POLICY_MANIFEST_SCHEMA,
88
88
  applicationId: staticManifest.applicationId || null,
89
- deliveryProfile: 'web-static',
89
+ deliveryProfile: 'static',
90
90
  origin,
91
91
  spaFallback: false,
92
92
  staticManifestDigest: staticManifest.manifestDigest || null,
package/dist/cli.js CHANGED
@@ -123,7 +123,7 @@ Usage:
123
123
  Options:
124
124
  --out-dir, -o <dir> Output directory (default: dist)
125
125
  --release Release build (omit serve-host; pack minify slot; proof)
126
- --profile <name> Delivery profile (default from config; builtins: web-ssr|web-static|web-client|web-hybrid)
126
+ --profile <name> Delivery profile (default from config; builtins: web-ssr|static|web-client|web-hybrid)
127
127
  --target <id> browser (default) | mini-program-wechat (pack dist/wechat for WeChat DevTools; build+dev)
128
128
  --origin <url> Site origin for static-cdn canonical/sitemap
129
129
  --host <host> Listen host (default: 127.0.0.1)
@@ -450,7 +450,7 @@ async function cmdBuild(args) {
450
450
  let assemble = null;
451
451
  try {
452
452
  if (selected.selection.assembly === 'static-cdn') {
453
- log.info(`web-static emit ${outDir}`);
453
+ log.info(`static emit ${outDir}`);
454
454
  }
455
455
  assemble = await assembleDelivery(outDir, {
456
456
  selection: selected.selection,
@@ -464,7 +464,7 @@ async function cmdBuild(args) {
464
464
  });
465
465
  for (const step of assemble.manifest.steps || []) {
466
466
  if (step.kind === 'static-cdn') {
467
- log.info(`web-static ok (${step.htmlFiles} html, ${step.skipped} skipped, digest=${String(step.digest).slice(0, 12)}…)`);
467
+ log.info(`static ok (${step.htmlFiles} html, ${step.skipped} skipped, digest=${String(step.digest).slice(0, 12)}…)`);
468
468
  }
469
469
  else if (step.kind === 'site-delivery' && step.digest) {
470
470
  log.info(`site-delivery ok (digest=${String(step.digest).slice(0, 12)}…)`);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A3: content-addressed assets/<hash> layout for immutable CDN objects.
3
- * Logical paths stay available for serve/dev; web-static HTML rewrites to hashed URLs.
3
+ * Logical paths stay available for serve/dev; static HTML rewrites to hashed URLs.
4
4
  * Identical bytes → identical asset path (cross-release / cross-source reuse by digest).
5
5
  */
6
6
  export declare const CONTENT_ADDRESSED_ASSETS_SCHEMA = "vmz.content_addressed_assets.v0";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A3: content-addressed assets/<hash> layout for immutable CDN objects.
3
- * Logical paths stay available for serve/dev; web-static HTML rewrites to hashed URLs.
3
+ * Logical paths stay available for serve/dev; static HTML rewrites to hashed URLs.
4
4
  * Identical bytes → identical asset path (cross-release / cross-source reuse by digest).
5
5
  */
6
6
  // @ts-nocheck
@@ -13,7 +13,7 @@ export declare const BUILTIN_PROFILES: Readonly<{
13
13
  host: string;
14
14
  assembly: string;
15
15
  };
16
- 'web-static': {
16
+ static: {
17
17
  host: string;
18
18
  assembly: string;
19
19
  };
@@ -12,7 +12,7 @@ export const SERVER_RUNTIMES = Object.freeze(['node', 'worker', 'deno', 'bun', '
12
12
  /** Official built-in aliases when not overridden in config. */
13
13
  export const BUILTIN_PROFILES = Object.freeze({
14
14
  'web-client': { host: 'browser', assembly: 'local-static' },
15
- 'web-static': { host: 'browser', assembly: 'static-cdn' },
15
+ static: { host: 'browser', assembly: 'static-cdn' },
16
16
  'web-ssr': { host: 'browser', assembly: 'server-host', serverRuntime: 'node' },
17
17
  'web-hybrid': { host: 'browser', assembly: 'cdn+server', serverRuntime: 'node' },
18
18
  });
@@ -90,16 +90,34 @@ export function buildLocaleRouteRealizationTable(input) {
90
90
  pathPattern: normalizePath(route.path),
91
91
  };
92
92
  realizations.push(entry);
93
- const prev = pathOwners.get(entry.path);
94
- if (prev && prev !== `${route.routeId}@${localeId}`) {
95
- diagnostics.push({
96
- code: DIAG_LOCALE_ROUTE_COLLISION,
97
- severity: 'error',
98
- message: `path ${entry.path} claimed by ${prev} and ${route.routeId}@${localeId}`,
99
- });
93
+ // `none` / `domain`: LocaleId is Host preference — many locales share one URL path.
94
+ // Collision only when *different RouteIds* claim the same path.
95
+ if (routing.strategy === 'none' || routing.strategy === 'domain') {
96
+ const prevRoute = pathOwners.get(entry.path);
97
+ if (prevRoute && prevRoute !== route.routeId) {
98
+ diagnostics.push({
99
+ code: DIAG_LOCALE_ROUTE_COLLISION,
100
+ severity: 'error',
101
+ message: `path ${entry.path} claimed by ${prevRoute} and ${route.routeId}`,
102
+ });
103
+ }
104
+ else {
105
+ pathOwners.set(entry.path, route.routeId);
106
+ }
100
107
  }
101
108
  else {
102
- pathOwners.set(entry.path, `${route.routeId}@${localeId}`);
109
+ const owner = `${route.routeId}@${localeId}`;
110
+ const prev = pathOwners.get(entry.path);
111
+ if (prev && prev !== owner) {
112
+ diagnostics.push({
113
+ code: DIAG_LOCALE_ROUTE_COLLISION,
114
+ severity: 'error',
115
+ message: `path ${entry.path} claimed by ${prev} and ${owner}`,
116
+ });
117
+ }
118
+ else {
119
+ pathOwners.set(entry.path, owner);
120
+ }
103
121
  }
104
122
  }
105
123
  }
@@ -136,7 +136,7 @@ export function normalizeSiteDelivery(raw, opts = {}) {
136
136
  artifact: String(d.artifact),
137
137
  expectedCompatibility: d.expectedCompatibility || {
138
138
  runtime: 'vmz',
139
- deliveryProfiles: ['web-static', 'filesystem'],
139
+ deliveryProfiles: ['static', 'filesystem'],
140
140
  },
141
141
  sources,
142
142
  resolutionPolicy: {
@@ -7,6 +7,7 @@ import crypto from 'node:crypto';
7
7
  import fs from 'node:fs';
8
8
  import path from 'node:path';
9
9
  import { pathToFileURL } from 'node:url';
10
+ import { preloadComponentRegistry } from '@vmz/core/component-registry';
10
11
  import { emitCdnPolicy } from './cdn-policy.js';
11
12
  import { emitContentAddressedAssets } from './content-addressed-assets.js';
12
13
  import { absoluteUrl, buildLocalePageMeta, localizeBodyLinks } from './locale-router.js';
@@ -29,7 +30,8 @@ export async function emitWebStatic(distDir, opts = {}) {
29
30
  if (!fs.existsSync(domPath)) {
30
31
  throw new Error(`emitWebStatic: missing ${domPath} — run vmz build first`);
31
32
  }
32
- const { renderToString, renderToStream } = await import(pathToFileURL(domPath).href);
33
+ const { renderToString, renderToStream, registerComponents } = await import(pathToFileURL(domPath).href);
34
+ await preloadComponentRegistry(distDir, registerComponents);
33
35
  const pageCatalog = listPageClientFiles(distDir);
34
36
  /** @type {Array<{
35
37
  * routeId: string,
@@ -186,7 +188,7 @@ export async function emitWebStatic(distDir, opts = {}) {
186
188
  const manifest = {
187
189
  schema: STATIC_DELIVERY_MANIFEST_SCHEMA,
188
190
  applicationId,
189
- deliveryProfile: 'web-static',
191
+ deliveryProfile: 'static',
190
192
  origin,
191
193
  generatedAt: new Date().toISOString(),
192
194
  spaFallback: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vmz/vmz",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "VMZ Node toolchain — N-API workspace session + CLI (publish name @vmz/vmz)",
6
6
  "license": "MIT",
@@ -48,15 +48,15 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@vmz/core": "0.1.7",
52
- "@vmz/plugin": "0.1.7",
53
- "@vmz/protocol": "0.1.7",
51
+ "@vmz/core": "0.1.9",
52
+ "@vmz/plugin": "0.1.9",
53
+ "@vmz/protocol": "0.1.9",
54
54
  "jiti": "^2.6.1",
55
55
  "json5": "^2.2.3"
56
56
  },
57
57
  "peerDependencies": {
58
- "@vmz/plugin-markdown-it": "0.1.7",
59
- "@vmz/test": "0.1.7",
58
+ "@vmz/plugin-markdown-it": "0.1.9",
59
+ "@vmz/test": "0.1.9",
60
60
  "typescript": "^5.8.3"
61
61
  },
62
62
  "peerDependenciesMeta": {
@@ -90,12 +90,12 @@
90
90
  "cli"
91
91
  ],
92
92
  "optionalDependencies": {
93
- "@vmz/vmz-win32-x64": "0.1.7",
94
- "@vmz/vmz-win32-arm64": "0.1.7",
95
- "@vmz/vmz-darwin-x64": "0.1.7",
96
- "@vmz/vmz-darwin-arm64": "0.1.7",
97
- "@vmz/vmz-linux-x64": "0.1.7",
98
- "@vmz/vmz-linux-arm64": "0.1.7"
93
+ "@vmz/vmz-win32-x64": "0.1.9",
94
+ "@vmz/vmz-win32-arm64": "0.1.9",
95
+ "@vmz/vmz-darwin-x64": "0.1.9",
96
+ "@vmz/vmz-darwin-arm64": "0.1.9",
97
+ "@vmz/vmz-linux-x64": "0.1.9",
98
+ "@vmz/vmz-linux-arm64": "0.1.9"
99
99
  },
100
100
  "publishConfig": {
101
101
  "access": "public"