@bleedingdev/modern-js-server-core 3.2.0-ultramodern.0 → 3.2.0-ultramodern.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.
- package/package.json +5 -5
- package/dist/types/adapters/node/helper/index.d.ts +0 -6
- package/dist/types/adapters/node/helper/loadCache.d.ts +0 -2
- package/dist/types/adapters/node/helper/loadConfig.d.ts +0 -3
- package/dist/types/adapters/node/helper/loadEnv.d.ts +0 -3
- package/dist/types/adapters/node/helper/loadPlugin.d.ts +0 -3
- package/dist/types/adapters/node/helper/utils.d.ts +0 -21
- package/dist/types/adapters/node/hono.d.ts +0 -19
- package/dist/types/adapters/node/index.d.ts +0 -5
- package/dist/types/adapters/node/node.d.ts +0 -17
- package/dist/types/adapters/node/plugins/index.d.ts +0 -3
- package/dist/types/adapters/node/plugins/nodeServer.d.ts +0 -6
- package/dist/types/adapters/node/plugins/resource.d.ts +0 -11
- package/dist/types/adapters/node/plugins/static.d.ts +0 -25
- package/dist/types/constants.d.ts +0 -26
- package/dist/types/context.d.ts +0 -3
- package/dist/types/helper.d.ts +0 -10
- package/dist/types/hono.d.ts +0 -3
- package/dist/types/index.d.ts +0 -14
- package/dist/types/plugins/compat/hooks.d.ts +0 -8
- package/dist/types/plugins/compat/index.d.ts +0 -3
- package/dist/types/plugins/contractGateAutopilot.d.ts +0 -35
- package/dist/types/plugins/contractGateSnapshotStore.d.ts +0 -57
- package/dist/types/plugins/default.d.ts +0 -7
- package/dist/types/plugins/favicon.d.ts +0 -2
- package/dist/types/plugins/index.d.ts +0 -11
- package/dist/types/plugins/log.d.ts +0 -2
- package/dist/types/plugins/mfCache.d.ts +0 -12
- package/dist/types/plugins/middlewares.d.ts +0 -2
- package/dist/types/plugins/monitors.d.ts +0 -6
- package/dist/types/plugins/processedBy.d.ts +0 -2
- package/dist/types/plugins/render/csrRscRender.d.ts +0 -2
- package/dist/types/plugins/render/dataHandler.d.ts +0 -5
- package/dist/types/plugins/render/index.d.ts +0 -3
- package/dist/types/plugins/render/inject.d.ts +0 -7
- package/dist/types/plugins/render/render.d.ts +0 -16
- package/dist/types/plugins/render/renderRscHandler.d.ts +0 -2
- package/dist/types/plugins/render/serverActionHandler.d.ts +0 -2
- package/dist/types/plugins/render/ssrCache.d.ts +0 -18
- package/dist/types/plugins/render/ssrRender.d.ts +0 -26
- package/dist/types/plugins/render/utils.d.ts +0 -3
- package/dist/types/plugins/route.d.ts +0 -2
- package/dist/types/plugins/telemetry.d.ts +0 -309
- package/dist/types/serverBase.d.ts +0 -38
- package/dist/types/types/config/bff.d.ts +0 -142
- package/dist/types/types/config/dev.d.ts +0 -4
- package/dist/types/types/config/html.d.ts +0 -15
- package/dist/types/types/config/index.d.ts +0 -35
- package/dist/types/types/config/output.d.ts +0 -20
- package/dist/types/types/config/security.d.ts +0 -4
- package/dist/types/types/config/server.d.ts +0 -402
- package/dist/types/types/config/share.d.ts +0 -3
- package/dist/types/types/config/source.d.ts +0 -7
- package/dist/types/types/config/tools.d.ts +0 -2
- package/dist/types/types/index.d.ts +0 -4
- package/dist/types/types/plugins/base.d.ts +0 -57
- package/dist/types/types/plugins/index.d.ts +0 -2
- package/dist/types/types/plugins/plugin.d.ts +0 -31
- package/dist/types/types/render.d.ts +0 -24
- package/dist/types/types/requestHandler.d.ts +0 -48
- package/dist/types/types/server.d.ts +0 -67
- package/dist/types/utils/entry.d.ts +0 -3
- package/dist/types/utils/env.d.ts +0 -2
- package/dist/types/utils/error.d.ts +0 -8
- package/dist/types/utils/index.d.ts +0 -9
- package/dist/types/utils/middlewareCollector.d.ts +0 -12
- package/dist/types/utils/publicDir.d.ts +0 -40
- package/dist/types/utils/request.d.ts +0 -17
- package/dist/types/utils/serverConfig.d.ts +0 -8
- package/dist/types/utils/storage.d.ts +0 -5
- package/dist/types/utils/transformStream.d.ts +0 -5
- package/dist/types/utils/warmup.d.ts +0 -1
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.1",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"flatted": "^3.4.2",
|
|
77
77
|
"hono": "^4.12.19",
|
|
78
78
|
"ts-deepmerge": "7.0.3",
|
|
79
|
-
"@modern-js/
|
|
80
|
-
"@modern-js/
|
|
81
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.
|
|
79
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.1",
|
|
80
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.1",
|
|
81
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.1"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@rslib/core": "0.21.5",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@types/node": "^25.8.0",
|
|
88
88
|
"@typescript/native-preview": "7.0.0-dev.20260516.1",
|
|
89
89
|
"http-proxy-middleware": "^4.0.0",
|
|
90
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.
|
|
90
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.1",
|
|
91
91
|
"@scripts/rstest-config": "2.66.0"
|
|
92
92
|
},
|
|
93
93
|
"sideEffects": false,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { loadCacheConfig } from './loadCache';
|
|
2
|
-
export { loadServerCliConfig, loadServerRuntimeConfig } from './loadConfig';
|
|
3
|
-
export { loadServerEnv } from './loadEnv';
|
|
4
|
-
export { loadServerPlugins } from './loadPlugin';
|
|
5
|
-
export type { NodeBindings } from './utils';
|
|
6
|
-
export { isResFinalized } from './utils';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { CliConfig, ServerConfig, UserConfig } from '../../../types';
|
|
2
|
-
export declare function loadServerRuntimeConfig(serverConfigPath: string): Promise<ServerConfig | undefined>;
|
|
3
|
-
export declare function loadServerCliConfig(pwd: string, defaultConfig?: UserConfig): CliConfig;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ClientManifest, NodeRequest, NodeResponse, SSRManifest } from '@modern-js/types/server';
|
|
2
|
-
import type { HonoRequest, ServerManifest } from '../../../types';
|
|
3
|
-
type ExtendedNodeRequest = NodeRequest & {
|
|
4
|
-
__honoRequest?: HonoRequest;
|
|
5
|
-
__templates?: Record<string, string>;
|
|
6
|
-
__serverManifest?: ServerManifest;
|
|
7
|
-
__rscServerManifest?: ServerManifest;
|
|
8
|
-
__rscClientManifest?: ClientManifest;
|
|
9
|
-
__rscSSRManifest?: SSRManifest;
|
|
10
|
-
};
|
|
11
|
-
type ExtendedNodeResponse = NodeResponse & {
|
|
12
|
-
_modernBodyPiped?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type NodeBindings = {
|
|
15
|
-
node: {
|
|
16
|
-
req: ExtendedNodeRequest;
|
|
17
|
-
res: ExtendedNodeResponse;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const isResFinalized: (res: ExtendedNodeResponse) => boolean;
|
|
21
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { NodeRequest, NodeResponse } from '@modern-js/types/server';
|
|
2
|
-
import type { Context, Middleware, Next, ServerEnv } from '../../types';
|
|
3
|
-
import { type NodeBindings } from './helper';
|
|
4
|
-
export type ServerNodeEnv = {
|
|
5
|
-
Bindings: NodeBindings;
|
|
6
|
-
};
|
|
7
|
-
export type ServerNodeMiddleware = Middleware<ServerNodeEnv>;
|
|
8
|
-
export type ServerNodeContext = Context<ServerNodeEnv>;
|
|
9
|
-
type Handler = (req: NodeRequest, res: NodeResponse) => void | Promise<void>;
|
|
10
|
-
export declare const httpCallBack2HonoMid: (handler: Handler) => (context: Context<ServerNodeEnv & ServerEnv>, next: Next) => Promise<void>;
|
|
11
|
-
type ConnectMiddleware = ((req: NodeRequest, res: NodeResponse, callback: (...args: unknown[]) => void) => void) | ((req: NodeRequest, res: NodeResponse) => void);
|
|
12
|
-
export declare const connectMid2HonoMid: (handler: ConnectMiddleware) => Middleware;
|
|
13
|
-
/**
|
|
14
|
-
* Because we are not sure how use devServer.before and devServer.after, we add a new function to handle the mock middleware
|
|
15
|
-
* And we supose mock handler always process the res directly
|
|
16
|
-
* So we need to set the context.finalized = true and resolve the promise
|
|
17
|
-
*/
|
|
18
|
-
export declare const connectMockMid2HonoMid: (handler: ConnectMiddleware) => Middleware;
|
|
19
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig, } from './helper';
|
|
2
|
-
export type { ServerNodeContext, ServerNodeMiddleware } from './hono';
|
|
3
|
-
export { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid, } from './hono';
|
|
4
|
-
export { createNodeServer, createWebRequest, sendResponse, } from './node';
|
|
5
|
-
export { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin, } from './plugins';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Server as NodeServer } from 'node:http';
|
|
2
|
-
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type { Server as NodeHttpsServer } from 'node:https';
|
|
4
|
-
import type { NodeRequest, NodeResponse } from '@modern-js/types/server';
|
|
5
|
-
import type { RequestHandler } from '../../types';
|
|
6
|
-
export declare const createWebRequest: (req: NodeRequest, res: NodeResponse, body?: BodyInit) => Request;
|
|
7
|
-
export declare const sendResponse: (response: Response, res: NodeResponse) => Promise<void>;
|
|
8
|
-
declare const getRequestListener: (handler: RequestHandler) => (req: NodeRequest, res: NodeResponse) => Promise<void>;
|
|
9
|
-
type NodeServerWrapper = (NodeServer | NodeHttpsServer | Http2SecureServer) & {
|
|
10
|
-
getRequestListener: () => ReturnType<typeof getRequestListener>;
|
|
11
|
-
getRequestHandler: () => RequestHandler;
|
|
12
|
-
};
|
|
13
|
-
export declare const createNodeServer: (requestHandler: RequestHandler, httpsOptions?: {
|
|
14
|
-
key?: string | Buffer;
|
|
15
|
-
cert?: string | Buffer;
|
|
16
|
-
}, http2?: boolean) => Promise<NodeServerWrapper>;
|
|
17
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Server as NodeServer } from 'node:http';
|
|
2
|
-
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type { ServerPlugin } from '../../../types';
|
|
4
|
-
export declare const injectNodeSeverPlugin: ({ nodeServer, }: {
|
|
5
|
-
nodeServer: NodeServer | Http2SecureServer;
|
|
6
|
-
}) => ServerPlugin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Monitors, ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { Middleware, ServerEnv, ServerManifest, ServerPlugin } from '../../../types';
|
|
3
|
-
export declare function getHtmlTemplates(pwd: string, routes: ServerRoute[]): Promise<Record<string, string>>;
|
|
4
|
-
export declare function injectTemplates(pwd: string, routes?: ServerRoute[], htmlTemplatePromise?: ReturnType<typeof getHtmlTemplates>): Middleware<ServerEnv>;
|
|
5
|
-
export declare function getServerManifest(pwd: string, routes: ServerRoute[], monitors?: Monitors): Promise<ServerManifest>;
|
|
6
|
-
export declare function injectServerManifest(pwd: string, routes?: ServerRoute[], manifestPromise?: Promise<ServerManifest>): Middleware<ServerEnv>;
|
|
7
|
-
export declare function getRscServerManifest(pwd: string): Promise<any>;
|
|
8
|
-
export declare function getClientManifest(pwd: string): Promise<any>;
|
|
9
|
-
export declare function getRscSSRManifest(pwd: string): Promise<any>;
|
|
10
|
-
export declare const injectRscManifestPlugin: (enableRsc: boolean) => ServerPlugin;
|
|
11
|
-
export declare const injectResourcePlugin: () => ServerPlugin;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { HtmlNormalizedConfig, Middleware, OutputNormalizedConfig, ServerNormalizedConfig, ServerPlugin } from '../../../types';
|
|
3
|
-
export declare const serverStaticPlugin: () => ServerPlugin;
|
|
4
|
-
export type PublicMiddlwareOptions = {
|
|
5
|
-
pwd: string;
|
|
6
|
-
routes: ServerRoute[];
|
|
7
|
-
};
|
|
8
|
-
export declare function createPublicMiddleware({ pwd, routes, }: PublicMiddlwareOptions): Middleware;
|
|
9
|
-
export interface ServerStaticOptions {
|
|
10
|
-
pwd: string;
|
|
11
|
-
output: OutputNormalizedConfig;
|
|
12
|
-
html: HtmlNormalizedConfig;
|
|
13
|
-
server: ServerNormalizedConfig;
|
|
14
|
-
routes?: ServerRoute[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* This middleware is used to serve static assets
|
|
18
|
-
* TODO: In next major version, only serve static assets in the `static` and `upload` directory.
|
|
19
|
-
*
|
|
20
|
-
* 1. In dev mode, the static assets generated by bundler will be served by the rsbuildDevMiddleware, and other file in `static` directory will be served by this middleware.
|
|
21
|
-
* 2. In prod mode, all the static assets in `static` and `upload` directory will be served by this middleware.
|
|
22
|
-
* 3. So some file not in `static` can be access in dev mode, but not in prod mode. Cause we can not serve all files in prod mode, as we should not expose server code in prod mode.
|
|
23
|
-
* 4. Through Modern.js not serve this file in prod mode, you can upload the files to a CDN.
|
|
24
|
-
*/
|
|
25
|
-
export declare function createStaticMiddleware(options: ServerStaticOptions): Middleware;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const AGGRED_DIR: {
|
|
2
|
-
mock: string;
|
|
3
|
-
server: string;
|
|
4
|
-
api: string;
|
|
5
|
-
shared: string;
|
|
6
|
-
lambda: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const REPLACE_REG: {
|
|
9
|
-
before: {
|
|
10
|
-
head: string;
|
|
11
|
-
body: string;
|
|
12
|
-
};
|
|
13
|
-
after: {
|
|
14
|
-
head: string;
|
|
15
|
-
body: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare enum ServerTimings {
|
|
19
|
-
SERVER_HANDLE_REQUEST = "server-handle-request",
|
|
20
|
-
SERVER_MIDDLEWARE = "server-middleware",
|
|
21
|
-
SERVER_HOOK_AFTER_RENDER = "server-hook-after-render",
|
|
22
|
-
SERVER_HOOK_AFTER_MATCH = "server-hook-after-match"
|
|
23
|
-
}
|
|
24
|
-
export declare const SERVER_TIMING = "Server-Timing";
|
|
25
|
-
export declare const X_RENDER_CACHE = "x-render-cache";
|
|
26
|
-
export declare const X_MODERNJS_RENDER = "x-modernjs-render";
|
package/dist/types/context.d.ts
DELETED
package/dist/types/helper.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Context } from './types';
|
|
2
|
-
type LoaderContext = Map<string, unknown>;
|
|
3
|
-
type Var = {
|
|
4
|
-
loaderContext: LoaderContext;
|
|
5
|
-
};
|
|
6
|
-
interface Env {
|
|
7
|
-
Variables: Var;
|
|
8
|
-
}
|
|
9
|
-
export declare function getLoaderCtx(c: Context<Env>): LoaderContext;
|
|
10
|
-
export {};
|
package/dist/types/hono.d.ts
DELETED
package/dist/types/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { Hono } from 'hono';
|
|
2
|
-
export { AGGRED_DIR } from './constants';
|
|
3
|
-
export { run, useHonoContext } from './context';
|
|
4
|
-
export { getLoaderCtx } from './helper';
|
|
5
|
-
export * from './plugins';
|
|
6
|
-
export type { ServerBase, ServerBaseOptions } from './serverBase';
|
|
7
|
-
export { createServerBase } from './serverBase';
|
|
8
|
-
export type { Context, HonoRequest as InternalRequest, Middleware, MiddlewareHandler, Next, ServerEnv, ServerLoaderBundle, ServerManifest, } from './types';
|
|
9
|
-
export * from './types/config';
|
|
10
|
-
export * from './types/plugins';
|
|
11
|
-
export * from './types/render';
|
|
12
|
-
export * from './types/requestHandler';
|
|
13
|
-
export { createErrorHtml, ErrorDigest, onError } from './utils';
|
|
14
|
-
export { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths, } from './utils/publicDir';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { InternalServerContext } from '@modern-js/plugin';
|
|
2
|
-
import type { ServerPluginExtends } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* old plugin useHookRunners function result
|
|
5
|
-
*/
|
|
6
|
-
export declare function getHookRunners(context: InternalServerContext<ServerPluginExtends>): Record<string, any>;
|
|
7
|
-
export declare function transformHookRunner(hookRunnerName: string): string;
|
|
8
|
-
export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type ContractGateSnapshotStore } from './contractGateSnapshotStore';
|
|
2
|
-
import type { TelemetryCanaryOrchestrator } from './telemetry';
|
|
3
|
-
type LoggerLike = {
|
|
4
|
-
info?: (message: string) => void;
|
|
5
|
-
warn?: (message: string) => void;
|
|
6
|
-
};
|
|
7
|
-
export type ContractGateAutopilotOptions = {
|
|
8
|
-
orchestrator: TelemetryCanaryOrchestrator;
|
|
9
|
-
gateSnapshotPath?: string;
|
|
10
|
-
gateSnapshotStore?: ContractGateSnapshotStore;
|
|
11
|
-
pollIntervalMs?: number;
|
|
12
|
-
gateStaleAfterMs?: number;
|
|
13
|
-
logger?: LoggerLike;
|
|
14
|
-
};
|
|
15
|
-
export declare class ContractGateAutopilot {
|
|
16
|
-
private readonly orchestrator;
|
|
17
|
-
private readonly gateSnapshotStore;
|
|
18
|
-
private readonly gateSnapshotPath?;
|
|
19
|
-
private readonly pollIntervalMs;
|
|
20
|
-
private readonly gateStaleAfterMs;
|
|
21
|
-
private readonly logger?;
|
|
22
|
-
private poller?;
|
|
23
|
-
private lastSnapshotFingerprint?;
|
|
24
|
-
private readonly appliedGateFingerprints;
|
|
25
|
-
constructor(options: ContractGateAutopilotOptions);
|
|
26
|
-
start(): Promise<void>;
|
|
27
|
-
stop(): void;
|
|
28
|
-
syncOnce(): Promise<number>;
|
|
29
|
-
private loadSnapshot;
|
|
30
|
-
private normalizeSnapshot;
|
|
31
|
-
private normalizeGateValue;
|
|
32
|
-
private normalizeUpdatedAt;
|
|
33
|
-
private normalizeExpiresAt;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export declare const CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION = 1;
|
|
2
|
-
export declare const DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH = ".modern/contract-gates.json";
|
|
3
|
-
export type GateSnapshotGateValue = boolean | {
|
|
4
|
-
passed?: boolean;
|
|
5
|
-
reason?: string;
|
|
6
|
-
updatedAt?: number;
|
|
7
|
-
expiresAt?: number;
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
export type GateSnapshot = {
|
|
11
|
-
schemaVersion?: number;
|
|
12
|
-
updatedAt?: number;
|
|
13
|
-
gates?: Record<string, GateSnapshotGateValue>;
|
|
14
|
-
};
|
|
15
|
-
type LoggerLike = {
|
|
16
|
-
info?: (message: string) => void;
|
|
17
|
-
warn?: (message: string) => void;
|
|
18
|
-
};
|
|
19
|
-
export type ContractGateSnapshotStore = {
|
|
20
|
-
name: string;
|
|
21
|
-
readSnapshot: () => Promise<GateSnapshot | undefined>;
|
|
22
|
-
writeSnapshot: (snapshot: GateSnapshot) => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
export type ContractGateSnapshotStoreFactoryContext = {
|
|
25
|
-
appDirectory: string;
|
|
26
|
-
gateSnapshotPath: string;
|
|
27
|
-
options?: Record<string, unknown>;
|
|
28
|
-
logger?: LoggerLike;
|
|
29
|
-
};
|
|
30
|
-
export type ContractGateSnapshotStoreFactory = (context: ContractGateSnapshotStoreFactoryContext) => Promise<ContractGateSnapshotStore> | ContractGateSnapshotStore;
|
|
31
|
-
export type ContractGateSnapshotStoreModule = {
|
|
32
|
-
createContractGateSnapshotStore?: ContractGateSnapshotStoreFactory;
|
|
33
|
-
default?: ContractGateSnapshotStoreFactory | {
|
|
34
|
-
createContractGateSnapshotStore?: ContractGateSnapshotStoreFactory;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export type ContractGateSnapshotStoreUserConfig = {
|
|
38
|
-
module: string;
|
|
39
|
-
options?: Record<string, unknown>;
|
|
40
|
-
};
|
|
41
|
-
export type ContractGateSnapshotHttpStoreOptions = {
|
|
42
|
-
endpoint: string;
|
|
43
|
-
readMethod?: string;
|
|
44
|
-
writeMethod?: string;
|
|
45
|
-
headers?: Record<string, string>;
|
|
46
|
-
timeoutMs?: number;
|
|
47
|
-
};
|
|
48
|
-
export declare const createHttpContractGateSnapshotStore: (options: ContractGateSnapshotHttpStoreOptions) => ContractGateSnapshotStore;
|
|
49
|
-
export declare const resolveContractGateSnapshotPath: (appDirectory: string, configuredPath: string | undefined) => string;
|
|
50
|
-
export declare const createFileContractGateSnapshotStore: (gateSnapshotPath: string) => ContractGateSnapshotStore;
|
|
51
|
-
export declare const resolveContractGateSnapshotStore: (input: {
|
|
52
|
-
appDirectory: string;
|
|
53
|
-
gateSnapshotPath: string;
|
|
54
|
-
stateStore?: ContractGateSnapshotStoreUserConfig;
|
|
55
|
-
logger?: LoggerLike;
|
|
56
|
-
}) => Promise<ContractGateSnapshotStore>;
|
|
57
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@modern-js/types';
|
|
2
|
-
import type { ServerPlugin } from '../types';
|
|
3
|
-
import { type InjectRenderHandlerOptions } from './render';
|
|
4
|
-
export type CreateDefaultPluginsOptions = InjectRenderHandlerOptions & {
|
|
5
|
-
logger?: Logger | false;
|
|
6
|
-
};
|
|
7
|
-
export declare function createDefaultPlugins(options?: CreateDefaultPluginsOptions): ServerPlugin[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { compatPlugin, handleSetupResult } from './compat';
|
|
2
|
-
export { ContractGateAutopilot, type ContractGateAutopilotOptions, } from './contractGateAutopilot';
|
|
3
|
-
export { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION, type ContractGateSnapshotHttpStoreOptions, type ContractGateSnapshotStore, type ContractGateSnapshotStoreFactory, type ContractGateSnapshotStoreFactoryContext, type ContractGateSnapshotStoreModule, type ContractGateSnapshotStoreUserConfig, createFileContractGateSnapshotStore, createHttpContractGateSnapshotStore, DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH, type GateSnapshot, type GateSnapshotGateValue, resolveContractGateSnapshotPath, resolveContractGateSnapshotStore, } from './contractGateSnapshotStore';
|
|
4
|
-
export { type CreateDefaultPluginsOptions, createDefaultPlugins, } from './default';
|
|
5
|
-
export { faviconPlugin } from './favicon';
|
|
6
|
-
export { logPlugin } from './log';
|
|
7
|
-
export { injectConfigMiddlewarePlugin } from './middlewares';
|
|
8
|
-
export { injectloggerPlugin, injectServerTiming } from './monitors';
|
|
9
|
-
export { processedByPlugin } from './processedBy';
|
|
10
|
-
export { getRenderHandler, type InjectRenderHandlerOptions, injectRenderHandlerPlugin, renderPlugin, } from './render';
|
|
11
|
-
export { createOtlpTelemetryExporter, createRuntimeFallbackSignalRuntimeState, createRuntimeSignalError, createTelemetryAwareMetrics, createVictoriaMetricsTelemetryExporter, DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT, DEFAULT_RUNTIME_STATUS_ENDPOINT, enforceRuntimeFallbackSignalAuthToken, enforceRuntimeFallbackSignalTrustPolicy, getRuntimeSignalErrorStatusCode, hasEnabledTelemetryExporters, injectTelemetryPlugin, normalizeRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackTrustPolicy, type OtlpExporterOptions, parseRuntimeFallbackSignalPayloadFromRawBody, type RuntimeFallbackSignalAuthConfig, type RuntimeFallbackSignalRuntimeState, type RuntimeFallbackSignalTrustContext, type RuntimeFallbackSignalTrustPolicy, type RuntimeSignalError, type RuntimeSignalErrorCode, resolveRuntimeFallbackSignalEndpoint, type TelemetryCanaryDecision, TelemetryCanaryOrchestrator, type TelemetryCanaryStatusSnapshot, type TelemetryEnvelope, type TelemetryExporter, type TelemetryQueueStats, TelemetryRegistry, type TelemetryRegistryOptions, type TelemetrySignalType, type TelemetrySloAlert, TelemetryStartupHealthError, type VictoriaMetricsExporterOptions, } from './telemetry';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare function getRequestPathname(url: string): string;
|
|
2
|
-
export declare function isMfManifestAsset(pathname: string): boolean;
|
|
3
|
-
export declare function isMfRemoteEntryAsset(pathname: string): boolean;
|
|
4
|
-
export declare function resolveMfAssetCacheHeaders(url: string, query?: Record<string, unknown>): {
|
|
5
|
-
'cache-control': string;
|
|
6
|
-
pragma: string;
|
|
7
|
-
expires: string;
|
|
8
|
-
} | {
|
|
9
|
-
'cache-control': string;
|
|
10
|
-
pragma?: undefined;
|
|
11
|
-
expires?: undefined;
|
|
12
|
-
} | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@modern-js/types';
|
|
2
|
-
import type { Context, Next, ServerEnv, ServerPlugin } from '../types';
|
|
3
|
-
export declare const initMonitorsPlugin: () => ServerPlugin;
|
|
4
|
-
export declare const injectloggerPlugin: (inputLogger: Logger) => ServerPlugin;
|
|
5
|
-
export declare const injectServerTiming: () => ServerPlugin;
|
|
6
|
-
export declare function requestLatencyMiddleware(): (c: Context<ServerEnv>, next: Next) => Promise<void>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { SSRRenderOptions } from './ssrRender';
|
|
3
|
-
export declare const dataHandler: (request: Request, { routeInfo, serverRoutes, monitors, onError, onTiming, serverManifest, loaderContext, }: SSRRenderOptions & {
|
|
4
|
-
serverRoutes: ServerRoute[];
|
|
5
|
-
}) => Promise<Response | void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CacheConfig, GetRenderHandlerOptions, Render, ServerPlugin } from '../../types';
|
|
2
|
-
export interface InjectRenderHandlerOptions {
|
|
3
|
-
staticGenerate?: boolean;
|
|
4
|
-
cacheConfig?: CacheConfig;
|
|
5
|
-
}
|
|
6
|
-
export declare const injectRenderHandlerPlugin: ({ staticGenerate, cacheConfig, }: InjectRenderHandlerOptions) => ServerPlugin;
|
|
7
|
-
export declare function getRenderHandler({ pwd, routes, config, cacheConfig, metaName, staticGenerate, onFallback, }: GetRenderHandlerOptions): Promise<Render>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { CacheConfig, OnFallback, Render, UserConfig } from '../../types';
|
|
3
|
-
interface CreateRenderOptions {
|
|
4
|
-
pwd: string;
|
|
5
|
-
routes: ServerRoute[];
|
|
6
|
-
config: UserConfig;
|
|
7
|
-
cacheConfig?: CacheConfig;
|
|
8
|
-
staticGenerate?: boolean;
|
|
9
|
-
onFallback?: OnFallback;
|
|
10
|
-
metaName?: string;
|
|
11
|
-
forceCSR?: boolean;
|
|
12
|
-
forceCSRMap?: Map<string, boolean>;
|
|
13
|
-
nonce?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function createRender({ routes, pwd, metaName, staticGenerate, cacheConfig, forceCSR, forceCSRMap, config, onFallback, }: CreateRenderOptions): Promise<Render>;
|
|
16
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CacheControl, CacheOption, Container } from '@modern-js/types';
|
|
2
|
-
import type { NodeRequest } from '@modern-js/types/server';
|
|
3
|
-
import type { RequestHandler, RequestHandlerOptions } from '../../types/requestHandler';
|
|
4
|
-
export type CacheStatus = 'hit' | 'stale' | 'expired' | 'miss';
|
|
5
|
-
type MaybeAsync<T> = Promise<T> | T;
|
|
6
|
-
/**
|
|
7
|
-
* Check if a request should be processed through cache logic
|
|
8
|
-
*/
|
|
9
|
-
export declare function shouldUseCache(request: Request): boolean;
|
|
10
|
-
export declare function matchCacheControl(cacheOption?: CacheOption, req?: NodeRequest): MaybeAsync<CacheControl | undefined | false>;
|
|
11
|
-
export interface GetCacheResultOptions {
|
|
12
|
-
cacheControl: CacheControl;
|
|
13
|
-
requestHandler: RequestHandler;
|
|
14
|
-
requestHandlerOptions: RequestHandlerOptions;
|
|
15
|
-
container?: Container;
|
|
16
|
-
}
|
|
17
|
-
export declare function getCacheResult(request: Request, options: GetCacheResultOptions): Promise<Response>;
|
|
18
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Reporter, ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { Monitors, NodeRequest, ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
|
-
import type { CacheConfig, ServerManifest, UserConfig } from '../../types';
|
|
4
|
-
import type { OnError, OnTiming, Params } from '../../types/requestHandler';
|
|
5
|
-
export interface SSRRenderOptions {
|
|
6
|
-
pwd: string;
|
|
7
|
-
html: string;
|
|
8
|
-
routeInfo: ServerRoute;
|
|
9
|
-
staticGenerate: boolean;
|
|
10
|
-
config: UserConfig;
|
|
11
|
-
serverManifest: ServerManifest;
|
|
12
|
-
rscServerManifest?: RscServerManifest;
|
|
13
|
-
rscClientManifest?: RscClientManifest;
|
|
14
|
-
rscSSRManifest?: RscSSRManifest;
|
|
15
|
-
loaderContext: Map<string, unknown>;
|
|
16
|
-
params: Params;
|
|
17
|
-
/** Produce by custom server hook */
|
|
18
|
-
locals?: Record<string, any>;
|
|
19
|
-
cacheConfig?: CacheConfig;
|
|
20
|
-
nodeReq?: NodeRequest;
|
|
21
|
-
monitors: Monitors;
|
|
22
|
-
onError: OnError;
|
|
23
|
-
onTiming: OnTiming;
|
|
24
|
-
reporter?: Reporter;
|
|
25
|
-
}
|
|
26
|
-
export declare function ssrRender(request: Request, { routeInfo, html, config: userConfig, staticGenerate, nodeReq, serverManifest, rscSSRManifest, rscClientManifest, rscServerManifest, locals, params, loaderContext, monitors, cacheConfig, onError, onTiming, reporter, }: SSRRenderOptions): Promise<Response>;
|