@modern-js/entry-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 +25 -16
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -35129,6 +35129,8 @@ var require_chainId = __commonJS({
35129
35129
  YAML: "yaml",
35130
35130
  /** Rule for wasm */
35131
35131
  WASM: "wasm",
35132
+ /** Rule for node */
35133
+ NODE: "node",
35132
35134
  /** Rule for bff */
35133
35135
  JS_BFF_API: "js-bff-api"
35134
35136
  },
@@ -35167,6 +35169,8 @@ var require_chainId = __commonJS({
35167
35169
  TOML: "toml",
35168
35170
  /** html-loader */
35169
35171
  HTML: "html",
35172
+ /** node-loader */
35173
+ NODE: "html",
35170
35174
  /** babel-loader */
35171
35175
  BABEL: "babel",
35172
35176
  /** esbuild-loader */
@@ -35427,7 +35431,6 @@ var require_constants = __commonJS({
35427
35431
  };
35428
35432
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
35429
35433
  "@modern-js/module-tools": "@modern-js/module-tools",
35430
- "@modern-js/doc-tools": "@modern-js/doc-tools",
35431
35434
  "@modern-js/runtime": "@modern-js/runtime/cli",
35432
35435
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
35433
35436
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -35705,11 +35708,12 @@ var require_config = __commonJS({
35705
35708
  });
35706
35709
  var _type = require_type();
35707
35710
  var isSSR = (config) => {
35711
+ var _server, _server1;
35708
35712
  const { server } = config;
35709
- if (server === null || server === void 0 ? void 0 : server.ssr) {
35713
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
35710
35714
  return true;
35711
35715
  }
35712
- if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
35716
+ if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
35713
35717
  for (const name of Object.keys(server.ssrByEntries)) {
35714
35718
  if (server.ssrByEntries[name]) {
35715
35719
  return true;
@@ -35719,27 +35723,29 @@ var require_config = __commonJS({
35719
35723
  return false;
35720
35724
  };
35721
35725
  var isUseSSRBundle = (config) => {
35726
+ var _output;
35722
35727
  const { output: output2 } = config;
35723
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
35728
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
35724
35729
  return true;
35725
35730
  }
35726
35731
  return isSSR(config);
35727
35732
  };
35728
35733
  var isServiceWorker = (config) => {
35729
- var _deploy_worker;
35734
+ var _deploy_worker, _deploy, _output;
35730
35735
  const { output: output2, deploy } = config;
35731
- 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))) {
35736
+ 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))) {
35732
35737
  return true;
35733
35738
  }
35734
35739
  return false;
35735
35740
  };
35736
35741
  var isRouterV5 = (config) => {
35737
- var _config_runtime, _config_runtime1, _config_runtime_router;
35738
- 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";
35742
+ var _config_runtime, _config_runtime_router, _config_runtime1, _config;
35743
+ 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";
35739
35744
  };
35740
35745
  var isSSGEntry = (config, entryName, entrypoints) => {
35746
+ var _ssgConfig, _ssgConfig1;
35741
35747
  const ssgConfig = config.output.ssg;
35742
- const useSSG = isSingleEntry2(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]);
35748
+ const useSSG = isSingleEntry2(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]);
35743
35749
  return useSSG;
35744
35750
  };
35745
35751
  var isSingleEntry2 = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -36486,7 +36492,7 @@ var require_alias = __commonJS({
36486
36492
  };
36487
36493
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
36488
36494
  var getAliasConfig = (aliasOption, option) => {
36489
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
36495
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
36490
36496
  const isTsProject2 = _fs.default.existsSync(option.tsconfigPath);
36491
36497
  const alias = mergeAlias(aliasOption);
36492
36498
  if (!isTsProject2) {
@@ -36498,10 +36504,10 @@ var require_alias = __commonJS({
36498
36504
  };
36499
36505
  }
36500
36506
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
36501
- const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
36507
+ const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
36502
36508
  return {
36503
36509
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
36504
- 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),
36510
+ 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),
36505
36511
  isTsPath: true,
36506
36512
  isTsProject: isTsProject2
36507
36513
  };
@@ -37040,7 +37046,8 @@ var require_prettyInstructions = __commonJS({
37040
37046
  const LOCAL_LABEL = "Local: ";
37041
37047
  const NETWORK_LABEL = "Network: ";
37042
37048
  const isLocalhost = (url) => {
37043
- return url === null || url === void 0 ? void 0 : url.includes("localhost");
37049
+ var _url;
37050
+ return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
37044
37051
  };
37045
37052
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
37046
37053
  return [
@@ -37069,7 +37076,7 @@ var require_prettyInstructions = __commonJS({
37069
37076
  var prettyInstructions = (appContext, config) => {
37070
37077
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
37071
37078
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
37072
- 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);
37079
+ 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);
37073
37080
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
37074
37081
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
37075
37082
  let message = "App running at:\n\n";
@@ -37134,8 +37141,9 @@ var require_require = __commonJS({
37134
37141
  });
37135
37142
  var _fs = require_fs();
37136
37143
  var compatRequire = (filePath, interop = true) => {
37144
+ var _mod;
37137
37145
  const mod = require(filePath);
37138
- const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
37146
+ const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
37139
37147
  return rtnESMDefault ? mod.default : mod;
37140
37148
  };
37141
37149
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -116259,6 +116267,7 @@ var BooleanConfigName = {
116259
116267
 
116260
116268
  // ../../generator-common/dist/esm-node/mwa/entry.js
116261
116269
  var getEntryNameSchema = (extra = {}) => {
116270
+ var _extra;
116262
116271
  return {
116263
116272
  type: "string",
116264
116273
  title: i18n.t(localeKeys.entry.name),
@@ -116277,7 +116286,7 @@ var getEntryNameSchema = (extra = {}) => {
116277
116286
  dependencies: [],
116278
116287
  fulfill: {
116279
116288
  state: {
116280
- visible: !(extra === null || extra === void 0 ? void 0 : extra.isEmptySrc)
116289
+ visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isEmptySrc)
116281
116290
  }
116282
116291
  }
116283
116292
  }
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,12 +30,12 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/plugin-i18n": "2.26.0",
34
- "@modern-js/generator-common": "3.1.28",
35
- "@modern-js/generator-utils": "3.1.28",
36
- "@modern-js/utils": "2.26.0",
37
- "@scripts/jest-config": "2.26.0",
38
- "@scripts/build": "2.26.0"
33
+ "@modern-js/plugin-i18n": "2.28.0",
34
+ "@modern-js/generator-utils": "3.1.30",
35
+ "@modern-js/utils": "2.28.0",
36
+ "@modern-js/generator-common": "3.1.30",
37
+ "@scripts/jest-config": "2.28.0",
38
+ "@scripts/build": "2.28.0"
39
39
  },
40
40
  "sideEffects": false,
41
41
  "publishConfig": {