@modern-js/ssg-generator 3.2.1 → 3.2.2

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 -26
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -115223,8 +115223,6 @@ var require_chainId2 = __commonJS({
115223
115223
  STYLE: "style-loader",
115224
115224
  /** postcss-loader */
115225
115225
  POSTCSS: "postcss",
115226
- /** markdown-loader */
115227
- MARKDOWN: "markdown",
115228
115226
  /** ignore-css-loader */
115229
115227
  IGNORE_CSS: "ignore-css",
115230
115228
  /** css-modules-typescript-loader */
@@ -115305,7 +115303,9 @@ var require_chainId2 = __commonJS({
115305
115303
  /** HtmlAsyncChunkPlugin */
115306
115304
  HTML_ASYNC_CHUNK: "html-async-chunk",
115307
115305
  /** SWC_POLYFILL_CHECKER */
115308
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
115306
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
115307
+ /** RouterPlugin */
115308
+ ROUTER_MANIFEST: "route-plugin"
115309
115309
  },
115310
115310
  /** Predefined minimizers */
115311
115311
  MINIMIZER: {
@@ -115761,12 +115761,11 @@ var require_config4 = __commonJS({
115761
115761
  var _constants = require_constants2();
115762
115762
  var _type = require_type2();
115763
115763
  var isSSR = (config) => {
115764
- var _server, _server1;
115765
115764
  const { server } = config;
115766
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
115765
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
115767
115766
  return true;
115768
115767
  }
115769
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115768
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
115770
115769
  for (const name of Object.keys(server.ssrByEntries)) {
115771
115770
  if (server.ssrByEntries[name]) {
115772
115771
  return true;
@@ -115776,29 +115775,28 @@ var require_config4 = __commonJS({
115776
115775
  return false;
115777
115776
  };
115778
115777
  var isUseSSRBundle = (config) => {
115779
- var _output;
115780
115778
  const { output: output2 } = config;
115781
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
115779
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
115782
115780
  return true;
115783
115781
  }
115784
115782
  return isSSR(config);
115785
115783
  };
115786
115784
  var isServiceWorker = (config) => {
115787
- var _deploy_worker, _deploy, _output;
115785
+ var _deploy_worker;
115788
115786
  const { output: output2, deploy } = config;
115789
- 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))) {
115787
+ 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))) {
115790
115788
  return true;
115791
115789
  }
115792
115790
  return false;
115793
115791
  };
115794
115792
  var isRouterV5 = (config) => {
115795
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
115796
- 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";
115793
+ var _config_runtime, _config_runtime_router, _config_runtime1;
115794
+ 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";
115797
115795
  };
115798
115796
  var isSSGEntry = (config, entryName, entrypoints) => {
115799
- var _config_source, _ssgConfig, _ssgConfig1;
115797
+ var _config_source;
115800
115798
  const ssgConfig = config.output.ssg;
115801
- 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]);
115799
+ 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]);
115802
115800
  return useSSG;
115803
115801
  };
115804
115802
  var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -116377,9 +116375,14 @@ var require_logger3 = __commonJS({
116377
116375
  label: "info",
116378
116376
  level: "info"
116379
116377
  },
116378
+ ready: {
116379
+ color: "green",
116380
+ label: "ready",
116381
+ level: "info"
116382
+ },
116380
116383
  success: {
116381
116384
  color: "green",
116382
- label: "Success",
116385
+ label: "success",
116383
116386
  level: "info"
116384
116387
  },
116385
116388
  warn: {
@@ -116559,7 +116562,7 @@ var require_alias2 = __commonJS({
116559
116562
  };
116560
116563
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
116561
116564
  var getAliasConfig = (aliasOption, option) => {
116562
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
116565
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
116563
116566
  const isTsProject2 = _fs.default.existsSync(option.tsconfigPath);
116564
116567
  const alias = mergeAlias(aliasOption);
116565
116568
  if (!isTsProject2) {
@@ -116571,12 +116574,12 @@ var require_alias2 = __commonJS({
116571
116574
  };
116572
116575
  }
116573
116576
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
116574
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116577
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
116575
116578
  return {
116576
116579
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
116577
116580
  paths: {
116578
116581
  ...alias,
116579
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
116582
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
116580
116583
  },
116581
116584
  isTsPath: true,
116582
116585
  isTsProject: isTsProject2
@@ -116971,7 +116974,7 @@ var require_port2 = __commonJS({
116971
116974
  if (strictPort) {
116972
116975
  throw new Error(`Port "${original}" is occupied, please choose another one.`);
116973
116976
  } else if (!slient) {
116974
- _logger.logger.info(`Something is already running on port ${original}. ${_compiled.chalk.yellow(`Use port ${port} instead.`)}`);
116977
+ _logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
116975
116978
  }
116976
116979
  }
116977
116980
  return port;
@@ -117023,10 +117026,7 @@ var require_prettyInstructions2 = __commonJS({
117023
117026
  var getAddressUrls = (protocol = "http", port, host) => {
117024
117027
  const LOCAL_LABEL = "Local: ";
117025
117028
  const NETWORK_LABEL = "Network: ";
117026
- const isLocalhost = (url) => {
117027
- var _url;
117028
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
117029
- };
117029
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
117030
117030
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
117031
117031
  return [
117032
117032
  {
@@ -117057,7 +117057,7 @@ var require_prettyInstructions2 = __commonJS({
117057
117057
  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);
117058
117058
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
117059
117059
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
117060
- let message = "App running at:\n\n";
117060
+ let message = "\n";
117061
117061
  if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
117062
117062
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
117063
117063
  `).join("");
@@ -117119,9 +117119,8 @@ var require_require2 = __commonJS({
117119
117119
  });
117120
117120
  var _fs = require_fs2();
117121
117121
  var compatRequire = (filePath, interop = true) => {
117122
- var _mod;
117123
117122
  const mod = require(filePath);
117124
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
117123
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
117125
117124
  return rtnESMDefault ? mod.default : mod;
117126
117125
  };
117127
117126
  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.2.1",
18
+ "version": "3.2.2",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,12 +29,12 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/generator-utils": "3.2.1",
33
- "@modern-js/generator-common": "3.2.1",
34
- "@modern-js/plugin-i18n": "2.35.0",
35
- "@modern-js/dependence-generator": "3.2.1",
36
- "@scripts/jest-config": "2.35.0",
37
- "@scripts/build": "2.35.0"
32
+ "@modern-js/dependence-generator": "3.2.2",
33
+ "@modern-js/generator-utils": "3.2.2",
34
+ "@modern-js/plugin-i18n": "2.35.1",
35
+ "@modern-js/generator-common": "3.2.2",
36
+ "@scripts/build": "2.35.1",
37
+ "@scripts/jest-config": "2.35.1"
38
38
  },
39
39
  "sideEffects": false,
40
40
  "publishConfig": {