@vmz/vmz 0.1.8 → 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.
- package/dist/cdn-policy.js +1 -1
- package/dist/cli.js +3 -3
- package/dist/content-addressed-assets.d.ts +1 -1
- package/dist/content-addressed-assets.js +1 -1
- package/dist/delivery-profile.d.ts +1 -1
- package/dist/delivery-profile.js +1 -1
- package/dist/site-delivery.js +1 -1
- package/dist/static-emit.js +4 -2
- package/package.json +12 -12
package/dist/cdn-policy.js
CHANGED
|
@@ -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: '
|
|
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|
|
|
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(`
|
|
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(`
|
|
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;
|
|
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;
|
|
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
|
package/dist/delivery-profile.js
CHANGED
|
@@ -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
|
-
|
|
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
|
});
|
package/dist/site-delivery.js
CHANGED
|
@@ -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: ['
|
|
139
|
+
deliveryProfiles: ['static', 'filesystem'],
|
|
140
140
|
},
|
|
141
141
|
sources,
|
|
142
142
|
resolutionPolicy: {
|
package/dist/static-emit.js
CHANGED
|
@@ -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: '
|
|
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.
|
|
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.
|
|
52
|
-
"@vmz/plugin": "0.1.
|
|
53
|
-
"@vmz/protocol": "0.1.
|
|
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.
|
|
59
|
-
"@vmz/test": "0.1.
|
|
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.
|
|
94
|
-
"@vmz/vmz-win32-arm64": "0.1.
|
|
95
|
-
"@vmz/vmz-darwin-x64": "0.1.
|
|
96
|
-
"@vmz/vmz-darwin-arm64": "0.1.
|
|
97
|
-
"@vmz/vmz-linux-x64": "0.1.
|
|
98
|
-
"@vmz/vmz-linux-arm64": "0.1.
|
|
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"
|