@vmz/vmz 0.1.17 → 0.1.18
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/application-cmd.d.ts +6 -16
- package/dist/application-cmd.js +34 -180
- package/dist/author-input.d.ts +40 -19
- package/dist/author-input.js +2 -16
- package/dist/build-assemble.d.ts +63 -41
- package/dist/build-assemble.js +42 -43
- package/dist/bundler-adapter.d.ts +46 -48
- package/dist/bundler-adapter.js +4 -43
- package/dist/cdn-policy.d.ts +77 -93
- package/dist/cdn-policy.js +10 -16
- package/dist/cli-localize.d.ts +34 -0
- package/dist/cli-localize.js +58 -0
- package/dist/cli.d.ts +8 -19
- package/dist/cli.js +69 -252
- package/dist/content-addressed-assets.d.ts +24 -10
- package/dist/content-addressed-assets.js +2 -7
- package/dist/delivery-profile.d.ts +54 -27
- package/dist/delivery-profile.js +15 -13
- package/dist/dev-session.d.ts +29 -23
- package/dist/dev-session.js +0 -21
- package/dist/dev-watch-roots.d.ts +34 -25
- package/dist/dev-watch-roots.js +0 -31
- package/dist/document-build.d.ts +22 -97
- package/dist/document-build.js +4 -19
- package/dist/document-check.d.ts +30 -53
- package/dist/document-check.js +14 -29
- package/dist/document-cmd.d.ts +3 -6
- package/dist/document-cmd.js +19 -79
- package/dist/document-designs.d.ts +5 -8
- package/dist/document-designs.js +2 -15
- package/dist/document-enrich.d.ts +52 -24
- package/dist/document-enrich.js +4 -32
- package/dist/document-evidence.d.ts +46 -43
- package/dist/document-evidence.js +6 -47
- package/dist/document-integrate.d.ts +13 -29
- package/dist/document-integrate.js +2 -13
- package/dist/document-interactive.d.ts +45 -67
- package/dist/document-interactive.js +9 -50
- package/dist/document-layout-render.d.ts +7 -16
- package/dist/document-layout-render.js +0 -17
- package/dist/document-locale.d.ts +12 -25
- package/dist/document-locale.js +3 -14
- package/dist/document-markdown.d.ts +9 -5
- package/dist/document-markdown.js +0 -4
- package/dist/document-routing-config.d.ts +7 -14
- package/dist/document-routing-config.js +0 -9
- package/dist/document-scan.d.ts +14 -18
- package/dist/document-scan.js +2 -23
- package/dist/document-schema.d.ts +154 -41
- package/dist/document-schema.js +0 -35
- package/dist/embedded-packaging.d.ts +20 -8
- package/dist/embedded-packaging.js +0 -1
- package/dist/explain-cmd.d.ts +4 -3
- package/dist/explain-cmd.js +16 -65
- package/dist/index.d.ts +70 -143
- package/dist/index.js +16 -136
- package/dist/invocation.d.ts +29 -50
- package/dist/invocation.js +11 -57
- package/dist/locale-check.d.ts +69 -70
- package/dist/locale-check.js +5 -66
- package/dist/locale-cmd.d.ts +2 -5
- package/dist/locale-cmd.js +62 -142
- package/dist/locale-delivery.d.ts +294 -191
- package/dist/locale-delivery.js +8 -94
- package/dist/locale-route-emit.d.ts +23 -9
- package/dist/locale-route-emit.js +0 -7
- package/dist/locale-router.d.ts +189 -162
- package/dist/locale-router.js +13 -122
- package/dist/locale-runtime.d.ts +292 -262
- package/dist/locale-runtime.js +8 -102
- package/dist/locale-schema.js +0 -1
- package/dist/locale-tooling.d.ts +100 -63
- package/dist/locale-tooling.js +7 -45
- package/dist/log.d.ts +22 -15
- package/dist/log.js +24 -21
- package/dist/native-addon.d.ts +10 -9
- package/dist/native-addon.js +1 -10
- package/dist/pack-client-packages.d.ts +5 -1
- package/dist/pack-client-packages.js +0 -6
- package/dist/pack.d.ts +17 -15
- package/dist/pack.js +0 -12
- package/dist/packages.d.ts +10 -23
- package/dist/packages.js +1 -37
- package/dist/plan-cmd.d.ts +6 -0
- package/dist/plan-cmd.js +35 -0
- package/dist/plugin-host.js +0 -1
- package/dist/port.d.ts +2 -10
- package/dist/port.js +2 -11
- package/dist/pretty-json.d.ts +9 -19
- package/dist/pretty-json.js +3 -17
- package/dist/production-observability.d.ts +37 -181
- package/dist/production-observability.js +1 -9
- package/dist/production-test-pack.d.ts +17 -3
- package/dist/production-test-pack.js +0 -2
- package/dist/public-static-assets.d.ts +6 -1
- package/dist/public-static-assets.js +0 -5
- package/dist/refactor-cmd.d.ts +3 -6
- package/dist/refactor-cmd.js +16 -69
- package/dist/release-cmd.d.ts +7 -6
- package/dist/release-cmd.js +17 -59
- package/dist/release-pack.d.ts +7 -3
- package/dist/release-pack.js +0 -6
- package/dist/resolve.d.ts +15 -19
- package/dist/resolve.js +1 -15
- package/dist/server-artifact.d.ts +30 -75
- package/dist/server-artifact.js +0 -10
- package/dist/server-language-backend.d.ts +22 -79
- package/dist/server-language-backend.js +0 -26
- package/dist/site-delivery.d.ts +46 -59
- package/dist/site-delivery.js +3 -8
- package/dist/site-favicon.d.ts +6 -1
- package/dist/site-favicon.js +0 -5
- package/dist/static-emit.d.ts +73 -103
- package/dist/static-emit.js +1 -26
- package/dist/test-cmd.d.ts +3 -5
- package/dist/test-cmd.js +15 -25
- package/dist/test-compile.js +0 -1
- package/dist/test-discover.js +0 -1
- package/dist/test-logic.js +0 -1
- package/dist/test-protocol.js +0 -1
- package/dist/toolchain-dx.d.ts +11 -0
- package/dist/toolchain-dx.js +10 -0
- package/dist/watch-diff.d.ts +4 -13
- package/dist/watch-diff.js +0 -17
- package/dist/wechat-packaging.d.ts +8 -7
- package/dist/wechat-packaging.js +0 -6
- package/locales/en-US/cli.json +105 -0
- package/locales/locales.json +4 -0
- package/package.json +15 -12
- package/dist/resolve-native-cli.d.ts +0 -14
- package/dist/resolve-native-cli.js +0 -84
package/dist/resolve.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared project path resolution for the Node CLI host .
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveWorkspaceDirs(opts?:
|
|
4
|
+
export interface ResolveWorkspaceDirsOpts {
|
|
5
|
+
cwd?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
outDir?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PackageMeta {
|
|
10
|
+
name?: string;
|
|
11
|
+
private?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function findPackageJson(startDir: string): string | null;
|
|
14
|
+
/** Resolve project root + out dir from CLI args / cwd. Prefers an explicit path; otherwise walks up for package.json with `src/`. */
|
|
15
|
+
export declare function resolveWorkspaceDirs(opts?: ResolveWorkspaceDirsOpts): {
|
|
16
16
|
project: string;
|
|
17
|
-
outDir:
|
|
18
|
-
cwd:
|
|
17
|
+
outDir: string;
|
|
18
|
+
cwd: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
* @param {string} projectRoot
|
|
22
|
-
* @returns {{ name?: string, private?: boolean } | null}
|
|
23
|
-
*/
|
|
24
|
-
export declare function readPackageMeta(projectRoot: any): any;
|
|
20
|
+
export declare function readPackageMeta(projectRoot: string): PackageMeta | null;
|
package/dist/resolve.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
2
|
* Shared project path resolution for the Node CLI host .
|
|
4
3
|
*/
|
|
5
4
|
import { existsSync, readFileSync } from 'node:fs';
|
|
6
5
|
import path from 'node:path';
|
|
7
|
-
/**
|
|
8
|
-
* @param {string} startDir
|
|
9
|
-
* @returns {string | null}
|
|
10
|
-
*/
|
|
11
6
|
export function findPackageJson(startDir) {
|
|
12
7
|
let dir = path.resolve(startDir);
|
|
13
8
|
for (;;) {
|
|
@@ -20,12 +15,7 @@ export function findPackageJson(startDir) {
|
|
|
20
15
|
dir = parent;
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Resolve project root + out dir from CLI args / cwd.
|
|
25
|
-
* Prefers an explicit path; otherwise walks up for package.json with `src/`.
|
|
26
|
-
*
|
|
27
|
-
* @param {{ cwd?: string, path?: string, outDir?: string }} opts
|
|
28
|
-
*/
|
|
18
|
+
/** Resolve project root + out dir from CLI args / cwd. Prefers an explicit path; otherwise walks up for package.json with `src/`. */
|
|
29
19
|
export function resolveWorkspaceDirs(opts = {}) {
|
|
30
20
|
const cwd = opts.cwd ?? process.cwd();
|
|
31
21
|
const input = path.resolve(cwd, opts.path ?? '.');
|
|
@@ -38,10 +28,6 @@ export function resolveWorkspaceDirs(opts = {}) {
|
|
|
38
28
|
const outDir = opts.outDir ? (path.isAbsolute(opts.outDir) ? opts.outDir : path.join(project, opts.outDir)) : path.join(project, 'dist');
|
|
39
29
|
return { project, outDir, cwd };
|
|
40
30
|
}
|
|
41
|
-
/**
|
|
42
|
-
* @param {string} projectRoot
|
|
43
|
-
* @returns {{ name?: string, private?: boolean } | null}
|
|
44
|
-
*/
|
|
45
31
|
export function readPackageMeta(projectRoot) {
|
|
46
32
|
const pkgPath = path.join(projectRoot, 'package.json');
|
|
47
33
|
if (!existsSync(pkgPath))
|
|
@@ -14,83 +14,37 @@ export declare const SERVER_RUNTIME_ADAPTER_SCHEMA = "vmz.server.runtime_adapter
|
|
|
14
14
|
* packDigest?: string | null,
|
|
15
15
|
* }} [opts]
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
interface ServerArtifactOpts {
|
|
18
|
+
profileId?: string | null;
|
|
19
|
+
assembly?: string | null;
|
|
20
|
+
serverRuntime?: string | null;
|
|
21
|
+
packDigest?: string | null;
|
|
22
|
+
}
|
|
23
|
+
interface ServerArtifactBody {
|
|
24
|
+
schema: string;
|
|
25
|
+
profileId: string | null;
|
|
26
|
+
assembly: string | null;
|
|
27
|
+
selectedRuntime: string;
|
|
28
|
+
entry: {
|
|
29
|
+
kind: string;
|
|
30
|
+
standards: string[];
|
|
31
|
+
rpcPath: string;
|
|
32
|
+
};
|
|
33
|
+
httpContract: {
|
|
19
34
|
schema: string;
|
|
20
|
-
|
|
21
|
-
assembly: any;
|
|
22
|
-
selectedRuntime: string;
|
|
23
|
-
entry: {
|
|
24
|
-
kind: string;
|
|
25
|
-
standards: string[];
|
|
26
|
-
rpcPath: string;
|
|
27
|
-
};
|
|
28
|
-
httpContract: {
|
|
29
|
-
schema: string;
|
|
30
|
-
digest: string;
|
|
31
|
-
};
|
|
32
|
-
publicRoutes: {
|
|
33
|
-
verb: string;
|
|
34
|
-
path: string;
|
|
35
|
-
moduleId: string;
|
|
36
|
-
method: string;
|
|
37
|
-
className: string;
|
|
38
|
-
visibility: string;
|
|
39
|
-
kind: string;
|
|
40
|
-
}[];
|
|
41
|
-
internalCapabilities: any[];
|
|
42
|
-
middlewareUnits: any[];
|
|
43
|
-
routeDecisionTree: ({
|
|
44
|
-
id: string;
|
|
45
|
-
match: {
|
|
46
|
-
method: string;
|
|
47
|
-
path: string;
|
|
48
|
-
};
|
|
49
|
-
action: string;
|
|
50
|
-
target: {
|
|
51
|
-
moduleId: string;
|
|
52
|
-
method: string;
|
|
53
|
-
};
|
|
54
|
-
visibility: string;
|
|
55
|
-
} | {
|
|
56
|
-
id: string;
|
|
57
|
-
match: {
|
|
58
|
-
method: string;
|
|
59
|
-
path: string;
|
|
60
|
-
};
|
|
61
|
-
action: string;
|
|
62
|
-
visibility: string;
|
|
63
|
-
})[];
|
|
64
|
-
deploymentSchema: any;
|
|
65
|
-
packDigest: any;
|
|
66
|
-
adapters: {
|
|
67
|
-
node: {
|
|
68
|
-
kind: string;
|
|
69
|
-
status: string;
|
|
70
|
-
entry: string;
|
|
71
|
-
};
|
|
72
|
-
worker: {
|
|
73
|
-
kind: string;
|
|
74
|
-
status: string;
|
|
75
|
-
entry: string;
|
|
76
|
-
};
|
|
77
|
-
deno: {
|
|
78
|
-
kind: string;
|
|
79
|
-
status: string;
|
|
80
|
-
entry: string;
|
|
81
|
-
};
|
|
82
|
-
bun: {
|
|
83
|
-
kind: string;
|
|
84
|
-
status: string;
|
|
85
|
-
entry: string;
|
|
86
|
-
};
|
|
87
|
-
'rust-host': {
|
|
88
|
-
kind: string;
|
|
89
|
-
status: string;
|
|
90
|
-
entry: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
35
|
+
digest: string;
|
|
93
36
|
};
|
|
37
|
+
publicRoutes: Array<Record<string, unknown>>;
|
|
38
|
+
internalCapabilities: Array<Record<string, unknown>>;
|
|
39
|
+
middlewareUnits: unknown[];
|
|
40
|
+
routeDecisionTree: unknown[];
|
|
41
|
+
deploymentSchema: unknown;
|
|
42
|
+
packDigest: string | null;
|
|
43
|
+
adapters: Record<string, unknown>;
|
|
44
|
+
artifactDigest?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function emitServerArtifact(outDir: string, opts?: ServerArtifactOpts): {
|
|
47
|
+
artifact: ServerArtifactBody;
|
|
94
48
|
path: string;
|
|
95
49
|
httpContractDigest: string;
|
|
96
50
|
};
|
|
@@ -138,3 +92,4 @@ export declare function projectServerRuntimeAdapter(artifact: any, adapterId: an
|
|
|
138
92
|
publicRouteCount: any;
|
|
139
93
|
internalCapabilityCount: any;
|
|
140
94
|
};
|
|
95
|
+
export {};
|
package/dist/server-artifact.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* P4 ServerArtifact — compiled route decision tree + public ServerRoute contracts
|
|
3
3
|
* + internal capability units + selected runtime adapter. Web Standards Fetch entry.
|
|
4
4
|
*/
|
|
5
|
-
// @ts-nocheck
|
|
6
5
|
import crypto from 'node:crypto';
|
|
7
6
|
import { existsSync, mkdirSync, readFileSync } from 'node:fs';
|
|
8
7
|
import path from 'node:path';
|
|
@@ -12,15 +11,6 @@ export const SERVER_ARTIFACT_SCHEMA = 'vmz.server.artifact.v0';
|
|
|
12
11
|
export const HTTP_CONTRACT_SCHEMA = 'vmz.http.contract.v0';
|
|
13
12
|
export const SERVER_RUNTIME_ADAPTER_SCHEMA = 'vmz.server.runtime_adapter.v0';
|
|
14
13
|
const DEFAULT_RPC_PATH = '/__vmz/rpc';
|
|
15
|
-
/**
|
|
16
|
-
* @param {string} outDir
|
|
17
|
-
* @param {{
|
|
18
|
-
* profileId?: string | null,
|
|
19
|
-
* assembly?: string | null,
|
|
20
|
-
* serverRuntime?: string | null,
|
|
21
|
-
* packDigest?: string | null,
|
|
22
|
-
* }} [opts]
|
|
23
|
-
*/
|
|
24
14
|
export function emitServerArtifact(outDir, opts = {}) {
|
|
25
15
|
const deployment = readJson(path.join(outDir, 'vmz-deployment.json')) || { schema: null, units: [] };
|
|
26
16
|
const routes = readJson(path.join(outDir, 'vmz-routes.json'));
|
|
@@ -2,88 +2,31 @@
|
|
|
2
2
|
* Server Language DSL backends (lang on `<script server>`).
|
|
3
3
|
* Author surface is a VMZ DSL flavor — not full target-language source.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export declare const SERVER_LANG_IDS: readonly
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* }} ServerLanguageBackendMeta
|
|
23
|
-
*/
|
|
24
|
-
/** @type {Record<ServerLangId, ServerLanguageBackendMeta>} */
|
|
25
|
-
export declare const SERVER_LANGUAGE_BACKENDS: Readonly<{
|
|
26
|
-
ts: {
|
|
27
|
-
langId: string;
|
|
28
|
-
aliases: string[];
|
|
29
|
-
compatibleRuntimes: string[];
|
|
30
|
-
implemented: boolean;
|
|
31
|
-
artifactRoot: string;
|
|
32
|
-
};
|
|
33
|
-
rust: {
|
|
34
|
-
langId: string;
|
|
35
|
-
aliases: string[];
|
|
36
|
-
compatibleRuntimes: string[];
|
|
37
|
-
implemented: boolean;
|
|
38
|
-
artifactRoot: string;
|
|
39
|
-
};
|
|
40
|
-
python: {
|
|
41
|
-
langId: string;
|
|
42
|
-
aliases: string[];
|
|
43
|
-
compatibleRuntimes: string[];
|
|
44
|
-
implemented: boolean;
|
|
45
|
-
artifactRoot: string;
|
|
46
|
-
};
|
|
47
|
-
java: {
|
|
48
|
-
langId: string;
|
|
49
|
-
aliases: string[];
|
|
50
|
-
compatibleRuntimes: string[];
|
|
51
|
-
implemented: boolean;
|
|
52
|
-
artifactRoot: string;
|
|
53
|
-
};
|
|
54
|
-
}>;
|
|
55
|
-
/**
|
|
56
|
-
* Resolve author `lang` attr (or null/undefined for default TS).
|
|
57
|
-
* @param {string | null | undefined} raw
|
|
58
|
-
* @returns {{
|
|
59
|
-
* ok: true, langId: ServerLangId, backend: ServerLanguageBackendMeta
|
|
60
|
-
* } | {
|
|
61
|
-
* ok: false, code: string, message: string
|
|
62
|
-
* }}
|
|
63
|
-
*/
|
|
64
|
-
export declare function resolveServerLanguage(raw: any): {
|
|
65
|
-
ok: boolean;
|
|
5
|
+
export type ServerLangId = 'ts' | 'rust' | 'python' | 'java';
|
|
6
|
+
export declare const SERVER_LANG_IDS: readonly ["ts", "rust", "python", "java"];
|
|
7
|
+
export declare const SERVER_LANG_ALIASES: Record<string, ServerLangId>;
|
|
8
|
+
export interface ServerLanguageBackendMeta {
|
|
9
|
+
langId: ServerLangId;
|
|
10
|
+
aliases: string[];
|
|
11
|
+
compatibleRuntimes: string[];
|
|
12
|
+
implemented: boolean;
|
|
13
|
+
artifactRoot: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const SERVER_LANGUAGE_BACKENDS: Record<ServerLangId, ServerLanguageBackendMeta>;
|
|
16
|
+
export type ResolveServerLanguageResult = {
|
|
17
|
+
ok: true;
|
|
18
|
+
langId: ServerLangId;
|
|
19
|
+
backend: ServerLanguageBackendMeta;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
66
22
|
code: string;
|
|
67
23
|
message: string;
|
|
68
|
-
langId?: undefined;
|
|
69
|
-
backend?: undefined;
|
|
70
|
-
} | {
|
|
71
|
-
ok: boolean;
|
|
72
|
-
langId: any;
|
|
73
|
-
backend: any;
|
|
74
|
-
code?: undefined;
|
|
75
|
-
message?: undefined;
|
|
76
24
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
ok: boolean;
|
|
25
|
+
export declare function resolveServerLanguage(raw: string | null | undefined): ResolveServerLanguageResult;
|
|
26
|
+
export declare function assertLangRuntimePair(langId: ServerLangId, serverRuntime: string | null | undefined): {
|
|
27
|
+
ok: true;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
83
30
|
code: string;
|
|
84
31
|
message: string;
|
|
85
|
-
} | {
|
|
86
|
-
ok: boolean;
|
|
87
|
-
code?: undefined;
|
|
88
|
-
message?: undefined;
|
|
89
32
|
};
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* Server Language DSL backends (lang on `<script server>`).
|
|
3
3
|
* Author surface is a VMZ DSL flavor — not full target-language source.
|
|
4
4
|
*/
|
|
5
|
-
// @ts-nocheck
|
|
6
|
-
/** @typedef {'ts' | 'rust' | 'python' | 'java'} ServerLangId */
|
|
7
5
|
export const SERVER_LANG_IDS = Object.freeze(['ts', 'rust', 'python', 'java']);
|
|
8
|
-
/** @type {Record<string, ServerLangId>} */
|
|
9
6
|
export const SERVER_LANG_ALIASES = Object.freeze({
|
|
10
7
|
ts: 'ts',
|
|
11
8
|
typescript: 'ts',
|
|
@@ -13,16 +10,6 @@ export const SERVER_LANG_ALIASES = Object.freeze({
|
|
|
13
10
|
python: 'python',
|
|
14
11
|
java: 'java',
|
|
15
12
|
});
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {{
|
|
18
|
-
* langId: ServerLangId,
|
|
19
|
-
* aliases: string[],
|
|
20
|
-
* compatibleRuntimes: string[],
|
|
21
|
-
* implemented: boolean,
|
|
22
|
-
* artifactRoot: string,
|
|
23
|
-
* }} ServerLanguageBackendMeta
|
|
24
|
-
*/
|
|
25
|
-
/** @type {Record<ServerLangId, ServerLanguageBackendMeta>} */
|
|
26
13
|
export const SERVER_LANGUAGE_BACKENDS = Object.freeze({
|
|
27
14
|
ts: {
|
|
28
15
|
langId: 'ts',
|
|
@@ -53,15 +40,6 @@ export const SERVER_LANGUAGE_BACKENDS = Object.freeze({
|
|
|
53
40
|
artifactRoot: 'target/vmz/server-java',
|
|
54
41
|
},
|
|
55
42
|
});
|
|
56
|
-
/**
|
|
57
|
-
* Resolve author `lang` attr (or null/undefined for default TS).
|
|
58
|
-
* @param {string | null | undefined} raw
|
|
59
|
-
* @returns {{
|
|
60
|
-
* ok: true, langId: ServerLangId, backend: ServerLanguageBackendMeta
|
|
61
|
-
* } | {
|
|
62
|
-
* ok: false, code: string, message: string
|
|
63
|
-
* }}
|
|
64
|
-
*/
|
|
65
43
|
export function resolveServerLanguage(raw) {
|
|
66
44
|
const trimmed = raw == null ? '' : String(raw).trim();
|
|
67
45
|
if (!trimmed) {
|
|
@@ -85,10 +63,6 @@ export function resolveServerLanguage(raw) {
|
|
|
85
63
|
}
|
|
86
64
|
return { ok: true, langId, backend };
|
|
87
65
|
}
|
|
88
|
-
/**
|
|
89
|
-
* @param {ServerLangId} langId
|
|
90
|
-
* @param {string | null | undefined} serverRuntime
|
|
91
|
-
*/
|
|
92
66
|
export function assertLangRuntimePair(langId, serverRuntime) {
|
|
93
67
|
const backend = SERVER_LANGUAGE_BACKENDS[langId];
|
|
94
68
|
if (!backend) {
|
package/dist/site-delivery.d.ts
CHANGED
|
@@ -12,35 +12,19 @@ export declare const SITE_DELIVERY_RESOLUTION_SCHEMA = "vmz.site.delivery_resolu
|
|
|
12
12
|
export declare function defineSite(delivery: any): any;
|
|
13
13
|
/**
|
|
14
14
|
* Normalize authoring delivery → frozen SiteDeliveryContract.
|
|
15
|
-
* @param {unknown} raw
|
|
16
|
-
* @param {{ siteId?: string, projectRoot?: string }} [opts]
|
|
17
|
-
* @returns {{ ok: true, contract: Record<string, any> } | { ok: false, diagnostics: Array<{ code: string, message: string }> }}
|
|
18
15
|
*/
|
|
19
|
-
export declare function normalizeSiteDelivery(raw:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
export declare function normalizeSiteDelivery(raw: unknown, opts?: {
|
|
17
|
+
siteId?: string;
|
|
18
|
+
projectRoot?: string;
|
|
19
|
+
}): {
|
|
20
|
+
ok: true;
|
|
21
|
+
contract: Record<string, any>;
|
|
23
22
|
} | {
|
|
24
|
-
ok:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
artifact: string;
|
|
30
|
-
expectedCompatibility: any;
|
|
31
|
-
sources: any[];
|
|
32
|
-
resolutionPolicy: {
|
|
33
|
-
mode: string;
|
|
34
|
-
fallback: any;
|
|
35
|
-
fileLevelMix: boolean;
|
|
36
|
-
};
|
|
37
|
-
failurePolicy: any;
|
|
38
|
-
updatePolicy: any;
|
|
39
|
-
rollbackPolicy: any;
|
|
40
|
-
securityPolicy: any;
|
|
41
|
-
activation: string;
|
|
42
|
-
};
|
|
43
|
-
diagnostics?: undefined;
|
|
23
|
+
ok: false;
|
|
24
|
+
diagnostics: Array<{
|
|
25
|
+
code: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
44
28
|
};
|
|
45
29
|
/**
|
|
46
30
|
* Probe one physical source for release-level readiness (not per-URL).
|
|
@@ -54,31 +38,44 @@ export declare function normalizeSiteDelivery(raw: any, opts?: {}): {
|
|
|
54
38
|
* error?: string | null,
|
|
55
39
|
* }} [probe]
|
|
56
40
|
*/
|
|
57
|
-
export declare function normalizeSourceProbe(probe?: {
|
|
41
|
+
export declare function normalizeSourceProbe(probe?: {
|
|
42
|
+
available?: boolean;
|
|
43
|
+
artifactDigest?: string | null;
|
|
44
|
+
integrityOk?: boolean;
|
|
45
|
+
signatureOk?: boolean;
|
|
46
|
+
objectClosureOk?: boolean;
|
|
47
|
+
mixedDigestObjects?: boolean;
|
|
48
|
+
error?: string | null;
|
|
49
|
+
}): {
|
|
58
50
|
available: boolean;
|
|
59
|
-
artifactDigest:
|
|
51
|
+
artifactDigest: string;
|
|
60
52
|
integrityOk: boolean;
|
|
61
53
|
signatureOk: boolean;
|
|
62
54
|
objectClosureOk: boolean;
|
|
63
55
|
mixedDigestObjects: boolean;
|
|
64
|
-
error:
|
|
56
|
+
error: string;
|
|
65
57
|
};
|
|
66
58
|
/**
|
|
67
59
|
* Resolve one complete release per SiteDeliveryContract (no file-level mix).
|
|
68
60
|
* @param {Record<string, any>} contract
|
|
69
61
|
* @param {Record<string, ReturnType<typeof normalizeSourceProbe>>} probes by sourceId
|
|
70
62
|
*/
|
|
71
|
-
export declare function resolveSiteRelease(contract:
|
|
63
|
+
export declare function resolveSiteRelease(contract: Record<string, any>, probes?: Record<string, ReturnType<typeof normalizeSourceProbe>>): {
|
|
72
64
|
schema: string;
|
|
73
65
|
status: string;
|
|
74
|
-
selectedSourceId:
|
|
75
|
-
selectedKind:
|
|
76
|
-
selectedDigest:
|
|
77
|
-
fallbackReason: string;
|
|
78
|
-
attempted:
|
|
66
|
+
selectedSourceId: string;
|
|
67
|
+
selectedKind: unknown;
|
|
68
|
+
selectedDigest: string | null;
|
|
69
|
+
fallbackReason: string | null;
|
|
70
|
+
attempted: {
|
|
71
|
+
sourceId: string;
|
|
72
|
+
result: string;
|
|
73
|
+
reason: string | null;
|
|
74
|
+
}[];
|
|
79
75
|
fileLevelMix: boolean;
|
|
80
76
|
activation: string;
|
|
81
|
-
contractDigest:
|
|
77
|
+
contractDigest: unknown;
|
|
78
|
+
resolutionDigest?: string;
|
|
82
79
|
} | {
|
|
83
80
|
schema: string;
|
|
84
81
|
status: string;
|
|
@@ -86,7 +83,11 @@ export declare function resolveSiteRelease(contract: any, probes?: {}): {
|
|
|
86
83
|
selectedKind: any;
|
|
87
84
|
selectedDigest: any;
|
|
88
85
|
fallbackReason: string;
|
|
89
|
-
attempted:
|
|
86
|
+
attempted: {
|
|
87
|
+
sourceId: string;
|
|
88
|
+
result: string;
|
|
89
|
+
reason: string | null;
|
|
90
|
+
}[];
|
|
90
91
|
fileLevelMix: boolean;
|
|
91
92
|
activation: string;
|
|
92
93
|
contractDigest: any;
|
|
@@ -98,12 +99,12 @@ export declare function resolveSiteRelease(contract: any, probes?: {}): {
|
|
|
98
99
|
*/
|
|
99
100
|
export declare function probeReleaseDirectory(releaseDir: any): {
|
|
100
101
|
available: boolean;
|
|
101
|
-
artifactDigest:
|
|
102
|
+
artifactDigest: string;
|
|
102
103
|
integrityOk: boolean;
|
|
103
104
|
signatureOk: boolean;
|
|
104
105
|
objectClosureOk: boolean;
|
|
105
106
|
mixedDigestObjects: boolean;
|
|
106
|
-
error:
|
|
107
|
+
error: string;
|
|
107
108
|
};
|
|
108
109
|
/**
|
|
109
110
|
* Emit normalized contract (+ optional resolution) under dist/_vmz.
|
|
@@ -111,24 +112,10 @@ export declare function probeReleaseDirectory(releaseDir: any): {
|
|
|
111
112
|
* @param {unknown} deliveryRaw
|
|
112
113
|
* @param {{ siteId?: string, probes?: Record<string, any> }} [opts]
|
|
113
114
|
*/
|
|
114
|
-
export declare function emitSiteDelivery(outDir:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
artifact: string;
|
|
120
|
-
expectedCompatibility: any;
|
|
121
|
-
sources: any[];
|
|
122
|
-
resolutionPolicy: {
|
|
123
|
-
mode: string;
|
|
124
|
-
fallback: any;
|
|
125
|
-
fileLevelMix: boolean;
|
|
126
|
-
};
|
|
127
|
-
failurePolicy: any;
|
|
128
|
-
updatePolicy: any;
|
|
129
|
-
rollbackPolicy: any;
|
|
130
|
-
securityPolicy: any;
|
|
131
|
-
activation: string;
|
|
132
|
-
};
|
|
115
|
+
export declare function emitSiteDelivery(outDir: string, deliveryRaw: unknown, opts?: {
|
|
116
|
+
siteId?: string;
|
|
117
|
+
probes?: Record<string, ReturnType<typeof normalizeSourceProbe>>;
|
|
118
|
+
}): {
|
|
119
|
+
contract: Record<string, any>;
|
|
133
120
|
resolution: any;
|
|
134
121
|
};
|
package/dist/site-delivery.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* A3-site: SiteDeliveryContract — embedded | filesystem | remote selection + release fallback.
|
|
3
3
|
* Authoring via defineConfig({ delivery }) / defineSite(...); pure data only.
|
|
4
4
|
*/
|
|
5
|
-
// @ts-nocheck
|
|
6
5
|
import crypto from 'node:crypto';
|
|
7
6
|
import fs from 'node:fs';
|
|
8
7
|
import path from 'node:path';
|
|
@@ -19,12 +18,8 @@ export function defineSite(delivery) {
|
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Normalize authoring delivery → frozen SiteDeliveryContract.
|
|
22
|
-
* @param {unknown} raw
|
|
23
|
-
* @param {{ siteId?: string, projectRoot?: string }} [opts]
|
|
24
|
-
* @returns {{ ok: true, contract: Record<string, any> } | { ok: false, diagnostics: Array<{ code: string, message: string }> }}
|
|
25
21
|
*/
|
|
26
22
|
export function normalizeSiteDelivery(raw, opts = {}) {
|
|
27
|
-
/** @type {Array<{ code: string, message: string }>} */
|
|
28
23
|
const diagnostics = [];
|
|
29
24
|
if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
30
25
|
return {
|
|
@@ -32,7 +27,7 @@ export function normalizeSiteDelivery(raw, opts = {}) {
|
|
|
32
27
|
diagnostics: [{ code: 'site.delivery.invalid', message: 'delivery must be a plain object' }],
|
|
33
28
|
};
|
|
34
29
|
}
|
|
35
|
-
const d =
|
|
30
|
+
const d = raw;
|
|
36
31
|
if (typeof d.artifact !== 'string' || !d.artifact.trim()) {
|
|
37
32
|
diagnostics.push({ code: 'site.delivery.artifact', message: 'delivery.artifact is required' });
|
|
38
33
|
}
|
|
@@ -110,7 +105,7 @@ export function normalizeSiteDelivery(raw, opts = {}) {
|
|
|
110
105
|
message: `resolution.mode must be 'release' (got ${mode})`,
|
|
111
106
|
});
|
|
112
107
|
}
|
|
113
|
-
|
|
108
|
+
const fallback = Array.isArray(resolution.fallback) ? resolution.fallback.map(String) : sources.map((s) => s.sourceId);
|
|
114
109
|
for (const id of fallback) {
|
|
115
110
|
if (!seen.has(id)) {
|
|
116
111
|
diagnostics.push({
|
|
@@ -314,7 +309,7 @@ export function probeReleaseDirectory(releaseDir) {
|
|
|
314
309
|
*/
|
|
315
310
|
export function emitSiteDelivery(outDir, deliveryRaw, opts = {}) {
|
|
316
311
|
const norm = normalizeSiteDelivery(deliveryRaw, { siteId: opts.siteId });
|
|
317
|
-
if (
|
|
312
|
+
if (norm.ok === false) {
|
|
318
313
|
throw new Error(`emitSiteDelivery: ${norm.diagnostics.map((d) => d.message).join('; ')}`);
|
|
319
314
|
}
|
|
320
315
|
const vmzDir = path.join(outDir, '_vmz');
|
package/dist/site-favicon.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ export declare const SITE_FAVICON_SCHEMA = "vmz.site_favicon.v0";
|
|
|
7
7
|
* @param {string} distDir
|
|
8
8
|
* @param {{ projectRoot?: string, skipNative?: boolean }} [opts]
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface SiteFaviconOpts {
|
|
11
|
+
projectRoot?: string;
|
|
12
|
+
skipNative?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function emitSiteFavicon(distDir: string, opts?: SiteFaviconOpts): {
|
|
11
15
|
schema: string;
|
|
12
16
|
status: string;
|
|
13
17
|
source: string;
|
|
@@ -29,3 +33,4 @@ export declare function readSiteFaviconHeadHtml(distDir: any): any;
|
|
|
29
33
|
* @param {Array<{ png: Buffer, size: number }>} images
|
|
30
34
|
*/
|
|
31
35
|
export declare function packPngsIntoIco(images: any): Buffer<ArrayBuffer>;
|
|
36
|
+
export {};
|
package/dist/site-favicon.js
CHANGED
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
* Site favicon: author SVG → PNG + ICO + `_vmz/site-favicon.json` head links.
|
|
3
3
|
* Convention: `assets/favicon.svg` (or `favicon.svg`) under project / already in dist.
|
|
4
4
|
*/
|
|
5
|
-
// @ts-nocheck
|
|
6
5
|
import fs from 'node:fs';
|
|
7
6
|
import path from 'node:path';
|
|
8
7
|
import { requireNativeAddon } from './native-addon.js';
|
|
9
8
|
import { writePrettyJsonFile } from './pretty-json.js';
|
|
10
9
|
export const SITE_FAVICON_SCHEMA = 'vmz.site_favicon.v0';
|
|
11
10
|
const ICO_SIZES = [16, 32, 48];
|
|
12
|
-
/**
|
|
13
|
-
* @param {string} distDir
|
|
14
|
-
* @param {{ projectRoot?: string, skipNative?: boolean }} [opts]
|
|
15
|
-
*/
|
|
16
11
|
export function emitSiteFavicon(distDir, opts = {}) {
|
|
17
12
|
const absDist = path.resolve(distDir);
|
|
18
13
|
const projectRoot = opts.projectRoot ? path.resolve(opts.projectRoot) : null;
|