@modern-js/base-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 +27 -17
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -113743,6 +113743,8 @@ var require_chainId = __commonJS({
113743
113743
  YAML: "yaml",
113744
113744
  /** Rule for wasm */
113745
113745
  WASM: "wasm",
113746
+ /** Rule for node */
113747
+ NODE: "node",
113746
113748
  /** Rule for bff */
113747
113749
  JS_BFF_API: "js-bff-api"
113748
113750
  },
@@ -113781,6 +113783,8 @@ var require_chainId = __commonJS({
113781
113783
  TOML: "toml",
113782
113784
  /** html-loader */
113783
113785
  HTML: "html",
113786
+ /** node-loader */
113787
+ NODE: "html",
113784
113788
  /** babel-loader */
113785
113789
  BABEL: "babel",
113786
113790
  /** esbuild-loader */
@@ -114041,7 +114045,6 @@ var require_constants = __commonJS({
114041
114045
  };
114042
114046
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
114043
114047
  "@modern-js/module-tools": "@modern-js/module-tools",
114044
- "@modern-js/doc-tools": "@modern-js/doc-tools",
114045
114048
  "@modern-js/runtime": "@modern-js/runtime/cli",
114046
114049
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
114047
114050
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -114319,11 +114322,12 @@ var require_config2 = __commonJS({
114319
114322
  });
114320
114323
  var _type = require_type();
114321
114324
  var isSSR = (config) => {
114325
+ var _server, _server1;
114322
114326
  const { server } = config;
114323
- if (server === null || server === void 0 ? void 0 : server.ssr) {
114327
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
114324
114328
  return true;
114325
114329
  }
114326
- if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
114330
+ if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
114327
114331
  for (const name of Object.keys(server.ssrByEntries)) {
114328
114332
  if (server.ssrByEntries[name]) {
114329
114333
  return true;
@@ -114333,27 +114337,29 @@ var require_config2 = __commonJS({
114333
114337
  return false;
114334
114338
  };
114335
114339
  var isUseSSRBundle = (config) => {
114340
+ var _output;
114336
114341
  const { output: output2 } = config;
114337
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
114342
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
114338
114343
  return true;
114339
114344
  }
114340
114345
  return isSSR(config);
114341
114346
  };
114342
114347
  var isServiceWorker = (config) => {
114343
- var _deploy_worker;
114348
+ var _deploy_worker, _deploy, _output;
114344
114349
  const { output: output2, deploy } = config;
114345
- 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))) {
114350
+ 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))) {
114346
114351
  return true;
114347
114352
  }
114348
114353
  return false;
114349
114354
  };
114350
114355
  var isRouterV5 = (config) => {
114351
- var _config_runtime, _config_runtime1, _config_runtime_router;
114352
- 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";
114356
+ var _config_runtime, _config_runtime_router, _config_runtime1, _config;
114357
+ 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";
114353
114358
  };
114354
114359
  var isSSGEntry = (config, entryName, entrypoints) => {
114360
+ var _ssgConfig, _ssgConfig1;
114355
114361
  const ssgConfig = config.output.ssg;
114356
- 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]);
114362
+ 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]);
114357
114363
  return useSSG;
114358
114364
  };
114359
114365
  var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -115100,7 +115106,7 @@ var require_alias = __commonJS({
115100
115106
  };
115101
115107
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
115102
115108
  var getAliasConfig = (aliasOption, option) => {
115103
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
115109
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
115104
115110
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
115105
115111
  const alias = mergeAlias(aliasOption);
115106
115112
  if (!isTsProject) {
@@ -115112,10 +115118,10 @@ var require_alias = __commonJS({
115112
115118
  };
115113
115119
  }
115114
115120
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
115115
- const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
115121
+ const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
115116
115122
  return {
115117
115123
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
115118
- 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),
115124
+ 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),
115119
115125
  isTsPath: true,
115120
115126
  isTsProject
115121
115127
  };
@@ -115654,7 +115660,8 @@ var require_prettyInstructions = __commonJS({
115654
115660
  const LOCAL_LABEL = "Local: ";
115655
115661
  const NETWORK_LABEL = "Network: ";
115656
115662
  const isLocalhost = (url) => {
115657
- return url === null || url === void 0 ? void 0 : url.includes("localhost");
115663
+ var _url;
115664
+ return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
115658
115665
  };
115659
115666
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
115660
115667
  return [
@@ -115683,7 +115690,7 @@ var require_prettyInstructions = __commonJS({
115683
115690
  var prettyInstructions = (appContext, config) => {
115684
115691
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
115685
115692
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
115686
- 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);
115693
+ 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);
115687
115694
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
115688
115695
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
115689
115696
  let message = "App running at:\n\n";
@@ -115748,8 +115755,9 @@ var require_require = __commonJS({
115748
115755
  });
115749
115756
  var _fs = require_fs();
115750
115757
  var compatRequire = (filePath, interop = true) => {
115758
+ var _mod;
115751
115759
  const mod = require(filePath);
115752
- const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
115760
+ const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
115753
115761
  return rtnESMDefault ? mod.default : mod;
115754
115762
  };
115755
115763
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -131066,11 +131074,13 @@ var PackageManagerName = {
131066
131074
  [PackageManager.Npm]: "npm"
131067
131075
  };
131068
131076
  var getPackageManagerSchema = (extra = {}) => {
131077
+ var _extra, _extra1;
131069
131078
  return {
131070
131079
  type: "string",
131071
131080
  title: i18n2.t(localeKeys2.packageManager.self),
131072
131081
  enum: Object.values(PackageManager).filter((packageManager) => {
131073
- return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
131082
+ var _extra2;
131083
+ return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
131074
131084
  }).map((packageManager) => ({
131075
131085
  value: packageManager,
131076
131086
  label: PackageManagerName[packageManager]
@@ -131080,7 +131090,7 @@ var getPackageManagerSchema = (extra = {}) => {
131080
131090
  dependencies: [],
131081
131091
  fulfill: {
131082
131092
  state: {
131083
- visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
131093
+ visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
131084
131094
  }
131085
131095
  }
131086
131096
  }
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
  "types": "./src/index.ts",
21
21
  "main": "./dist/index.js",
@@ -30,10 +30,10 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/generator-common": "3.1.29",
34
- "@modern-js/generator-utils": "3.1.29",
35
- "@scripts/jest-config": "2.27.0",
36
- "@scripts/build": "2.27.0"
33
+ "@modern-js/generator-utils": "3.1.30",
34
+ "@modern-js/generator-common": "3.1.30",
35
+ "@scripts/jest-config": "2.28.0",
36
+ "@scripts/build": "2.28.0"
37
37
  },
38
38
  "sideEffects": false,
39
39
  "publishConfig": {