@modern-js/upgrade-generator 3.1.29 → 3.1.30
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/index.js +23 -15
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -115349,6 +115349,8 @@ var require_chainId = __commonJS({
|
|
|
115349
115349
|
YAML: "yaml",
|
|
115350
115350
|
/** Rule for wasm */
|
|
115351
115351
|
WASM: "wasm",
|
|
115352
|
+
/** Rule for node */
|
|
115353
|
+
NODE: "node",
|
|
115352
115354
|
/** Rule for bff */
|
|
115353
115355
|
JS_BFF_API: "js-bff-api"
|
|
115354
115356
|
},
|
|
@@ -115387,6 +115389,8 @@ var require_chainId = __commonJS({
|
|
|
115387
115389
|
TOML: "toml",
|
|
115388
115390
|
/** html-loader */
|
|
115389
115391
|
HTML: "html",
|
|
115392
|
+
/** node-loader */
|
|
115393
|
+
NODE: "html",
|
|
115390
115394
|
/** babel-loader */
|
|
115391
115395
|
BABEL: "babel",
|
|
115392
115396
|
/** esbuild-loader */
|
|
@@ -115647,7 +115651,6 @@ var require_constants = __commonJS({
|
|
|
115647
115651
|
};
|
|
115648
115652
|
var INTERNAL_MODULE_TOOLS_PLUGINS = {
|
|
115649
115653
|
"@modern-js/module-tools": "@modern-js/module-tools",
|
|
115650
|
-
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
|
115651
115654
|
"@modern-js/runtime": "@modern-js/runtime/cli",
|
|
115652
115655
|
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
|
115653
115656
|
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
|
@@ -115925,11 +115928,12 @@ var require_config2 = __commonJS({
|
|
|
115925
115928
|
});
|
|
115926
115929
|
var _type = require_type();
|
|
115927
115930
|
var isSSR = (config) => {
|
|
115931
|
+
var _server, _server1;
|
|
115928
115932
|
const { server } = config;
|
|
115929
|
-
if (server === null ||
|
|
115933
|
+
if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
|
|
115930
115934
|
return true;
|
|
115931
115935
|
}
|
|
115932
|
-
if ((server === null ||
|
|
115936
|
+
if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
|
115933
115937
|
for (const name of Object.keys(server.ssrByEntries)) {
|
|
115934
115938
|
if (server.ssrByEntries[name]) {
|
|
115935
115939
|
return true;
|
|
@@ -115939,27 +115943,29 @@ var require_config2 = __commonJS({
|
|
|
115939
115943
|
return false;
|
|
115940
115944
|
};
|
|
115941
115945
|
var isUseSSRBundle = (config) => {
|
|
115946
|
+
var _output;
|
|
115942
115947
|
const { output: output2 } = config;
|
|
115943
|
-
if (output2 === null ||
|
|
115948
|
+
if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
|
|
115944
115949
|
return true;
|
|
115945
115950
|
}
|
|
115946
115951
|
return isSSR(config);
|
|
115947
115952
|
};
|
|
115948
115953
|
var isServiceWorker = (config) => {
|
|
115949
|
-
var _deploy_worker;
|
|
115954
|
+
var _deploy_worker, _deploy, _output;
|
|
115950
115955
|
const { output: output2, deploy } = config;
|
|
115951
|
-
if ((deploy === null ||
|
|
115956
|
+
if (((_deploy = deploy) === null || _deploy === void 0 ? void 0 : (_deploy_worker = _deploy.worker) === null || _deploy_worker === void 0 ? void 0 : _deploy_worker.ssr) && (((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) || isSSR(config))) {
|
|
115952
115957
|
return true;
|
|
115953
115958
|
}
|
|
115954
115959
|
return false;
|
|
115955
115960
|
};
|
|
115956
115961
|
var isRouterV5 = (config) => {
|
|
115957
|
-
var _config_runtime, _config_runtime1,
|
|
115958
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (config === null ||
|
|
115962
|
+
var _config_runtime, _config_runtime_router, _config_runtime1, _config;
|
|
115963
|
+
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && ((_config = config) === null || _config === void 0 ? void 0 : (_config_runtime1 = _config.runtime) === null || _config_runtime1 === void 0 ? void 0 : (_config_runtime_router = _config_runtime1.router) === null || _config_runtime_router === void 0 ? void 0 : _config_runtime_router.mode) === "react-router-5";
|
|
115959
115964
|
};
|
|
115960
115965
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
|
115966
|
+
var _ssgConfig, _ssgConfig1;
|
|
115961
115967
|
const ssgConfig = config.output.ssg;
|
|
115962
|
-
const useSSG = isSingleEntry(entrypoints) ? Boolean(ssgConfig) : ssgConfig === true || typeof (ssgConfig === null ||
|
|
115968
|
+
const useSSG = isSingleEntry(entrypoints) ? Boolean(ssgConfig) : ssgConfig === true || typeof ((_ssgConfig = ssgConfig) === null || _ssgConfig === void 0 ? void 0 : _ssgConfig[0]) === "function" || Boolean((_ssgConfig1 = ssgConfig) === null || _ssgConfig1 === void 0 ? void 0 : _ssgConfig1[entryName]);
|
|
115963
115969
|
return useSSG;
|
|
115964
115970
|
};
|
|
115965
115971
|
var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
|
|
@@ -116706,7 +116712,7 @@ var require_alias = __commonJS({
|
|
|
116706
116712
|
};
|
|
116707
116713
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
|
116708
116714
|
var getAliasConfig = (aliasOption, option) => {
|
|
116709
|
-
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
|
116715
|
+
var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
|
|
116710
116716
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
|
116711
116717
|
const alias = mergeAlias(aliasOption);
|
|
116712
116718
|
if (!isTsProject) {
|
|
@@ -116718,10 +116724,10 @@ var require_alias = __commonJS({
|
|
|
116718
116724
|
};
|
|
116719
116725
|
}
|
|
116720
116726
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
|
116721
|
-
const baseUrl = tsconfig === null ||
|
|
116727
|
+
const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
|
116722
116728
|
return {
|
|
116723
116729
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
|
116724
|
-
paths: __spreadValues(__spreadValues({}, alias), tsconfig === null ||
|
|
116730
|
+
paths: __spreadValues(__spreadValues({}, alias), (_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths),
|
|
116725
116731
|
isTsPath: true,
|
|
116726
116732
|
isTsProject
|
|
116727
116733
|
};
|
|
@@ -117260,7 +117266,8 @@ var require_prettyInstructions = __commonJS({
|
|
|
117260
117266
|
const LOCAL_LABEL = "Local: ";
|
|
117261
117267
|
const NETWORK_LABEL = "Network: ";
|
|
117262
117268
|
const isLocalhost = (url) => {
|
|
117263
|
-
|
|
117269
|
+
var _url;
|
|
117270
|
+
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
|
117264
117271
|
};
|
|
117265
117272
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
|
117266
117273
|
return [
|
|
@@ -117289,7 +117296,7 @@ var require_prettyInstructions = __commonJS({
|
|
|
117289
117296
|
var prettyInstructions = (appContext, config) => {
|
|
117290
117297
|
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
|
117291
117298
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
|
117292
|
-
const isHttps = (0, _is.isDev)() && ((
|
|
117299
|
+
const isHttps = (0, _is.isDev)() && ((_appContext_builder = appContext.builder) === null || _appContext_builder === void 0 ? void 0 : (_appContext_builder_context_devServer = _appContext_builder.context.devServer) === null || _appContext_builder_context_devServer === void 0 ? void 0 : _appContext_builder_context_devServer.https);
|
|
117293
117300
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
|
117294
117301
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
|
117295
117302
|
let message = "App running at:\n\n";
|
|
@@ -117354,8 +117361,9 @@ var require_require = __commonJS({
|
|
|
117354
117361
|
});
|
|
117355
117362
|
var _fs = require_fs();
|
|
117356
117363
|
var compatRequire = (filePath, interop = true) => {
|
|
117364
|
+
var _mod;
|
|
117357
117365
|
const mod = require(filePath);
|
|
117358
|
-
const rtnESMDefault = interop && (mod === null ||
|
|
117366
|
+
const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
|
|
117359
117367
|
return rtnESMDefault ? mod.default : mod;
|
|
117360
117368
|
};
|
|
117361
117369
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.30",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@types/node": "^14",
|
|
31
31
|
"jest": "^29",
|
|
32
32
|
"typescript": "^5",
|
|
33
|
-
"@scripts/build": "2.
|
|
34
|
-
"@scripts/jest-config": "2.
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/generator-common": "3.1.
|
|
33
|
+
"@scripts/build": "2.28.0",
|
|
34
|
+
"@scripts/jest-config": "2.28.0",
|
|
35
|
+
"@modern-js/generator-utils": "3.1.30",
|
|
36
|
+
"@modern-js/plugin-i18n": "2.28.0",
|
|
37
|
+
"@modern-js/generator-common": "3.1.30"
|
|
38
38
|
},
|
|
39
39
|
"sideEffects": false,
|
|
40
40
|
"publishConfig": {
|