@modern-js/monorepo-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 +26 -29
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -116907,7 +116907,9 @@ var require_chainId2 = __commonJS({
116907
116907
  /** HtmlAsyncChunkPlugin */
116908
116908
  HTML_ASYNC_CHUNK: "html-async-chunk",
116909
116909
  /** SWC_POLYFILL_CHECKER */
116910
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
116910
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
116911
+ /** RouterPlugin */
116912
+ ROUTER_MANIFEST: "route-plugin"
116911
116913
  },
116912
116914
  /** Predefined minimizers */
116913
116915
  MINIMIZER: {
@@ -117363,12 +117365,11 @@ var require_config4 = __commonJS({
117363
117365
  var _constants = require_constants2();
117364
117366
  var _type = require_type2();
117365
117367
  var isSSR = (config) => {
117366
- var _server, _server1;
117367
117368
  const { server } = config;
117368
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
117369
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
117369
117370
  return true;
117370
117371
  }
117371
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117372
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117372
117373
  for (const name of Object.keys(server.ssrByEntries)) {
117373
117374
  if (server.ssrByEntries[name]) {
117374
117375
  return true;
@@ -117378,29 +117379,28 @@ var require_config4 = __commonJS({
117378
117379
  return false;
117379
117380
  };
117380
117381
  var isUseSSRBundle = (config) => {
117381
- var _output;
117382
117382
  const { output: output2 } = config;
117383
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
117383
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
117384
117384
  return true;
117385
117385
  }
117386
117386
  return isSSR(config);
117387
117387
  };
117388
117388
  var isServiceWorker = (config) => {
117389
- var _deploy_worker, _deploy, _output;
117389
+ var _deploy_worker;
117390
117390
  const { output: output2, deploy } = config;
117391
- 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))) {
117391
+ 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))) {
117392
117392
  return true;
117393
117393
  }
117394
117394
  return false;
117395
117395
  };
117396
117396
  var isRouterV5 = (config) => {
117397
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
117398
- 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";
117397
+ var _config_runtime, _config_runtime_router, _config_runtime1;
117398
+ 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";
117399
117399
  };
117400
117400
  var isSSGEntry = (config, entryName, entrypoints) => {
117401
- var _config_source, _ssgConfig, _ssgConfig1;
117401
+ var _config_source;
117402
117402
  const ssgConfig = config.output.ssg;
117403
- 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]);
117403
+ 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]);
117404
117404
  return useSSG;
117405
117405
  };
117406
117406
  var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -117979,6 +117979,11 @@ var require_logger3 = __commonJS({
117979
117979
  label: "info",
117980
117980
  level: "info"
117981
117981
  },
117982
+ ready: {
117983
+ color: "green",
117984
+ label: "ready",
117985
+ level: "info"
117986
+ },
117982
117987
  success: {
117983
117988
  color: "green",
117984
117989
  label: "success",
@@ -118161,7 +118166,7 @@ var require_alias2 = __commonJS({
118161
118166
  };
118162
118167
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
118163
118168
  var getAliasConfig = (aliasOption, option) => {
118164
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
118169
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
118165
118170
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
118166
118171
  const alias = mergeAlias(aliasOption);
118167
118172
  if (!isTsProject) {
@@ -118173,12 +118178,12 @@ var require_alias2 = __commonJS({
118173
118178
  };
118174
118179
  }
118175
118180
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
118176
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118181
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118177
118182
  return {
118178
118183
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
118179
118184
  paths: {
118180
118185
  ...alias,
118181
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118186
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118182
118187
  },
118183
118188
  isTsPath: true,
118184
118189
  isTsProject
@@ -118573,7 +118578,7 @@ var require_port2 = __commonJS({
118573
118578
  if (strictPort) {
118574
118579
  throw new Error(`Port "${original}" is occupied, please choose another one.`);
118575
118580
  } else if (!slient) {
118576
- _logger.logger.info(`Something is already running on port ${original}. ${_compiled.chalk.yellow(`Use port ${port} instead.`)}`);
118581
+ _logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
118577
118582
  }
118578
118583
  }
118579
118584
  return port;
@@ -118625,10 +118630,7 @@ var require_prettyInstructions2 = __commonJS({
118625
118630
  var getAddressUrls = (protocol = "http", port, host) => {
118626
118631
  const LOCAL_LABEL = "Local: ";
118627
118632
  const NETWORK_LABEL = "Network: ";
118628
- const isLocalhost = (url) => {
118629
- var _url;
118630
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
118631
- };
118633
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
118632
118634
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
118633
118635
  return [
118634
118636
  {
@@ -118659,7 +118661,7 @@ var require_prettyInstructions2 = __commonJS({
118659
118661
  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);
118660
118662
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
118661
118663
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
118662
- let message = "App running at:\n\n";
118664
+ let message = "\n";
118663
118665
  if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
118664
118666
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
118665
118667
  `).join("");
@@ -118721,9 +118723,8 @@ var require_require2 = __commonJS({
118721
118723
  });
118722
118724
  var _fs = require_fs2();
118723
118725
  var compatRequire = (filePath, interop = true) => {
118724
- var _mod;
118725
118726
  const mod = require(filePath);
118726
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
118727
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
118727
118728
  return rtnESMDefault ? mod.default : mod;
118728
118729
  };
118729
118730
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -134763,14 +134764,10 @@ var PackageManagerName = {
134763
134764
  [PackageManager.Npm]: "npm"
134764
134765
  };
134765
134766
  var getPackageManagerSchema = (extra = {}) => {
134766
- var _extra, _extra1;
134767
134767
  return {
134768
134768
  type: "string",
134769
134769
  title: i18n2.t(localeKeys2.packageManager.self),
134770
- enum: Object.values(PackageManager).filter((packageManager) => {
134771
- var _extra2;
134772
- return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
134773
- }).map((packageManager) => ({
134770
+ enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
134774
134771
  value: packageManager,
134775
134772
  label: PackageManagerName[packageManager]
134776
134773
  })),
@@ -134779,7 +134776,7 @@ var getPackageManagerSchema = (extra = {}) => {
134779
134776
  dependencies: [],
134780
134777
  fulfill: {
134781
134778
  state: {
134782
- visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
134779
+ visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
134783
134780
  }
134784
134781
  }
134785
134782
  }
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": [
@@ -30,14 +30,14 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/base-generator": "0.0.0-nightly-20230917160555",
34
- "@modern-js/changeset-generator": "0.0.0-nightly-20230917160555",
35
- "@modern-js/generator-common": "0.0.0-nightly-20230917160555",
36
- "@modern-js/generator-utils": "0.0.0-nightly-20230917160555",
37
- "@modern-js/plugin-i18n": "0.0.0-nightly-20230917160555",
38
- "@modern-js/packages-generator": "0.0.0-nightly-20230917160555",
39
- "@scripts/build": "0.0.0-nightly-20230917160555",
40
- "@scripts/jest-config": "0.0.0-nightly-20230917160555"
33
+ "@modern-js/base-generator": "0.0.0-nightly-20230920160608",
34
+ "@modern-js/changeset-generator": "0.0.0-nightly-20230920160608",
35
+ "@modern-js/generator-common": "0.0.0-nightly-20230920160608",
36
+ "@modern-js/generator-utils": "0.0.0-nightly-20230920160608",
37
+ "@modern-js/plugin-i18n": "0.0.0-nightly-20230920160608",
38
+ "@modern-js/packages-generator": "0.0.0-nightly-20230920160608",
39
+ "@scripts/build": "0.0.0-nightly-20230920160608",
40
+ "@scripts/jest-config": "0.0.0-nightly-20230920160608"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {