@modern-js/mwa-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 +32 -20
  2. package/package.json +11 -11
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)");
@@ -133246,11 +133254,13 @@ var PackageManagerName = {
133246
133254
  [PackageManager.Npm]: "npm"
133247
133255
  };
133248
133256
  var getPackageManagerSchema = (extra = {}) => {
133257
+ var _extra, _extra1;
133249
133258
  return {
133250
133259
  type: "string",
133251
133260
  title: i18n2.t(localeKeys2.packageManager.self),
133252
133261
  enum: Object.values(PackageManager).filter((packageManager) => {
133253
- return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
133262
+ var _extra2;
133263
+ return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
133254
133264
  }).map((packageManager) => ({
133255
133265
  value: packageManager,
133256
133266
  label: PackageManagerName[packageManager]
@@ -133260,7 +133270,7 @@ var getPackageManagerSchema = (extra = {}) => {
133260
133270
  dependencies: [],
133261
133271
  fulfill: {
133262
133272
  state: {
133263
- visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
133273
+ visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
133264
133274
  }
133265
133275
  }
133266
133276
  }
@@ -133270,15 +133280,16 @@ var getPackageManagerSchema = (extra = {}) => {
133270
133280
 
133271
133281
  // ../../generator-common/dist/esm-node/common/packageName.js
133272
133282
  var getPackageNameSchema = (extra = {}) => {
133283
+ var _extra, _extra1, _extra2, _extra3;
133273
133284
  return {
133274
133285
  type: "string",
133275
- title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
133286
+ title: ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
133276
133287
  "x-reactions": [
133277
133288
  {
133278
133289
  dependencies: [],
133279
133290
  fulfill: {
133280
133291
  state: {
133281
- 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)
133292
+ 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)
133282
133293
  }
133283
133294
  }
133284
133295
  }
@@ -133295,6 +133306,7 @@ var getPackageNameSchema = (extra = {}) => {
133295
133306
  // ../../generator-common/dist/esm-node/common/packagePath.js
133296
133307
  var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
133297
133308
  var getPackagePathSchema = (extra) => {
133309
+ var _extra;
133298
133310
  return {
133299
133311
  type: "string",
133300
133312
  title: i18n2.t(localeKeys2.packagePath.self),
@@ -133306,7 +133318,7 @@ var getPackagePathSchema = (extra) => {
133306
133318
  fulfill: {
133307
133319
  state: {
133308
133320
  value: "{{$deps[0]}}",
133309
- visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
133321
+ visible: Boolean((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject)
133310
133322
  }
133311
133323
  }
133312
133324
  }
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": [
@@ -30,16 +30,16 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/dependence-generator": "3.1.29",
34
- "@modern-js/generator-utils": "3.1.29",
35
- "@modern-js/packages-generator": "3.1.29",
36
- "@modern-js/rspack-generator": "3.1.29",
37
- "@modern-js/plugin-i18n": "2.27.0",
38
- "@modern-js/entry-generator": "3.1.29",
39
- "@modern-js/generator-common": "3.1.29",
40
- "@modern-js/base-generator": "3.1.29",
41
- "@scripts/build": "2.27.0",
42
- "@scripts/jest-config": "2.27.0"
33
+ "@modern-js/generator-common": "3.1.30",
34
+ "@modern-js/entry-generator": "3.1.30",
35
+ "@modern-js/generator-utils": "3.1.30",
36
+ "@modern-js/packages-generator": "3.1.30",
37
+ "@modern-js/rspack-generator": "3.1.30",
38
+ "@modern-js/plugin-i18n": "2.28.0",
39
+ "@modern-js/dependence-generator": "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": {