@vmz/core 0.1.32 → 0.2.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.
Files changed (66) hide show
  1. package/dist/{client-nav.d.ts → browser/client-nav.d.ts} +4 -13
  2. package/dist/{client-nav.js → browser/client-nav.js} +16 -74
  3. package/dist/browser/direct-api.types.d.ts +141 -0
  4. package/dist/browser/direct-api.types.js +4 -0
  5. package/dist/browser/direct-host-box.d.ts +11 -0
  6. package/dist/{direct-host-box.js → browser/direct-host-box.js} +2 -18
  7. package/dist/{dom-core.d.ts → browser/dom-core.d.ts} +67 -220
  8. package/dist/browser/dom-core.js +2484 -0
  9. package/dist/browser/dom-core.types.d.ts +127 -0
  10. package/dist/browser/dom-core.types.js +4 -0
  11. package/dist/{position-context.js → browser/position-context.js} +1 -1
  12. package/dist/browser/unknown-component.d.ts +14 -0
  13. package/dist/{unknown-component.js → browser/unknown-component.js} +5 -30
  14. package/dist/{dom.browser.d.ts → faces/dom.browser.d.ts} +2 -2
  15. package/dist/{dom.browser.js → faces/dom.browser.js} +2 -3
  16. package/dist/faces/dom.client.d.ts +4 -0
  17. package/dist/faces/dom.client.js +4 -0
  18. package/dist/faces/dom.d.ts +6 -0
  19. package/dist/faces/dom.js +6 -0
  20. package/dist/faces/http.d.ts +6 -0
  21. package/dist/{http.js → faces/http.js} +0 -1
  22. package/dist/faces/server.d.ts +30 -0
  23. package/dist/{server.js → faces/server.js} +27 -149
  24. package/dist/{vmz-dom.d.ts → faces/vmz-dom.d.ts} +1 -1
  25. package/dist/{vmz-dom.js → faces/vmz-dom.js} +1 -2
  26. package/dist/{vmz-runtime.d.ts → faces/vmz-runtime.d.ts} +1 -1
  27. package/dist/{vmz-runtime.js → faces/vmz-runtime.js} +1 -2
  28. package/dist/host/deployment-registry.d.ts +16 -0
  29. package/dist/{deployment-registry.js → host/deployment-registry.js} +1 -68
  30. package/dist/host/list-client-components.d.ts +14 -0
  31. package/dist/{list-client-components.js → host/list-client-components.js} +0 -37
  32. package/dist/{localize-body-links.js → host/localize-body-links.js} +0 -1
  33. package/dist/host/native-addon.d.ts +6 -0
  34. package/dist/{native-addon.js → host/native-addon.js} +0 -20
  35. package/dist/host/render-host.d.ts +20 -0
  36. package/dist/{render-host.js → host/render-host.js} +1 -17
  37. package/dist/{serve-host.d.ts → host/serve-host.d.ts} +3 -3
  38. package/dist/{serve-host.mjs → host/serve-host.mjs} +45 -168
  39. package/dist/shared/dom-attr-normalize.d.ts +8 -0
  40. package/dist/shared/dom-attr-normalize.js +71 -0
  41. package/dist/shared/host.types.d.ts +113 -0
  42. package/dist/shared/host.types.js +4 -0
  43. package/dist/shared/server.types.d.ts +67 -0
  44. package/dist/shared/server.types.js +4 -0
  45. package/dist/{dom-ssr.d.ts → ssr/dom-ssr.d.ts} +8 -37
  46. package/dist/{dom-ssr.js → ssr/dom-ssr.js} +189 -217
  47. package/package.json +34 -34
  48. package/dist/deployment-registry.d.ts +0 -70
  49. package/dist/direct-host-box.d.ts +0 -26
  50. package/dist/dom-core.js +0 -4815
  51. package/dist/dom.client.d.ts +0 -4
  52. package/dist/dom.client.js +0 -5
  53. package/dist/dom.d.ts +0 -6
  54. package/dist/dom.js +0 -7
  55. package/dist/http.d.ts +0 -6
  56. package/dist/list-client-components.d.ts +0 -62
  57. package/dist/native-addon.d.ts +0 -12
  58. package/dist/render-host.d.ts +0 -32
  59. package/dist/server.d.ts +0 -46
  60. package/dist/unknown-component.d.ts +0 -40
  61. /package/dist/{position-context.d.ts → browser/position-context.d.ts} +0 -0
  62. /package/dist/{index.d.ts → faces/index.d.ts} +0 -0
  63. /package/dist/{index.js → faces/index.js} +0 -0
  64. /package/dist/{localize-body-links.d.ts → host/localize-body-links.d.ts} +0 -0
  65. /package/dist/{route-layout-chain.d.ts → host/route-layout-chain.d.ts} +0 -0
  66. /package/dist/{route-layout-chain.js → host/route-layout-chain.js} +0 -0
