@vmz/vmz 0.1.12 → 0.1.13

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.
Files changed (46) hide show
  1. package/dist/build-assemble.js +3 -4
  2. package/dist/cdn-policy.js +4 -5
  3. package/dist/cli.js +15 -50
  4. package/dist/content-addressed-assets.d.ts +2 -8
  5. package/dist/content-addressed-assets.js +34 -111
  6. package/dist/delivery-profile.d.ts +1 -11
  7. package/dist/delivery-profile.js +1 -70
  8. package/dist/dev-session.d.ts +0 -1
  9. package/dist/dev-session.js +65 -268
  10. package/dist/document-build.d.ts +1 -2
  11. package/dist/document-build.js +82 -104
  12. package/dist/document-cmd.js +9 -2
  13. package/dist/document-enrich.d.ts +1 -2
  14. package/dist/document-enrich.js +4 -15
  15. package/dist/document-integrate.js +21 -29
  16. package/dist/embedded-packaging.js +1 -2
  17. package/dist/index.d.ts +1 -15
  18. package/dist/index.js +3 -59
  19. package/dist/locale-check.js +61 -28
  20. package/dist/locale-cmd.js +42 -10
  21. package/dist/locale-route-emit.d.ts +1 -4
  22. package/dist/locale-route-emit.js +32 -7
  23. package/dist/locale-router.js +8 -26
  24. package/dist/pack.js +2 -3
  25. package/dist/production-observability.js +2 -3
  26. package/dist/production-test-pack.js +3 -4
  27. package/dist/release-pack.js +18 -5
  28. package/dist/server-artifact.js +3 -4
  29. package/dist/site-delivery.js +3 -4
  30. package/dist/static-emit.js +97 -118
  31. package/dist/test-cmd.js +1 -2
  32. package/package.json +12 -12
  33. package/dist/dev-watch-roots.d.ts +0 -80
  34. package/dist/dev-watch-roots.js +0 -245
  35. package/dist/document-layout-render.d.ts +0 -20
  36. package/dist/document-layout-render.js +0 -87
  37. package/dist/document-routing-config.d.ts +0 -13
  38. package/dist/document-routing-config.js +0 -40
  39. package/dist/native-addon.d.ts +0 -9
  40. package/dist/native-addon.js +0 -84
  41. package/dist/pretty-json.d.ts +0 -19
  42. package/dist/pretty-json.js +0 -43
  43. package/dist/route-path.d.ts +0 -35
  44. package/dist/route-path.js +0 -77
  45. package/dist/wechat-packaging.d.ts +0 -22
  46. package/dist/wechat-packaging.js +0 -59
@@ -1,22 +0,0 @@
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
- };
@@ -1,59 +0,0 @@
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
- }