@modern-js/prod-server 2.54.1 → 2.54.3
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/index.js +11 -7
- package/dist/cjs/netlify.js +4 -0
- package/dist/esm/index.js +12 -8
- package/dist/esm/netlify.js +6 -2
- package/dist/esm-node/index.js +11 -7
- package/dist/esm-node/netlify.js +5 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +8 -8
package/dist/cjs/index.js
CHANGED
|
@@ -20,8 +20,8 @@ var src_exports = {};
|
|
|
20
20
|
__export(src_exports, {
|
|
21
21
|
applyPlugins: () => import_apply2.applyPlugins,
|
|
22
22
|
createProdServer: () => createProdServer,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
loadServerPlugins: () => import_node2.loadServerPlugins,
|
|
24
|
+
loadServerRuntimeConfig: () => import_node2.loadServerRuntimeConfig
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(src_exports);
|
|
27
27
|
var import_node = require("@modern-js/server-core/node");
|
|
@@ -31,10 +31,14 @@ var import_apply2 = require("./apply");
|
|
|
31
31
|
var import_node2 = require("@modern-js/server-core/node");
|
|
32
32
|
const createProdServer = async (options) => {
|
|
33
33
|
await (0, import_node.loadServerEnv)(options);
|
|
34
|
-
const serverConfig = (0, import_node.loadServerConfig)(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
35
34
|
const serverBaseOptions = options;
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const serverCliConfig = process.env.NODE_ENV === "production" ? (0, import_node.loadServerCliConfig)(options.pwd, options.config) : options.config;
|
|
36
|
+
if (serverCliConfig) {
|
|
37
|
+
serverBaseOptions.config = serverCliConfig;
|
|
38
|
+
}
|
|
39
|
+
const serverRuntimeConfig = (0, import_node.loadServerRuntimeConfig)(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
40
|
+
if (serverRuntimeConfig) {
|
|
41
|
+
serverBaseOptions.serverConfig = serverRuntimeConfig;
|
|
38
42
|
}
|
|
39
43
|
const server = (0, import_server_core.createServerBase)(serverBaseOptions);
|
|
40
44
|
const nodeServer = await (0, import_node.createNodeServer)(server.handle.bind(server));
|
|
@@ -46,6 +50,6 @@ const createProdServer = async (options) => {
|
|
|
46
50
|
0 && (module.exports = {
|
|
47
51
|
applyPlugins,
|
|
48
52
|
createProdServer,
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
loadServerPlugins,
|
|
54
|
+
loadServerRuntimeConfig
|
|
51
55
|
});
|
package/dist/cjs/netlify.js
CHANGED
|
@@ -25,6 +25,10 @@ var import_node = require("@modern-js/server-core/node");
|
|
|
25
25
|
var import_server_core = require("@modern-js/server-core");
|
|
26
26
|
var import_apply = require("./apply");
|
|
27
27
|
const createNetlifyFunction = async (options) => {
|
|
28
|
+
const serverCliConfig = (0, import_node.loadServerCliConfig)(options.pwd, options.config);
|
|
29
|
+
if (serverCliConfig) {
|
|
30
|
+
options.config = serverCliConfig;
|
|
31
|
+
}
|
|
28
32
|
const server = (0, import_server_core.createServerBase)(options);
|
|
29
33
|
await (0, import_node.loadServerEnv)(options);
|
|
30
34
|
await (0, import_apply.applyPlugins)(server, options);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
-
import { createNodeServer,
|
|
3
|
+
import { createNodeServer, loadServerRuntimeConfig, loadServerCliConfig, loadServerEnv } from "@modern-js/server-core/node";
|
|
4
4
|
import { createServerBase } from "@modern-js/server-core";
|
|
5
5
|
import { applyPlugins } from "./apply";
|
|
6
6
|
import { applyPlugins as applyPlugins2 } from "./apply";
|
|
7
|
-
import { loadServerPlugins,
|
|
7
|
+
import { loadServerPlugins, loadServerRuntimeConfig as loadServerRuntimeConfig2 } from "@modern-js/server-core/node";
|
|
8
8
|
var createProdServer = function() {
|
|
9
9
|
var _ref = _async_to_generator(function(options) {
|
|
10
|
-
var
|
|
10
|
+
var serverBaseOptions, serverCliConfig, serverRuntimeConfig, server, nodeServer;
|
|
11
11
|
return _ts_generator(this, function(_state) {
|
|
12
12
|
switch (_state.label) {
|
|
13
13
|
case 0:
|
|
@@ -17,10 +17,14 @@ var createProdServer = function() {
|
|
|
17
17
|
];
|
|
18
18
|
case 1:
|
|
19
19
|
_state.sent();
|
|
20
|
-
serverConfig = loadServerConfig(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
21
20
|
serverBaseOptions = options;
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
serverCliConfig = process.env.NODE_ENV === "production" ? loadServerCliConfig(options.pwd, options.config) : options.config;
|
|
22
|
+
if (serverCliConfig) {
|
|
23
|
+
serverBaseOptions.config = serverCliConfig;
|
|
24
|
+
}
|
|
25
|
+
serverRuntimeConfig = loadServerRuntimeConfig(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
26
|
+
if (serverRuntimeConfig) {
|
|
27
|
+
serverBaseOptions.serverConfig = serverRuntimeConfig;
|
|
24
28
|
}
|
|
25
29
|
server = createServerBase(serverBaseOptions);
|
|
26
30
|
return [
|
|
@@ -55,6 +59,6 @@ var createProdServer = function() {
|
|
|
55
59
|
export {
|
|
56
60
|
applyPlugins2 as applyPlugins,
|
|
57
61
|
createProdServer,
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
loadServerPlugins,
|
|
63
|
+
loadServerRuntimeConfig2 as loadServerRuntimeConfig
|
|
60
64
|
};
|
package/dist/esm/netlify.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
-
import { loadServerEnv } from "@modern-js/server-core/node";
|
|
3
|
+
import { loadServerCliConfig, loadServerEnv } from "@modern-js/server-core/node";
|
|
4
4
|
import { createServerBase } from "@modern-js/server-core";
|
|
5
5
|
import { applyPlugins } from "./apply";
|
|
6
6
|
var createNetlifyFunction = function() {
|
|
7
7
|
var _ref = _async_to_generator(function(options) {
|
|
8
|
-
var server;
|
|
8
|
+
var serverCliConfig, server;
|
|
9
9
|
return _ts_generator(this, function(_state) {
|
|
10
10
|
switch (_state.label) {
|
|
11
11
|
case 0:
|
|
12
|
+
serverCliConfig = loadServerCliConfig(options.pwd, options.config);
|
|
13
|
+
if (serverCliConfig) {
|
|
14
|
+
options.config = serverCliConfig;
|
|
15
|
+
}
|
|
12
16
|
server = createServerBase(options);
|
|
13
17
|
return [
|
|
14
18
|
4,
|
package/dist/esm-node/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { createNodeServer,
|
|
1
|
+
import { createNodeServer, loadServerRuntimeConfig, loadServerCliConfig, loadServerEnv } from "@modern-js/server-core/node";
|
|
2
2
|
import { createServerBase } from "@modern-js/server-core";
|
|
3
3
|
import { applyPlugins } from "./apply";
|
|
4
4
|
import { applyPlugins as applyPlugins2 } from "./apply";
|
|
5
|
-
import { loadServerPlugins,
|
|
5
|
+
import { loadServerPlugins, loadServerRuntimeConfig as loadServerRuntimeConfig2 } from "@modern-js/server-core/node";
|
|
6
6
|
const createProdServer = async (options) => {
|
|
7
7
|
await loadServerEnv(options);
|
|
8
|
-
const serverConfig = loadServerConfig(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
9
8
|
const serverBaseOptions = options;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const serverCliConfig = process.env.NODE_ENV === "production" ? loadServerCliConfig(options.pwd, options.config) : options.config;
|
|
10
|
+
if (serverCliConfig) {
|
|
11
|
+
serverBaseOptions.config = serverCliConfig;
|
|
12
|
+
}
|
|
13
|
+
const serverRuntimeConfig = loadServerRuntimeConfig(options.pwd, options.serverConfigFile, options.serverConfigPath);
|
|
14
|
+
if (serverRuntimeConfig) {
|
|
15
|
+
serverBaseOptions.serverConfig = serverRuntimeConfig;
|
|
12
16
|
}
|
|
13
17
|
const server = createServerBase(serverBaseOptions);
|
|
14
18
|
const nodeServer = await createNodeServer(server.handle.bind(server));
|
|
@@ -19,6 +23,6 @@ const createProdServer = async (options) => {
|
|
|
19
23
|
export {
|
|
20
24
|
applyPlugins2 as applyPlugins,
|
|
21
25
|
createProdServer,
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
loadServerPlugins,
|
|
27
|
+
loadServerRuntimeConfig2 as loadServerRuntimeConfig
|
|
24
28
|
};
|
package/dist/esm-node/netlify.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { loadServerEnv } from "@modern-js/server-core/node";
|
|
1
|
+
import { loadServerCliConfig, loadServerEnv } from "@modern-js/server-core/node";
|
|
2
2
|
import { createServerBase } from "@modern-js/server-core";
|
|
3
3
|
import { applyPlugins } from "./apply";
|
|
4
4
|
const createNetlifyFunction = async (options) => {
|
|
5
|
+
const serverCliConfig = loadServerCliConfig(options.pwd, options.config);
|
|
6
|
+
if (serverCliConfig) {
|
|
7
|
+
options.config = serverCliConfig;
|
|
8
|
+
}
|
|
5
9
|
const server = createServerBase(options);
|
|
6
10
|
await loadServerEnv(options);
|
|
7
11
|
await applyPlugins(server, options);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { ProdServerOptions } from './types';
|
|
4
4
|
export { applyPlugins, type ApplyPlugins } from './apply';
|
|
5
|
-
export { loadServerPlugins,
|
|
5
|
+
export { loadServerPlugins, loadServerRuntimeConfig, } from '@modern-js/server-core/node';
|
|
6
6
|
export type { ServerPlugin } from '@modern-js/server-core';
|
|
7
7
|
export type { ProdServerOptions, BaseEnv } from './types';
|
|
8
8
|
export declare const createProdServer: (options: ProdServerOptions) => Promise<(import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>) & {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.54.
|
|
18
|
+
"version": "2.54.3",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@swc/helpers": "0.5.3",
|
|
44
|
-
"@modern-js/server-core": "2.54.
|
|
45
|
-
"@modern-js/utils": "2.54.
|
|
46
|
-
"@modern-js/runtime-utils": "2.54.
|
|
44
|
+
"@modern-js/server-core": "2.54.3",
|
|
45
|
+
"@modern-js/utils": "2.54.3",
|
|
46
|
+
"@modern-js/runtime-utils": "2.54.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/merge-deep": "^3.0.0",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"tsx": "^3.12.7",
|
|
57
57
|
"@types/jest": "^29",
|
|
58
58
|
"typescript": "~5.0.4",
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
59
|
+
"@scripts/build": "2.54.3",
|
|
60
|
+
"@modern-js/types": "2.54.3",
|
|
61
|
+
"@scripts/jest-config": "2.54.3",
|
|
62
|
+
"@modern-js/eslint-config": "2.54.3"
|
|
63
63
|
},
|
|
64
64
|
"sideEffects": [],
|
|
65
65
|
"engines": {
|