@zenithbuild/cli 0.7.5 → 0.7.7

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 (68) hide show
  1. package/dist/adapters/adapter-netlify.js +0 -8
  2. package/dist/adapters/adapter-vercel.js +6 -14
  3. package/dist/adapters/copy-hosted-page-runtime.js +2 -1
  4. package/dist/build/hoisted-code-transforms.d.ts +4 -1
  5. package/dist/build/hoisted-code-transforms.js +5 -3
  6. package/dist/build/page-ir-normalization.d.ts +1 -1
  7. package/dist/build/page-ir-normalization.js +33 -3
  8. package/dist/build/page-loop.js +46 -2
  9. package/dist/dev-build-session/helpers.d.ts +29 -0
  10. package/dist/dev-build-session/helpers.js +223 -0
  11. package/dist/dev-build-session/session.d.ts +24 -0
  12. package/dist/dev-build-session/session.js +204 -0
  13. package/dist/dev-build-session/state.d.ts +37 -0
  14. package/dist/dev-build-session/state.js +17 -0
  15. package/dist/dev-build-session.d.ts +1 -24
  16. package/dist/dev-build-session.js +1 -434
  17. package/dist/dev-server/css-state.d.ts +7 -0
  18. package/dist/dev-server/css-state.js +92 -0
  19. package/dist/dev-server/not-found.d.ts +23 -0
  20. package/dist/dev-server/not-found.js +129 -0
  21. package/dist/dev-server/request-handler.d.ts +1 -0
  22. package/dist/dev-server/request-handler.js +376 -0
  23. package/dist/dev-server/route-check.d.ts +9 -0
  24. package/dist/dev-server/route-check.js +100 -0
  25. package/dist/dev-server/watcher.d.ts +5 -0
  26. package/dist/dev-server/watcher.js +216 -0
  27. package/dist/dev-server.js +123 -924
  28. package/dist/images/payload.js +4 -0
  29. package/dist/manifest.js +46 -1
  30. package/dist/preview/create-preview-server.d.ts +18 -0
  31. package/dist/preview/create-preview-server.js +71 -0
  32. package/dist/preview/manifest.d.ts +42 -0
  33. package/dist/preview/manifest.js +57 -0
  34. package/dist/preview/paths.d.ts +3 -0
  35. package/dist/preview/paths.js +38 -0
  36. package/dist/preview/payload.d.ts +6 -0
  37. package/dist/preview/payload.js +34 -0
  38. package/dist/preview/request-handler.d.ts +1 -0
  39. package/dist/preview/request-handler.js +300 -0
  40. package/dist/preview/server-runner.d.ts +49 -0
  41. package/dist/preview/server-runner.js +220 -0
  42. package/dist/preview/server-script-runner-template.d.ts +1 -0
  43. package/dist/preview/server-script-runner-template.js +425 -0
  44. package/dist/preview.d.ts +5 -112
  45. package/dist/preview.js +7 -1119
  46. package/dist/resource-response.d.ts +15 -0
  47. package/dist/resource-response.js +91 -2
  48. package/dist/server-contract/constants.d.ts +5 -0
  49. package/dist/server-contract/constants.js +5 -0
  50. package/dist/server-contract/export-validation.d.ts +5 -0
  51. package/dist/server-contract/export-validation.js +59 -0
  52. package/dist/server-contract/json-serializable.d.ts +1 -0
  53. package/dist/server-contract/json-serializable.js +52 -0
  54. package/dist/server-contract/resolve.d.ts +15 -0
  55. package/dist/server-contract/resolve.js +271 -0
  56. package/dist/server-contract/result-helpers.d.ts +51 -0
  57. package/dist/server-contract/result-helpers.js +59 -0
  58. package/dist/server-contract/route-result-validation.d.ts +2 -0
  59. package/dist/server-contract/route-result-validation.js +73 -0
  60. package/dist/server-contract/stage.d.ts +6 -0
  61. package/dist/server-contract/stage.js +22 -0
  62. package/dist/server-contract.d.ts +6 -62
  63. package/dist/server-contract.js +9 -493
  64. package/dist/server-middleware.d.ts +10 -0
  65. package/dist/server-middleware.js +30 -0
  66. package/dist/server-output.js +13 -1
  67. package/dist/server-runtime/node-server.js +25 -3
  68. package/package.json +3 -3
package/dist/preview.d.ts CHANGED
@@ -1,112 +1,5 @@
1
- /**
2
- * Create and start a preview server.
3
- *
4
- * @param {{ distDir: string, port?: number, host?: string, logger?: object | null, config?: object, projectRoot?: string }} options
5
- * @returns {Promise<{ server: import('http').Server, port: number, close: () => void }>}
6
- */
7
- export function createPreviewServer(options: {
8
- distDir: string;
9
- port?: number;
10
- host?: string;
11
- logger?: object | null;
12
- config?: object;
13
- projectRoot?: string;
14
- }): Promise<{
15
- server: import("http").Server;
16
- port: number;
17
- close: () => void;
18
- }>;
19
- /**
20
- * @typedef {{
21
- * path: string;
22
- * output: string;
23
- * server_script?: string | null;
24
- * server_script_path?: string | null;
25
- * prerender?: boolean;
26
- * route_id?: string;
27
- * pattern?: string;
28
- * params_shape?: Record<string, string>;
29
- * has_guard?: boolean;
30
- * has_load?: boolean;
31
- * guard_module_ref?: string | null;
32
- * load_module_ref?: string | null;
33
- * }} PreviewRoute
34
- */
35
- /**
36
- * @param {string} distDir
37
- * @returns {Promise<PreviewRoute[]>}
38
- */
39
- export function loadRouteManifest(distDir: string): Promise<PreviewRoute[]>;
40
- export function loadRouteSurfaceState(distDir: any, fallbackBasePath?: string): Promise<{
41
- basePath: string;
42
- pageRoutes: any;
43
- resourceRoutes: any[];
44
- }>;
45
- /**
46
- * @param {{ source: string, sourcePath: string, params: Record<string, string>, requestUrl?: string, requestMethod?: string, requestHeaders?: Record<string, string | string[] | undefined>, requestBodyBuffer?: Buffer | null, routePattern?: string, routeFile?: string, routeId?: string, routeKind?: 'page' | 'resource' }} input
47
- * @returns {Promise<{ result: { kind: string, [key: string]: unknown }, trace: { guard: string, action: string, load: string }, status?: number, setCookies?: string[] }>}
48
- */
49
- export function executeServerRoute({ source, sourcePath, params, requestUrl, requestMethod, requestHeaders, requestBodyBuffer, routePattern, routeFile, routeId, routeKind, guardOnly }: {
50
- source: string;
51
- sourcePath: string;
52
- params: Record<string, string>;
53
- requestUrl?: string;
54
- requestMethod?: string;
55
- requestHeaders?: Record<string, string | string[] | undefined>;
56
- requestBodyBuffer?: Buffer | null;
57
- routePattern?: string;
58
- routeFile?: string;
59
- routeId?: string;
60
- routeKind?: "page" | "resource";
61
- }): Promise<{
62
- result: {
63
- kind: string;
64
- [key: string]: unknown;
65
- };
66
- trace: {
67
- guard: string;
68
- action: string;
69
- load: string;
70
- };
71
- status?: number;
72
- setCookies?: string[];
73
- }>;
74
- /**
75
- * @param {{ source: string, sourcePath: string, params: Record<string, string>, requestUrl?: string, requestMethod?: string, requestHeaders?: Record<string, string | string[] | undefined>, routePattern?: string, routeFile?: string, routeId?: string }} input
76
- * @returns {Promise<Record<string, unknown> | null>}
77
- */
78
- export function executeServerScript(input: {
79
- source: string;
80
- sourcePath: string;
81
- params: Record<string, string>;
82
- requestUrl?: string;
83
- requestMethod?: string;
84
- requestHeaders?: Record<string, string | string[] | undefined>;
85
- routePattern?: string;
86
- routeFile?: string;
87
- routeId?: string;
88
- }): Promise<Record<string, unknown> | null>;
89
- /**
90
- * @param {string} html
91
- * @param {Record<string, unknown>} payload
92
- * @returns {string}
93
- */
94
- export function injectSsrPayload(html: string, payload: Record<string, unknown>): string;
95
- export function toStaticFilePath(distDir: any, pathname: any): string | null;
96
- export function resolveWithinDist(distDir: any, requestPath: any): string | null;
97
- export const matchRoute: typeof matchManifestRoute;
98
- export type PreviewRoute = {
99
- path: string;
100
- output: string;
101
- server_script?: string | null;
102
- server_script_path?: string | null;
103
- prerender?: boolean;
104
- route_id?: string;
105
- pattern?: string;
106
- params_shape?: Record<string, string>;
107
- has_guard?: boolean;
108
- has_load?: boolean;
109
- guard_module_ref?: string | null;
110
- load_module_ref?: string | null;
111
- };
112
- import { matchRoute as matchManifestRoute } from './server/resolve-request-route.js';
1
+ export { createPreviewServer } from "./preview/create-preview-server.js";
2
+ export { injectSsrPayload } from "./preview/payload.js";
3
+ export { loadRouteManifest, loadRouteSurfaceState, matchRoute } from "./preview/manifest.js";
4
+ export { executeServerRoute, executeServerScript } from "./preview/server-runner.js";
5
+ export { toStaticFilePath, resolveWithinDist } from "./preview/paths.js";