@@ -1,4 +0,0 @@
1
- /**
2
- * Browser / client-only DOM entry — tree-shakeable (no SSR serialize/hydrate).
3
- */
4
- export * from './dom-core.js';
@@ -1,5 +0,0 @@
1
- // @ts-nocheck
2
- /**
3
- * Browser / client-only DOM entry — tree-shakeable (no SSR serialize/hydrate).
4
- */
5
- export * from './dom-core.js';
package/dist/dom.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * VMZ DOM / SSR runtime — precise patches, no VDOM diff.
3
- * Compat barrel for `@vmz/core/dom` (full client + SSR).
4
- */
5
- export * from './dom-core.js';
6
- export * from './dom-ssr.js';
package/dist/dom.js DELETED
@@ -1,7 +0,0 @@
1
- // @ts-nocheck
2
- /**
3
- * VMZ DOM / SSR runtime — precise patches, no VDOM diff.
4
- * Compat barrel for `@vmz/core/dom` (full client + SSR).
5
- */
6
- export * from './dom-core.js';
7
- export * from './dom-ssr.js';
package/dist/http.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /** Compile-time HTTP decorators — erased from server JS emit; kept for authoring. */
2
- export declare function Get(path: any): (_target: any, _key: any, descriptor: any) => any;
3
- export declare function Post(path: any): (_target: any, _key: any, descriptor: any) => any;
4
- export declare function Put(path: any): (_target: any, _key: any, descriptor: any) => any;
5
- export declare function Delete(path: any): (_target: any, _key: any, descriptor: any) => any;
6
- export declare function Patch(path: any): (_target: any, _key: any, descriptor: any) => any;
@@ -1,62 +0,0 @@
1
- /**
2
- * Discover compiled client component modules from Deployment Plan only.
3
- * Shared by serve-host SSR, static emit, and test hosts (plan-only host).
4
- */
5
- export { DEPLOYMENT_SCHEMA, readDeploymentDocument, componentEntriesFromDeployment, collectDependsOnClosure, dedupeComponentEntriesByTag, mergeExplicitComponentEntries, loadComponentEntries, importAndRegisterComponentEntries, bootstrapComponentRegistry, } from './deployment-registry.js';
6
- export { createRenderHost } from './render-host.js';
7
- /**
8
- * @param {string} dir
9
- * @param {{ strict?: boolean }} [opts]
10
- * @returns {Promise<Array<{ name: string, entry: string, chunkId?: string }>>}
11
- */
12
- export declare function listClientComponents(dir: any, opts?: {}): Promise<{
13
- name: any;
14
- entry: any;
15
- chunkId: any;
16
- }[]>;
17
- /**
18
- * Sync variant for callers that already use fs sync (legacy static-emit helpers).
19
- * @param {string} dir
20
- * @param {{ strict?: boolean }} [opts]
21
- * @returns {Array<{ name: string, entry: string, chunkId?: string }>}
22
- */
23
- export declare function listClientComponentsSync(dir: any, opts?: {}): {
24
- name: any;
25
- entry: any;
26
- chunkId: any;
27
- }[];
28
- /**
29
- * @param {Array<{ name: string, entry: string, chunkId?: string }>} entries
30
- * @param {Record<string, string> | undefined} explicit
31
- * @returns {Array<{ name: string, entry: string, chunkId?: string }>}
32
- */
33
- export declare function mergeComponentEntries(entries: any, explicit: any): {
34
- name: any;
35
- entry: any;
36
- chunkId: any;
37
- }[];
38
- /**
39
- * @param {string} distDir
40
- * @param {Record<string, string> | undefined} [explicit]
41
- * @param {{ strict?: boolean, closureRoots?: string[] }} [opts]
42
- * @returns {Promise<Array<{ name: string, entry: string, chunkId?: string }>>}
43
- */
44
- export declare function resolveComponentEntries(distDir: any, explicit: any, opts?: {}): Promise<{
45
- name: any;
46
- entry: any;
47
- chunkId: any;
48
- }[]>;
49
- /**
50
- * Import all (or filtered) client components and register for SSR / static emit / test hosts.
51
- * @param {string} distDir
52
- * @param {(map: Record<string, unknown>) => void} registerComponents
53
- * @param {{
54
- * cacheBust?: string | number,
55
- * include?: (entry: { name: string, entry: string, chunkId?: string }) => boolean,
56
- * explicit?: Record<string, string>,
57
- * strict?: boolean,
58
- * closureRoots?: string[],
59
- * preload?: 'all' | 'closure' | 'none',
60
- * }} [opts]
61
- */
62
- export declare function preloadComponentRegistry(distDir: any, registerComponents: any, opts?: {}): Promise<{}>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Discover and load the vmz N-API addon (same contract as `@vmz/vmz` loadNative).
3
- */
4
- /**
5
- * @returns {any}
6
- */
7
- export declare function loadNativeAddon(): any;
8
- /**
9
- * @param {string} fnName
10
- * @returns {any}
11
- */
12
- export declare function requireNativeFn(fnName: any): any;
@@ -1,32 +0,0 @@
1
- /**
2
- * Unified SSR/DOM render host — explicit deployment bootstrap before renderToString/stream/mount.
3
- * Hosts must not call renderToString until ensureComponents() has run for the active closure.
4
- */
5
- /**
6
- * @param {string} distDir
7
- * @param {{
8
- * strictDeployment?: boolean,
9
- * strict?: boolean,
10
- * explicit?: Record<string, string>,
11
- * cacheBust?: string | number,
12
- * preload?: 'all' | 'closure' | 'none',
13
- * closureRoots?: string[],
14
- * }} [opts]
15
- */
16
- export declare function createRenderHost(distDir: any, opts?: {}): Promise<{
17
- distDir: any;
18
- deployment: any;
19
- dom: any;
20
- loadedChunkIds: Set<unknown>;
21
- ensureComponents: (rootChunkIds: any) => Promise<{}>;
22
- closureChunkIds: (rootChunkIds: any) => Set<unknown>;
23
- renderToString: any;
24
- renderToStream: any;
25
- mount: any;
26
- hydrate: any;
27
- resume: any;
28
- destroy: any;
29
- flushPending: any;
30
- /** @deprecated Prefer ensureComponents via createRenderHost; low-level escape hatch. */
31
- registerComponents: any;
32
- }>;
package/dist/server.d.ts DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * Minimal VMZ runtime — `#server` invoke + RPC/REST HTTP + optional static/SSR.
3
- *
4
- *
5
- * Browser-safe: no static `node:*` imports. Node builtins are loaded only inside
6
- * Node/SSR request handlers so client bundles can `import { callServer }`.
7
- */
8
- /**
9
- * Map `#server/foo` → filesystem / URL the host can `import`.
10
- * Only set this in Node/SSR hosts — browser bundles must omit it so RPC goes HTTP.
11
- */
12
- export declare function setServerModuleResolver(fn: any): void;
13
- /** @param {Route[]} next */
14
- export declare function setRoutes(next: any): void;
15
- /**
16
- * @param {string} moduleId
17
- * @param {string} method
18
- * @param {unknown[]} args
19
- */
20
- export declare function callServer(moduleId: any, method: any, args?: any[]): Promise<any>;
21
- /**
22
- * @param {RpcRequest} body
23
- */
24
- export declare function handleRpc(body: any): Promise<any>;
25
- /**
26
- * Match REST route from `vmz-routes.json`.
27
- * @param {string} verb
28
- * @param {string} pathname
29
- * @returns {Route | null}
30
- */
31
- export declare function matchRoute(verb: any, pathname: any): any;
32
- /**
33
- * Web Standards Fetch entry for ServerArtifact hosts (Node adapter, worker/edge parity).
34
- * Handles RPC + public ServerRoute only; static/SSR stay on Node host options.
35
- * @param {Request} request
36
- * @returns {Promise<Response>}
37
- */
38
- export declare function handleFetchRequest(request: any): Promise<Response>;
39
- /**
40
- * Node `http.createServer` listener: RPC + REST + optional static / SSR index.
41
- * RPC/REST go through {@link handleFetchRequest} so Node and Fetch hosts share one core.
42
- * @param {import('node:http').IncomingMessage} req
43
- * @param {import('node:http').ServerResponse} res
44
- * @param {NodeRequestOptions} [opts]
45
- */
46
- export declare function handleNodeRequest(req: any, res: any, opts?: {}): Promise<void>;
@@ -1,40 +0,0 @@
1
- /**
2
- * Unknown Direct component resilience (`ssr-unknown-component-error-node`).
3
- * Leaf failure → subtree error node; do not throw out of document SSR.
4
- */
5
- /** @type {string} */
6
- export declare const UNKNOWN_COMPONENT_ERROR = "unknown-component";
7
- /**
8
- * Append a leaf diagnostic for tooling (does not replace the error node).
9
- * @param {string} name
10
- * @param {string} [via]
11
- */
12
- export declare function noteUnknownComponent(name: any, via?: string): void;
13
- /**
14
- * SSR serialize-tree error node (keeps document HTTP 200).
15
- * @param {string} name
16
- */
17
- export declare function serializeUnknownComponentNode(name: any): {
18
- __kind: string;
19
- tag: string;
20
- attrs: {
21
- 'data-vmz-error': string;
22
- 'data-vmz-component': string;
23
- };
24
- children: any[];
25
- appendChild(c: any): void;
26
- };
27
- /**
28
- * Live DOM error host (client create / schedule).
29
- * @param {string} name
30
- * @param {string} [via]
31
- * @returns {HTMLElement}
32
- */
33
- export declare function createUnknownComponentElement(name: any, via?: string): HTMLDivElement;
34
- /**
35
- * Mark an existing island host as unknown (resume / EventEntry).
36
- * @param {HTMLElement} el
37
- * @param {string} name
38
- * @param {string} [via]
39
- */
40
- export declare function markUnknownComponentHost(el: any, name: any, via?: string): void;
File without changes
File without changes