@modern-js/repo-generator 0.0.0-next-1690354890697 → 0.0.0-next-1690383964237

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 +42 -29
  2. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -122973,7 +122973,6 @@ var require_constants2 = __commonJS({
122973
122973
  };
122974
122974
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
122975
122975
  "@modern-js/module-tools": "@modern-js/module-tools",
122976
- "@modern-js/doc-tools": "@modern-js/doc-tools",
122977
122976
  "@modern-js/runtime": "@modern-js/runtime/cli",
122978
122977
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
122979
122978
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -123251,11 +123250,12 @@ var require_config2 = __commonJS({
123251
123250
  });
123252
123251
  var _type = require_type();
123253
123252
  var isSSR = (config) => {
123253
+ var _server, _server1;
123254
123254
  const { server } = config;
123255
- if (server === null || server === void 0 ? void 0 : server.ssr) {
123255
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
123256
123256
  return true;
123257
123257
  }
123258
- 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)) {
123259
123259
  for (const name of Object.keys(server.ssrByEntries)) {
123260
123260
  if (server.ssrByEntries[name]) {
123261
123261
  return true;
@@ -123265,27 +123265,29 @@ var require_config2 = __commonJS({
123265
123265
  return false;
123266
123266
  };
123267
123267
  var isUseSSRBundle = (config) => {
123268
+ var _output;
123268
123269
  const { output: output2 } = config;
123269
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
123270
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
123270
123271
  return true;
123271
123272
  }
123272
123273
  return isSSR(config);
123273
123274
  };
123274
123275
  var isServiceWorker = (config) => {
123275
- var _deploy_worker;
123276
+ var _deploy_worker, _deploy, _output;
123276
123277
  const { output: output2, deploy } = config;
123277
- 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))) {
123278
123279
  return true;
123279
123280
  }
123280
123281
  return false;
123281
123282
  };
123282
123283
  var isRouterV5 = (config) => {
123283
- var _config_runtime, _config_runtime1, _config_runtime_router;
123284
- 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";
123285
123286
  };
123286
123287
  var isSSGEntry = (config, entryName, entrypoints) => {
123288
+ var _ssgConfig, _ssgConfig1;
123287
123289
  const ssgConfig = config.output.ssg;
123288
- 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]);
123289
123291
  return useSSG;
123290
123292
  };
