@modern-js/ssg-generator 0.0.0-nightly-20230926160605 → 0.0.0-nightly-20230927160620

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 +19 -31
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -124925,12 +124925,11 @@ var require_config4 = __commonJS({
124925
124925
  var import_constants10 = require_constants3();
124926
124926
  var import_type = require_type2();
124927
124927
  var isSSR = (config) => {
124928
- var _server, _server1;
124929
124928
  const { server } = config;
124930
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
124929
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
124931
124930
  return true;
124932
124931
  }
124933
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, import_type.isEmpty)(server.ssrByEntries)) {
124932
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, import_type.isEmpty)(server.ssrByEntries)) {
124934
124933
  for (const name of Object.keys(server.ssrByEntries)) {
124935
124934
  if (server.ssrByEntries[name]) {
124936
124935
  return true;
@@ -124940,29 +124939,28 @@ var require_config4 = __commonJS({
124940
124939
  return false;
124941
124940
  };
124942
124941
  var isUseSSRBundle = (config) => {
124943
- var _output;
124944
124942
  const { output: output2 } = config;
124945
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
124943
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
124946
124944
  return true;
124947
124945
  }
124948
124946
  return isSSR(config);
124949
124947
  };
124950
124948
  var isServiceWorker = (config) => {
124951
- var _deploy_worker, _deploy, _output;
124949
+ var _deploy_worker;
124952
124950
  const { output: output2, deploy } = config;
124953
- 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))) {
124951
+ 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))) {
124954
124952
  return true;
124955
124953
  }
124956
124954
  return false;
124957
124955
  };
124958
124956
  var isRouterV5 = (config) => {
124959
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
124960
- 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";
124957
+ var _config_runtime, _config_runtime_router, _config_runtime1;
124958
+ 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";
124961
124959
  };
124962
124960
  var isSSGEntry = (config, entryName, entrypoints) => {
124963
- var _config_source, _ssgConfig, _ssgConfig1;
124961
+ var _config_source;
124964
124962
  const ssgConfig = config.output.ssg;
124965
- const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? 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]);
124963
+ const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? 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]);
124966
124964
  return useSSG;
124967
124965
  };
124968
124966
  var isSingleEntry = (entrypoints, mainEntryName = import_constants10.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -125827,7 +125825,7 @@ var require_alias2 = __commonJS({
125827
125825
  };
125828
125826
  var mergeAlias = (alias) => (0, import_applyOptionsChain.applyOptionsChain)({}, alias);
125829
125827
  var getAliasConfig = (aliasOption, option) => {
125830
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
125828
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
125831
125829
  const isTsProject2 = import_fs.default.existsSync(option.tsconfigPath);
125832
125830
  const alias = mergeAlias(aliasOption);
125833
125831
  if (!isTsProject2) {
@@ -125839,12 +125837,12 @@ var require_alias2 = __commonJS({
125839
125837
  };
125840
125838
  }
125841
125839
  const tsconfig = (0, import_get.readTsConfigByFile)(option.tsconfigPath);
125842
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
125840
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
125843
125841
  return {
125844
125842
  absoluteBaseUrl: baseUrl ? import_path13.default.join(option.appDirectory, baseUrl) : option.appDirectory,
125845
125843
  paths: {
125846
125844
  ...alias,
125847
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
125845
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
125848
125846
  },
125849
125847
  isTsPath: true,
125850
125848
  isTsProject: isTsProject2
@@ -126332,10 +126330,7 @@ var require_prettyInstructions2 = __commonJS({
126332
126330
  var getAddressUrls = (protocol = "http", port, host) => {
126333
126331
  const LOCAL_LABEL = "Local: ";
126334
126332
  const NETWORK_LABEL = "Network: ";
126335
- const isLocalhost = (url) => {
126336
- var _url;
126337
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
126338
- };
126333
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
126339
126334
  if (host && host !== import_constants10.DEFAULT_DEV_HOST) {
126340
126335
  return [
126341
126336
  {
@@ -126425,9 +126420,8 @@ var require_require2 = __commonJS({
126425
126420
  module2.exports = __toCommonJS2(require_exports);
126426
126421
  var import_fs = require_fs2();
126427
126422
  var compatRequire = (filePath, interop = true) => {
126428
- var _mod;
126429
126423
  const mod = require(filePath);
126430
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
126424
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
126431
126425
  return rtnESMDefault ? mod.default : mod;
126432
126426
  };
126433
126427
  var dynamicImport = new Function("modulePath", "return import(modulePath)");
@@ -141953,14 +141947,10 @@ var PackageManagerName = {
141953
141947
  [PackageManager.Npm]: "npm"
141954
141948
  };
141955
141949
  var getPackageManagerSchema = (extra = {}) => {
141956
- var _extra, _extra1;
141957
141950
  return {
141958
141951
  type: "string",
141959
141952
  title: i18n2.t(localeKeys2.packageManager.self),
141960
- enum: Object.values(PackageManager).filter((packageManager) => {
141961
- var _extra2;
141962
- return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
141963
- }).map((packageManager) => ({
141953
+ enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
141964
141954
  value: packageManager,
141965
141955
  label: PackageManagerName[packageManager]
141966
141956
  })),
@@ -141969,7 +141959,7 @@ var getPackageManagerSchema = (extra = {}) => {
141969
141959
  dependencies: [],
141970
141960
  fulfill: {
141971
141961
  state: {
141972
- visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
141962
+ visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
141973
141963
  }
141974
141964
  }
141975
141965
  }
@@ -141979,16 +141969,15 @@ var getPackageManagerSchema = (extra = {}) => {
141979
141969
 
141980
141970
  // ../../generator-common/dist/esm-node/common/packageName.js
141981
141971
  var getPackageNameSchema = (extra = {}) => {
141982
- var _extra, _extra1, _extra2;
141983
141972
  return {
141984
141973
  type: "string",
141985
- title: ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
141974
+ title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
141986
141975
  "x-reactions": [
141987
141976
  {
141988
141977
  dependencies: [],
141989
141978
  fulfill: {
141990
141979
  state: {
141991
- visible: Boolean((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) || !((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.isMwa)
141980
+ visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa)
141992
141981
  }
141993
141982
  }
141994
141983
  }
@@ -142005,7 +141994,6 @@ var getPackageNameSchema = (extra = {}) => {
142005
141994
  // ../../generator-common/dist/esm-node/common/packagePath.js
142006
141995
  var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
142007
141996
  var getPackagePathSchema = (extra) => {
142008
- var _extra;
142009
141997
  return {
142010
141998
  type: "string",
142011
141999
  title: i18n2.t(localeKeys2.packagePath.self),
@@ -142017,7 +142005,7 @@ var getPackagePathSchema = (extra) => {
142017
142005
  fulfill: {
142018
142006
  state: {
142019
142007
  value: "{{$deps[0]}}",
142020
- visible: Boolean((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject)
142008
+ visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
142021
142009
  }
142022
142010
  }
142023
142011
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20230926160605",
18
+ "version": "0.0.0-nightly-20230927160620",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,13 +29,13 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/dependence-generator": "0.0.0-nightly-20230926160605",
33
- "@modern-js/generator-common": "0.0.0-nightly-20230926160605",
34
- "@modern-js/generator-utils": "0.0.0-nightly-20230926160605",
35
- "@modern-js/plugin-i18n": "0.0.0-nightly-20230926160605",
36
- "@modern-js/utils": "0.0.0-nightly-20230926160605",
37
- "@scripts/build": "0.0.0-nightly-20230926160605",
38
- "@scripts/jest-config": "0.0.0-nightly-20230926160605"
32
+ "@modern-js/dependence-generator": "0.0.0-nightly-20230927160620",
33
+ "@modern-js/generator-common": "0.0.0-nightly-20230927160620",
34
+ "@modern-js/generator-utils": "0.0.0-nightly-20230927160620",
35
+ "@modern-js/plugin-i18n": "0.0.0-nightly-20230927160620",
36
+ "@modern-js/utils": "0.0.0-nightly-20230927160620",
37
+ "@scripts/build": "0.0.0-nightly-20230927160620",
38
+ "@scripts/jest-config": "0.0.0-nightly-20230927160620"
39
39
  },
40
40
  "sideEffects": false,
41
41
  "publishConfig": {