@modern-js/repo-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.
Files changed (2) hide show
  1. package/dist/index.js +46 -29
  2. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -122671,6 +122671,8 @@ var require_chainId = __commonJS({
122671
122671
  YAML: "yaml",
122672
122672
  /** Rule for wasm */
122673
122673
  WASM: "wasm",
122674
+ /** Rule for node */
122675
+ NODE: "node",
122674
122676
  /** Rule for bff */
122675
122677
  JS_BFF_API: "js-bff-api"
122676
122678
  },
@@ -122709,6 +122711,8 @@ var require_chainId = __commonJS({
122709
122711
  TOML: "toml",
122710
122712
  /** html-loader */
122711
122713
  HTML: "html",
122714
+ /** node-loader */
122715
+ NODE: "html",
122712
122716
  /** babel-loader */
122713
122717
  BABEL: "babel",
122714
122718
  /** esbuild-loader */
@@ -122969,7 +122973,6 @@ var require_constants2 = __commonJS({
122969
122973
  };
122970
122974
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
122971
122975
  "@modern-js/module-tools": "@modern-js/module-tools",
122972
- "@modern-js/doc-tools": "@modern-js/doc-tools",
122973
122976
  "@modern-js/runtime": "@modern-js/runtime/cli",
122974
122977
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
122975
122978
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -123247,11 +123250,12 @@ var require_config2 = __commonJS({
123247
123250
  });
123248
123251
  var _type = require_type();
123249
123252
  var isSSR = (config) => {
123253
+ var _server, _server1;
123250
123254
  const { server } = config;
123251
- if (server === null || server === void 0 ? void 0 : server.ssr) {
123255
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
123252
123256
  return true;
123253
123257
  }
123254
- if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
123258
+ if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
123255
123259
  for (const name of Object.keys(server.ssrByEntries)) {
123256
123260
  if (server.ssrByEntries[name]) {
123257
123261
  return true;
@@ -123261,27 +123265,29 @@ var require_config2 = __commonJS({
123261
123265
  return false;
123262
123266
  };
123263
123267
  var isUseSSRBundle = (config) => {
123268
+ var _output;
123264
123269
  const { output: output2 } = config;
123265
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
123270
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
123266
123271
  return true;
123267
123272
  }
123268
123273
  return isSSR(config);
123269
123274
  };
123270
123275
  var isServiceWorker = (config) => {
123271
- var _deploy_worker;
123276
+ var _deploy_worker, _deploy, _output;
123272
123277
  const { output: output2, deploy } = config;
123273
- 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))) {
123278
+ 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))) {
123274
123279
  return true;
123275
123280
  }
123276
123281
  return false;
123277
123282
  };
123278
123283
  var isRouterV5 = (config) => {
123279
- var _config_runtime, _config_runtime1, _config_runtime_router;
123280
- 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";
123284
+ var _config_runtime, _config_runtime_router, _config_runtime1, _config;
123285
+ 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";
123281
123286
  };
123282
123287
  var isSSGEntry = (config, entryName, entrypoints) => {
123288
+ var _ssgConfig, _ssgConfig1;
123283
123289
  const ssgConfig = config.output.ssg;
123284
- 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]);
123290
+ 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]);
123285
123291
  return useSSG;
123286
123292
  };
