@modern-js/server-core 3.9.0 → 3.9.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/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/helper.d.ts +1 -1
- package/dist/types/index.d.ts +13 -13
- 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 +3 -3
- 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 +2 -2
- package/dist/types/types/config/index.d.ts +14 -14
- 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 +2 -2
- 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 +6 -6
- /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 = /\/:./;
|
|
@@ -163,7 +162,7 @@ async function renderHandler(request, options, mode, fallbackWrapper, framework)
|
|
|
163
162
|
const { nestedRoutesJson } = serverManifest;
|
|
164
163
|
const routes = nestedRoutesJson?.[options.routeInfo.entryName];
|
|
165
164
|
if (routes) {
|
|
166
|
-
const { matchRoutes } = __webpack_require__(
|
|
165
|
+
const { matchRoutes } = __webpack_require__(718);
|
|
167
166
|
const url = new URL(request.url);
|
|
168
167
|
const matchedRoutes = matchRoutes(routes, url.pathname, options.routeInfo.urlPath);
|
|
169
168
|
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 { loadServerEnv } from './loadEnv';
|
|
2
|
-
export { loadServerPlugins } from './loadPlugin';
|
|
3
|
-
export { loadServerRuntimeConfig, loadServerCliConfig } from './loadConfig';
|
|
4
|
-
export { loadCacheConfig } from './loadCache';
|
|
5
|
-
export { isResFinalized } from './utils';
|
|
6
|
-
export type { NodeBindings } from './utils';
|
|
1
|
+
export { loadServerEnv } from './loadEnv.js';
|
|
2
|
+
export { loadServerPlugins } from './loadPlugin.js';
|
|
3
|
+
export { loadServerRuntimeConfig, loadServerCliConfig } from './loadConfig.js';
|
|
4
|
+
export { loadCacheConfig } from './loadCache.js';
|
|
5
|
+
export { isResFinalized } from './utils.js';
|
|
6
|
+
export type { NodeBindings } 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 { httpCallBack2HonoMid, connectMid2HonoMid, connectMockMid2HonoMid, } from './hono';
|
|
2
|
-
export type { ServerNodeContext, ServerNodeMiddleware } from './hono';
|
|
3
|
-
export { createNodeServer, sendResponse, createWebRequest, } from './node';
|
|
4
|
-
export { serverStaticPlugin, injectResourcePlugin, getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectRscManifestPlugin, } from './plugins';
|
|
5
|
-
export { loadServerPlugins, loadServerEnv, loadServerRuntimeConfig, loadServerCliConfig, loadCacheConfig, } from './helper';
|
|
1
|
+
export { httpCallBack2HonoMid, connectMid2HonoMid, connectMockMid2HonoMid, } from './hono.js';
|
|
2
|
+
export type { ServerNodeContext, ServerNodeMiddleware } from './hono.js';
|
|
3
|
+
export { createNodeServer, sendResponse, createWebRequest, } from './node.js';
|
|
4
|
+
export { serverStaticPlugin, injectResourcePlugin, getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectRscManifestPlugin, } from './plugins/index.js';
|
|
5
|
+
export { loadServerPlugins, loadServerEnv, loadServerRuntimeConfig, loadServerCliConfig, loadCacheConfig, } from './helper/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 './static';
|
|
2
|
-
export * from './resource';
|
|
3
|
-
export * from './nodeServer';
|
|
1
|
+
export * from './static.js';
|
|
2
|
+
export * from './resource.js';
|
|
3
|
+
export * from './nodeServer.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;
|
package/dist/types/helper.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { createErrorHtml, onError, ErrorDigest } from './utils';
|
|
2
|
-
export { normalizePublicDir, normalizePublicDirPath, getPublicDirRoutePrefixes, getPublicDirPatterns, resolvePublicDirPaths, getPublicDirConfig, } from './utils/publicDir';
|
|
3
|
-
export { AGGRED_DIR } from './constants';
|
|
4
|
-
export type { ServerBase, ServerBaseOptions } from './serverBase';
|
|
5
|
-
export { createServerBase } from './serverBase';
|
|
6
|
-
export { run, useHonoContext } from './context';
|
|
1
|
+
export { createErrorHtml, onError, ErrorDigest } from './utils/index.js';
|
|
2
|
+
export { normalizePublicDir, normalizePublicDirPath, getPublicDirRoutePrefixes, getPublicDirPatterns, resolvePublicDirPaths, getPublicDirConfig, } from './utils/publicDir.js';
|
|
3
|
+
export { AGGRED_DIR } from './constants.js';
|
|
4
|
+
export type { ServerBase, ServerBaseOptions } from './serverBase.js';
|
|
5
|
+
export { createServerBase } from './serverBase.js';
|
|
6
|
+
export { run, useHonoContext } from './context.js';
|
|
7
7
|
export { Hono } from 'hono';
|
|
8
|
-
export type { Middleware, MiddlewareHandler, Context, Next, HonoRequest as InternalRequest, ServerEnv, ServerManifest, ServerLoaderBundle, } from './types';
|
|
9
|
-
export { getLoaderCtx } from './helper';
|
|
10
|
-
export * from './plugins';
|
|
11
|
-
export * from './types/plugins';
|
|
12
|
-
export * from './types/render';
|
|
13
|
-
export * from './types/config';
|
|
14
|
-
export * from './types/requestHandler';
|
|
8
|
+
export type { Middleware, MiddlewareHandler, Context, Next, HonoRequest as InternalRequest, ServerEnv, ServerManifest, ServerLoaderBundle, } from './types/index.js';
|
|
9
|
+
export { getLoaderCtx } from './helper.js';
|
|
10
|
+
export * from './plugins/index.js';
|
|
11
|
+
export * from './types/plugins/index.js';
|
|
12
|
+
export * from './types/render.js';
|
|
13
|
+
export * from './types/config/index.js';
|
|
14
|
+
export * from './types/requestHandler.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 { renderPlugin, injectRenderHandlerPlugin, type InjectRenderHandlerOptions, getRenderHandler, } from './render';
|
|
2
|
-
export { faviconPlugin } from './favicon';
|
|
3
|
-
export { injectServerTiming, injectloggerPlugin } from './monitors';
|
|
4
|
-
export { processedByPlugin } from './processedBy';
|
|
5
|
-
export { logPlugin } from './log';
|
|
6
|
-
export { createDefaultPlugins, type CreateDefaultPluginsOptions, } from './default';
|
|
7
|
-
export { compatPlugin, handleSetupResult } from './compat';
|
|
8
|
-
export { injectConfigMiddlewarePlugin } from './middlewares';
|
|
1
|
+
export { renderPlugin, injectRenderHandlerPlugin, type InjectRenderHandlerOptions, getRenderHandler, } from './render/index.js';
|
|
2
|
+
export { faviconPlugin } from './favicon.js';
|
|
3
|
+
export { injectServerTiming, injectloggerPlugin } from './monitors.js';
|
|
4
|
+
export { processedByPlugin } from './processedBy.js';
|
|
5
|
+
export { logPlugin } from './log.js';
|
|
6
|
+
export { createDefaultPlugins, type CreateDefaultPluginsOptions, } from './default.js';
|
|
7
|
+
export { compatPlugin, handleSetupResult } from './compat/index.js';
|
|
8
|
+
export { injectConfigMiddlewarePlugin } from './middlewares.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, }: 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,8 +1,8 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Router } from 'hono/router';
|
|
3
|
-
import type { CacheConfig, UserConfig } from '../../types';
|
|
4
|
-
import type { Render } from '../../types';
|
|
5
|
-
import type { Params } from '../../types/requestHandler';
|
|
3
|
+
import type { CacheConfig, UserConfig } from '../../types/index.js';
|
|
4
|
+
import type { Render } from '../../types/index.js';
|
|
5
|
+
import type { Params } from '../../types/requestHandler.js';
|
|
6
6
|
interface CreateRenderOptions {
|
|
7
7
|
pwd: string;
|
|
8
8
|
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,8 +1,8 @@
|
|
|
1
1
|
import type { Reporter, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Monitors, ClientManifest as RscClientManifest, SSRManifest as RscSSRManifest, ServerManifest as RscServerManifest } from '@modern-js/types/server';
|
|
3
3
|
import type { NodeRequest } from '@modern-js/types/server';
|
|
4
|
-
import type { CacheConfig, ServerManifest, UserConfig } from '../../types';
|
|
5
|
-
import type { OnError, OnTiming, Params } from '../../types/requestHandler';
|
|
4
|
+
import type { CacheConfig, ServerManifest, UserConfig } from '../../types/index.js';
|
|
5
|
+
import type { OnError, OnTiming, Params } from '../../types/requestHandler.js';
|
|
6
6
|
export interface SSRRenderOptions {
|
|
7
7
|
pwd: string;
|
|
8
8
|
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;
|
|
@@ -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,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 * from './plugin';
|
|
2
|
-
export type { ServerConfig, CacheConfig, GetRenderHandlerOptions, FileChangeEvent, WebServerStartInput, APIServerStartInput, ServerMiddleware, MiddlewareObj, } from './base';
|
|
1
|
+
export * from './plugin.js';
|
|
2
|
+
export type { ServerConfig, CacheConfig, GetRenderHandlerOptions, FileChangeEvent, WebServerStartInput, APIServerStartInput, ServerMiddleware, MiddlewareObj, } from './base.js';
|
|
@@ -2,8 +2,8 @@ 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 { MiddlewareObj } from './base';
|
|
6
|
-
import type { APIServerStartInput, ServerConfig, WebAdapter, WebServerStartInput } from './base';
|
|
5
|
+
import type { MiddlewareObj } from './base.js';
|
|
6
|
+
import type { APIServerStartInput, ServerConfig, WebAdapter, WebServerStartInput } from './base.js';
|
|
7
7
|
export type PrepareWebServerFn = (input: WebServerStartInput) => Promise<WebAdapter | null>;
|
|
8
8
|
export type PrepareApiServerFn = (input: APIServerStartInput) => Promise<MiddlewareHandler>;
|
|
9
9
|
export type AfterMatchFn = (ctx: AfterMatchContext) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Monitors, Reporter, ClientManifest as RscClientManifest, SSRManifest as RscSSRManifest, ServerManifest as RscServerManifest } from '@modern-js/types';
|
|
2
2
|
import type { NodeRequest } from '@modern-js/types/server';
|
|
3
|
-
import type { ServerManifest } from './server';
|
|
3
|
+
import type { 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, SSRManifest as RscSSRManifest, ServerManifest as RscServerManifest } 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, SSRManifest as RscSSRManifest, ServerManifest as RscServerManifest } 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 './env';
|
|
2
|
-
export * from './transformStream';
|
|
3
|
-
export * from './middlewareCollector';
|
|
4
|
-
export * from './error';
|
|
5
|
-
export * from './warmup';
|
|
6
|
-
export * from './entry';
|
|
7
|
-
export * from './request';
|
|
8
|
-
export * from './serverConfig';
|
|
9
|
-
export * from './publicDir';
|
|
1
|
+
export * from './env.js';
|
|
2
|
+
export * from './transformStream.js';
|
|
3
|
+
export * from './middlewareCollector.js';
|
|
4
|
+
export * from './error.js';
|
|
5
|
+
export * from './warmup.js';
|
|
6
|
+
export * from './entry.js';
|
|
7
|
+
export * from './request.js';
|
|
8
|
+
export * from './serverConfig.js';
|
|
9
|
+
export * from './publicDir.js';
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.9.
|
|
18
|
+
"version": "3.9.1",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -71,19 +71,19 @@
|
|
|
71
71
|
"flatted": "^3.4.4",
|
|
72
72
|
"hono": "^4.11.7",
|
|
73
73
|
"ts-deepmerge": "7.0.3",
|
|
74
|
-
"@modern-js/plugin": "3.9.
|
|
75
|
-
"@modern-js/runtime-utils": "3.9.
|
|
76
|
-
"@modern-js/utils": "3.9.
|
|
74
|
+
"@modern-js/plugin": "3.9.1",
|
|
75
|
+
"@modern-js/runtime-utils": "3.9.1",
|
|
76
|
+
"@modern-js/utils": "3.9.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@rslib/core": "0.
|
|
79
|
+
"@rslib/core": "1.0.0",
|
|
80
80
|
"@types/cloneable-readable": "^2.0.3",
|
|
81
81
|
"@types/merge-deep": "^3.0.3",
|
|
82
82
|
"@types/node": "^20",
|
|
83
83
|
"http-proxy-middleware": "^2.0.10",
|
|
84
84
|
"typescript": "^5",
|
|
85
85
|
"@modern-js/rslib": "2.68.10",
|
|
86
|
-
"@modern-js/types": "3.9.
|
|
86
|
+
"@modern-js/types": "3.9.1",
|
|
87
87
|
"@scripts/rstest-config": "2.66.0"
|
|
88
88
|
},
|
|
89
89
|
"sideEffects": false,
|
|
File without changes
|
|
File without changes
|