@modern-js/monorepo-generator 3.1.28 → 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.
Files changed (2) hide show
  1. package/dist/index.js +27 -17
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -115368,6 +115368,8 @@ var require_chainId = __commonJS({
115368
115368
  YAML: "yaml",
115369
115369
  /** Rule for wasm */
115370
115370
  WASM: "wasm",
115371
+ /** Rule for node */
115372
+ NODE: "node",
115371
115373
  /** Rule for bff */
115372
115374
  JS_BFF_API: "js-bff-api"
115373
115375
  },
@@ -115406,6 +115408,8 @@ var require_chainId = __commonJS({
115406
115408
  TOML: "toml",
115407
115409
  /** html-loader */
115408
115410
  HTML: "html",
115411
+ /** node-loader */
115412
+ NODE: "html",
115409
115413
  /** babel-loader */
115410
115414
  BABEL: "babel",
115411
115415
  /** esbuild-loader */
@@ -115666,7 +115670,6 @@ var require_constants = __commonJS({
115666
115670
  };
115667
115671
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
115668
115672
  "@modern-js/module-tools": "@modern-js/module-tools",
115669
- "@modern-js/doc-tools": "@modern-js/doc-tools",
115670
115673
  "@modern-js/runtime": "@modern-js/runtime/cli",
115671
115674
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
115672
115675
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -115944,11 +115947,12 @@ var require_config2 = __commonJS({
115944
115947
  });
115945
115948
  var _type = require_type();
115946
115949
  var isSSR = (config) => {
115950
+ var _server, _server1;
115947
115951
  const { server } = config;
115948
- if (server === null || server === void 0 ? void 0 : server.ssr) {
115952
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
115949
115953
  return true;
115950
115954
  }
115951
- if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115955
+ if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115952
115956
  for (const name of Object.keys(server.ssrByEntries)) {
115953
115957
  if (server.ssrByEntries[name]) {
115954
115958
  return true;
@@ -115958,27 +115962,29 @@ var require_config2 = __commonJS({
115958
115962
  return false;
115959
115963
  };
115960
115964
  var isUseSSRBundle = (config) => {
115965
+ var _output;
115961
115966
  const { output: output2 } = config;
115962
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
115967
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
115963
115968
  return true;
115964
115969
  }
115965
115970
  return isSSR(config);
115966
115971
  };
115967
115972
  var isServiceWorker = (config) => {
115968
- var _deploy_worker;
115973
+ var _deploy_worker, _deploy, _output;
115969
115974
  const { output: output2, deploy } = config;
115970
- 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))) {
115975
+ 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))) {
115971
115976
  return true;
115972
115977
  }
115973
115978
  return false;
115974
115979
  };
115975
115980
  var isRouterV5 = (config) => {
115976
- var _config_runtime, _config_runtime1, _config_runtime_router;
115977
- 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";
115981
+ var _config_runtime, _config_runtime_router, _config_runtime1, _config;
115982
+ 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";
115978
115983
  };
115979
115984
  var isSSGEntry = (config, entryName, entrypoints) => {
115985
+ var _ssgConfig, _ssgConfig1;
115980
115986
  const ssgConfig = config.output.ssg;
115981
- const useSSG = isSingleEntry(entrypoints) ? 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]);
115987
+ 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]);
115982
115988
  return useSSG;
115983
115989
  };
115984
115990
  var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -116725,7 +116731,7 @@ var require_alias = __commonJS({
116725
116731
  };
116726
116732
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
116727
116733
  var getAliasConfig = (aliasOption, option) => {
116728
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
116734
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
116729
116735
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
116730
116736
  const alias = mergeAlias(aliasOption);
116731
116737
  if (!isTsProject) {
@@ -116737,10 +116743,10 @@ var require_alias = __commonJS({
116737
116743
  };
116738
116744
  }
116739
116745
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
116740
- const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116746
+ const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116741
116747
  return {
116742
116748
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
116743
- paths: __spreadValues(__spreadValues({}, alias), tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths),
116749
+ 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),
116744
116750
  isTsPath: true,
116745
116751
  isTsProject
116746
116752
  };
@@ -117279,7 +117285,8 @@ var require_prettyInstructions = __commonJS({
117279
117285
  const LOCAL_LABEL = "Local: ";
117280
117286
  const NETWORK_LABEL = "Network: ";
117281
117287
  const isLocalhost = (url) => {
117282
- return url === null || url === void 0 ? void 0 : url.includes("localhost");
117288
+ var _url;
117289
+ return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
117283
117290
  };
117284
117291
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
117285
117292
  return [
@@ -117308,7 +117315,7 @@ var require_prettyInstructions = __commonJS({
117308
117315
  var prettyInstructions = (appContext, config) => {
117309
117316
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
117310
117317
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
117311
- const isHttps = (0, _is.isDev)() && ((_appContext_builder_context_devServer = (_appContext_builder = appContext.builder) === null || _appContext_builder === void 0 ? void 0 : _appContext_builder.context.devServer) === null || _appContext_builder_context_devServer === void 0 ? void 0 : _appContext_builder_context_devServer.https);
117318
+ 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);
117312
117319
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
117313
117320
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
117314
117321
  let message = "App running at:\n\n";
@@ -117373,8 +117380,9 @@ var require_require = __commonJS({
117373
117380
  });
117374
117381
  var _fs = require_fs();
117375
117382
  var compatRequire = (filePath, interop = true) => {
117383
+ var _mod;
117376
117384
  const mod = require(filePath);
117377
- const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
117385
+ const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
117378
117386
  return rtnESMDefault ? mod.default : mod;
117379
117387
  };
117380
117388
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -133435,11 +133443,13 @@ var PackageManagerName = {
133435
133443
  [PackageManager.Npm]: "npm"
133436
133444
  };
133437
133445
  var getPackageManagerSchema = (extra = {}) => {
133446
+ var _extra, _extra1;
133438
133447
  return {
133439
133448
  type: "string",
133440
133449
  title: i18n2.t(localeKeys2.packageManager.self),
133441
133450
  enum: Object.values(PackageManager).filter((packageManager) => {
133442
- return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
133451
+ var _extra2;
133452
+ return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
133443
133453
  }).map((packageManager) => ({
133444
133454
  value: packageManager,
133445
133455
  label: PackageManagerName[packageManager]
@@ -133449,7 +133459,7 @@ var getPackageManagerSchema = (extra = {}) => {
133449
133459
  dependencies: [],
133450
133460
  fulfill: {
133451
133461
  state: {
133452
- visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
133462
+ visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
133453
133463
  }
133454
133464
  }
133455
133465
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.28",
18
+ "version": "3.1.30",
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": "3.1.28",
34
- "@modern-js/plugin-i18n": "2.26.0",
35
- "@modern-js/packages-generator": "3.1.28",
36
- "@modern-js/generator-utils": "3.1.28",
37
- "@modern-js/generator-common": "3.1.28",
38
- "@modern-js/changeset-generator": "3.1.28",
39
- "@scripts/jest-config": "2.26.0",
40
- "@scripts/build": "2.26.0"
33
+ "@modern-js/base-generator": "3.1.30",
34
+ "@modern-js/generator-utils": "3.1.30",
35
+ "@modern-js/plugin-i18n": "2.28.0",
36
+ "@modern-js/packages-generator": "3.1.30",
37
+ "@modern-js/generator-common": "3.1.30",
38
+ "@modern-js/changeset-generator": "3.1.30",
39
+ "@scripts/jest-config": "2.28.0",
40
+ "@scripts/build": "2.28.0"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {