@modern-js/app-tools 2.31.2 → 2.32.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/CHANGELOG.md +58 -0
- package/LICENSE +1 -1
- package/dist/cjs/analyze/constants.js +4 -0
- package/dist/cjs/analyze/getServerRoutes.js +1 -1
- package/dist/cjs/analyze/nestedRoutes.js +14 -1
- package/dist/cjs/analyze/templates.js +10 -7
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +1 -1
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +24 -22
- package/dist/cjs/index.js +16 -0
- package/dist/esm/analyze/constants.js +4 -0
- package/dist/esm/analyze/getServerRoutes.js +1 -1
- package/dist/esm/analyze/nestedRoutes.js +16 -1
- package/dist/esm/analyze/templates.js +10 -7
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +1 -1
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +24 -22
- package/dist/esm/index.js +42 -1
- package/dist/esm-node/analyze/constants.js +4 -0
- package/dist/esm-node/analyze/getServerRoutes.js +1 -1
- package/dist/esm-node/analyze/nestedRoutes.js +14 -1
- package/dist/esm-node/analyze/templates.js +10 -7
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +1 -1
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +24 -22
- package/dist/esm-node/index.js +17 -1
- package/dist/types/analyze/constants.d.ts +4 -0
- package/package.json +28 -28
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,63 @@
|
|
1
1
|
# @modern-js/app-tools
|
2
2
|
|
3
|
+
## 2.32.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 4323e68: feat: support client-data file
|
8
|
+
feat: 支持 client-data 文件
|
9
|
+
- 2447d64: feat: support ssr resources preload
|
10
|
+
feat: 支持 ssr 资源预加载
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- e5a3fb4: fix: integration test, and export LoaderContext from utils
|
15
|
+
fix: 集成测试,然后导出 LoaderContext
|
16
|
+
- 3910eb8: fix: route.json fit ssr.preload
|
17
|
+
fix: route.json 适配 ssr.preload
|
18
|
+
- 6076166: fix: packaging errors found by publint
|
19
|
+
|
20
|
+
fix: 修复 publint 检测到的 packaging 问题
|
21
|
+
|
22
|
+
- c72980d: chore: When the page component exists, keep the layout component
|
23
|
+
chore: 当 page 组件存在时,保留 layout 组件
|
24
|
+
- 3149ccd: fix: should update asset when only html exists
|
25
|
+
fix: 只有当 html 存在时,才更新资源
|
26
|
+
- Updated dependencies [e6c7d33]
|
27
|
+
- Updated dependencies [e5a3fb4]
|
28
|
+
- Updated dependencies [6076166]
|
29
|
+
- Updated dependencies [5f7c714]
|
30
|
+
- Updated dependencies [6517032]
|
31
|
+
- Updated dependencies [a030aff]
|
32
|
+
- Updated dependencies [6d73519]
|
33
|
+
- Updated dependencies [83c1cf7]
|
34
|
+
- Updated dependencies [79658a0]
|
35
|
+
- Updated dependencies [0cc3981]
|
36
|
+
- Updated dependencies [ddcdef2]
|
37
|
+
- Updated dependencies [4323e68]
|
38
|
+
- Updated dependencies [3c91100]
|
39
|
+
- Updated dependencies [2447d64]
|
40
|
+
- Updated dependencies [5255eba]
|
41
|
+
- @modern-js/prod-server@2.32.0
|
42
|
+
- @modern-js/utils@2.32.0
|
43
|
+
- @modern-js/builder-webpack-provider@2.32.0
|
44
|
+
- @modern-js/builder-rspack-provider@2.32.0
|
45
|
+
- @modern-js/node-bundle-require@2.32.0
|
46
|
+
- @modern-js/plugin-data-loader@2.32.0
|
47
|
+
- @modern-js/plugin@2.32.0
|
48
|
+
- @modern-js/types@2.32.0
|
49
|
+
- @modern-js/server-core@2.32.0
|
50
|
+
- @modern-js/core@2.32.0
|
51
|
+
- @modern-js/server@2.32.0
|
52
|
+
- @modern-js/builder-shared@2.32.0
|
53
|
+
- @modern-js/builder@2.32.0
|
54
|
+
- @modern-js/builder-plugin-esbuild@2.32.0
|
55
|
+
- @modern-js/builder-plugin-node-polyfill@2.32.0
|
56
|
+
- @modern-js/plugin-i18n@2.32.0
|
57
|
+
- @modern-js/plugin-lint@2.32.0
|
58
|
+
- @modern-js/new-action@2.32.0
|
59
|
+
- @modern-js/upgrade@2.32.0
|
60
|
+
|
3
61
|
## 2.31.2
|
4
62
|
|
5
63
|
### Patch Changes
|
package/LICENSE
CHANGED
@@ -107,8 +107,12 @@ const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
107
107
|
const NESTED_ROUTE = {
|
108
108
|
LAYOUT_FILE: "layout",
|
109
109
|
LAYOUT_LOADER_FILE: "layout.loader",
|
110
|
+
LAYOUT_DATA_FILE: "layout.data",
|
111
|
+
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
110
112
|
PAGE_FILE: "page",
|
111
113
|
PAGE_LOADER_FILE: "page.loader",
|
114
|
+
PAGE_DATA_FILE: "layout.data",
|
115
|
+
PAGE_CLIENT_LOADER: "page.data.client",
|
112
116
|
LOADING_FILE: "loading",
|
113
117
|
ERROR_FILE: "error",
|
114
118
|
LOADER_FILE: "loader",
|
@@ -89,7 +89,7 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
|
|
89
89
|
const entryOptions = (0, _utils.getEntryOptions)(entryName, isMainEntry, ssr, ssrByEntries, packageName);
|
90
90
|
const isSSR = Boolean(entryOptions);
|
91
91
|
const isWorker = Boolean(workerSSR);
|
92
|
-
const isStream = typeof entryOptions === "object" && entryOptions.mode === "stream";
|
92
|
+
const isStream = typeof entryOptions === "object" && (entryOptions.mode === "stream" || Boolean(entryOptions.preload));
|
93
93
|
const { resHeaders } = ((_routes = routes) === null || _routes === void 0 ? void 0 : _routes[entryName]) || {};
|
94
94
|
let route = {
|
95
95
|
urlPath: `/${isMainEntry ? "" : entryName}`,
|
@@ -66,7 +66,8 @@ const optimizeRoute = (routeTree) => {
|
|
66
66
|
];
|
67
67
|
}
|
68
68
|
const { children } = routeTree;
|
69
|
-
|
69
|
+
const hasPage = children.some((child) => child.index);
|
70
|
+
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config && !routeTree.clientData && !hasPage) {
|
70
71
|
const newRoutes = children.map((child) => {
|
71
72
|
const routePath = `${routeTree.path ? routeTree.path : ""}${child.path ? `/${child.path}` : ""}`;
|
72
73
|
const newRoute = {
|
@@ -142,6 +143,12 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
142
143
|
route.loader = itemPath;
|
143
144
|
}
|
144
145
|
}
|
146
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
147
|
+
route.clientData = itemPath;
|
148
|
+
}
|
149
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.LAYOUT_DATA_FILE) {
|
150
|
+
route.data = itemPath;
|
151
|
+
}
|
145
152
|
if (itemWithoutExt === _constants.NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
146
153
|
if (!route.config) {
|
147
154
|
route.config = itemPath;
|
@@ -153,6 +160,12 @@ const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldVersion)
|
|
153
160
|
if (itemWithoutExt === _constants.NESTED_ROUTE.PAGE_LOADER_FILE) {
|
154
161
|
pageLoaderFile = itemPath;
|
155
162
|
}
|
163
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
164
|
+
route.clientData = itemPath;
|
165
|
+
}
|
166
|
+
if (itemWithoutExt === _constants.NESTED_ROUTE.PAGE_DATA_FILE) {
|
167
|
+
route.data = itemPath;
|
168
|
+
}
|
156
169
|
if (itemWithoutExt === _constants.NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
157
170
|
pageConfigFile = itemPath;
|
158
171
|
}
|
@@ -164,12 +164,13 @@ const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, entryName,
|
|
164
164
|
import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"
|
165
165
|
`;
|
166
166
|
let rootLayoutCode = ``;
|
167
|
-
const getDataLoaderPath = (loaderId) => {
|
167
|
+
const getDataLoaderPath = (loaderId, clientData) => {
|
168
168
|
if (!ssrMode) {
|
169
169
|
return "";
|
170
170
|
}
|
171
|
+
const clientDataStr = clientData ? `&clientData=${clientData}` : "";
|
171
172
|
if (nestedRoutesEntry) {
|
172
|
-
return `?mapFile=${(0, _utils.slash)(loadersMapFile)}&loaderId=${loaderId}`;
|
173
|
+
return `?mapFile=${(0, _utils.slash)(loadersMapFile)}&loaderId=${loaderId}${clientDataStr}`;
|
173
174
|
}
|
174
175
|
return "";
|
175
176
|
};
|
@@ -194,15 +195,17 @@ const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, entryName,
|
|
194
195
|
errors.push(route.error);
|
195
196
|
error = `error_${errors.length - 1}`;
|
196
197
|
}
|
197
|
-
if (route.loader) {
|
198
|
+
if (route.loader || route.data) {
|
198
199
|
loaders.push(route.loader);
|
199
200
|
const loaderId = loaders.length - 1;
|
200
201
|
loader = `loader_${loaderId}`;
|
201
202
|
loadersMap[loader] = {
|
202
203
|
routeId: route.id,
|
203
|
-
filePath: route.loader,
|
204
|
-
|
204
|
+
filePath: route.data || route.loader,
|
205
|
+
clientData: Boolean(route.clientData),
|
206
|
+
inline: Boolean(route.data)
|
205
207
|
};
|
208
|
+
loader = `loader_${loaderId}`;
|
206
209
|
}
|
207
210
|
if (typeof route.config === "string") {
|
208
211
|
configs.push(route.config);
|
@@ -301,10 +304,10 @@ const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, entryName,
|
|
301
304
|
let importLoadersCode = "";
|
302
305
|
for (const [key, loaderInfo] of Object.entries(loadersMap)) {
|
303
306
|
if (loaderInfo.inline) {
|
304
|
-
importLoadersCode += `import { loader as ${key} } from "${(0, _utils.slash)(loaderInfo.filePath)}${getDataLoaderPath(key)}";
|
307
|
+
importLoadersCode += `import { loader as ${key} } from "${(0, _utils.slash)(loaderInfo.filePath)}${getDataLoaderPath(key, loaderInfo.clientData)}";
|
305
308
|
`;
|
306
309
|
} else {
|
307
|
-
importLoadersCode += `import ${key} from "${(0, _utils.slash)(loaderInfo.filePath)}${getDataLoaderPath(key)}";
|
310
|
+
importLoadersCode += `import ${key} from "${(0, _utils.slash)(loaderInfo.filePath)}${getDataLoaderPath(key, loaderInfo.clientData)}";
|
308
311
|
`;
|
309
312
|
}
|
310
313
|
}
|
@@ -154,6 +154,6 @@ function applySSRDataLoader(chain, options) {
|
|
154
154
|
const { appDirectory } = appContext;
|
155
155
|
const { entriesDir = "./src" } = normalizedConfig.source;
|
156
156
|
const absolutePath = _path.resolve(appDirectory, entriesDir).split(_path.sep).join("(\\\\|/)");
|
157
|
-
const reg = new RegExp(`${absolutePath}.*\\.loader\\.[t|j]
|
157
|
+
const reg = new RegExp(`${absolutePath}.*\\.(loader|data|data.client)\\.[t|j]sx?$`);
|
158
158
|
chain.module.rule("ssr-data-loader").test(reg).use("data-loader").loader(require.resolve("@modern-js/plugin-data-loader/loader")).end();
|
159
159
|
}
|
@@ -164,28 +164,30 @@ class RouterPlugin {
|
|
164
164
|
const oldHtml = compilation.assets[htmlName];
|
165
165
|
const { enableInlineRouteManifests, disableFilenameHash, staticJsDir, scriptLoading, nonce } = this;
|
166
166
|
const nonceAttr = nonce ? `nonce="${nonce}"` : "";
|
167
|
-
if (
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
167
|
+
if (oldHtml) {
|
168
|
+
if (enableInlineRouteManifests) {
|
169
|
+
compilation.updateAsset(
|
170
|
+
htmlName,
|
171
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, `<script ${nonceAttr}>${injectedContent}</script>`)),
|
172
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
173
|
+
void 0
|
174
|
+
);
|
175
|
+
} else {
|
176
|
+
const scriptPath = `${staticJsDir}/${ROUTE_MANIFEST_HOLDER}-${entryName}${disableFilenameHash ? ".js" : `.${generateContentHash(injectedContent)}.js`}`;
|
177
|
+
const scriptUrl = `${publicPath}${scriptPath}`;
|
178
|
+
const scriptLoadingAttr = (
|
179
|
+
// eslint-disable-next-line no-nested-ternary
|
180
|
+
scriptLoading === "defer" ? scriptLoading : scriptLoading === "module" ? `type="module"` : ""
|
181
|
+
);
|
182
|
+
const script = `<script ${scriptLoadingAttr} ${nonceAttr} src="${scriptUrl}"></script>`;
|
183
|
+
compilation.updateAsset(
|
184
|
+
htmlName,
|
185
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, script)),
|
186
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
187
|
+
void 0
|
188
|
+
);
|
189
|
+
compilation.emitAsset(scriptPath, new RawSource(injectedContent));
|
190
|
+
}
|
189
191
|
}
|
190
192
|
}
|
191
193
|
if (prevManifestAsset) {
|
package/dist/cjs/index.js
CHANGED
@@ -123,6 +123,7 @@ const appTools = (options = {
|
|
123
123
|
...appContext,
|
124
124
|
toolsType: "app-tools"
|
125
125
|
});
|
126
|
+
const nestedRoutes = {};
|
126
127
|
const locale = (0, _languagedetector.getLocaleLanguage)();
|
127
128
|
_locale.i18n.changeLanguage({
|
128
129
|
locale
|
@@ -208,6 +209,21 @@ const appTools = (options = {
|
|
208
209
|
(0, _utils.cleanRequireCache)([
|
209
210
|
require.resolve("./analyze")
|
210
211
|
]);
|
212
|
+
},
|
213
|
+
async modifyFileSystemRoutes({ entrypoint, routes }) {
|
214
|
+
nestedRoutes[entrypoint.entryName] = routes;
|
215
|
+
return {
|
216
|
+
entrypoint,
|
217
|
+
routes
|
218
|
+
};
|
219
|
+
},
|
220
|
+
async beforeGenerateRoutes({ entrypoint, code }) {
|
221
|
+
const { distDirectory } = api.useAppContext();
|
222
|
+
await _utils.fs.outputJSON(_path.default.resolve(distDirectory, _utils.NESTED_ROUTE_SPEC_FILE), nestedRoutes);
|
223
|
+
return {
|
224
|
+
entrypoint,
|
225
|
+
code
|
226
|
+
};
|
211
227
|
}
|
212
228
|
};
|
213
229
|
}
|
@@ -28,8 +28,12 @@ export var FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
28
28
|
export var NESTED_ROUTE = {
|
29
29
|
LAYOUT_FILE: "layout",
|
30
30
|
LAYOUT_LOADER_FILE: "layout.loader",
|
31
|
+
LAYOUT_DATA_FILE: "layout.data",
|
32
|
+
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
31
33
|
PAGE_FILE: "page",
|
32
34
|
PAGE_LOADER_FILE: "page.loader",
|
35
|
+
PAGE_DATA_FILE: "layout.data",
|
36
|
+
PAGE_CLIENT_LOADER: "page.data.client",
|
33
37
|
LOADING_FILE: "loading",
|
34
38
|
ERROR_FILE: "error",
|
35
39
|
LOADER_FILE: "loader",
|
@@ -80,7 +80,7 @@ var collectHtmlRoutes = function(entrypoints, appContext, config) {
|
|
80
80
|
var entryOptions = getEntryOptions(entryName, isMainEntry, ssr, ssrByEntries, packageName);
|
81
81
|
var isSSR = Boolean(entryOptions);
|
82
82
|
var isWorker = Boolean(workerSSR);
|
83
|
-
var isStream = typeof entryOptions === "object" && entryOptions.mode === "stream";
|
83
|
+
var isStream = typeof entryOptions === "object" && (entryOptions.mode === "stream" || Boolean(entryOptions.preload));
|
84
84
|
var resHeaders = (((_routes = routes) === null || _routes === void 0 ? void 0 : _routes[entryName]) || {}).resHeaders;
|
85
85
|
var route = {
|
86
86
|
urlPath: "/".concat(isMainEntry ? "" : entryName),
|
@@ -45,7 +45,10 @@ export var optimizeRoute = function(routeTree) {
|
|
45
45
|
];
|
46
46
|
}
|
47
47
|
var children = routeTree.children;
|
48
|
-
|
48
|
+
var hasPage = children.some(function(child) {
|
49
|
+
return child.index;
|
50
|
+
});
|
51
|
+
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config && !routeTree.clientData && !hasPage) {
|
49
52
|
var newRoutes = children.map(function(child) {
|
50
53
|
var routePath = "".concat(routeTree.path ? routeTree.path : "").concat(child.path ? "/".concat(child.path) : "");
|
51
54
|
var newRoute = _object_spread_props(_object_spread({}, child), {
|
@@ -179,6 +182,12 @@ export var walk = function() {
|
|
179
182
|
route.loader = itemPath;
|
180
183
|
}
|
181
184
|
}
|
185
|
+
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
186
|
+
route.clientData = itemPath;
|
187
|
+
}
|
188
|
+
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_DATA_FILE) {
|
189
|
+
route.data = itemPath;
|
190
|
+
}
|
182
191
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
183
192
|
if (!route.config) {
|
184
193
|
route.config = itemPath;
|
@@ -190,6 +199,12 @@ export var walk = function() {
|
|
190
199
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_LOADER_FILE) {
|
191
200
|
pageLoaderFile = itemPath;
|
192
201
|
}
|
202
|
+
if (itemWithoutExt === NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
203
|
+
route.clientData = itemPath;
|
204
|
+
}
|
205
|
+
if (itemWithoutExt === NESTED_ROUTE.PAGE_DATA_FILE) {
|
206
|
+
route.data = itemPath;
|
207
|
+
}
|
193
208
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
194
209
|
pageConfigFile = itemPath;
|
195
210
|
}
|
@@ -99,12 +99,13 @@ export var fileSystemRoutes = function() {
|
|
99
99
|
loadersMapFile = path.join(internalDirectory, entryName, TEMP_LOADERS_DIR, "map.json");
|
100
100
|
importLazyCode = '\n import { lazy } from "react";\n import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"\n ';
|
101
101
|
rootLayoutCode = "";
|
102
|
-
getDataLoaderPath = function(loaderId) {
|
102
|
+
getDataLoaderPath = function(loaderId, clientData) {
|
103
103
|
if (!ssrMode) {
|
104
104
|
return "";
|
105
105
|
}
|
106
|
+
var clientDataStr = clientData ? "&clientData=".concat(clientData) : "";
|
106
107
|
if (nestedRoutesEntry) {
|
107
|
-
return "?mapFile=".concat(slash(loadersMapFile), "&loaderId=").concat(loaderId);
|
108
|
+
return "?mapFile=".concat(slash(loadersMapFile), "&loaderId=").concat(loaderId).concat(clientDataStr);
|
108
109
|
}
|
109
110
|
return "";
|
110
111
|
};
|
@@ -129,15 +130,17 @@ export var fileSystemRoutes = function() {
|
|
129
130
|
errors.push(route2.error);
|
130
131
|
error = "error_".concat(errors.length - 1);
|
131
132
|
}
|
132
|
-
if (route2.loader) {
|
133
|
+
if (route2.loader || route2.data) {
|
133
134
|
loaders.push(route2.loader);
|
134
135
|
var loaderId = loaders.length - 1;
|
135
136
|
loader = "loader_".concat(loaderId);
|
136
137
|
loadersMap[loader] = {
|
137
138
|
routeId: route2.id,
|
138
|
-
filePath: route2.loader,
|
139
|
-
|
139
|
+
filePath: route2.data || route2.loader,
|
140
|
+
clientData: Boolean(route2.clientData),
|
141
|
+
inline: Boolean(route2.data)
|
140
142
|
};
|
143
|
+
loader = "loader_".concat(loaderId);
|
141
144
|
}
|
142
145
|
if (typeof route2.config === "string") {
|
143
146
|
configs.push(route2.config);
|
@@ -252,9 +255,9 @@ export var fileSystemRoutes = function() {
|
|
252
255
|
for (_iterator1 = Object.entries(loadersMap)[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
253
256
|
_step_value = _sliced_to_array(_step1.value, 2), key = _step_value[0], loaderInfo = _step_value[1];
|
254
257
|
if (loaderInfo.inline) {
|
255
|
-
importLoadersCode += "import { loader as ".concat(key, ' } from "').concat(slash(loaderInfo.filePath)).concat(getDataLoaderPath(key), '";\n');
|
258
|
+
importLoadersCode += "import { loader as ".concat(key, ' } from "').concat(slash(loaderInfo.filePath)).concat(getDataLoaderPath(key, loaderInfo.clientData), '";\n');
|
256
259
|
} else {
|
257
|
-
importLoadersCode += "import ".concat(key, ' from "').concat(slash(loaderInfo.filePath)).concat(getDataLoaderPath(key), '";\n');
|
260
|
+
importLoadersCode += "import ".concat(key, ' from "').concat(slash(loaderInfo.filePath)).concat(getDataLoaderPath(key, loaderInfo.clientData), '";\n');
|
258
261
|
}
|
259
262
|
}
|
260
263
|
} catch (err) {
|
@@ -253,6 +253,6 @@ function applySSRDataLoader(chain, options) {
|
|
253
253
|
var appDirectory = appContext.appDirectory;
|
254
254
|
var _normalizedConfig_source = normalizedConfig.source, _normalizedConfig_source_entriesDir = _normalizedConfig_source.entriesDir, entriesDir = _normalizedConfig_source_entriesDir === void 0 ? "./src" : _normalizedConfig_source_entriesDir;
|
255
255
|
var absolutePath = path.resolve(appDirectory, entriesDir).split(path.sep).join("(\\\\|/)");
|
256
|
-
var reg = new RegExp("".concat(absolutePath, ".*\\.loader\\.[t|j]
|
256
|
+
var reg = new RegExp("".concat(absolutePath, ".*\\.(loader|data|data.client)\\.[t|j]sx?$"));
|
257
257
|
chain.module.rule("ssr-data-loader").test(reg).use("data-loader").loader(require.resolve("@modern-js/plugin-data-loader/loader")).end();
|
258
258
|
}
|
@@ -172,28 +172,30 @@ export var RouterPlugin = /* @__PURE__ */ function() {
|
|
172
172
|
var oldHtml = compilation.assets[htmlName];
|
173
173
|
var enableInlineRouteManifests = _this1.enableInlineRouteManifests, disableFilenameHash = _this1.disableFilenameHash, staticJsDir = _this1.staticJsDir, scriptLoading = _this1.scriptLoading, nonce = _this1.nonce;
|
174
174
|
var nonceAttr = nonce ? 'nonce="'.concat(nonce, '"') : "";
|
175
|
-
if (
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
175
|
+
if (oldHtml) {
|
176
|
+
if (enableInlineRouteManifests) {
|
177
|
+
compilation.updateAsset(
|
178
|
+
htmlName,
|
179
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, "<script ".concat(nonceAttr, ">").concat(injectedContent, "</script>"))),
|
180
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
181
|
+
void 0
|
182
|
+
);
|
183
|
+
} else {
|
184
|
+
var scriptPath = "".concat(staticJsDir, "/").concat(ROUTE_MANIFEST_HOLDER, "-").concat(entryName).concat(disableFilenameHash ? ".js" : ".".concat(generateContentHash(injectedContent), ".js"));
|
185
|
+
var scriptUrl = "".concat(publicPath).concat(scriptPath);
|
186
|
+
var scriptLoadingAttr = (
|
187
|
+
// eslint-disable-next-line no-nested-ternary
|
188
|
+
scriptLoading === "defer" ? scriptLoading : scriptLoading === "module" ? 'type="module"' : ""
|
189
|
+
);
|
190
|
+
var script = "<script ".concat(scriptLoadingAttr, " ").concat(nonceAttr, ' src="').concat(scriptUrl, '"></script>');
|
191
|
+
compilation.updateAsset(
|
192
|
+
htmlName,
|
193
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, script)),
|
194
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
195
|
+
void 0
|
196
|
+
);
|
197
|
+
compilation.emitAsset(scriptPath, new RawSource(injectedContent));
|
198
|
+
}
|
197
199
|
}
|
198
200
|
};
|
199
201
|
stats = compilation.getStats().toJson({
|
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 } from "@modern-js/utils";
|
7
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv, fs, NESTED_ROUTE_SPEC_FILE } from "@modern-js/utils";
|
8
8
|
import { castArray } from "@modern-js/utils/lodash";
|
9
9
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
10
10
|
import analyzePlugin from "./analyze";
|
@@ -301,6 +301,7 @@ export var appTools = function() {
|
|
301
301
|
api.setAppContext(_object_spread_props(_object_spread({}, appContext), {
|
302
302
|
toolsType: "app-tools"
|
303
303
|
}));
|
304
|
+
var nestedRoutes = {};
|
304
305
|
var locale = getLocaleLanguage();
|
305
306
|
i18n.changeLanguage({
|
306
307
|
locale: locale
|
@@ -601,6 +602,46 @@ export var appTools = function() {
|
|
601
602
|
];
|
602
603
|
});
|
603
604
|
})();
|
605
|
+
},
|
606
|
+
modifyFileSystemRoutes: function modifyFileSystemRoutes(param) {
|
607
|
+
var entrypoint = param.entrypoint, routes = param.routes;
|
608
|
+
return _async_to_generator(function() {
|
609
|
+
return _ts_generator(this, function(_state) {
|
610
|
+
nestedRoutes[entrypoint.entryName] = routes;
|
611
|
+
return [
|
612
|
+
2,
|
613
|
+
{
|
614
|
+
entrypoint: entrypoint,
|
615
|
+
routes: routes
|
616
|
+
}
|
617
|
+
];
|
618
|
+
});
|
619
|
+
})();
|
620
|
+
},
|
621
|
+
beforeGenerateRoutes: function beforeGenerateRoutes(param) {
|
622
|
+
var entrypoint = param.entrypoint, code = param.code;
|
623
|
+
return _async_to_generator(function() {
|
624
|
+
var distDirectory;
|
625
|
+
return _ts_generator(this, function(_state) {
|
626
|
+
switch (_state.label) {
|
627
|
+
case 0:
|
628
|
+
distDirectory = api.useAppContext().distDirectory;
|
629
|
+
return [
|
630
|
+
4,
|
631
|
+
fs.outputJSON(path.resolve(distDirectory, NESTED_ROUTE_SPEC_FILE), nestedRoutes)
|
632
|
+
];
|
633
|
+
case 1:
|
634
|
+
_state.sent();
|
635
|
+
return [
|
636
|
+
2,
|
637
|
+
{
|
638
|
+
entrypoint: entrypoint,
|
639
|
+
code: code
|
640
|
+
}
|
641
|
+
];
|
642
|
+
}
|
643
|
+
});
|
644
|
+
})();
|
604
645
|
}
|
605
646
|
};
|
606
647
|
}
|
@@ -28,8 +28,12 @@ export const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
28
28
|
export const NESTED_ROUTE = {
|
29
29
|
LAYOUT_FILE: "layout",
|
30
30
|
LAYOUT_LOADER_FILE: "layout.loader",
|
31
|
+
LAYOUT_DATA_FILE: "layout.data",
|
32
|
+
LAYOUT_CLIENT_LOADER: "layout.data.client",
|
31
33
|
PAGE_FILE: "page",
|
32
34
|
PAGE_LOADER_FILE: "page.loader",
|
35
|
+
PAGE_DATA_FILE: "layout.data",
|
36
|
+
PAGE_CLIENT_LOADER: "page.data.client",
|
33
37
|
LOADING_FILE: "loading",
|
34
38
|
ERROR_FILE: "error",
|
35
39
|
LOADER_FILE: "loader",
|
@@ -78,7 +78,7 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
|
|
78
78
|
const entryOptions = getEntryOptions(entryName, isMainEntry, ssr, ssrByEntries, packageName);
|
79
79
|
const isSSR = Boolean(entryOptions);
|
80
80
|
const isWorker = Boolean(workerSSR);
|
81
|
-
const isStream = typeof entryOptions === "object" && entryOptions.mode === "stream";
|
81
|
+
const isStream = typeof entryOptions === "object" && (entryOptions.mode === "stream" || Boolean(entryOptions.preload));
|
82
82
|
const { resHeaders } = ((_routes = routes) === null || _routes === void 0 ? void 0 : _routes[entryName]) || {};
|
83
83
|
let route = {
|
84
84
|
urlPath: `/${isMainEntry ? "" : entryName}`,
|
@@ -43,7 +43,8 @@ export const optimizeRoute = (routeTree) => {
|
|
43
43
|
];
|
44
44
|
}
|
45
45
|
const { children } = routeTree;
|
46
|
-
|
46
|
+
const hasPage = children.some((child) => child.index);
|
47
|
+
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config && !routeTree.clientData && !hasPage) {
|
47
48
|
const newRoutes = children.map((child) => {
|
48
49
|
const routePath = `${routeTree.path ? routeTree.path : ""}${child.path ? `/${child.path}` : ""}`;
|
49
50
|
const newRoute = {
|
@@ -119,6 +120,12 @@ export const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldV
|
|
119
120
|
route.loader = itemPath;
|
120
121
|
}
|
121
122
|
}
|
123
|
+
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CLIENT_LOADER) {
|
124
|
+
route.clientData = itemPath;
|
125
|
+
}
|
126
|
+
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_DATA_FILE) {
|
127
|
+
route.data = itemPath;
|
128
|
+
}
|
122
129
|
if (itemWithoutExt === NESTED_ROUTE.LAYOUT_CONFIG_FILE) {
|
123
130
|
if (!route.config) {
|
124
131
|
route.config = itemPath;
|
@@ -130,6 +137,12 @@ export const walk = async (dirname, rootDir, alias, entryName, isMainEntry, oldV
|
|
130
137
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_LOADER_FILE) {
|
131
138
|
pageLoaderFile = itemPath;
|
132
139
|
}
|
140
|
+
if (itemWithoutExt === NESTED_ROUTE.PAGE_CLIENT_LOADER) {
|
141
|
+
route.clientData = itemPath;
|
142
|
+
}
|
143
|
+
if (itemWithoutExt === NESTED_ROUTE.PAGE_DATA_FILE) {
|
144
|
+
route.data = itemPath;
|
145
|
+
}
|
133
146
|
if (itemWithoutExt === NESTED_ROUTE.PAGE_CONFIG_FILE) {
|
134
147
|
pageConfigFile = itemPath;
|
135
148
|
}
|
@@ -132,12 +132,13 @@ export const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, ent
|
|
132
132
|
import loadable, { lazy as loadableLazy } from "@modern-js/runtime/loadable"
|
133
133
|
`;
|
134
134
|
let rootLayoutCode = ``;
|
135
|
-
const getDataLoaderPath = (loaderId) => {
|
135
|
+
const getDataLoaderPath = (loaderId, clientData) => {
|
136
136
|
if (!ssrMode) {
|
137
137
|
return "";
|
138
138
|
}
|
139
|
+
const clientDataStr = clientData ? `&clientData=${clientData}` : "";
|
139
140
|
if (nestedRoutesEntry) {
|
140
|
-
return `?mapFile=${slash(loadersMapFile)}&loaderId=${loaderId}`;
|
141
|
+
return `?mapFile=${slash(loadersMapFile)}&loaderId=${loaderId}${clientDataStr}`;
|
141
142
|
}
|
142
143
|
return "";
|
143
144
|
};
|
@@ -162,15 +163,17 @@ export const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, ent
|
|
162
163
|
errors.push(route.error);
|
163
164
|
error = `error_${errors.length - 1}`;
|
164
165
|
}
|
165
|
-
if (route.loader) {
|
166
|
+
if (route.loader || route.data) {
|
166
167
|
loaders.push(route.loader);
|
167
168
|
const loaderId = loaders.length - 1;
|
168
169
|
loader = `loader_${loaderId}`;
|
169
170
|
loadersMap[loader] = {
|
170
171
|
routeId: route.id,
|
171
|
-
filePath: route.loader,
|
172
|
-
|
172
|
+
filePath: route.data || route.loader,
|
173
|
+
clientData: Boolean(route.clientData),
|
174
|
+
inline: Boolean(route.data)
|
173
175
|
};
|
176
|
+
loader = `loader_${loaderId}`;
|
174
177
|
}
|
175
178
|
if (typeof route.config === "string") {
|
176
179
|
configs.push(route.config);
|
@@ -269,10 +272,10 @@ export const fileSystemRoutes = async ({ routes, ssrMode, nestedRoutesEntry, ent
|
|
269
272
|
let importLoadersCode = "";
|
270
273
|
for (const [key, loaderInfo] of Object.entries(loadersMap)) {
|
271
274
|
if (loaderInfo.inline) {
|
272
|
-
importLoadersCode += `import { loader as ${key} } from "${slash(loaderInfo.filePath)}${getDataLoaderPath(key)}";
|
275
|
+
importLoadersCode += `import { loader as ${key} } from "${slash(loaderInfo.filePath)}${getDataLoaderPath(key, loaderInfo.clientData)}";
|
273
276
|
`;
|
274
277
|
} else {
|
275
|
-
importLoadersCode += `import ${key} from "${slash(loaderInfo.filePath)}${getDataLoaderPath(key)}";
|
278
|
+
importLoadersCode += `import ${key} from "${slash(loaderInfo.filePath)}${getDataLoaderPath(key, loaderInfo.clientData)}";
|
276
279
|
`;
|
277
280
|
}
|
278
281
|
}
|
@@ -143,6 +143,6 @@ function applySSRDataLoader(chain, options) {
|
|
143
143
|
const { appDirectory } = appContext;
|
144
144
|
const { entriesDir = "./src" } = normalizedConfig.source;
|
145
145
|
const absolutePath = path.resolve(appDirectory, entriesDir).split(path.sep).join("(\\\\|/)");
|
146
|
-
const reg = new RegExp(`${absolutePath}.*\\.loader\\.[t|j]
|
146
|
+
const reg = new RegExp(`${absolutePath}.*\\.(loader|data|data.client)\\.[t|j]sx?$`);
|
147
147
|
chain.module.rule("ssr-data-loader").test(reg).use("data-loader").loader(require.resolve("@modern-js/plugin-data-loader/loader")).end();
|
148
148
|
}
|
@@ -154,28 +154,30 @@ export class RouterPlugin {
|
|
154
154
|
const oldHtml = compilation.assets[htmlName];
|
155
155
|
const { enableInlineRouteManifests, disableFilenameHash, staticJsDir, scriptLoading, nonce } = this;
|
156
156
|
const nonceAttr = nonce ? `nonce="${nonce}"` : "";
|
157
|
-
if (
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
157
|
+
if (oldHtml) {
|
158
|
+
if (enableInlineRouteManifests) {
|
159
|
+
compilation.updateAsset(
|
160
|
+
htmlName,
|
161
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, `<script ${nonceAttr}>${injectedContent}</script>`)),
|
162
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
163
|
+
void 0
|
164
|
+
);
|
165
|
+
} else {
|
166
|
+
const scriptPath = `${staticJsDir}/${ROUTE_MANIFEST_HOLDER}-${entryName}${disableFilenameHash ? ".js" : `.${generateContentHash(injectedContent)}.js`}`;
|
167
|
+
const scriptUrl = `${publicPath}${scriptPath}`;
|
168
|
+
const scriptLoadingAttr = (
|
169
|
+
// eslint-disable-next-line no-nested-ternary
|
170
|
+
scriptLoading === "defer" ? scriptLoading : scriptLoading === "module" ? `type="module"` : ""
|
171
|
+
);
|
172
|
+
const script = `<script ${scriptLoadingAttr} ${nonceAttr} src="${scriptUrl}"></script>`;
|
173
|
+
compilation.updateAsset(
|
174
|
+
htmlName,
|
175
|
+
new RawSource(oldHtml.source().toString().replace(placeholder, script)),
|
176
|
+
// FIXME: The arguments third of updatgeAsset is a optional function in webpack.
|
177
|
+
void 0
|
178
|
+
);
|
179
|
+
compilation.emitAsset(scriptPath, new RawSource(injectedContent));
|
180
|
+
}
|
179
181
|
}
|
180
182
|
}
|
181
183
|
if (prevManifestAsset) {
|
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 } from "@modern-js/utils";
|
3
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv, fs, NESTED_ROUTE_SPEC_FILE } from "@modern-js/utils";
|
4
4
|
import { castArray } from "@modern-js/utils/lodash";
|
5
5
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
6
6
|
import analyzePlugin from "./analyze";
|
@@ -89,6 +89,7 @@ export const appTools = (options = {
|
|
89
89
|
...appContext,
|
90
90
|
toolsType: "app-tools"
|
91
91
|
});
|
92
|
+
const nestedRoutes = {};
|
92
93
|
const locale = getLocaleLanguage();
|
93
94
|
i18n.changeLanguage({
|
94
95
|
locale
|
@@ -174,6 +175,21 @@ export const appTools = (options = {
|
|
174
175
|
cleanRequireCache([
|
175
176
|
require.resolve("./analyze")
|
176
177
|
]);
|
178
|
+
},
|
179
|
+
async modifyFileSystemRoutes({ entrypoint, routes }) {
|
180
|
+
nestedRoutes[entrypoint.entryName] = routes;
|
181
|
+
return {
|
182
|
+
entrypoint,
|
183
|
+
routes
|
184
|
+
};
|
185
|
+
},
|
186
|
+
async beforeGenerateRoutes({ entrypoint, code }) {
|
187
|
+
const { distDirectory } = api.useAppContext();
|
188
|
+
await fs.outputJSON(path.resolve(distDirectory, NESTED_ROUTE_SPEC_FILE), nestedRoutes);
|
189
|
+
return {
|
190
|
+
entrypoint,
|
191
|
+
code
|
192
|
+
};
|
177
193
|
}
|
178
194
|
};
|
179
195
|
}
|
@@ -19,8 +19,12 @@ export declare const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
19
19
|
export declare const NESTED_ROUTE: {
|
20
20
|
LAYOUT_FILE: string;
|
21
21
|
LAYOUT_LOADER_FILE: string;
|
22
|
+
LAYOUT_DATA_FILE: string;
|
23
|
+
LAYOUT_CLIENT_LOADER: string;
|
22
24
|
PAGE_FILE: string;
|
23
25
|
PAGE_LOADER_FILE: string;
|
26
|
+
PAGE_DATA_FILE: string;
|
27
|
+
PAGE_CLIENT_LOADER: string;
|
24
28
|
LOADING_FILE: string;
|
25
29
|
ERROR_FILE: string;
|
26
30
|
LOADER_FILE: string;
|
package/package.json
CHANGED
@@ -15,33 +15,33 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.32.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
22
22
|
"exports": {
|
23
23
|
".": {
|
24
|
+
"types": "./dist/types/index.d.ts",
|
24
25
|
"node": {
|
25
26
|
"jsnext:source": "./src/index.ts",
|
26
27
|
"import": "./dist/esm/index.js",
|
27
28
|
"require": "./dist/cjs/index.js"
|
28
29
|
},
|
29
|
-
"types": "./dist/types/index.d.ts",
|
30
30
|
"default": "./dist/cjs/index.js"
|
31
31
|
},
|
32
32
|
"./cli": {
|
33
|
-
"jsnext:source": "./src/index.ts",
|
34
33
|
"types": "./dist/types/index.d.ts",
|
34
|
+
"jsnext:source": "./src/index.ts",
|
35
35
|
"default": "./dist/cjs/index.js"
|
36
36
|
},
|
37
37
|
"./types": {
|
38
|
-
"jsnext:source": "./lib/types.d.ts",
|
39
38
|
"types": "./lib/types.d.ts",
|
39
|
+
"jsnext:source": "./lib/types.d.ts",
|
40
40
|
"default": "./lib/types.d.ts"
|
41
41
|
},
|
42
42
|
"./server": {
|
43
|
-
"jsnext:source": "./src/exports/server.ts",
|
44
43
|
"types": "./dist/types/exports/server.d.ts",
|
44
|
+
"jsnext:source": "./src/exports/server.ts",
|
45
45
|
"default": "./dist/cjs/exports/server.js"
|
46
46
|
}
|
47
47
|
},
|
@@ -73,24 +73,24 @@
|
|
73
73
|
"esbuild": "0.17.19",
|
74
74
|
"rspack-plugin-virtual-module": "0.1.7",
|
75
75
|
"@swc/helpers": "0.5.1",
|
76
|
-
"@modern-js/builder": "2.
|
77
|
-
"@modern-js/builder-plugin-esbuild": "2.
|
78
|
-
"@modern-js/builder-plugin-node-polyfill": "2.
|
79
|
-
"@modern-js/builder-shared": "2.
|
80
|
-
"@modern-js/builder-webpack-provider": "2.
|
81
|
-
"@modern-js/core": "2.
|
82
|
-
"@modern-js/new-action": "2.
|
83
|
-
"@modern-js/node-bundle-require": "2.
|
84
|
-
"@modern-js/plugin": "2.
|
85
|
-
"@modern-js/plugin-data-loader": "2.
|
86
|
-
"@modern-js/plugin-i18n": "2.
|
87
|
-
"@modern-js/plugin-lint": "2.
|
88
|
-
"@modern-js/prod-server": "2.
|
89
|
-
"@modern-js/server": "2.
|
90
|
-
"@modern-js/types": "2.
|
91
|
-
"@modern-js/upgrade": "2.
|
92
|
-
"@modern-js/utils": "2.
|
93
|
-
"@modern-js/server-core": "2.
|
76
|
+
"@modern-js/builder": "2.32.0",
|
77
|
+
"@modern-js/builder-plugin-esbuild": "2.32.0",
|
78
|
+
"@modern-js/builder-plugin-node-polyfill": "2.32.0",
|
79
|
+
"@modern-js/builder-shared": "2.32.0",
|
80
|
+
"@modern-js/builder-webpack-provider": "2.32.0",
|
81
|
+
"@modern-js/core": "2.32.0",
|
82
|
+
"@modern-js/new-action": "2.32.0",
|
83
|
+
"@modern-js/node-bundle-require": "2.32.0",
|
84
|
+
"@modern-js/plugin": "2.32.0",
|
85
|
+
"@modern-js/plugin-data-loader": "2.32.0",
|
86
|
+
"@modern-js/plugin-i18n": "2.32.0",
|
87
|
+
"@modern-js/plugin-lint": "2.32.0",
|
88
|
+
"@modern-js/prod-server": "2.32.0",
|
89
|
+
"@modern-js/server": "2.32.0",
|
90
|
+
"@modern-js/types": "2.32.0",
|
91
|
+
"@modern-js/upgrade": "2.32.0",
|
92
|
+
"@modern-js/utils": "2.32.0",
|
93
|
+
"@modern-js/server-core": "2.32.0"
|
94
94
|
},
|
95
95
|
"devDependencies": {
|
96
96
|
"@types/babel__traverse": "^7.14.2",
|
@@ -99,13 +99,13 @@
|
|
99
99
|
"jest": "^29",
|
100
100
|
"typescript": "^5",
|
101
101
|
"webpack": "^5.88.1",
|
102
|
-
"@modern-js/builder-plugin-swc": "2.
|
103
|
-
"@modern-js/builder-rspack-provider": "2.
|
104
|
-
"@scripts/
|
105
|
-
"@scripts/
|
102
|
+
"@modern-js/builder-plugin-swc": "2.32.0",
|
103
|
+
"@modern-js/builder-rspack-provider": "2.32.0",
|
104
|
+
"@scripts/build": "2.32.0",
|
105
|
+
"@scripts/jest-config": "2.32.0"
|
106
106
|
},
|
107
107
|
"peerDependencies": {
|
108
|
-
"@modern-js/builder-rspack-provider": "^2.
|
108
|
+
"@modern-js/builder-rspack-provider": "^2.32.0"
|
109
109
|
},
|
110
110
|
"peerDependenciesMeta": {
|
111
111
|
"@modern-js/builder-rspack-provider": {
|