@modern-js/server 3.9.0 → 3.9.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/cjs/helpers/mock.js +1 -1
- package/dist/esm/helpers/mock.mjs +1 -1
- package/dist/esm-node/helpers/mock.mjs +1 -1
- package/dist/types/createDevServer.d.ts +1 -1
- package/dist/types/dev-tools/https/index.d.ts +1 -1
- package/dist/types/dev.d.ts +2 -2
- package/dist/types/helpers/devOptions.d.ts +2 -2
- package/dist/types/helpers/index.d.ts +5 -5
- package/dist/types/index.d.ts +3 -3
- package/package.json +8 -8
package/dist/cjs/helpers/mock.js
CHANGED
|
@@ -130,7 +130,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
130
130
|
if (matchedMockAPI) {
|
|
131
131
|
const { handler } = matchedMockAPI;
|
|
132
132
|
if ('function' == typeof handler) return await (0, node_namespaceObject.connectMockMid2HonoMid)(handler)(c, next);
|
|
133
|
-
return c.json(handler);
|
|
133
|
+
else return c.json(handler);
|
|
134
134
|
}
|
|
135
135
|
return next();
|
|
136
136
|
};
|
|
@@ -84,7 +84,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
84
84
|
if (matchedMockAPI) {
|
|
85
85
|
const { handler } = matchedMockAPI;
|
|
86
86
|
if ('function' == typeof handler) return await connectMockMid2HonoMid(handler)(c, next);
|
|
87
|
-
return c.json(handler);
|
|
87
|
+
else return c.json(handler);
|
|
88
88
|
}
|
|
89
89
|
return next();
|
|
90
90
|
};
|
|
@@ -85,7 +85,7 @@ async function getMockMiddleware(pwd, mockDir) {
|
|
|
85
85
|
if (matchedMockAPI) {
|
|
86
86
|
const { handler } = matchedMockAPI;
|
|
87
87
|
if ('function' == typeof handler) return await connectMockMid2HonoMid(handler)(c, next);
|
|
88
|
-
return c.json(handler);
|
|
88
|
+
else return c.json(handler);
|
|
89
89
|
}
|
|
90
90
|
return next();
|
|
91
91
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplyPlugins, ModernDevServerOptions } from './types';
|
|
1
|
+
import type { ApplyPlugins, ModernDevServerOptions } from './types.js';
|
|
2
2
|
export declare function createDevServer(options: ModernDevServerOptions, applyPlugins: ApplyPlugins): Promise<{
|
|
3
3
|
server: (import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | import("http2").Http2SecureServer<typeof import("http").IncomingMessage, typeof import("http").ServerResponse, typeof import("http2").Http2ServerRequest, typeof import("http2").Http2ServerResponse>) & {
|
|
4
4
|
getRequestListener: () => ReturnType<(handler: import("@modern-js/server-core/dist/types/types").RequestHandler) => (req: import("@modern-js/types/server").NodeRequest, res: import("@modern-js/types/server").NodeResponse) => Promise<void>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type Buffer from 'buffer';
|
|
2
|
-
import type { DevServerHttpsOptions } from '../../types';
|
|
2
|
+
import type { DevServerHttpsOptions } from '../../types.js';
|
|
3
3
|
export declare const genHttpsOptions: (userOptions: DevServerHttpsOptions, pwd: string) => Promise<{
|
|
4
4
|
key?: Buffer | string;
|
|
5
5
|
cert?: Buffer | string;
|
package/dist/types/dev.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { Http2SecureServer } from 'node:http2';
|
|
|
3
3
|
import type { Server as NodeHttpsServer } from 'node:https';
|
|
4
4
|
import type { BuilderInstance, Rspack } from '@modern-js/builder';
|
|
5
5
|
import type { ServerBase, ServerBaseOptions, ServerPlugin } from '@modern-js/server-core';
|
|
6
|
-
import type { WatchEvent } from './dev-tools/watcher';
|
|
7
|
-
import type { ModernDevServerOptions } from './types';
|
|
6
|
+
import type { WatchEvent } from './dev-tools/watcher/index.js';
|
|
7
|
+
import type { ModernDevServerOptions } from './types.js';
|
|
8
8
|
type BuilderDevServer = Awaited<ReturnType<BuilderInstance['createDevServer']>>;
|
|
9
9
|
export type DevPluginOptions = ModernDevServerOptions<ServerBaseOptions> & {
|
|
10
10
|
builderDevServer?: BuilderDevServer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BuilderInstance } from '@modern-js/builder';
|
|
2
|
-
import type { DevServerOptions } from '../types';
|
|
2
|
+
import type { DevServerOptions } from '../types.js';
|
|
3
3
|
export declare const getDevOptions: (devOptions: DevServerOptions) => {
|
|
4
4
|
setupMiddlewares?: Array<(middlewares: {
|
|
5
5
|
unshift: (...handlers: import("@modern-js/types/server").RequestHandler[]) => void;
|
|
6
6
|
push: (...handlers: import("@modern-js/types/server").RequestHandler[]) => void;
|
|
7
7
|
}, server: import("@modern-js/types/server").ExposeServerApis) => void>;
|
|
8
8
|
https?: import("@modern-js/types/server/devServer").DevServerHttpsOptions;
|
|
9
|
-
server?: import("../types").DevServerConfig;
|
|
9
|
+
server?: import("../types.js").DevServerConfig;
|
|
10
10
|
};
|
|
11
11
|
export declare const getDevAssetPrefix: (builder?: BuilderInstance) => Promise<string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type WatchOptions } from '@modern-js/utils';
|
|
2
|
-
import Watcher, { type WatchEvent } from '../dev-tools/watcher';
|
|
3
|
-
export * from './repack';
|
|
4
|
-
export * from './devOptions';
|
|
5
|
-
export * from './fileReader';
|
|
6
|
-
export * from './mock';
|
|
2
|
+
import Watcher, { type WatchEvent } from '../dev-tools/watcher/index.js';
|
|
3
|
+
export * from './repack.js';
|
|
4
|
+
export * from './devOptions.js';
|
|
5
|
+
export * from './fileReader.js';
|
|
6
|
+
export * from './mock.js';
|
|
7
7
|
export declare function startWatcher({ pwd, distDir, apiDir, sharedDir, mockDir, watchOptions, onChange, }: {
|
|
8
8
|
pwd: string;
|
|
9
9
|
distDir: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DevServerOptions } from './types';
|
|
2
|
-
export { createDevServer } from './createDevServer';
|
|
3
|
-
export type { ModernDevServerOptions, ApplyPlugins, CorsOptions, } from './types';
|
|
1
|
+
import type { DevServerOptions } from './types.js';
|
|
2
|
+
export { createDevServer } from './createDevServer.js';
|
|
3
|
+
export type { ModernDevServerOptions, ApplyPlugins, CorsOptions, } from './types.js';
|
|
4
4
|
export type SetupMiddlewares = DevServerOptions['setupMiddlewares'];
|
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.2",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"minimatch": "^3.1.2",
|
|
45
45
|
"path-to-regexp": "^6.3.0",
|
|
46
46
|
"ws": "^8.21.3",
|
|
47
|
-
"@modern-js/runtime-utils": "3.9.
|
|
48
|
-
"@modern-js/server-core": "3.9.
|
|
49
|
-
"@modern-js/server-utils": "3.9.
|
|
50
|
-
"@modern-js/types": "3.9.
|
|
51
|
-
"@modern-js/utils": "3.9.
|
|
47
|
+
"@modern-js/runtime-utils": "3.9.2",
|
|
48
|
+
"@modern-js/server-core": "3.9.2",
|
|
49
|
+
"@modern-js/server-utils": "3.9.2",
|
|
50
|
+
"@modern-js/types": "3.9.2",
|
|
51
|
+
"@modern-js/utils": "3.9.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@rslib/core": "0.
|
|
54
|
+
"@rslib/core": "1.0.0",
|
|
55
55
|
"@types/connect-history-api-fallback": "^1.5.4",
|
|
56
56
|
"@types/minimatch": "^3.0.5",
|
|
57
57
|
"@types/node": "^20",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tsconfig-paths": "4.2.0",
|
|
62
62
|
"typescript": "^5",
|
|
63
63
|
"websocket": "^1.0.35",
|
|
64
|
-
"@modern-js/builder": "3.9.
|
|
64
|
+
"@modern-js/builder": "3.9.2",
|
|
65
65
|
"@modern-js/rslib": "2.68.10",
|
|
66
66
|
"@scripts/rstest-config": "2.66.0"
|
|
67
67
|
},
|