@modern-js/app-tools 2.56.2-alpha.2 → 2.57.0
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/builder/generator/getBuilderEnvironments.js +1 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +1 -1
- package/dist/cjs/commands/dev.js +21 -9
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/plugins/deploy/dependencies/index.js +1 -2
- package/dist/cjs/utils/createServer.js +1 -1
- package/dist/esm/builder/generator/getBuilderEnvironments.js +2 -0
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.js +1 -1
- package/dist/esm/commands/dev.js +43 -16
- package/dist/esm/index.js +1 -42
- package/dist/esm/plugins/deploy/dependencies/index.js +1 -2
- package/dist/esm/utils/createServer.js +1 -1
- package/dist/esm-node/builder/generator/getBuilderEnvironments.js +1 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.js +1 -1
- package/dist/esm-node/commands/dev.js +22 -10
- package/dist/esm-node/index.js +1 -17
- package/dist/esm-node/plugins/deploy/dependencies/index.js +1 -2
- package/dist/esm-node/utils/createServer.js +1 -1
- package/dist/types/commands/dev.d.ts +2 -1
- package/dist/types/exports/server.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/config/index.d.ts +2 -2
- package/package.json +17 -17
@@ -42,7 +42,7 @@ function getBuilderEnvironments(normalizedConfig, appContext) {
|
|
42
42
|
const serverEntries = {};
|
43
43
|
for (const entry in entries) {
|
44
44
|
const v = entries[entry];
|
45
|
-
serverEntries[entry] = v.map((entry2) => entry2.replace("index.jsx", "index.server.jsx"));
|
45
|
+
serverEntries[entry] = v.map((entry2) => entry2.replace("index.jsx", "index.server.jsx")).map((entry2) => entry2.replace("bootstrap.jsx", "bootstrap.server.jsx"));
|
46
46
|
}
|
47
47
|
const environments = {
|
48
48
|
web: {
|
package/dist/cjs/commands/dev.js
CHANGED
@@ -42,8 +42,8 @@ var import_printInstructions = require("../utils/printInstructions");
|
|
42
42
|
var import_createServer = require("../utils/createServer");
|
43
43
|
var import_routes = require("../utils/routes");
|
44
44
|
var import_config = require("../utils/config");
|
45
|
-
const dev = async (api, options, devServerOptions
|
46
|
-
var _normalizedConfig_source, _normalizedConfig_tools;
|
45
|
+
const dev = async (api, options, devServerOptions) => {
|
46
|
+
var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
|
47
47
|
if (options.analyze) {
|
48
48
|
process.env.BUNDLE_ANALYZE = "true";
|
49
49
|
}
|
@@ -93,20 +93,32 @@ const dev = async (api, options, devServerOptions = {}) => {
|
|
93
93
|
plugins: pluginInstances,
|
94
94
|
...devServerOptions
|
95
95
|
};
|
96
|
+
const host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || import_utils.DEFAULT_DEV_HOST;
|
96
97
|
if (apiOnly) {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
const { server } = await (0, import_server.createDevServer)({
|
99
|
+
...serverOptions,
|
100
|
+
runCompile: false
|
101
|
+
}, (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || import_prod_server.applyPlugins);
|
102
|
+
server.listen({
|
101
103
|
port,
|
102
104
|
host
|
103
105
|
}, () => {
|
104
106
|
(0, import_printInstructions.printInstructions)(hookRunners, appContext, normalizedConfig);
|
105
107
|
});
|
106
108
|
} else {
|
107
|
-
const { server } = await
|
108
|
-
serverOptions,
|
109
|
-
|
109
|
+
const { server, afterListen } = await (0, import_server.createDevServer)({
|
110
|
+
...serverOptions,
|
111
|
+
builder: appContext.builder
|
112
|
+
}, (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || import_prod_server.applyPlugins);
|
113
|
+
server.listen({
|
114
|
+
port,
|
115
|
+
host
|
116
|
+
}, async (err) => {
|
117
|
+
if (err) {
|
118
|
+
import_utils.logger.error("Occur error %s, when start dev server", err);
|
119
|
+
}
|
120
|
+
import_utils.logger.debug("listen dev server done");
|
121
|
+
await afterListen();
|
110
122
|
});
|
111
123
|
(0, import_createServer.setServer)(server);
|
112
124
|
}
|
package/dist/cjs/index.js
CHANGED
@@ -84,7 +84,6 @@ const appTools = (options = {
|
|
84
84
|
...appContext,
|
85
85
|
toolsType: "app-tools"
|
86
86
|
});
|
87
|
-
const nestedRoutes = {};
|
88
87
|
const locale = (0, import_language_detector.getLocaleLanguage)();
|
89
88
|
import_locale.i18n.changeLanguage({
|
90
89
|
locale
|
@@ -149,21 +148,6 @@ const appTools = (options = {
|
|
149
148
|
(0, import_utils.cleanRequireCache)([
|
150
149
|
require.resolve("./plugins/analyze")
|
151
150
|
]);
|
152
|
-
},
|
153
|
-
async modifyFileSystemRoutes({ entrypoint, routes }) {
|
154
|
-
nestedRoutes[entrypoint.entryName] = routes;
|
155
|
-
return {
|
156
|
-
entrypoint,
|
157
|
-
routes
|
158
|
-
};
|
159
|
-
},
|
160
|
-
async beforeGenerateRoutes({ entrypoint, code }) {
|
161
|
-
const { distDirectory } = api.useAppContext();
|
162
|
-
await import_utils.fs.outputJSON(import_path.default.resolve(distDirectory, import_utils.NESTED_ROUTE_SPEC_FILE), nestedRoutes);
|
163
|
-
return {
|
164
|
-
entrypoint,
|
165
|
-
code
|
166
|
-
};
|
167
151
|
}
|
168
152
|
};
|
169
153
|
}
|
@@ -72,8 +72,7 @@ const handleDependencies = async ({ appDir, serverRootDir, includeEntries, trace
|
|
72
72
|
const packageJsonPath = match ? import_node_path.default.join(match[0], "package.json") : await (0, import_utils.pkgUp)({
|
73
73
|
cwd: import_node_path.default.dirname(filePath)
|
74
74
|
});
|
75
|
-
if (packageJsonPath
|
76
|
-
console.log("ffffffff", filePath);
|
75
|
+
if (packageJsonPath === null || packageJsonPath === void 0 ? void 0 : packageJsonPath.startsWith(dependencySearchRoot)) {
|
77
76
|
const packageJson = await import_utils.fs.readJSON(packageJsonPath);
|
78
77
|
pkgPath = baseDir = import_node_path.default.dirname(packageJsonPath);
|
79
78
|
subpath = import_node_path.default.relative(baseDir, filePath);
|
@@ -41,7 +41,7 @@ const createServer = async (options) => {
|
|
41
41
|
if (server) {
|
42
42
|
server.close();
|
43
43
|
}
|
44
|
-
server = await (0, import_server.createDevServer)(options, import_prod_server.applyPlugins);
|
44
|
+
server = (await (0, import_server.createDevServer)(options, import_prod_server.applyPlugins)).server;
|
45
45
|
return server;
|
46
46
|
};
|
47
47
|
// Annotate the CommonJS export names for ESM import in node:
|
@@ -38,6 +38,8 @@ function getBuilderEnvironments(normalizedConfig, appContext) {
|
|
38
38
|
var v = entries[entry1];
|
39
39
|
serverEntries[entry1] = v.map(function(entry2) {
|
40
40
|
return entry2.replace("index.jsx", "index.server.jsx");
|
41
|
+
}).map(function(entry2) {
|
42
|
+
return entry2.replace("bootstrap.jsx", "bootstrap.server.jsx");
|
41
43
|
});
|
42
44
|
}
|
43
45
|
var environments = {
|
package/dist/esm/commands/dev.js
CHANGED
@@ -4,7 +4,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
5
|
import path from "node:path";
|
6
6
|
import { ResolvedConfigContext } from "@modern-js/core";
|
7
|
-
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta } from "@modern-js/utils";
|
7
|
+
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta, logger } from "@modern-js/utils";
|
8
8
|
import { createDevServer } from "@modern-js/server";
|
9
9
|
import { applyPlugins } from "@modern-js/prod-server";
|
10
10
|
import { loadServerPlugins } from "../utils/loadPlugins";
|
@@ -14,13 +14,11 @@ import { setServer } from "../utils/createServer";
|
|
14
14
|
import { generateRoutes } from "../utils/routes";
|
15
15
|
import { buildServerConfig } from "../utils/config";
|
16
16
|
var dev = function() {
|
17
|
-
var _ref = _async_to_generator(function(api, options) {
|
18
|
-
var
|
19
|
-
var _arguments = arguments;
|
17
|
+
var _ref = _async_to_generator(function(api, options, devServerOptions) {
|
18
|
+
var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev, normalizedConfig, appContext, hookRunners, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, serverOptions, host, server, _ref2, server1, afterListen;
|
20
19
|
return _ts_generator(this, function(_state) {
|
21
20
|
switch (_state.label) {
|
22
21
|
case 0:
|
23
|
-
devServerOptions = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
|
24
22
|
if (options.analyze) {
|
25
23
|
process.env.BUNDLE_ANALYZE = "true";
|
26
24
|
}
|
@@ -92,6 +90,7 @@ var dev = function() {
|
|
92
90
|
serverConfigFile,
|
93
91
|
plugins: pluginInstances
|
94
92
|
}, devServerOptions);
|
93
|
+
host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || DEFAULT_DEV_HOST;
|
95
94
|
if (!apiOnly)
|
96
95
|
return [
|
97
96
|
3,
|
@@ -99,12 +98,13 @@ var dev = function() {
|
|
99
98
|
];
|
100
99
|
return [
|
101
100
|
4,
|
102
|
-
createDevServer(serverOptions,
|
101
|
+
createDevServer(_object_spread_props(_object_spread({}, serverOptions), {
|
102
|
+
runCompile: false
|
103
|
+
}), (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || applyPlugins)
|
103
104
|
];
|
104
105
|
case 6:
|
105
|
-
|
106
|
-
|
107
|
-
app.listen({
|
106
|
+
server = _state.sent().server;
|
107
|
+
server.listen({
|
108
108
|
port,
|
109
109
|
host
|
110
110
|
}, function() {
|
@@ -117,14 +117,41 @@ var dev = function() {
|
|
117
117
|
case 7:
|
118
118
|
return [
|
119
119
|
4,
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
})
|
120
|
+
createDevServer(_object_spread_props(_object_spread({}, serverOptions), {
|
121
|
+
builder: appContext.builder
|
122
|
+
}), (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || applyPlugins)
|
124
123
|
];
|
125
124
|
case 8:
|
126
|
-
|
127
|
-
|
125
|
+
_ref2 = _state.sent(), server1 = _ref2.server, afterListen = _ref2.afterListen;
|
126
|
+
server1.listen({
|
127
|
+
port,
|
128
|
+
host
|
129
|
+
}, function() {
|
130
|
+
var _ref3 = _async_to_generator(function(err) {
|
131
|
+
return _ts_generator(this, function(_state2) {
|
132
|
+
switch (_state2.label) {
|
133
|
+
case 0:
|
134
|
+
if (err) {
|
135
|
+
logger.error("Occur error %s, when start dev server", err);
|
136
|
+
}
|
137
|
+
logger.debug("listen dev server done");
|
138
|
+
return [
|
139
|
+
4,
|
140
|
+
afterListen()
|
141
|
+
];
|
142
|
+
case 1:
|
143
|
+
_state2.sent();
|
144
|
+
return [
|
145
|
+
2
|
146
|
+
];
|
147
|
+
}
|
148
|
+
});
|
149
|
+
});
|
150
|
+
return function(err) {
|
151
|
+
return _ref3.apply(this, arguments);
|
152
|
+
};
|
153
|
+
}());
|
154
|
+
setServer(server1);
|
128
155
|
_state.label = 9;
|
129
156
|
case 9:
|
130
157
|
return [
|
@@ -133,7 +160,7 @@ var dev = function() {
|
|
133
160
|
}
|
134
161
|
});
|
135
162
|
});
|
136
|
-
return function dev2(api, options) {
|
163
|
+
return function dev2(api, options, devServerOptions) {
|
137
164
|
return _ref.apply(this, arguments);
|
138
165
|
};
|
139
166
|
}();
|
package/dist/esm/index.js
CHANGED
@@ -4,7 +4,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
5
|
import path from "path";
|
6
6
|
import { lintPlugin } from "@modern-js/plugin-lint";
|
7
|
-
import { cleanRequireCache, emptyDir, getCommand, getArgv
|
7
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv } from "@modern-js/utils";
|
8
8
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
9
9
|
import initializePlugin from "./plugins/initialize";
|
10
10
|
import analyzePlugin from "./plugins/analyze";
|
@@ -52,7 +52,6 @@ var appTools = function() {
|
|
52
52
|
api.setAppContext(_object_spread_props(_object_spread({}, appContext), {
|
53
53
|
toolsType: "app-tools"
|
54
54
|
}));
|
55
|
-
var nestedRoutes = {};
|
56
55
|
var locale = getLocaleLanguage();
|
57
56
|
i18n.changeLanguage({
|
58
57
|
locale
|
@@ -226,46 +225,6 @@ var appTools = function() {
|
|
226
225
|
];
|
227
226
|
});
|
228
227
|
})();
|
229
|
-
},
|
230
|
-
modifyFileSystemRoutes: function modifyFileSystemRoutes(param) {
|
231
|
-
var entrypoint = param.entrypoint, routes = param.routes;
|
232
|
-
return _async_to_generator(function() {
|
233
|
-
return _ts_generator(this, function(_state) {
|
234
|
-
nestedRoutes[entrypoint.entryName] = routes;
|
235
|
-
return [
|
236
|
-
2,
|
237
|
-
{
|
238
|
-
entrypoint,
|
239
|
-
routes
|
240
|
-
}
|
241
|
-
];
|
242
|
-
});
|
243
|
-
})();
|
244
|
-
},
|
245
|
-
beforeGenerateRoutes: function beforeGenerateRoutes(param) {
|
246
|
-
var entrypoint = param.entrypoint, code = param.code;
|
247
|
-
return _async_to_generator(function() {
|
248
|
-
var distDirectory;
|
249
|
-
return _ts_generator(this, function(_state) {
|
250
|
-
switch (_state.label) {
|
251
|
-
case 0:
|
252
|
-
distDirectory = api.useAppContext().distDirectory;
|
253
|
-
return [
|
254
|
-
4,
|
255
|
-
fs.outputJSON(path.resolve(distDirectory, NESTED_ROUTE_SPEC_FILE), nestedRoutes)
|
256
|
-
];
|
257
|
-
case 1:
|
258
|
-
_state.sent();
|
259
|
-
return [
|
260
|
-
2,
|
261
|
-
{
|
262
|
-
entrypoint,
|
263
|
-
code
|
264
|
-
}
|
265
|
-
];
|
266
|
-
}
|
267
|
-
});
|
268
|
-
})();
|
269
228
|
}
|
270
229
|
};
|
271
230
|
}
|
@@ -106,12 +106,11 @@ var handleDependencies = function() {
|
|
106
106
|
_state2.label = 6;
|
107
107
|
case 6:
|
108
108
|
packageJsonPath = _tmp;
|
109
|
-
if (!(packageJsonPath
|
109
|
+
if (!(packageJsonPath === null || packageJsonPath === void 0 ? void 0 : packageJsonPath.startsWith(dependencySearchRoot)))
|
110
110
|
return [
|
111
111
|
3,
|
112
112
|
8
|
113
113
|
];
|
114
|
-
console.log("ffffffff", filePath);
|
115
114
|
return [
|
116
115
|
4,
|
117
116
|
fse.readJSON(packageJsonPath)
|
@@ -19,7 +19,7 @@ function getBuilderEnvironments(normalizedConfig, appContext) {
|
|
19
19
|
const serverEntries = {};
|
20
20
|
for (const entry in entries) {
|
21
21
|
const v = entries[entry];
|
22
|
-
serverEntries[entry] = v.map((entry2) => entry2.replace("index.jsx", "index.server.jsx"));
|
22
|
+
serverEntries[entry] = v.map((entry2) => entry2.replace("index.jsx", "index.server.jsx")).map((entry2) => entry2.replace("bootstrap.jsx", "bootstrap.server.jsx"));
|
23
23
|
}
|
24
24
|
const environments = {
|
25
25
|
web: {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import path from "node:path";
|
2
2
|
import { ResolvedConfigContext } from "@modern-js/core";
|
3
|
-
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta } from "@modern-js/utils";
|
3
|
+
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta, logger } from "@modern-js/utils";
|
4
4
|
import { createDevServer } from "@modern-js/server";
|
5
5
|
import { applyPlugins } from "@modern-js/prod-server";
|
6
6
|
import { loadServerPlugins } from "../utils/loadPlugins";
|
@@ -9,8 +9,8 @@ import { printInstructions } from "../utils/printInstructions";
|
|
9
9
|
import { setServer } from "../utils/createServer";
|
10
10
|
import { generateRoutes } from "../utils/routes";
|
11
11
|
import { buildServerConfig } from "../utils/config";
|
12
|
-
const dev = async (api, options, devServerOptions
|
13
|
-
var _normalizedConfig_source, _normalizedConfig_tools;
|
12
|
+
const dev = async (api, options, devServerOptions) => {
|
13
|
+
var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
|
14
14
|
if (options.analyze) {
|
15
15
|
process.env.BUNDLE_ANALYZE = "true";
|
16
16
|
}
|
@@ -60,20 +60,32 @@ const dev = async (api, options, devServerOptions = {}) => {
|
|
60
60
|
plugins: pluginInstances,
|
61
61
|
...devServerOptions
|
62
62
|
};
|
63
|
+
const host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || DEFAULT_DEV_HOST;
|
63
64
|
if (apiOnly) {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
const { server } = await createDevServer({
|
66
|
+
...serverOptions,
|
67
|
+
runCompile: false
|
68
|
+
}, (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || applyPlugins);
|
69
|
+
server.listen({
|
68
70
|
port,
|
69
71
|
host
|
70
72
|
}, () => {
|
71
73
|
printInstructions(hookRunners, appContext, normalizedConfig);
|
72
74
|
});
|
73
75
|
} else {
|
74
|
-
const { server } = await
|
75
|
-
serverOptions,
|
76
|
-
|
76
|
+
const { server, afterListen } = await createDevServer({
|
77
|
+
...serverOptions,
|
78
|
+
builder: appContext.builder
|
79
|
+
}, (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || applyPlugins);
|
80
|
+
server.listen({
|
81
|
+
port,
|
82
|
+
host
|
83
|
+
}, async (err) => {
|
84
|
+
if (err) {
|
85
|
+
logger.error("Occur error %s, when start dev server", err);
|
86
|
+
}
|
87
|
+
logger.debug("listen dev server done");
|
88
|
+
await afterListen();
|
77
89
|
});
|
78
90
|
setServer(server);
|
79
91
|
}
|
package/dist/esm-node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import path from "path";
|
2
2
|
import { lintPlugin } from "@modern-js/plugin-lint";
|
3
|
-
import { cleanRequireCache, emptyDir, getCommand, getArgv
|
3
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv } from "@modern-js/utils";
|
4
4
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
5
5
|
import initializePlugin from "./plugins/initialize";
|
6
6
|
import analyzePlugin from "./plugins/analyze";
|
@@ -47,7 +47,6 @@ const appTools = (options = {
|
|
47
47
|
...appContext,
|
48
48
|
toolsType: "app-tools"
|
49
49
|
});
|
50
|
-
const nestedRoutes = {};
|
51
50
|
const locale = getLocaleLanguage();
|
52
51
|
i18n.changeLanguage({
|
53
52
|
locale
|
@@ -112,21 +111,6 @@ const appTools = (options = {
|
|
112
111
|
cleanRequireCache([
|
113
112
|
require.resolve("./plugins/analyze")
|
114
113
|
]);
|
115
|
-
},
|
116
|
-
async modifyFileSystemRoutes({ entrypoint, routes }) {
|
117
|
-
nestedRoutes[entrypoint.entryName] = routes;
|
118
|
-
return {
|
119
|
-
entrypoint,
|
120
|
-
routes
|
121
|
-
};
|
122
|
-
},
|
123
|
-
async beforeGenerateRoutes({ entrypoint, code }) {
|
124
|
-
const { distDirectory } = api.useAppContext();
|
125
|
-
await fs.outputJSON(path.resolve(distDirectory, NESTED_ROUTE_SPEC_FILE), nestedRoutes);
|
126
|
-
return {
|
127
|
-
entrypoint,
|
128
|
-
code
|
129
|
-
};
|
130
114
|
}
|
131
115
|
};
|
132
116
|
}
|
@@ -39,8 +39,7 @@ const handleDependencies = async ({ appDir, serverRootDir, includeEntries, trace
|
|
39
39
|
const packageJsonPath = match ? path.join(match[0], "package.json") : await pkgUp({
|
40
40
|
cwd: path.dirname(filePath)
|
41
41
|
});
|
42
|
-
if (packageJsonPath
|
43
|
-
console.log("ffffffff", filePath);
|
42
|
+
if (packageJsonPath === null || packageJsonPath === void 0 ? void 0 : packageJsonPath.startsWith(dependencySearchRoot)) {
|
44
43
|
const packageJson = await fse.readJSON(packageJsonPath);
|
45
44
|
pkgPath = baseDir = path.dirname(packageJsonPath);
|
46
45
|
subpath = path.relative(baseDir, filePath);
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { PluginAPI } from '@modern-js/core';
|
2
|
+
import { ApplyPlugins } from '@modern-js/server';
|
2
3
|
import { DevOptions } from '../utils/types';
|
3
4
|
import type { AppTools } from '../types';
|
4
5
|
export interface ExtraServerOptions {
|
5
|
-
|
6
|
+
applyPlugins?: ApplyPlugins;
|
6
7
|
}
|
7
8
|
export declare const dev: (api: PluginAPI<AppTools<'shared'>>, options: DevOptions, devServerOptions?: ExtraServerOptions) => Promise<void>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { UnstableMiddleware, UnstableMiddlewareContext, UnstableNext } from '@modern-js/types';
|
2
|
+
export type { ServerPlugin } from '@modern-js/server-core';
|
2
3
|
export type RenderMiddleware = UnstableMiddleware;
|
3
4
|
export type RenderMiddlewareContext = UnstableMiddlewareContext;
|
4
5
|
export type RenderNext = UnstableNext;
|
package/dist/types/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { CliPlugin } from '@modern-js/core';
|
2
2
|
import { AppTools } from './types';
|
3
3
|
export { dev } from './commands/dev';
|
4
|
+
export type { DevOptions } from './utils/types';
|
4
5
|
export { mergeConfig } from '@modern-js/core';
|
5
6
|
export * from './defineConfig';
|
6
7
|
export * from './types';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ServerUserConfig, BffUserConfig } from '@modern-js/server-core';
|
2
|
-
import type { UniBuilderPlugin } from '@modern-js/uni-builder';
|
2
|
+
import type { UniBuilderPlugin, LooseRsbuildPlugin } from '@modern-js/uni-builder';
|
3
3
|
import type { RsbuildConfig } from '@rsbuild/core';
|
4
4
|
import type { Bundler } from '../utils';
|
5
5
|
import type { OutputUserConfig } from './output';
|
@@ -38,7 +38,7 @@ export interface AppToolsUserConfig<B extends Bundler> {
|
|
38
38
|
tools?: ToolsUserConfig<B>;
|
39
39
|
security?: SecurityUserConfig;
|
40
40
|
testing?: TestingUserConfig;
|
41
|
-
builderPlugins?: UniBuilderPlugin
|
41
|
+
builderPlugins?: Array<LooseRsbuildPlugin | UniBuilderPlugin>;
|
42
42
|
performance?: PerformanceUserConfig;
|
43
43
|
devtools?: any;
|
44
44
|
environments?: RsbuildConfig['environments'];
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.57.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -87,20 +87,20 @@
|
|
87
87
|
"mlly": "^1.6.1",
|
88
88
|
"pkg-types": "^1.1.0",
|
89
89
|
"std-env": "^3.7.0",
|
90
|
-
"@modern-js/core": "2.
|
91
|
-
"@modern-js/node-bundle-require": "2.
|
92
|
-
"@modern-js/plugin": "2.
|
93
|
-
"@modern-js/plugin-
|
94
|
-
"@modern-js/plugin-i18n": "2.
|
95
|
-
"@modern-js/
|
96
|
-
"@modern-js/server": "2.
|
97
|
-
"@modern-js/
|
98
|
-
"@modern-js/utils": "2.
|
99
|
-
"@modern-js/
|
100
|
-
"@modern-js/
|
101
|
-
"@modern-js/
|
102
|
-
"@modern-js/
|
103
|
-
"@modern-js/
|
90
|
+
"@modern-js/core": "2.57.0",
|
91
|
+
"@modern-js/node-bundle-require": "2.57.0",
|
92
|
+
"@modern-js/plugin": "2.57.0",
|
93
|
+
"@modern-js/plugin-data-loader": "2.57.0",
|
94
|
+
"@modern-js/plugin-i18n": "2.57.0",
|
95
|
+
"@modern-js/plugin-lint": "2.57.0",
|
96
|
+
"@modern-js/prod-server": "2.57.0",
|
97
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.57.0",
|
98
|
+
"@modern-js/server-utils": "2.57.0",
|
99
|
+
"@modern-js/server": "2.57.0",
|
100
|
+
"@modern-js/server-core": "2.57.0",
|
101
|
+
"@modern-js/types": "2.57.0",
|
102
|
+
"@modern-js/uni-builder": "2.57.0",
|
103
|
+
"@modern-js/utils": "2.57.0"
|
104
104
|
},
|
105
105
|
"devDependencies": {
|
106
106
|
"@rsbuild/plugin-swc": "1.0.1-beta.3",
|
@@ -112,8 +112,8 @@
|
|
112
112
|
"tsconfig-paths": "^4.2.0",
|
113
113
|
"typescript": "^5",
|
114
114
|
"webpack": "^5.93.0",
|
115
|
-
"@scripts/
|
116
|
-
"@scripts/
|
115
|
+
"@scripts/jest-config": "2.57.0",
|
116
|
+
"@scripts/build": "2.57.0"
|
117
117
|
},
|
118
118
|
"sideEffects": false,
|
119
119
|
"publishConfig": {
|