@modern-js/packages-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 +23 -15
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -115794,6 +115794,8 @@ var require_chainId = __commonJS({
115794
115794
  YAML: "yaml",
115795
115795
  /** Rule for wasm */
115796
115796
  WASM: "wasm",
115797
+ /** Rule for node */
115798
+ NODE: "node",
115797
115799
  /** Rule for bff */
115798
115800
  JS_BFF_API: "js-bff-api"
115799
115801
  },
@@ -115832,6 +115834,8 @@ var require_chainId = __commonJS({
115832
115834
  TOML: "toml",
115833
115835
  /** html-loader */
115834
115836
  HTML: "html",
115837
+ /** node-loader */
115838
+ NODE: "html",
115835
115839
  /** babel-loader */
115836
115840
  BABEL: "babel",
115837
115841
  /** esbuild-loader */
@@ -116092,7 +116096,6 @@ var require_constants = __commonJS({
116092
116096
  };
116093
116097
  var INTERNAL_MODULE_TOOLS_PLUGINS = {
116094
116098
  "@modern-js/module-tools": "@modern-js/module-tools",
116095
- "@modern-js/doc-tools": "@modern-js/doc-tools",
116096
116099
  "@modern-js/runtime": "@modern-js/runtime/cli",
116097
116100
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
116098
116101
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
@@ -116370,11 +116373,12 @@ var require_config2 = __commonJS({
116370
116373
  });
116371
116374
  var _type = require_type();
116372
116375
  var isSSR = (config) => {
116376
+ var _server, _server1;
116373
116377
  const { server } = config;
116374
- if (server === null || server === void 0 ? void 0 : server.ssr) {
116378
+ if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
116375
116379
  return true;
116376
116380
  }
116377
- if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
116381
+ if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
116378
116382
  for (const name of Object.keys(server.ssrByEntries)) {
116379
116383
  if (server.ssrByEntries[name]) {
116380
116384
  return true;
@@ -116384,27 +116388,29 @@ var require_config2 = __commonJS({
116384
116388
  return false;
116385
116389
  };
116386
116390
  var isUseSSRBundle = (config) => {
116391
+ var _output;
116387
116392
  const { output: output2 } = config;
116388
- if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
116393
+ if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
116389
116394
  return true;
116390
116395
  }
116391
116396
  return isSSR(config);
116392
116397
  };
116393
116398
  var isServiceWorker = (config) => {
116394
- var _deploy_worker;
116399
+ var _deploy_worker, _deploy, _output;
116395
116400
  const { output: output2, deploy } = config;
116396
- 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))) {
116401
+ 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))) {
116397
116402
  return true;
116398
116403
  }
116399
116404
  return false;
116400
116405
  };
116401
116406
  var isRouterV5 = (config) => {
116402
- var _config_runtime, _config_runtime1, _config_runtime_router;
116403
- 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";
116407
+ var _config_runtime, _config_runtime_router, _config_runtime1, _config;
116408
+ 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";
116404
116409
  };
116405
116410
  var isSSGEntry = (config, entryName, entrypoints) => {
116411
+ var _ssgConfig, _ssgConfig1;
116406
116412
  const ssgConfig = config.output.ssg;
116407
- 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]);
116413
+ 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]);
116408
116414
  return useSSG;
116409
116415
  };
116410
116416
  var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
@@ -117151,7 +117157,7 @@ var require_alias = __commonJS({
117151
117157
  };
117152
117158
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
117153
117159
  var getAliasConfig = (aliasOption, option) => {
117154
- var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
117160
+ var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
117155
117161
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
117156
117162
  const alias = mergeAlias(aliasOption);
117157
117163
  if (!isTsProject) {
@@ -117163,10 +117169,10 @@ var require_alias = __commonJS({
117163
117169
  };
117164
117170
  }
117165
117171
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
117166
- const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
117172
+ const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
117167
117173
  return {
117168
117174
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
117169
- 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),
117175
+ 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),
117170
117176
  isTsPath: true,
117171
117177
  isTsProject
117172
117178
  };
@@ -117705,7 +117711,8 @@ var require_prettyInstructions = __commonJS({
117705
117711
  const LOCAL_LABEL = "Local: ";
117706
117712
  const NETWORK_LABEL = "Network: ";
117707
117713
  const isLocalhost = (url) => {
117708
- return url === null || url === void 0 ? void 0 : url.includes("localhost");
117714
+ var _url;
117715
+ return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
117709
117716
  };
117710
117717
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
117711
117718
  return [
@@ -117734,7 +117741,7 @@ var require_prettyInstructions = __commonJS({
117734
117741
  var prettyInstructions = (appContext, config) => {
117735
117742
  var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
117736
117743
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
117737
- 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);
117744
+ 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);
117738
117745
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
117739
117746
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
117740
117747
  let message = "App running at:\n\n";
@@ -117799,8 +117806,9 @@ var require_require = __commonJS({
117799
117806
  });
117800
117807
  var _fs = require_fs();
117801
117808
  var compatRequire = (filePath, interop = true) => {
117809
+ var _mod;
117802
117810
  const mod = require(filePath);
117803
- const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
117811
+ const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
117804
117812
  return rtnESMDefault ? mod.default : mod;
117805
117813
  };
117806
117814
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
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,10 +30,10 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/generator-utils": "3.1.29",
34
- "@modern-js/generator-common": "3.1.29",
35
- "@scripts/build": "2.27.0",
36
- "@scripts/jest-config": "2.27.0"
33
+ "@scripts/jest-config": "2.28.0",
34
+ "@modern-js/generator-utils": "3.1.30",
35
+ "@scripts/build": "2.28.0",
36
+ "@modern-js/generator-common": "3.1.30"
37
37
  },
38
38
  "sideEffects": false,
39
39
  "publishConfig": {