@vmz/vmz 0.0.4 → 0.1.1
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/build-assemble.d.ts +52 -0
- package/dist/build-assemble.js +192 -0
- package/dist/cdn-policy.d.ts +22 -4
- package/dist/cdn-policy.js +109 -13
- package/dist/cli.js +122 -27
- package/dist/content-addressed-assets.js +2 -1
- package/dist/delivery-profile.d.ts +84 -0
- package/dist/delivery-profile.js +348 -0
- package/dist/dev-session.d.ts +6 -0
- package/dist/dev-session.js +167 -40
- package/dist/document-build.js +33 -32
- package/dist/document-cmd.js +2 -9
- package/dist/document-enrich.js +8 -0
- package/dist/document-integrate.js +10 -17
- package/dist/embedded-packaging.d.ts +22 -0
- package/dist/embedded-packaging.js +109 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +69 -2
- package/dist/locale-check.js +39 -66
- package/dist/locale-cmd.js +12 -44
- package/dist/locale-route-emit.d.ts +37 -0
- package/dist/locale-route-emit.js +109 -0
- package/dist/locale-router.d.ts +20 -0
- package/dist/locale-router.js +68 -0
- package/dist/log.d.ts +2 -2
- package/dist/log.js +11 -3
- package/dist/mini-host.d.ts +47 -0
- package/dist/mini-host.js +202 -0
- package/dist/native-addon.d.ts +9 -0
- package/dist/native-addon.js +84 -0
- package/dist/pack-client-packages.d.ts +25 -0
- package/dist/pack-client-packages.js +399 -0
- package/dist/pack.d.ts +58 -0
- package/dist/pack.js +123 -0
- package/dist/plugin-host.d.ts +1 -1
- package/dist/plugin-host.js +2 -2
- package/dist/pretty-json.d.ts +19 -0
- package/dist/pretty-json.js +43 -0
- package/dist/production-observability.js +3 -2
- package/dist/production-test-pack.d.ts +0 -14
- package/dist/production-test-pack.js +27 -31
- package/dist/release-pack.js +17 -21
- package/dist/route-path.d.ts +35 -0
- package/dist/route-path.js +77 -0
- package/dist/server-artifact.d.ts +140 -0
- package/dist/server-artifact.js +204 -0
- package/dist/server-language-backend.d.ts +89 -0
- package/dist/server-language-backend.js +121 -0
- package/dist/site-delivery.js +3 -2
- package/dist/static-emit.d.ts +10 -1
- package/dist/static-emit.js +192 -97
- package/dist/test-cmd.js +2 -1
- package/dist/wechat-packaging.d.ts +22 -0
- package/dist/wechat-packaging.js +59 -0
- package/package.json +12 -12
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize `defineConfig({ delivery: { packaging: { wechat } } })` for wechat_pack.
|
|
3
|
+
* Pure data only. Writes `dist/_vmz/wechat-packaging.json` (not a second config entry).
|
|
4
|
+
*/
|
|
5
|
+
export declare const WECHAT_PACKAGING_SCHEMA = "vmz.target.wechat_packaging.v0";
|
|
6
|
+
export declare const WECHAT_PACKAGING_REL = "dist/_vmz/wechat-packaging.json";
|
|
7
|
+
/**
|
|
8
|
+
* @param {unknown} delivery
|
|
9
|
+
* @returns {{ schema: string, appId: string, projectName?: string, title?: string }}
|
|
10
|
+
*/
|
|
11
|
+
export declare function wechatPackagingFromDelivery(delivery: any): {
|
|
12
|
+
schema: string;
|
|
13
|
+
appId: any;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Load `vmz.config.*` and write the WeChat packaging contract for the Rust packer.
|
|
17
|
+
* @param {string} project
|
|
18
|
+
*/
|
|
19
|
+
export declare function materializeWechatPackaging(project: any): {
|
|
20
|
+
schema: string;
|
|
21
|
+
appId: any;
|
|
22
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize `defineConfig({ delivery: { packaging: { wechat } } })` for wechat_pack.
|
|
3
|
+
* Pure data only. Writes `dist/_vmz/wechat-packaging.json` (not a second config entry).
|
|
4
|
+
*/
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { createJiti } from 'jiti';
|
|
9
|
+
import { pickDeliveryPackaging } from './delivery-profile.js';
|
|
10
|
+
import { writePrettyJsonFile } from './pretty-json.js';
|
|
11
|
+
export const WECHAT_PACKAGING_SCHEMA = 'vmz.target.wechat_packaging.v0';
|
|
12
|
+
export const WECHAT_PACKAGING_REL = 'dist/_vmz/wechat-packaging.json';
|
|
13
|
+
const CONFIG_NAMES = ['vmz.config.ts', 'vmz.config.mts', 'vmz.config.mjs', 'vmz.config.js'];
|
|
14
|
+
function loadConfigSync(project) {
|
|
15
|
+
for (const name of CONFIG_NAMES) {
|
|
16
|
+
const full = path.join(project, name);
|
|
17
|
+
if (!existsSync(full))
|
|
18
|
+
continue;
|
|
19
|
+
const jiti = createJiti(import.meta.url, {
|
|
20
|
+
interopDefault: true,
|
|
21
|
+
moduleCache: false,
|
|
22
|
+
});
|
|
23
|
+
return jiti(full);
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @param {unknown} delivery
|
|
29
|
+
* @returns {{ schema: string, appId: string, projectName?: string, title?: string }}
|
|
30
|
+
*/
|
|
31
|
+
export function wechatPackagingFromDelivery(delivery) {
|
|
32
|
+
const diagnostics = [];
|
|
33
|
+
const packaging = pickDeliveryPackaging(delivery && typeof delivery === 'object' ? delivery : {}, diagnostics);
|
|
34
|
+
const wechat = packaging && packaging.wechat ? packaging.wechat : {};
|
|
35
|
+
/** @type {{ schema: string, appId: string, projectName?: string, title?: string }} */
|
|
36
|
+
const out = {
|
|
37
|
+
schema: WECHAT_PACKAGING_SCHEMA,
|
|
38
|
+
appId: typeof wechat.appId === 'string' && wechat.appId.trim() ? wechat.appId.trim() : 'touristappid',
|
|
39
|
+
};
|
|
40
|
+
if (typeof wechat.projectName === 'string' && wechat.projectName.trim()) {
|
|
41
|
+
out.projectName = wechat.projectName.trim();
|
|
42
|
+
}
|
|
43
|
+
if (typeof wechat.title === 'string' && wechat.title.trim()) {
|
|
44
|
+
out.title = wechat.title.trim();
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Load `vmz.config.*` and write the WeChat packaging contract for the Rust packer.
|
|
50
|
+
* @param {string} project
|
|
51
|
+
*/
|
|
52
|
+
export function materializeWechatPackaging(project) {
|
|
53
|
+
const cfg = loadConfigSync(project);
|
|
54
|
+
const spec = wechatPackagingFromDelivery(cfg?.delivery);
|
|
55
|
+
const abs = path.join(project, WECHAT_PACKAGING_REL);
|
|
56
|
+
mkdirSync(path.dirname(abs), { recursive: true });
|
|
57
|
+
writePrettyJsonFile(abs, spec);
|
|
58
|
+
return spec;
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/vmz",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
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.
|
|
52
|
-
"@vmz/plugin": "0.
|
|
53
|
-
"@vmz/protocol": "0.
|
|
51
|
+
"@vmz/core": "0.1.1",
|
|
52
|
+
"@vmz/plugin": "0.1.1",
|
|
53
|
+
"@vmz/protocol": "0.1.1",
|
|
54
54
|
"jiti": "^2.6.1",
|
|
55
55
|
"json5": "^2.2.3"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@vmz/plugin-markdown-it": "0.
|
|
59
|
-
"@vmz/test": "0.
|
|
58
|
+
"@vmz/plugin-markdown-it": "0.1.1",
|
|
59
|
+
"@vmz/test": "0.1.1",
|
|
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.
|
|
94
|
-
"@vmz/vmz-win32-arm64": "0.
|
|
95
|
-
"@vmz/vmz-darwin-x64": "0.
|
|
96
|
-
"@vmz/vmz-darwin-arm64": "0.
|
|
97
|
-
"@vmz/vmz-linux-x64": "0.
|
|
98
|
-
"@vmz/vmz-linux-arm64": "0.
|
|
93
|
+
"@vmz/vmz-win32-x64": "0.1.1",
|
|
94
|
+
"@vmz/vmz-win32-arm64": "0.1.1",
|
|
95
|
+
"@vmz/vmz-darwin-x64": "0.1.1",
|
|
96
|
+
"@vmz/vmz-darwin-arm64": "0.1.1",
|
|
97
|
+
"@vmz/vmz-linux-x64": "0.1.1",
|
|
98
|
+
"@vmz/vmz-linux-arm64": "0.1.1"
|
|
99
99
|
},
|
|
100
100
|
"publishConfig": {
|
|
101
101
|
"access": "public"
|