@bleedingdev/modern-js-server-core 3.8.3-ultramodern.6 → 3.9.0-ultramodern.2
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/esm/plugins/render/render.mjs +4 -5
- package/dist/esm-node/plugins/render/render.mjs +4 -3
- package/dist/types/adapters/node/helper/index.d.ts +6 -6
- package/dist/types/adapters/node/helper/loadCache.d.ts +1 -1
- package/dist/types/adapters/node/helper/loadConfig.d.ts +1 -1
- package/dist/types/adapters/node/helper/loadEnv.d.ts +1 -1
- package/dist/types/adapters/node/helper/loadPlugin.d.ts +1 -1
- package/dist/types/adapters/node/helper/utils.d.ts +1 -1
- package/dist/types/adapters/node/hono.d.ts +2 -2
- package/dist/types/adapters/node/index.d.ts +5 -5
- package/dist/types/adapters/node/node.d.ts +1 -1
- package/dist/types/adapters/node/plugins/index.d.ts +3 -3
- package/dist/types/adapters/node/plugins/nodeServer.d.ts +1 -1
- package/dist/types/adapters/node/plugins/resource.d.ts +1 -1
- package/dist/types/adapters/node/plugins/static.d.ts +1 -1
- package/dist/types/adapters/node/plugins/staticModuleFederation.d.ts +1 -1
- package/dist/types/adapters/node/plugins/staticPrecompressed.d.ts +1 -1
- package/dist/types/adapters/node/plugins/staticServing.d.ts +1 -1
- package/dist/types/helper.d.ts +1 -1
- package/dist/types/index.d.ts +14 -14
- package/dist/types/plugins/compat/hooks.d.ts +1 -1
- package/dist/types/plugins/compat/index.d.ts +2 -2
- package/dist/types/plugins/default.d.ts +2 -2
- package/dist/types/plugins/favicon.d.ts +1 -1
- package/dist/types/plugins/index.d.ts +8 -8
- package/dist/types/plugins/log.d.ts +1 -1
- package/dist/types/plugins/middlewares.d.ts +1 -1
- package/dist/types/plugins/monitors.d.ts +1 -1
- package/dist/types/plugins/processedBy.d.ts +1 -1
- package/dist/types/plugins/render/csrRscRender.d.ts +1 -1
- package/dist/types/plugins/render/dataHandler.d.ts +1 -1
- package/dist/types/plugins/render/index.d.ts +2 -2
- package/dist/types/plugins/render/inject.d.ts +1 -1
- package/dist/types/plugins/render/render.d.ts +2 -2
- package/dist/types/plugins/render/renderRscHandler.d.ts +1 -1
- package/dist/types/plugins/render/serverActionHandler.d.ts +1 -1
- package/dist/types/plugins/render/ssrCache.d.ts +1 -1
- package/dist/types/plugins/render/ssrRender.d.ts +2 -2
- package/dist/types/plugins/render/utils.d.ts +2 -2
- package/dist/types/plugins/route.d.ts +1 -1
- package/dist/types/serverBase.d.ts +3 -3
- package/dist/types/types/config/bff.d.ts +2 -2
- package/dist/types/types/config/index.d.ts +14 -14
- package/dist/types/types/config/server.d.ts +2 -2
- package/dist/types/types/config/source.d.ts +1 -1
- package/dist/types/types/index.d.ts +4 -4
- package/dist/types/types/plugins/base.d.ts +3 -3
- package/dist/types/types/plugins/index.d.ts +2 -2
- package/dist/types/types/plugins/plugin.d.ts +1 -1
- package/dist/types/types/render.d.ts +1 -1
- package/dist/types/types/requestHandler.d.ts +1 -1
- package/dist/types/types/server.d.ts +1 -1
- package/dist/types/utils/index.d.ts +9 -9
- package/dist/types/utils/publicDir.d.ts +1 -1
- package/dist/types/utils/serverConfig.d.ts +1 -1
- package/package.json +9 -9
- /package/dist/esm/{rslib-runtime.mjs → rslib-runtime~1.mjs} +0 -0
- /package/dist/esm-node/{rslib-runtime.mjs → rslib-runtime~0.mjs} +0 -0
|
@@ -7,11 +7,10 @@ import { dataHandler } from "./dataHandler.mjs";
|
|
|
7
7
|
import { renderRscHandler } from "./renderRscHandler.mjs";
|
|
8
8
|
import { serverActionHandler } from "./serverActionHandler.mjs";
|
|
9
9
|
import { ssrRender } from "./ssrRender.mjs";
|
|
10
|
-
import { __webpack_require__ } from "../../rslib-runtime.mjs";
|
|
11
|
-
import * as __rspack_external__modern_js_runtime_utils_router_4aa9f9b0 from "@modern-js/runtime-utils/router";
|
|
10
|
+
import { __webpack_require__ } from "../../rslib-runtime~1.mjs";
|
|
12
11
|
__webpack_require__.add({
|
|
13
|
-
|
|
14
|
-
module.exports =
|
|
12
|
+
718 (module) {
|
|
13
|
+
module.exports = require("@modern-js/runtime-utils/router");
|
|
15
14
|
}
|
|
16
15
|
});
|
|
17
16
|
const DYNAMIC_ROUTE_REG = /\/:./;
|
|
@@ -164,7 +163,7 @@ async function renderHandler(request, options, mode, fallbackWrapper, framework)
|
|
|
164
163
|
const { nestedRoutesJson } = serverManifest;
|
|
165
164
|
const routes = nestedRoutesJson?.[options.routeInfo.entryName];
|
|
166
165
|
if (routes) {
|
|
167
|
-
const { matchRoutes } = __webpack_require__(
|
|
166
|
+
const { matchRoutes } = __webpack_require__(718);
|
|
168
167
|
const url = new URL(request.url);
|
|
169
168
|
const matchedRoutes = matchRoutes(routes, url.pathname, options.routeInfo.urlPath);
|
|
170
169
|
if (matchedRoutes) {
|
|
@@ -8,11 +8,12 @@ import { dataHandler } from "./dataHandler.mjs";
|
|
|
8
8
|
import { renderRscHandler } from "./renderRscHandler.mjs";
|
|
9
9
|
import { serverActionHandler } from "./serverActionHandler.mjs";
|
|
10
10
|
import { ssrRender } from "./ssrRender.mjs";
|
|
11
|
-
import { __webpack_require__ } from "../../rslib-runtime.mjs";
|
|
12
|
-
import
|
|
11
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.mjs";
|
|
12
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
13
|
+
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
13
14
|
__webpack_require__.add({
|
|
14
15
|
"@modern-js/runtime-utils/router" (module) {
|
|
15
|
-
module.exports =
|
|
16
|
+
module.exports = __rspack_createRequire_require("@modern-js/runtime-utils/router");
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
19
|
const DYNAMIC_ROUTE_REG = /\/:./;
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
+
export { loadCacheConfig } from './loadCache.js';
|
|
2
|
+
export { loadServerCliConfig, loadServerRuntimeConfig } from './loadConfig.js';
|
|
3
|
+
export { loadServerEnv } from './loadEnv.js';
|
|
4
|
+
export { loadServerPlugins } from './loadPlugin.js';
|
|
5
|
+
export type { NodeBindings } from './utils.js';
|
|
6
|
+
export { isResFinalized } from './utils.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CacheConfig } from '../../../types';
|
|
1
|
+
import type { CacheConfig } from '../../../types/index.js';
|
|
2
2
|
export declare function loadCacheConfig(pwd: string): Promise<CacheConfig | undefined>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CliConfig, ServerConfig, UserConfig } from '../../../types';
|
|
1
|
+
import type { CliConfig, ServerConfig, UserConfig } from '../../../types/index.js';
|
|
2
2
|
export declare function loadServerRuntimeConfig(serverConfigPath: string): Promise<ServerConfig | undefined>;
|
|
3
3
|
export declare function loadServerCliConfig(pwd: string, defaultConfig?: UserConfig): CliConfig;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ServerPlugin } from '@modern-js/types';
|
|
2
|
-
import type { ServerPlugin as ServerPluginInstance } from '../../../types';
|
|
2
|
+
import type { ServerPlugin as ServerPluginInstance } from '../../../types/index.js';
|
|
3
3
|
export declare function loadServerPlugins(serverPlugins: ServerPlugin[], appDirectory: string): Promise<ServerPluginInstance[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientManifest, NodeRequest, NodeResponse, SSRManifest } from '@modern-js/types/server';
|
|
2
|
-
import type { HonoRequest, ServerManifest } from '../../../types';
|
|
2
|
+
import type { HonoRequest, ServerManifest } from '../../../types/index.js';
|
|
3
3
|
type ExtendedNodeRequest = NodeRequest & {
|
|
4
4
|
__honoRequest?: HonoRequest;
|
|
5
5
|
__templates?: Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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';
|
|
2
|
+
import type { Context, Middleware, Next, ServerEnv } from '../../types/index.js';
|
|
3
|
+
import { type NodeBindings } from './helper/index.js';
|
|
4
4
|
export type ServerNodeEnv = {
|
|
5
5
|
Bindings: NodeBindings;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
+
export { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig, } from './helper/index.js';
|
|
2
|
+
export type { ServerNodeContext, ServerNodeMiddleware } from './hono.js';
|
|
3
|
+
export { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid, } from './hono.js';
|
|
4
|
+
export { createNodeServer, createWebRequest, sendResponse, } from './node.js';
|
|
5
|
+
export { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin, } from './plugins/index.js';
|
|
@@ -2,7 +2,7 @@ import { type Server as NodeServer } from 'node:http';
|
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
3
|
import type { Server as NodeHttpsServer } from 'node:https';
|
|
4
4
|
import type { NodeRequest, NodeResponse } from '@modern-js/types/server';
|
|
5
|
-
import type { RequestHandler } from '../../types';
|
|
5
|
+
import type { RequestHandler } from '../../types/index.js';
|
|
6
6
|
export declare const createWebRequest: (req: NodeRequest, res: NodeResponse, body?: BodyInit) => Request;
|
|
7
7
|
export declare const sendResponse: (response: Response, res: NodeResponse) => Promise<void>;
|
|
8
8
|
declare const getRequestListener: (handler: RequestHandler) => (req: NodeRequest, res: NodeResponse) => Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './nodeServer';
|
|
2
|
-
export * from './resource';
|
|
3
|
-
export * from './static';
|
|
1
|
+
export * from './nodeServer.js';
|
|
2
|
+
export * from './resource.js';
|
|
3
|
+
export * from './static.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server as NodeServer } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type { ServerPlugin } from '../../../types';
|
|
3
|
+
import type { ServerPlugin } from '../../../types/index.js';
|
|
4
4
|
export declare const injectNodeSeverPlugin: ({ nodeServer, }: {
|
|
5
5
|
nodeServer: NodeServer | Http2SecureServer;
|
|
6
6
|
}) => ServerPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Monitors, ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { Middleware, ServerEnv, ServerManifest, ServerPlugin } from '../../../types';
|
|
2
|
+
import type { Middleware, ServerEnv, ServerManifest, ServerPlugin } from '../../../types/index.js';
|
|
3
3
|
export declare function getHtmlTemplates(pwd: string, routes: ServerRoute[]): Promise<Record<string, string>>;
|
|
4
4
|
export declare function injectTemplates(pwd: string, routes?: ServerRoute[], htmlTemplatePromise?: ReturnType<typeof getHtmlTemplates>): Middleware<ServerEnv>;
|
|
5
5
|
export declare function getServerManifest(pwd: string, routes: ServerRoute[], monitors?: Monitors): Promise<ServerManifest>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { HtmlNormalizedConfig, Middleware, OutputNormalizedConfig, ServerNormalizedConfig, ServerPlugin } from '../../../types';
|
|
2
|
+
import type { HtmlNormalizedConfig, Middleware, OutputNormalizedConfig, ServerNormalizedConfig, ServerPlugin } from '../../../types/index.js';
|
|
3
3
|
export declare const serverStaticPlugin: () => ServerPlugin;
|
|
4
4
|
export type PublicMiddlwareOptions = {
|
|
5
5
|
pwd: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { Middleware } from '../../../types';
|
|
2
|
+
import type { Middleware } from '../../../types/index.js';
|
|
3
3
|
type MiddlewareContext = Parameters<Middleware>[0];
|
|
4
4
|
type StaticServingRequest = {
|
|
5
5
|
requestPath: string;
|
package/dist/types/helper.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
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 type { SafeFailureEnvelope, SafeFailureHttpResult } from './utils';
|
|
14
|
-
export { createErrorHtml, createSafeFailureHttpResult, createSafeJsonFailureResponse, ErrorDigest, getSafeFailureStatus, onError, } from './utils';
|
|
15
|
-
export { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths, } from './utils/publicDir';
|
|
2
|
+
export { AGGRED_DIR } from './constants.js';
|
|
3
|
+
export { run, useHonoContext } from './context.js';
|
|
4
|
+
export { getLoaderCtx } from './helper.js';
|
|
5
|
+
export * from './plugins/index.js';
|
|
6
|
+
export type { ServerBase, ServerBaseOptions } from './serverBase.js';
|
|
7
|
+
export { createServerBase } from './serverBase.js';
|
|
8
|
+
export type { Context, HonoRequest as InternalRequest, Middleware, MiddlewareHandler, Next, ServerEnv, ServerLoaderBundle, ServerManifest, } from './types/index.js';
|
|
9
|
+
export * from './types/config/index.js';
|
|
10
|
+
export * from './types/plugins/index.js';
|
|
11
|
+
export * from './types/render.js';
|
|
12
|
+
export * from './types/requestHandler.js';
|
|
13
|
+
export type { SafeFailureEnvelope, SafeFailureHttpResult } from './utils/index.js';
|
|
14
|
+
export { createErrorHtml, createSafeFailureHttpResult, createSafeJsonFailureResponse, ErrorDigest, getSafeFailureStatus, onError, } from './utils/index.js';
|
|
15
|
+
export { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths, } from './utils/publicDir.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../../types';
|
|
2
|
-
export { handleSetupResult } from './hooks';
|
|
1
|
+
import type { ServerPlugin } from '../../types/index.js';
|
|
2
|
+
export { handleSetupResult } from './hooks.js';
|
|
3
3
|
export declare const compatPlugin: () => ServerPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@modern-js/types';
|
|
2
|
-
import type { ServerPlugin } from '../types';
|
|
3
|
-
import { type InjectRenderHandlerOptions } from './render';
|
|
2
|
+
import type { ServerPlugin } from '../types/index.js';
|
|
3
|
+
import { type InjectRenderHandlerOptions } from './render/index.js';
|
|
4
4
|
export type CreateDefaultPluginsOptions = InjectRenderHandlerOptions & {
|
|
5
5
|
logger?: Logger | false;
|
|
6
6
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../types';
|
|
1
|
+
import type { ServerPlugin } from '../types/index.js';
|
|
2
2
|
export declare const faviconPlugin: () => ServerPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { compatPlugin, handleSetupResult } from './compat';
|
|
2
|
-
export { type CreateDefaultPluginsOptions, createDefaultPlugins, } from './default';
|
|
3
|
-
export { faviconPlugin } from './favicon';
|
|
4
|
-
export { logPlugin } from './log';
|
|
5
|
-
export { injectConfigMiddlewarePlugin } from './middlewares';
|
|
6
|
-
export { injectloggerPlugin, injectServerTiming } from './monitors';
|
|
7
|
-
export { processedByPlugin } from './processedBy';
|
|
8
|
-
export { getRenderHandler, type InjectRenderHandlerOptions, injectRenderHandlerPlugin, renderPlugin, } from './render';
|
|
1
|
+
export { compatPlugin, handleSetupResult } from './compat/index.js';
|
|
2
|
+
export { type CreateDefaultPluginsOptions, createDefaultPlugins, } from './default.js';
|
|
3
|
+
export { faviconPlugin } from './favicon.js';
|
|
4
|
+
export { logPlugin } from './log.js';
|
|
5
|
+
export { injectConfigMiddlewarePlugin } from './middlewares.js';
|
|
6
|
+
export { injectloggerPlugin, injectServerTiming } from './monitors.js';
|
|
7
|
+
export { processedByPlugin } from './processedBy.js';
|
|
8
|
+
export { getRenderHandler, type InjectRenderHandlerOptions, injectRenderHandlerPlugin, renderPlugin, } from './render/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../types';
|
|
1
|
+
import type { ServerPlugin } from '../types/index.js';
|
|
2
2
|
export declare const logPlugin: () => ServerPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MiddlewareObj, ServerPlugin } from '../types';
|
|
1
|
+
import type { MiddlewareObj, ServerPlugin } from '../types/index.js';
|
|
2
2
|
export declare const injectConfigMiddlewarePlugin: (configMiddlewares?: MiddlewareObj[], configRenderMiddlewares?: MiddlewareObj[]) => ServerPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger } from '@modern-js/types';
|
|
2
|
-
import type { Context, Next, ServerEnv, ServerPlugin } from '../types';
|
|
2
|
+
import type { Context, Next, ServerEnv, ServerPlugin } from '../types/index.js';
|
|
3
3
|
export declare const initMonitorsPlugin: () => ServerPlugin;
|
|
4
4
|
export declare const injectloggerPlugin: (inputLogger: Logger) => ServerPlugin;
|
|
5
5
|
export declare const injectServerTiming: () => ServerPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../types';
|
|
1
|
+
import type { ServerPlugin } from '../types/index.js';
|
|
2
2
|
export declare const processedByPlugin: () => ServerPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SSRRenderOptions } from './ssrRender';
|
|
1
|
+
import type { SSRRenderOptions } from './ssrRender.js';
|
|
2
2
|
export declare const csrRscRender: (req: Request, options: SSRRenderOptions) => Promise<Response>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { SSRRenderOptions } from './ssrRender';
|
|
2
|
+
import type { SSRRenderOptions } from './ssrRender.js';
|
|
3
3
|
export declare const dataHandler: (request: Request, { routeInfo, serverRoutes, monitors, onError, onTiming, serverManifest, loaderContext, serverContext, reporter, }: SSRRenderOptions & {
|
|
4
4
|
serverRoutes: ServerRoute[];
|
|
5
5
|
}) => Promise<Response | void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../../types';
|
|
2
|
-
export * from './inject';
|
|
1
|
+
import type { ServerPlugin } from '../../types/index.js';
|
|
2
|
+
export * from './inject.js';
|
|
3
3
|
export declare const renderPlugin: () => ServerPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CacheConfig, GetRenderHandlerOptions, Render, ServerPlugin } from '../../types';
|
|
1
|
+
import type { CacheConfig, GetRenderHandlerOptions, Render, ServerPlugin } from '../../types/index.js';
|
|
2
2
|
export interface InjectRenderHandlerOptions {
|
|
3
3
|
staticGenerate?: boolean;
|
|
4
4
|
cacheConfig?: CacheConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Router } from 'hono/router';
|
|
3
|
-
import type { CacheConfig, Render, UserConfig } from '../../types';
|
|
4
|
-
import type { Params } from '../../types/requestHandler';
|
|
3
|
+
import type { CacheConfig, Render, UserConfig } from '../../types/index.js';
|
|
4
|
+
import type { Params } from '../../types/requestHandler.js';
|
|
5
5
|
interface CreateRenderOptions {
|
|
6
6
|
pwd: string;
|
|
7
7
|
routes: ServerRoute[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SSRRenderOptions } from './ssrRender';
|
|
1
|
+
import type { SSRRenderOptions } from './ssrRender.js';
|
|
2
2
|
export declare const renderRscHandler: (req: Request, options: SSRRenderOptions) => Promise<Response>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SSRRenderOptions } from './ssrRender';
|
|
1
|
+
import type { SSRRenderOptions } from './ssrRender.js';
|
|
2
2
|
export declare const serverActionHandler: (req: Request, { serverManifest, routeInfo, rscClientManifest }: SSRRenderOptions) => Promise<Response>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CacheControl, CacheOption, Container } from '@modern-js/types';
|
|
2
2
|
import type { NodeRequest } from '@modern-js/types/server';
|
|
3
|
-
import type { RequestHandler, RequestHandlerOptions } from '../../types/requestHandler';
|
|
3
|
+
import type { RequestHandler, RequestHandlerOptions } from '../../types/requestHandler.js';
|
|
4
4
|
export type CacheStatus = 'hit' | 'stale' | 'expired' | 'miss';
|
|
5
5
|
type MaybeAsync<T> = Promise<T> | T;
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Reporter, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Monitors, NodeRequest, ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
|
-
import type { CacheConfig, Context, ServerManifest, UserConfig } from '../../types';
|
|
4
|
-
import type { OnError, OnTiming, Params } from '../../types/requestHandler';
|
|
3
|
+
import type { CacheConfig, Context, ServerManifest, UserConfig } from '../../types/index.js';
|
|
4
|
+
import type { OnError, OnTiming, Params } from '../../types/requestHandler.js';
|
|
5
5
|
export interface SSRRenderOptions {
|
|
6
6
|
pwd: string;
|
|
7
7
|
html: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { UserConfig } from '../../types';
|
|
2
|
-
import type { RequestHandlerConfig } from '../../types/requestHandler';
|
|
1
|
+
import type { UserConfig } from '../../types/index.js';
|
|
2
|
+
import type { RequestHandlerConfig } from '../../types/requestHandler.js';
|
|
3
3
|
export declare function createRequestHandlerConfig(userConfig: UserConfig): RequestHandlerConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServerPlugin } from '../types';
|
|
1
|
+
import type { ServerPlugin } from '../types/index.js';
|
|
2
2
|
export declare const injectRoutePlugin: () => ServerPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ServerCreateOptions } from '@modern-js/plugin/server';
|
|
2
|
-
import type { Env, ServerConfig, ServerPlugin, ServerPluginHooks } from './types';
|
|
3
|
-
import type { CliConfig } from './types/config';
|
|
2
|
+
import type { Env, ServerConfig, ServerPlugin, ServerPluginHooks } from './types/index.js';
|
|
3
|
+
import type { CliConfig } from './types/config/index.js';
|
|
4
4
|
export interface ServerBaseOptions extends ServerCreateOptions {
|
|
5
5
|
/** server working directory, and then also dist directory */
|
|
6
6
|
config: CliConfig;
|
|
@@ -30,7 +30,7 @@ export declare class ServerBase<E extends Env = any> {
|
|
|
30
30
|
get put(): import("hono/types").HandlerInterface<E, "put", import("hono/types").BlankSchema, "/", "/">;
|
|
31
31
|
get delete(): import("hono/types").HandlerInterface<E, "delete", import("hono/types").BlankSchema, "/", "/">;
|
|
32
32
|
get patch(): import("hono/types").HandlerInterface<E, "patch", import("hono/types").BlankSchema, "/", "/">;
|
|
33
|
-
get handle(): (request: Request,
|
|
33
|
+
get handle(): (request: Request, env?: {} | E["Bindings"] | undefined, executionCtx?: import("hono").ExecutionContext) => Response | Promise<Response>;
|
|
34
34
|
get request(): (input: Request | string | URL, requestInit?: RequestInit, Env?: {} | E["Bindings"] | undefined, executionCtx?: import("hono").ExecutionContext) => Response | Promise<Response>;
|
|
35
35
|
get notFound(): (handler: import("hono").NotFoundHandler<E>) => import("hono/hono-base").HonoBase<E, import("hono/types").BlankSchema, "/", "/">;
|
|
36
36
|
get onError(): (handler: import("hono").ErrorHandler<E>) => import("hono/hono-base").HonoBase<E, import("hono/types").BlankSchema, "/", "/">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HttpMethodDecider } from '@modern-js/types';
|
|
2
|
-
import type { BffCrossProjectPolicyUserConfig, BffEffectUserConfig, BffRuntimeFramework } from './bffRuntime';
|
|
3
|
-
export type { BffCrossProjectPolicyUserConfig, BffEffectDataPlatformBatchUserConfig, BffEffectDataPlatformSelectionUserConfig, BffEffectDataPlatformUserConfig, BffEffectOpenApiUserConfig, BffEffectUserConfig, BffRuntimeFramework, } from './bffRuntime';
|
|
2
|
+
import type { BffCrossProjectPolicyUserConfig, BffEffectUserConfig, BffRuntimeFramework } from './bffRuntime.js';
|
|
3
|
+
export type { BffCrossProjectPolicyUserConfig, BffEffectDataPlatformBatchUserConfig, BffEffectDataPlatformSelectionUserConfig, BffEffectDataPlatformUserConfig, BffEffectOpenApiUserConfig, BffEffectUserConfig, BffRuntimeFramework, } from './bffRuntime.js';
|
|
4
4
|
export interface BffUserConfig {
|
|
5
5
|
prefix?: string | string[];
|
|
6
6
|
httpMethodDecider?: HttpMethodDecider;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { BffNormalizedConfig, BffUserConfig } from './bff';
|
|
2
|
-
import type { DevNormalizedConfig, DevUserConfig } from './dev';
|
|
3
|
-
import type { HtmlNormalizedConfig, HtmlUserConfig } from './html';
|
|
4
|
-
import type { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
5
|
-
import type { SecurityNormalizedConfig, SecurityUserConfig } from './security';
|
|
6
|
-
import type { ServerNormalizedConfig, ServerUserConfig } from './server';
|
|
7
|
-
import type { SourceNormalizedConfig, SourceUserConfig } from './source';
|
|
8
|
-
import type { ToolsNormalizedConfig, ToolsUserConfig } from './tools';
|
|
9
|
-
export * from './bff';
|
|
10
|
-
export * from './html';
|
|
11
|
-
export * from './output';
|
|
12
|
-
export * from './server';
|
|
13
|
-
export * from './source';
|
|
14
|
-
export * from './tools';
|
|
1
|
+
import type { BffNormalizedConfig, BffUserConfig } from './bff.js';
|
|
2
|
+
import type { DevNormalizedConfig, DevUserConfig } from './dev.js';
|
|
3
|
+
import type { HtmlNormalizedConfig, HtmlUserConfig } from './html.js';
|
|
4
|
+
import type { OutputNormalizedConfig, OutputUserConfig } from './output.js';
|
|
5
|
+
import type { SecurityNormalizedConfig, SecurityUserConfig } from './security.js';
|
|
6
|
+
import type { ServerNormalizedConfig, ServerUserConfig } from './server.js';
|
|
7
|
+
import type { SourceNormalizedConfig, SourceUserConfig } from './source.js';
|
|
8
|
+
import type { ToolsNormalizedConfig, ToolsUserConfig } from './tools.js';
|
|
9
|
+
export * from './bff.js';
|
|
10
|
+
export * from './html.js';
|
|
11
|
+
export * from './output.js';
|
|
12
|
+
export * from './server.js';
|
|
13
|
+
export * from './source.js';
|
|
14
|
+
export * from './tools.js';
|
|
15
15
|
export interface UserConfig {
|
|
16
16
|
output?: OutputUserConfig;
|
|
17
17
|
source?: SourceUserConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SSRMode } from '@modern-js/types';
|
|
2
2
|
import type { WatchOptions } from '@modern-js/utils';
|
|
3
|
-
import type { ServerTelemetryUserConfig } from './serverTelemetry';
|
|
4
|
-
export type { ServerTelemetryCanaryAutopilotStateStoreUserConfig, ServerTelemetryCanaryAutopilotUserConfig, ServerTelemetryCanaryContractGateUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalAuthUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalTrustPolicyUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalUserConfig, ServerTelemetryCanaryUserConfig, ServerTelemetryExporterOptions, ServerTelemetrySloUserConfig, ServerTelemetryUserConfig, ServerTelemetryVictoriaMetricsOptions, } from './serverTelemetry';
|
|
3
|
+
import type { ServerTelemetryUserConfig } from './serverTelemetry.js';
|
|
4
|
+
export type { ServerTelemetryCanaryAutopilotStateStoreUserConfig, ServerTelemetryCanaryAutopilotUserConfig, ServerTelemetryCanaryContractGateUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalAuthUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalTrustPolicyUserConfig, ServerTelemetryCanaryRuntimeFallbackSignalUserConfig, ServerTelemetryCanaryUserConfig, ServerTelemetryExporterOptions, ServerTelemetrySloUserConfig, ServerTelemetryUserConfig, ServerTelemetryVictoriaMetricsOptions, } from './serverTelemetry.js';
|
|
5
5
|
type Route = string | string[] | {
|
|
6
6
|
route?: string | string[];
|
|
7
7
|
disableSpa?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './config';
|
|
2
|
-
export * from './plugins';
|
|
3
|
-
export * from './render';
|
|
4
|
-
export * from './server';
|
|
1
|
+
export * from './config/index.js';
|
|
2
|
+
export * from './plugins/index.js';
|
|
3
|
+
export * from './render.js';
|
|
4
|
+
export * from './server.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CacheOption, Container, HttpMethodDecider, MiddlewareContext, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Context, MiddlewareHandler } from 'hono';
|
|
3
|
-
import type { UserConfig } from '../config';
|
|
4
|
-
import type { Render } from '../render';
|
|
5
|
-
import type { ServerPlugin } from './plugin';
|
|
3
|
+
import type { UserConfig } from '../config/index.js';
|
|
4
|
+
import type { Render } from '../render.js';
|
|
5
|
+
import type { ServerPlugin } from './plugin.js';
|
|
6
6
|
export type { FileChangeEvent, ResetEvent } from '@modern-js/plugin';
|
|
7
7
|
export type APIServerStartInput = {
|
|
8
8
|
pwd: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { APIServerStartInput, CacheConfig, FileChangeEvent, GetRenderHandlerOptions, MiddlewareObj, ServerConfig, ServerMiddleware, WebServerStartInput, } from './base';
|
|
2
|
-
export * from './plugin';
|
|
1
|
+
export type { APIServerStartInput, CacheConfig, FileChangeEvent, GetRenderHandlerOptions, MiddlewareObj, ServerConfig, ServerMiddleware, WebServerStartInput, } from './base.js';
|
|
2
|
+
export * from './plugin.js';
|
|
@@ -2,7 +2,7 @@ import type { AsyncPipelineHook, ServerContext as BaseServerContext, ServerPlugi
|
|
|
2
2
|
import type { Hooks } from '@modern-js/plugin/server';
|
|
3
3
|
import type { AfterMatchContext, AfterRenderContext, AfterStreamingRenderContext } from '@modern-js/types';
|
|
4
4
|
import type { MiddlewareHandler } from 'hono';
|
|
5
|
-
import type { APIServerStartInput, MiddlewareObj, ServerConfig, WebAdapter, WebServerStartInput } from './base';
|
|
5
|
+
import type { APIServerStartInput, MiddlewareObj, ServerConfig, WebAdapter, WebServerStartInput } from './base.js';
|
|
6
6
|
export type PrepareWebServerFn = (input: WebServerStartInput) => Promise<WebAdapter | null>;
|
|
7
7
|
export type PrepareApiServerFn = (input: APIServerStartInput) => Promise<MiddlewareHandler>;
|
|
8
8
|
export type AfterMatchFn = (ctx: AfterMatchContext) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Monitors, Reporter, ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types';
|
|
2
2
|
import type { NodeRequest } from '@modern-js/types/server';
|
|
3
|
-
import type { Context, ServerManifest } from './server';
|
|
3
|
+
import type { Context, ServerManifest } from './server.js';
|
|
4
4
|
export interface RenderOptions {
|
|
5
5
|
monitors: Monitors;
|
|
6
6
|
loaderContext?: Map<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Reporter, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Monitors, ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
|
-
import type { ServerUserConfig, SourceUserConfig } from './config';
|
|
3
|
+
import type { ServerUserConfig, SourceUserConfig } from './config/index.js';
|
|
4
4
|
export type Resource = {
|
|
5
5
|
loadableStats: Record<string, any>;
|
|
6
6
|
routeManifest: Record<string, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger, Metrics, Monitors, NestedRoute, Reporter, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
|
-
import type { RequestHandler as BundleRequestHandler, OnError, OnTiming, RequestHandlerOptions, Resource } from './requestHandler';
|
|
3
|
+
import type { RequestHandler as BundleRequestHandler, OnError, OnTiming, RequestHandlerOptions, Resource } from './requestHandler.js';
|
|
4
4
|
export type RequestHandler = (request: Request, ...args: any[]) => Response | Promise<Response>;
|
|
5
5
|
export type ServerLoaderBundle = {
|
|
6
6
|
routes: NestedRoute[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './entry';
|
|
2
|
-
export * from './env';
|
|
3
|
-
export * from './error';
|
|
4
|
-
export * from './middlewareCollector';
|
|
5
|
-
export * from './publicDir';
|
|
6
|
-
export * from './request';
|
|
7
|
-
export * from './serverConfig';
|
|
8
|
-
export * from './transformStream';
|
|
9
|
-
export * from './warmup';
|
|
1
|
+
export * from './entry.js';
|
|
2
|
+
export * from './env.js';
|
|
3
|
+
export * from './error.js';
|
|
4
|
+
export * from './middlewareCollector.js';
|
|
5
|
+
export * from './publicDir.js';
|
|
6
|
+
export * from './request.js';
|
|
7
|
+
export * from './serverConfig.js';
|
|
8
|
+
export * from './transformStream.js';
|
|
9
|
+
export * from './warmup.js';
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.
|
|
20
|
+
"version": "3.9.0-ultramodern.2",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -66,26 +66,26 @@
|
|
|
66
66
|
"node": ">=20"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.
|
|
70
|
-
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.
|
|
71
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.
|
|
72
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.
|
|
69
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.2",
|
|
70
|
+
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.2",
|
|
71
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.2",
|
|
72
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.2",
|
|
73
73
|
"@swc/helpers": "^0.5.23",
|
|
74
74
|
"@web-std/fetch": "^4.2.1",
|
|
75
75
|
"@web-std/file": "^3.0.3",
|
|
76
76
|
"@web-std/stream": "^1.0.3",
|
|
77
77
|
"cloneable-readable": "^3.0.0",
|
|
78
78
|
"flatted": "^3.4.4",
|
|
79
|
-
"hono": "^4.
|
|
79
|
+
"hono": "^4.13.7",
|
|
80
80
|
"ts-deepmerge": "8.0.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.
|
|
84
|
-
"@rslib/core": "0.
|
|
83
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.2",
|
|
84
|
+
"@rslib/core": "1.0.0",
|
|
85
85
|
"@scripts/rstest-config": "2.66.0",
|
|
86
86
|
"@types/cloneable-readable": "^2.0.3",
|
|
87
87
|
"@types/merge-deep": "^3.0.3",
|
|
88
|
-
"@types/node": "^26.
|
|
88
|
+
"@types/node": "^26.4.1",
|
|
89
89
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
90
90
|
"http-proxy-middleware": "^4.2.0",
|
|
91
91
|
"typescript": "^7.0.2"
|
|
File without changes
|
|
File without changes
|