123287
123293
  var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -124028,7 +124034,7 @@ var require_alias = __commonJS({
124028
124034
  };
124029
124035
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
124030
124036
  var getAliasConfig = (aliasOption, option) => {
124031
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
124037
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
124032
124038
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
124033
124039
  const alias = mergeAlias(aliasOption);
124034
124040
  if (!isTsProject) {
@@ -124040,10 +124046,10 @@ var require_alias = __commonJS({
124040
124046
  };
124041
124047
  }
124042
124048
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
124043
- const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
124049
+ const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
124044
124050
  return {
124045
124051
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
124046
- 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),
124052
+ 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),
124047
124053
  isTsPath: true,
124048
124054
  isTsProject
124049
124055
  };
@@ -124582,7 +124588,8 @@ var require_prettyInstructions = __commonJS({
124582
124588
  const LOCAL_LABEL = "Local: ";
124583
124589
  const NETWORK_LABEL = "Network: ";
124584
124590
  const isLocalhost = (url) => {
124585
- return url === null || url === void 0 ? void 0 : url.includes("localhost");
124591
+ var _url;
124592
+ return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
124586
124593
  };
124587
124594
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
124588
124595
  return [
@@ -124611,7 +124618,7 @@ var require_prettyInstructions = __commonJS({
124611
124618
  var prettyInstructions = (appContext, config) => {
124612
124619
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
124613
124620
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
124614
- 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);
124621
+ 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);
124615
124622
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
124616
124623
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
124617
124624
  let message = "App running at:\n\n";
@@ -124676,8 +124683,9 @@ var require_require = __commonJS({
124676
124683
  });
124677
124684
  var _fs = require_fs();
124678
124685
  var compatRequire = (filePath, interop = true) => {
124686
+ var _mod;
124679
124687
  const mod = require(filePath);
124680
- const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
124688
+ const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
124681
124689
  return rtnESMDefault ? mod.default : mod;
124682
124690
  };
124683
124691
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -144493,16 +144501,18 @@ var getSolutionSchema = (extra = {}) => {
144493
144501
  type: "string",
144494
144502
  title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
144495
144503
  enum: (() => {
144496
- var _extra_customPlugin, _extra_customPlugin_custom;
144497
- const items = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values((extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolution : Solution)).filter((solution) => {
144498
- return !((extra === null || extra === void 0 ? void 0 : extra.isSubProject) && solution === Solution.Monorepo);
144504
+ var _extra, _extra1, _extra_customPlugin_custom, _extra_customPlugin, _extra2;
144505
+ const items = (((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.solutions) || Object.values(((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepo) ? SubSolution : Solution)).filter((solution) => {
144506
+ var _extra3;
144507
+ return !(((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isSubProject) && solution === Solution.Monorepo);
144499
144508
  }).map((solution) => {
144509
+ var _extra3;
144500
144510
  return {
144501
144511
  value: solution,
144502
- label: (extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
144512
+ label: ((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
144503
144513
  };
144504
144514
  });
144505
- if (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
144515
+ if ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : (_extra_customPlugin = _extra2.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
144506
144516
  return [
144507
144517
  ...items,
144508
144518
  {
@@ -144518,7 +144528,8 @@ var getSolutionSchema = (extra = {}) => {
144518
144528
  };
144519
144529
  };
144520
144530
  var getScenesSchema = (extra = {}) => {
144521
- const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
144531
+ var _extra, _extra1, _extra2, _extra3, _extra4, _extra5, _extra6;
144532
+ const hasPlugin = ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.customPlugin) && extra.customPlugin[((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) : (_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.solution] && extra.customPlugin[((_extra4 = extra) === null || _extra4 === void 0 ? void 0 : _extra4.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra5 = extra) === null || _extra5 === void 0 ? void 0 : _extra5.solution) : (_extra6 = extra) === null || _extra6 === void 0 ? void 0 : _extra6.solution].length > 0;
144522
144533
  return {
144523
144534
  type: "object",
144524
144535
  properties: hasPlugin ? {
@@ -144526,15 +144537,17 @@ var getScenesSchema = (extra = {}) => {
144526
144537
  type: "string",
144527
144538
  title: i18n2.t(localeKeys2.scenes.self),
144528
144539
  enum: (() => {
144529
- const solution = (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
144530
- const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
144540
+ var _extra7, _extra12, _extra22, _extra32, _extra42;
144541
+ const solution = ((_extra7 = extra) === null || _extra7 === void 0 ? void 0 : _extra7.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra12 = extra) === null || _extra12 === void 0 ? void 0 : _extra12.solution) : (_extra22 = extra) === null || _extra22 === void 0 ? void 0 : _extra22.solution;
144542
+ const items = (((_extra32 = extra) === null || _extra32 === void 0 ? void 0 : _extra32.customPlugin) ? ((_extra42 = extra) === null || _extra42 === void 0 ? void 0 : _extra42.customPlugin[solution]) || [] : []).map((plugin) => ({
144531
144543
  value: plugin.key,
144532
144544
  label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
144533
144545
  }));
144534
144546
  if (solution && solution !== "custom") {
144547
+ var _extra52;
144535
144548
  items.unshift({
144536
144549
  value: solution,
144537
- label: `${(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
144550
+ label: `${((_extra52 = extra) === null || _extra52 === void 0 ? void 0 : _extra52.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
144538
144551
  });
144539
144552
  }
144540
144553
  return items;
@@ -144591,11 +144604,13 @@ var PackageManagerName = {
144591
144604
  [PackageManager.Npm]: "npm"
144592
144605
  };
144593
144606
  var getPackageManagerSchema = (extra = {}) => {
144607
+ var _extra, _extra1;
144594
144608
  return {
144595
144609
  type: "string",
144596
144610
  title: i18n2.t(localeKeys2.packageManager.self),
144597
144611
  enum: Object.values(PackageManager).filter((packageManager) => {
144598
- return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
144612
+ var _extra2;
144613
+ return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
144599
144614
  }).map((packageManager) => ({
144600
144615
  value: packageManager,
144601
144616
  label: PackageManagerName[packageManager]
@@ -144605,7 +144620,7 @@ var getPackageManagerSchema = (extra = {}) => {
144605
144620
  dependencies: [],
144606
144621
  fulfill: {
144607
144622
  state: {
144608
- visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
144623
+ visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
144609
144624
  }
144610
144625
  }
144611
144626
  }
@@ -144615,15 +144630,16 @@ var getPackageManagerSchema = (extra = {}) => {
144615
144630
 
144616
144631
  // ../../generator-common/dist/esm-node/common/packageName.js
144617
144632
  var getPackageNameSchema = (extra = {}) => {
144633
+ var _extra, _extra1, _extra2, _extra3;
144618
144634
  return {
144619
144635
  type: "string",
144620
- title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
144636
+ title: ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
144621
144637
  "x-reactions": [
144622
144638
  {
144623
144639
  dependencies: [],
144624
144640
  fulfill: {
144625
144641
  state: {
144626
- visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa) && !(extra === null || extra === void 0 ? void 0 : extra.isDoc)
144642
+ visible: Boolean((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) || !((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.isMwa) && !((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isDoc)
144627
144643
  }
144628
144644
  }
144629
144645
  }
@@ -144640,6 +144656,7 @@ var getPackageNameSchema = (extra = {}) => {
144640
144656
  // ../../generator-common/dist/esm-node/common/packagePath.js
144641
144657
  var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
144642
144658
  var getPackagePathSchema = (extra) => {
144659
+ var _extra;
144643
144660
  return {
144644
144661
  type: "string",
144645
144662
  title: i18n2.t(localeKeys2.packagePath.self),
@@ -144651,7 +144668,7 @@ var getPackagePathSchema = (extra) => {
144651
144668
  fulfill: {
144652
144669
  state: {
144653
144670
  value: "{{$deps[0]}}",
144654
- visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
144671
+ visible: Boolean((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject)
144655
144672
  }
144656
144673
  }
144657
144674
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.29",
18
+ "version": "3.1.30",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,17 +29,17 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/generator-common": "3.1.29",
33
- "@modern-js/module-generator": "3.1.29",
34
- "@modern-js/monorepo-generator": "3.1.29",
35
- "@modern-js/mwa-generator": "3.1.29",
36
- "@modern-js/doc-generator": "3.1.29",
37
- "@modern-js/utils": "2.27.0",
38
- "@modern-js/generator-plugin": "3.1.29",
39
- "@modern-js/base-generator": "3.1.29",
40
- "@modern-js/generator-utils": "3.1.29",
41
- "@scripts/jest-config": "2.27.0",
42
- "@scripts/build": "2.27.0"
32
+ "@modern-js/generator-utils": "3.1.30",
33
+ "@modern-js/module-generator": "3.1.30",
34
+ "@modern-js/monorepo-generator": "3.1.30",
35
+ "@modern-js/mwa-generator": "3.1.30",
36
+ "@modern-js/doc-generator": "3.1.30",
37
+ "@modern-js/utils": "2.28.0",
38
+ "@modern-js/generator-common": "3.1.30",
39
+ "@modern-js/generator-plugin": "3.1.30",
40
+ "@modern-js/base-generator": "3.1.30",
41
+ "@scripts/jest-config": "2.28.0",
42
+ "@scripts/build": "2.28.0"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "publishConfig": {