@jay-framework/production-server 0.17.3 → 0.18.0

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/index.d.ts CHANGED
@@ -1,86 +1,74 @@
1
- import * as _jay_framework_ssr_runtime from '@jay-framework/ssr-runtime';
1
+ import { B as BuildOptions, R as RouteManifest, a as RouteEntry } from './serve-index-9aAW1pbg.js';
2
+ export { A as ActionEntry, e as ArtifactStore, c as BuildMetadata, C as CacheEntry, F as FilesystemArtifactStore, I as InstanceEntry, M as MatchResult, d as PageModule, P as PluginEntry, n as PreImportedPlugin, b as RouteSegment, S as ServerElementModule, g as fetchActionRequest, f as fetchPageRequest, j as fetchStaticFile, k as initializeServices, l as initializeServicesFromModules, i as isActionRequest, m as matchRequest, r as registerActionsFromManifest, h as registerActionsFromModules } from './serve-index-9aAW1pbg.js';
3
+ import '@jay-framework/ssr-runtime';
4
+ import '@jay-framework/stack-server-runtime';
2
5
 
3
- interface RouteManifest {
4
- version: number;
5
- buildTimestamp: string;
6
- sourceHash: string;
7
- publicBasePath: string;
8
- projectRoot: string;
9
- sharedManifest: Record<string, string>;
10
- routes: RouteEntry[];
11
- actions: ActionEntry[];
12
- plugins: PluginEntry[];
13
- }
14
- interface RouteSegment {
15
- type: 'static' | 'param' | 'optional' | 'catchAll' | 'optionalCatchAll';
16
- value: string;
17
- }
18
- interface RouteEntry {
19
- pattern: string;
20
- segments: RouteSegment[];
21
- serverModule: string;
22
- jayHtmlPath?: string;
23
- trackByMap?: Record<string, string>;
24
- contracts?: string[];
25
- componentExport?: string;
26
- instances: InstanceEntry[];
27
- isPlugin?: boolean;
28
- pluginName?: string;
29
- }
30
- interface InstanceEntry {
31
- params: Record<string, string>;
32
- preRenderedPath: string;
33
- serverElementPath: string;
34
- clientBundlePath: string;
35
- clientCssPath?: string;
36
- }
37
- interface PreRenderedEntry {
38
- content: string;
39
- slowViewState: object;
40
- carryForward: object;
41
- }
42
- interface ActionEntry {
43
- serverModule: string;
44
- packageName?: string;
45
- isPlugin: boolean;
46
- actionNames: string[];
47
- }
48
- interface PluginEntry {
49
- name: string;
50
- packageName: string;
6
+ declare function buildVersion(options: BuildOptions): Promise<RouteManifest>;
7
+
8
+ interface MainServerOptions {
9
+ buildRoot: string;
10
+ version: string;
11
+ port: number;
12
+ publicBasePath?: string;
13
+ serveStatic?: boolean;
14
+ testMode?: boolean;
51
15
  }
52
- interface BuildMetadata {
53
- version: number;
54
- sourceHash: string;
55
- buildTimestamp: string;
56
- nodeVersion: string;
57
- instanceCount: number;
16
+ declare function startMainServer(options: MainServerOptions): Promise<void>;
17
+
18
+ interface RendererServerOptions {
19
+ buildRoot: string;
20
+ version: string;
21
+ port: number;
22
+ projectRoot: string;
23
+ pagesRoot: string;
24
+ tsConfigFilePath?: string;
25
+ minify?: boolean;
58
26
  }
59
- interface BuildOptions {
60
- version: number;
27
+ declare function startRendererServer(options: RendererServerOptions): Promise<void>;
28
+
29
+ type RebuildTarget = {
30
+ mode: 'contract';
31
+ contractName: string;
32
+ params?: Record<string, string>;
33
+ } | {
34
+ mode: 'route';
35
+ routePattern: string;
36
+ params?: Record<string, string>;
37
+ } | {
38
+ mode: 'url';
39
+ url: string;
40
+ };
41
+ interface RebuildOptions {
61
42
  projectRoot: string;
62
43
  pagesRoot: string;
63
44
  buildRoot: string;
64
- publicBasePath: string;
65
- concurrency: number;
66
- tsConfigFilePath: string;
45
+ version: string;
46
+ target: RebuildTarget;
47
+ tsConfigFilePath?: string;
67
48
  minify?: boolean;
68
49
  }
69
- interface ServerElementModule {
70
- renderToStream: (vs: object, ctx: _jay_framework_ssr_runtime.ServerRenderContext) => void;
50
+ interface RebuildResult {
51
+ affected: number;
52
+ rebuilt: number;
53
+ errors: Array<{
54
+ route: string;
55
+ params?: Record<string, string>;
56
+ error: string;
57
+ }>;
71
58
  }
72
- interface PageModule {
73
- [key: string]: any;
74
- }
75
-
76
- declare function buildVersion(options: BuildOptions): Promise<RouteManifest>;
77
-
78
- interface MainServerOptions {
59
+ declare function resolveContractToRoutes(manifest: RouteManifest, contractName: string): RouteEntry[];
60
+ declare function rebuild(options: RebuildOptions): Promise<RebuildResult>;
61
+ /** Convenience wrapper for contract-based rebuild (used by renderer server webhooks). */
62
+ declare function rebuildContract(options: {
63
+ projectRoot: string;
64
+ pagesRoot: string;
79
65
  buildRoot: string;
80
- version: number;
81
- port: number;
82
- publicBasePath: string;
83
- }
84
- declare function startMainServer(options: MainServerOptions): Promise<void>;
66
+ version: string;
67
+ contractName: string;
68
+ params?: Record<string, string>;
69
+ tsConfigFilePath?: string;
70
+ minify?: boolean;
71
+ }): Promise<RebuildResult>;
72
+ declare function cleanupOrphanedFiles(buildRoot: string, version: string): Promise<number>;
85
73
 
86
- export { type ActionEntry, type BuildMetadata, type BuildOptions, type InstanceEntry, type PageModule, type PluginEntry, type PreRenderedEntry, type RouteEntry, type RouteManifest, type RouteSegment, type ServerElementModule, buildVersion, startMainServer };
74
+ export { BuildOptions, type RebuildOptions, type RebuildResult, type RebuildTarget, type RendererServerOptions, RouteEntry, RouteManifest, buildVersion, cleanupOrphanedFiles, rebuild, rebuildContract, resolveContractToRoutes, startMainServer, startRendererServer };