@modern-js/upgrade-generator 3.2.0 → 3.2.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.
Files changed (2) hide show
  1. package/dist/index.js +25 -26
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -116820,8 +116820,6 @@ var require_chainId2 = __commonJS({
116820
116820
  STYLE: "style-loader",
116821
116821
  /** postcss-loader */
116822
116822
  POSTCSS: "postcss",
116823
- /** markdown-loader */
116824
- MARKDOWN: "markdown",
116825
116823
  /** ignore-css-loader */
116826
116824
  IGNORE_CSS: "ignore-css",
116827
116825
  /** css-modules-typescript-loader */
@@ -116902,7 +116900,9 @@ var require_chainId2 = __commonJS({
116902
116900
  /** HtmlAsyncChunkPlugin */
116903
116901
  HTML_ASYNC_CHUNK: "html-async-chunk",
116904
116902
  /** SWC_POLYFILL_CHECKER */
116905
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
116903
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
116904
+ /** RouterPlugin */
116905
+ ROUTER_MANIFEST: "route-plugin"
116906
116906
  },
116907
116907
  /** Predefined minimizers */
116908
116908
  MINIMIZER: {
@@ -117358,12 +117358,11 @@ var require_config4 = __commonJS({
117358
117358
  var _constants = require_constants2();
117359
117359
  var _type = require_type2();
117360
117360
  var isSSR = (config) => {
117361
- var _server, _server1;
117362
117361
  const { server } = config;
117363
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
117362
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
117364
117363
  return true;
117365
117364
  }
117366
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117365
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117367
117366
  for (const name of Object.keys(server.ssrByEntries)) {
117368
117367
  if (server.ssrByEntries[name]) {
117369
117368
  return true;
@@ -117373,29 +117372,28 @@ var require_config4 = __commonJS({
117373
117372
  return false;
117374
117373
  };
117375
117374
  var isUseSSRBundle = (config) => {
117376
- var _output;
117377
117375
  const { output: output2 } = config;
117378
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
117376
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
117379
117377
  return true;
117380
117378
  }
117381
117379
  return isSSR(config);
117382
117380
  };
117383
117381
  var isServiceWorker = (config) => {
117384
- var _deploy_worker, _deploy, _output;
117382
+ var _deploy_worker;
117385
117383
  const { output: output2, deploy } = config;
117386
- 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))) {
117384
+ if ((deploy === null || deploy === void 0 ? void 0 : (_deploy_worker = deploy.worker) === null || _deploy_worker === void 0 ? void 0 : _deploy_worker.ssr) && ((output2 === null || output2 === void 0 ? void 0 : output2.ssg) || isSSR(config))) {
117387
117385
  return true;
117388
117386
  }
117389
117387
  return false;
117390
117388
  };
117391
117389
  var isRouterV5 = (config) => {
117392
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
117393
- 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";
117390
+ var _config_runtime, _config_runtime_router, _config_runtime1;
117391
+ return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (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";
117394
117392
  };
117395
117393
  var isSSGEntry = (config, entryName, entrypoints) => {
117396
- var _config_source, _ssgConfig, _ssgConfig1;
117394
+ var _config_source;
117397
117395
  const ssgConfig = config.output.ssg;
117398
- const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? 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]);
117396
+ const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (ssgConfig === null || ssgConfig === void 0 ? void 0 : ssgConfig[0]) === "function" || Boolean(ssgConfig === null || ssgConfig === void 0 ? void 0 : ssgConfig[entryName]);
117399
117397
  return useSSG;
117400
117398
  };
117401
117399
  var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -117974,9 +117972,14 @@ var require_logger3 = __commonJS({
117974
117972
  label: "info",
117975
117973
  level: "info"
117976
117974
  },
117975
+ ready: {
117976
+ color: "green",
117977
+ label: "ready",
117978
+ level: "info"
117979
+ },
117977
117980
  success: {
117978
117981
  color: "green",
117979
- label: "Success",
117982
+ label: "success",
117980
117983
  level: "info"
117981
117984
  },
117982
117985
  warn: {
@@ -118156,7 +118159,7 @@ var require_alias2 = __commonJS({
118156
118159
  };
118157
118160
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
118158
118161
  var getAliasConfig = (aliasOption, option) => {
118159
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
118162
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
118160
118163
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
118161
118164
  const alias = mergeAlias(aliasOption);
118162
118165
  if (!isTsProject) {
@@ -118168,12 +118171,12 @@ var require_alias2 = __commonJS({
118168
118171
  };
118169
118172
  }
118170
118173
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
118171
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118174
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118172
118175
  return {
118173
118176
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
118174
118177
  paths: {
118175
118178
  ...alias,
118176
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118179
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118177
118180
  },
118178
118181
  isTsPath: true,
118179
118182
  isTsProject
@@ -118568,7 +118571,7 @@ var require_port2 = __commonJS({
118568
118571
  if (strictPort) {
118569
118572
  throw new Error(`Port "${original}" is occupied, please choose another one.`);
118570
118573
  } else if (!slient) {
118571
- _logger.logger.info(`Something is already running on port ${original}. ${_compiled.chalk.yellow(`Use port ${port} instead.`)}`);
118574
+ _logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
118572
118575
  }
118573
118576
  }
118574
118577
  return port;
@@ -118620,10 +118623,7 @@ var require_prettyInstructions2 = __commonJS({
118620
118623
  var getAddressUrls = (protocol = "http", port, host) => {
118621
118624
  const LOCAL_LABEL = "Local: ";
118622
118625
  const NETWORK_LABEL = "Network: ";
118623
- const isLocalhost = (url) => {
118624
- var _url;
118625
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
118626
- };
118626
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
118627
118627
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
118628
118628
  return [
118629
118629
  {
@@ -118654,7 +118654,7 @@ var require_prettyInstructions2 = __commonJS({
118654
118654
  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);
118655
118655
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
118656
118656
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
118657
- let message = "App running at:\n\n";
118657
+ let message = "\n";
118658
118658
  if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
118659
118659
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
118660
118660
  `).join("");
@@ -118716,9 +118716,8 @@ var require_require2 = __commonJS({
118716
118716
  });
118717
118717
  var _fs = require_fs2();
118718
118718
  var compatRequire = (filePath, interop = true) => {
118719
- var _mod;
118720
118719
  const mod = require(filePath);
118721
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
118720
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
118722
118721
  return rtnESMDefault ? mod.default : mod;
118723
118722
  };
118724
118723
  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.2.0",
18
+ "version": "3.2.2",
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
- "@modern-js/generator-utils": "3.2.0",
34
- "@scripts/jest-config": "2.34.0",
35
- "@modern-js/plugin-i18n": "2.34.0",
36
- "@scripts/build": "2.34.0",
37
- "@modern-js/generator-common": "3.2.0"
33
+ "@scripts/build": "2.35.1",
34
+ "@scripts/jest-config": "2.35.1",
35
+ "@modern-js/generator-utils": "3.2.2",
36
+ "@modern-js/plugin-i18n": "2.35.1",
37
+ "@modern-js/generator-common": "3.2.2"
38
38
  },
39
39
  "sideEffects": false,
40
40
  "publishConfig": {