@modern-js/router-v5-generator 0.0.0-nightly-20230917160555 → 0.0.0-nightly-20230920160608

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 +24 -23
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -115303,7 +115303,9 @@ var require_chainId2 = __commonJS({
115303
115303
  /** HtmlAsyncChunkPlugin */
115304
115304
  HTML_ASYNC_CHUNK: "html-async-chunk",
115305
115305
  /** SWC_POLYFILL_CHECKER */
115306
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
115306
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
115307
+ /** RouterPlugin */
115308
+ ROUTER_MANIFEST: "route-plugin"
115307
115309
  },
115308
115310
  /** Predefined minimizers */
115309
115311
  MINIMIZER: {
@@ -115759,12 +115761,11 @@ var require_config4 = __commonJS({
115759
115761
  var _constants = require_constants2();
115760
115762
  var _type = require_type2();
115761
115763
  var isSSR = (config) => {
115762
- var _server, _server1;
115763
115764
  const { server } = config;
115764
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
115765
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
115765
115766
  return true;
115766
115767
  }
115767
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115768
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115768
115769
  for (const name of Object.keys(server.ssrByEntries)) {
115769
115770
  if (server.ssrByEntries[name]) {
115770
115771
  return true;
@@ -115774,29 +115775,28 @@ var require_config4 = __commonJS({
115774
115775
  return false;
115775
115776
  };
115776
115777
  var isUseSSRBundle = (config) => {
115777
- var _output;
115778
115778
  const { output: output2 } = config;
115779
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
115779
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
115780
115780
  return true;
115781
115781
  }
115782
115782
  return isSSR(config);
115783
115783
  };
115784
115784
  var isServiceWorker = (config) => {
115785
- var _deploy_worker, _deploy, _output;
115785
+ var _deploy_worker;
115786
115786
  const { output: output2, deploy } = config;
115787
- 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))) {
115787
+ 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))) {
115788
115788
  return true;
115789
115789
  }
115790
115790
  return false;
115791
115791
  };
115792
115792
  var isRouterV5 = (config) => {
115793
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
115794
- 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";
115793
+ var _config_runtime, _config_runtime_router, _config_runtime1;
115794
+ 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";
115795
115795
  };
115796
115796
  var isSSGEntry = (config, entryName, entrypoints) => {
115797
- var _config_source, _ssgConfig, _ssgConfig1;
115797
+ var _config_source;
115798
115798
  const ssgConfig = config.output.ssg;
115799
- 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]);
115799
+ 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]);
115800
115800
  return useSSG;
115801
115801
  };
115802
115802
  var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -116375,6 +116375,11 @@ var require_logger3 = __commonJS({
116375
116375
  label: "info",
116376
116376
  level: "info"
116377
116377
  },
116378
+ ready: {
116379
+ color: "green",
116380
+ label: "ready",
116381
+ level: "info"
116382
+ },
116378
116383
  success: {
116379
116384
  color: "green",
116380
116385
  label: "success",
@@ -116557,7 +116562,7 @@ var require_alias2 = __commonJS({
116557
116562
  };
116558
116563
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
116559
116564
  var getAliasConfig = (aliasOption, option) => {
116560
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
116565
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
116561
116566
  const isTsProject2 = _fs.default.existsSync(option.tsconfigPath);
116562
116567
  const alias = mergeAlias(aliasOption);
116563
116568
  if (!isTsProject2) {
@@ -116569,12 +116574,12 @@ var require_alias2 = __commonJS({
116569
116574
  };
116570
116575
  }
116571
116576
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
116572
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116577
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116573
116578
  return {
116574
116579
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
116575
116580
  paths: {
116576
116581
  ...alias,
116577
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
116582
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
116578
116583
  },
116579
116584
  isTsPath: true,
116580
116585
  isTsProject: isTsProject2
@@ -116969,7 +116974,7 @@ var require_port2 = __commonJS({
116969
116974
  if (strictPort) {
116970
116975
  throw new Error(`Port "${original}" is occupied, please choose another one.`);
116971
116976
  } else if (!slient) {
116972
- _logger.logger.info(`Something is already running on port ${original}. ${_compiled.chalk.yellow(`Use port ${port} instead.`)}`);
116977
+ _logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
116973
116978
  }
116974
116979
  }
116975
116980
  return port;
@@ -117021,10 +117026,7 @@ var require_prettyInstructions2 = __commonJS({
117021
117026
  var getAddressUrls = (protocol = "http", port, host) => {
117022
117027
  const LOCAL_LABEL = "Local: ";
117023
117028
  const NETWORK_LABEL = "Network: ";
117024
- const isLocalhost = (url) => {
117025
- var _url;
117026
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
117027
- };
117029
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
117028
117030
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
117029
117031
  return [
117030
117032
  {
@@ -117055,7 +117057,7 @@ var require_prettyInstructions2 = __commonJS({
117055
117057
  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);
117056
117058
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
117057
117059
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
117058
- let message = "App running at:\n\n";
117060
+ let message = "\n";
117059
117061
  if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
117060
117062
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
117061
117063
  `).join("");
@@ -117117,9 +117119,8 @@ var require_require2 = __commonJS({
117117
117119
  });
117118
117120
  var _fs = require_fs2();
117119
117121
  var compatRequire = (filePath, interop = true) => {
117120
- var _mod;
117121
117122
  const mod = require(filePath);
117122
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
117123
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
117123
117124
  return rtnESMDefault ? mod.default : mod;
117124
117125
  };
117125
117126
  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": "0.0.0-nightly-20230917160555",
18
+ "version": "0.0.0-nightly-20230920160608",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,12 +29,12 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/dependence-generator": "0.0.0-nightly-20230917160555",
33
- "@modern-js/generator-common": "0.0.0-nightly-20230917160555",
34
- "@modern-js/generator-utils": "0.0.0-nightly-20230917160555",
35
- "@modern-js/plugin-i18n": "0.0.0-nightly-20230917160555",
36
- "@scripts/build": "0.0.0-nightly-20230917160555",
37
- "@scripts/jest-config": "0.0.0-nightly-20230917160555"
32
+ "@modern-js/dependence-generator": "0.0.0-nightly-20230920160608",
33
+ "@modern-js/generator-common": "0.0.0-nightly-20230920160608",
34
+ "@modern-js/generator-utils": "0.0.0-nightly-20230920160608",
35
+ "@modern-js/plugin-i18n": "0.0.0-nightly-20230920160608",
36
+ "@scripts/build": "0.0.0-nightly-20230920160608",
37
+ "@scripts/jest-config": "0.0.0-nightly-20230920160608"
38
38
  },
39
39
  "sideEffects": false,
40
40
  "publishConfig": {