123291
123293
  var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -124032,7 +124034,7 @@ var require_alias = __commonJS({
124032
124034
  };
124033
124035
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
124034
124036
  var getAliasConfig = (aliasOption, option) => {
124035
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
124037
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
124036
124038
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
124037
124039
  const alias = mergeAlias(aliasOption);
124038
124040
  if (!isTsProject) {
@@ -124044,10 +124046,10 @@ var require_alias = __commonJS({
124044
124046
  };
124045
124047
  }
124046
124048
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
124047
- 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;
124048
124050
  return {
124049
124051
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
124050
- 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),
124051
124053
  isTsPath: true,
124052
124054
  isTsProject
124053
124055
  };
@@ -124586,7 +124588,8 @@ var require_prettyInstructions = __commonJS({
124586
124588
  const LOCAL_LABEL = "Local: ";
124587
124589
  const NETWORK_LABEL = "Network: ";
124588
124590
  const isLocalhost = (url) => {
124589
- 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");
124590
124593
  };
124591
124594
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
124592
124595
  return [
@@ -124615,7 +124618,7 @@ var require_prettyInstructions = __commonJS({
124615
124618
  var prettyInstructions = (appContext, config) => {
124616
124619
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
124617
124620
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
124618
- 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);
124619
124622
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
124620
124623
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
124621
124624
  let message = "App running at:\n\n";
@@ -124680,8 +124683,9 @@ var require_require = __commonJS({
124680
124683
  });
124681
124684
  var _fs = require_fs();
124682
124685
  var compatRequire = (filePath, interop = true) => {
124686
+ var _mod;
124683
124687
  const mod = require(filePath);
124684
- 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);
124685
124689
  return rtnESMDefault ? mod.default : mod;
124686
124690
  };
124687
124691
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -144497,16 +144501,18 @@ var getSolutionSchema = (extra = {}) => {
144497
144501
  type: "string",
144498
144502
  title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
144499
144503
  enum: (() => {
144500
- var _extra_customPlugin, _extra_customPlugin_custom;
144501
- 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) => {
144502
- 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);
144503
144508
  }).map((solution) => {
144509
+ var _extra3;
144504
144510
  return {
144505
144511
  value: solution,
144506
- 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]()
144507
144513
  };
144508
144514
  });
144509
- 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) {
144510
144516
  return [
144511
144517
  ...items,
144512
144518
  {
@@ -144522,7 +144528,8 @@ var getSolutionSchema = (extra = {}) => {
144522
144528
  };
144523
144529
  };
144524
144530
  var getScenesSchema = (extra = {}) => {
144525
- 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;
144526
144533
  return {
144527
144534
  type: "object",
144528
144535
  properties: hasPlugin ? {
@@ -144530,15 +144537,17 @@ var getScenesSchema = (extra = {}) => {
144530
144537
  type: "string",
144531
144538
  title: i18n2.t(localeKeys2.scenes.self),
144532
144539
  enum: (() => {
144533
- 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;
144534
- 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) => ({
144535
144543
  value: plugin.key,
144536
144544
  label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
144537
144545
  }));
144538
144546
  if (solution && solution !== "custom") {
144547
+ var _extra52;
144539
144548
  items.unshift({
144540
144549
  value: solution,
144541
- 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)})`
144542
144551
  });
144543
144552
  }
144544
144553
  return items;
@@ -144595,11 +144604,13 @@ var PackageManagerName = {
144595
144604
  [PackageManager.Npm]: "npm"
144596
144605
  };
144597
144606
  var getPackageManagerSchema = (extra = {}) => {
144607
+ var _extra, _extra1;
144598
144608
  return {
144599
144609
  type: "string",
144600
144610
  title: i18n2.t(localeKeys2.packageManager.self),
144601
144611
  enum: Object.values(PackageManager).filter((packageManager) => {
144602
- 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;
144603
144614
  }).map((packageManager) => ({
144604
144615
  value: packageManager,
144605
144616
  label: PackageManagerName[packageManager]
@@ -144609,7 +144620,7 @@ var getPackageManagerSchema = (extra = {}) => {
144609
144620
  dependencies: [],
144610
144621
  fulfill: {
144611
144622
  state: {
144612
- 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)
144613
144624
  }
144614
144625
  }
144615
144626
  }
@@ -144619,15 +144630,16 @@ var getPackageManagerSchema = (extra = {}) => {
144619
144630
 
144620
144631
  // ../../generator-common/dist/esm-node/common/packageName.js
144621
144632
  var getPackageNameSchema = (extra = {}) => {
144633
+ var _extra, _extra1, _extra2, _extra3;
144622
144634
  return {
144623
144635
  type: "string",
144624
- 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),
144625
144637
  "x-reactions": [
144626
144638
  {
144627
144639
  dependencies: [],
144628
144640
  fulfill: {
144629
144641
  state: {
144630
- 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)
144631
144643
  }
144632
144644
  }
144633
144645
  }
@@ -144644,6 +144656,7 @@ var getPackageNameSchema = (extra = {}) => {
144644
144656
  // ../../generator-common/dist/esm-node/common/packagePath.js
144645
144657
  var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
144646
144658
  var getPackagePathSchema = (extra) => {
144659
+ var _extra;
144647
144660
  return {
144648
144661
  type: "string",
144649
144662
  title: i18n2.t(localeKeys2.packagePath.self),
@@ -144655,7 +144668,7 @@ var getPackagePathSchema = (extra) => {
144655
144668
  fulfill: {
144656
144669
  state: {
144657
144670
  value: "{{$deps[0]}}",
144658
- visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
144671
+ visible: Boolean((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject)
144659
144672
  }
144660
144673
  }
144661
144674
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1690354890697",
18
+ "version": "0.0.0-next-1690383964237",
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/base-generator": "0.0.0-next-1690354890697",
33
- "@modern-js/generator-common": "0.0.0-next-1690354890697",
34
- "@modern-js/generator-plugin": "0.0.0-next-1690354890697",
35
- "@modern-js/generator-utils": "0.0.0-next-1690354890697",
36
- "@modern-js/module-generator": "0.0.0-next-1690354890697",
37
- "@modern-js/monorepo-generator": "0.0.0-next-1690354890697",
38
- "@modern-js/mwa-generator": "0.0.0-next-1690354890697",
39
- "@modern-js/doc-generator": "0.0.0-next-1690354890697",
40
- "@modern-js/utils": "0.0.0-next-1690354890697",
41
- "@scripts/build": "0.0.0-next-1690354890697",
42
- "@scripts/jest-config": "0.0.0-next-1690354890697"
32
+ "@modern-js/base-generator": "0.0.0-next-1690383964237",
33
+ "@modern-js/generator-common": "0.0.0-next-1690383964237",
34
+ "@modern-js/generator-plugin": "0.0.0-next-1690383964237",
35
+ "@modern-js/module-generator": "0.0.0-next-1690383964237",
36
+ "@modern-js/generator-utils": "0.0.0-next-1690383964237",
37
+ "@modern-js/monorepo-generator": "0.0.0-next-1690383964237",
38
+ "@modern-js/mwa-generator": "0.0.0-next-1690383964237",
39
+ "@modern-js/doc-generator": "0.0.0-next-1690383964237",
40
+ "@scripts/build": "0.0.0-next-1690383964237",
41
+ "@modern-js/utils": "0.0.0-next-1690383964237",
42
+ "@scripts/jest-config": "0.0.0-next-1690383964237"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "publishConfig": {