@jay-framework/production-server 0.17.4 → 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 +10 -117
- package/dist/index.js +453 -1130
- package/dist/init-services-BKVwxzYb.js +796 -0
- package/dist/serve-index-9aAW1pbg.d.ts +179 -0
- package/dist/serve-index.d.ts +3 -0
- package/dist/serve-index.js +23 -0
- package/package.json +24 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,81 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
version: number;
|
|
6
|
-
buildTimestamp: string;
|
|
7
|
-
sourceHash: 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
|
-
trackByMap?: Record<string, string>;
|
|
23
|
-
contracts?: string[];
|
|
24
|
-
componentExport?: string;
|
|
25
|
-
instances: InstanceEntry[];
|
|
26
|
-
isPlugin?: boolean;
|
|
27
|
-
pluginName?: string;
|
|
28
|
-
}
|
|
29
|
-
interface InstanceEntry {
|
|
30
|
-
params: Record<string, string>;
|
|
31
|
-
preRenderedPath: string;
|
|
32
|
-
serverElementPath: string;
|
|
33
|
-
clientBundlePath: string;
|
|
34
|
-
clientCssPath?: string;
|
|
35
|
-
}
|
|
36
|
-
interface PreRenderedEntry {
|
|
37
|
-
content: string;
|
|
38
|
-
slowViewState: object;
|
|
39
|
-
carryForward: object;
|
|
40
|
-
}
|
|
41
|
-
interface ActionEntry {
|
|
42
|
-
serverModule: string;
|
|
43
|
-
packageName?: string;
|
|
44
|
-
isPlugin: boolean;
|
|
45
|
-
actionNames: string[];
|
|
46
|
-
}
|
|
47
|
-
interface PluginEntry {
|
|
48
|
-
name: string;
|
|
49
|
-
packageName: string;
|
|
50
|
-
}
|
|
51
|
-
interface BuildMetadata {
|
|
52
|
-
version: number;
|
|
53
|
-
sourceHash: string;
|
|
54
|
-
buildTimestamp: string;
|
|
55
|
-
nodeVersion: string;
|
|
56
|
-
instanceCount: number;
|
|
57
|
-
}
|
|
58
|
-
interface BuildOptions {
|
|
59
|
-
version: number;
|
|
60
|
-
projectRoot: string;
|
|
61
|
-
pagesRoot: string;
|
|
62
|
-
buildRoot: string;
|
|
63
|
-
concurrency: number;
|
|
64
|
-
tsConfigFilePath: string;
|
|
65
|
-
minify?: boolean;
|
|
66
|
-
}
|
|
67
|
-
interface ServerElementModule {
|
|
68
|
-
renderToStream: (vs: object, ctx: _jay_framework_ssr_runtime.ServerRenderContext) => void;
|
|
69
|
-
}
|
|
70
|
-
interface PageModule {
|
|
71
|
-
[key: string]: any;
|
|
72
|
-
}
|
|
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';
|
|
73
5
|
|
|
74
6
|
declare function buildVersion(options: BuildOptions): Promise<RouteManifest>;
|
|
75
7
|
|
|
76
8
|
interface MainServerOptions {
|
|
77
9
|
buildRoot: string;
|
|
78
|
-
version:
|
|
10
|
+
version: string;
|
|
79
11
|
port: number;
|
|
80
12
|
publicBasePath?: string;
|
|
81
13
|
serveStatic?: boolean;
|
|
@@ -85,7 +17,7 @@ declare function startMainServer(options: MainServerOptions): Promise<void>;
|
|
|
85
17
|
|
|
86
18
|
interface RendererServerOptions {
|
|
87
19
|
buildRoot: string;
|
|
88
|
-
version:
|
|
20
|
+
version: string;
|
|
89
21
|
port: number;
|
|
90
22
|
projectRoot: string;
|
|
91
23
|
pagesRoot: string;
|
|
@@ -110,7 +42,7 @@ interface RebuildOptions {
|
|
|
110
42
|
projectRoot: string;
|
|
111
43
|
pagesRoot: string;
|
|
112
44
|
buildRoot: string;
|
|
113
|
-
version:
|
|
45
|
+
version: string;
|
|
114
46
|
target: RebuildTarget;
|
|
115
47
|
tsConfigFilePath?: string;
|
|
116
48
|
minify?: boolean;
|
|
@@ -131,51 +63,12 @@ declare function rebuildContract(options: {
|
|
|
131
63
|
projectRoot: string;
|
|
132
64
|
pagesRoot: string;
|
|
133
65
|
buildRoot: string;
|
|
134
|
-
version:
|
|
66
|
+
version: string;
|
|
135
67
|
contractName: string;
|
|
136
68
|
params?: Record<string, string>;
|
|
137
69
|
tsConfigFilePath?: string;
|
|
138
70
|
minify?: boolean;
|
|
139
71
|
}): Promise<RebuildResult>;
|
|
140
|
-
declare function cleanupOrphanedFiles(buildRoot: string, version:
|
|
141
|
-
|
|
142
|
-
declare class FilesystemArtifactStore {
|
|
143
|
-
private basePath;
|
|
144
|
-
private manifestCache?;
|
|
145
|
-
private metadataMtime?;
|
|
146
|
-
private moduleCache;
|
|
147
|
-
constructor(basePath: string);
|
|
148
|
-
readManifest(): Promise<RouteManifest>;
|
|
149
|
-
readPreRenderedHtml(relativePath: string): Promise<PreRenderedEntry>;
|
|
150
|
-
loadServerElement(relativePath: string): Promise<ServerElementModule>;
|
|
151
|
-
loadPageModule(relativePath: string): Promise<PageModule>;
|
|
152
|
-
readRawFile(relativePath: string): Promise<string>;
|
|
153
|
-
getAssetPath(relativePath: string): string;
|
|
154
|
-
getBuildDir(): string;
|
|
155
|
-
private loadModule;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
interface MatchResult {
|
|
159
|
-
route: RouteEntry;
|
|
160
|
-
instance: InstanceEntry;
|
|
161
|
-
params: Record<string, string>;
|
|
162
|
-
pathname: string;
|
|
163
|
-
}
|
|
164
|
-
declare function matchRequest(manifest: RouteManifest, pathname: string): MatchResult | undefined;
|
|
165
|
-
|
|
166
|
-
declare function fetchPageRequest(match: MatchResult, manifest: RouteManifest, requestUrl: URL, artifacts: FilesystemArtifactStore, staticBaseUrl: string, cookies?: Record<string, string>): Promise<Response>;
|
|
167
|
-
|
|
168
|
-
declare function isActionRequest(pathname: string): boolean;
|
|
169
|
-
declare function fetchActionRequest(request: Request, registry?: ActionRegistry): Promise<Response>;
|
|
170
|
-
declare function registerActionsFromManifest(actions: Array<{
|
|
171
|
-
serverModule: string;
|
|
172
|
-
isPlugin: boolean;
|
|
173
|
-
actionNames: string[];
|
|
174
|
-
packageName?: string;
|
|
175
|
-
}>, buildDir: string, registry?: ActionRegistry): Promise<void>;
|
|
176
|
-
|
|
177
|
-
declare function fetchStaticFile(pathname: string, frontendDir: string): Promise<Response | null>;
|
|
178
|
-
|
|
179
|
-
declare function initializeServices(buildDir: string, projectRoot: string, label: string): Promise<void>;
|
|
72
|
+
declare function cleanupOrphanedFiles(buildRoot: string, version: string): Promise<number>;
|
|
180
73
|
|
|
181
|
-
export {
|
|
74
|
+
export { BuildOptions, type RebuildOptions, type RebuildResult, type RebuildTarget, type RendererServerOptions, RouteEntry, RouteManifest, buildVersion, cleanupOrphanedFiles, rebuild, rebuildContract, resolveContractToRoutes, startMainServer, startRendererServer };
|