@modern-js/packages-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 +5 -5
package/dist/index.js CHANGED
@@ -117266,8 +117266,6 @@ var require_chainId2 = __commonJS({
117266
117266
  STYLE: "style-loader",
117267
117267
  /** postcss-loader */
117268
117268
  POSTCSS: "postcss",
117269
- /** markdown-loader */
117270
- MARKDOWN: "markdown",
117271
117269
  /** ignore-css-loader */
117272
117270
  IGNORE_CSS: "ignore-css",
117273
117271
  /** css-modules-typescript-loader */
@@ -117348,7 +117346,9 @@ var require_chainId2 = __commonJS({
117348
117346
  /** HtmlAsyncChunkPlugin */
117349
117347
  HTML_ASYNC_CHUNK: "html-async-chunk",
117350
117348
  /** SWC_POLYFILL_CHECKER */
117351
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
117349
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
117350
+ /** RouterPlugin */
117351
+ ROUTER_MANIFEST: "route-plugin"
117352
117352
  },
117353
117353
  /** Predefined minimizers */
117354
117354
  MINIMIZER: {
@@ -117804,12 +117804,11 @@ var require_config4 = __commonJS({
117804
117804
  var _constants = require_constants2();
117805
117805
  var _type = require_type2();
117806
117806
  var isSSR = (config) => {
117807
- var _server, _server1;
117808
117807
  const { server } = config;
117809
- if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
117808
+ if (server === null || server === void 0 ? void 0 : server.ssr) {
117810
117809
  return true;
117811
117810
  }
117812
- if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117811
+ if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
117813
117812
  for (const name of Object.keys(server.ssrByEntries)) {
117814
117813
  if (server.ssrByEntries[name]) {
117815
117814
  return true;
@@ -117819,29 +117818,28 @@ var require_config4 = __commonJS({
117819
117818
  return false;
117820
117819
  };
117821
117820
  var isUseSSRBundle = (config) => {
117822
- var _output;
117823
117821
  const { output: output2 } = config;
117824
- if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
117822
+ if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
117825
117823
  return true;
117826
117824
  }
117827
117825
  return isSSR(config);
117828
117826
  };
117829
117827
  var isServiceWorker = (config) => {
117830
- var _deploy_worker, _deploy, _output;
117828
+ var _deploy_worker;
117831
117829
  const { output: output2, deploy } = config;
117832
- 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))) {
117830
+ 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))) {
117833
117831
  return true;
117834
117832
  }
117835
117833
  return false;
117836
117834
  };
117837
117835
  var isRouterV5 = (config) => {
117838
- var _config_runtime, _config_runtime_router, _config_runtime1, _config;
117839
- 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";
117836
+ var _config_runtime, _config_runtime_router, _config_runtime1;
117837
+ 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";
117840
117838
  };
117841
117839
  var isSSGEntry = (config, entryName, entrypoints) => {
117842
- var _config_source, _ssgConfig, _ssgConfig1;
117840
+ var _config_source;
117843
117841
  const ssgConfig = config.output.ssg;
117844
- 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]);
117842
+ 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]);
117845
117843
  return useSSG;
117846
117844
  };
117847
117845
  var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
@@ -118420,9 +118418,14 @@ var require_logger3 = __commonJS({
118420
118418
  label: "info",
118421
118419
  level: "info"
118422
118420
  },
118421
+ ready: {
118422
+ color: "green",
118423
+ label: "ready",
118424
+ level: "info"
118425
+ },
118423
118426
  success: {
118424
118427
  color: "green",
118425
- label: "Success",
118428
+ label: "success",
118426
118429
  level: "info"
118427
118430
  },
118428
118431
  warn: {
@@ -118602,7 +118605,7 @@ var require_alias2 = __commonJS({
118602
118605
  };
118603
118606
  var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
118604
118607
  var getAliasConfig = (aliasOption, option) => {
118605
- var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
118608
+ var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
118606
118609
  const isTsProject = _fs.default.existsSync(option.tsconfigPath);
118607
118610
  const alias = mergeAlias(aliasOption);
118608
118611
  if (!isTsProject) {
@@ -118614,12 +118617,12 @@ var require_alias2 = __commonJS({
118614
118617
  };
118615
118618
  }
118616
118619
  const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
118617
- const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118620
+ const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
118618
118621
  return {
118619
118622
  absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
118620
118623
  paths: {
118621
118624
  ...alias,
118622
- ...(_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118625
+ ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
118623
118626
  },
118624
118627
  isTsPath: true,
118625
118628
  isTsProject
@@ -119014,7 +119017,7 @@ var require_port2 = __commonJS({
119014
119017
  if (strictPort) {
119015
119018
  throw new Error(`Port "${original}" is occupied, please choose another one.`);
119016
119019
  } else if (!slient) {
119017
- _logger.logger.info(`Something is already running on port ${original}. ${_compiled.chalk.yellow(`Use port ${port} instead.`)}`);
119020
+ _logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
119018
119021
  }
119019
119022
  }
119020
119023
  return port;
@@ -119066,10 +119069,7 @@ var require_prettyInstructions2 = __commonJS({
119066
119069
  var getAddressUrls = (protocol = "http", port, host) => {
119067
119070
  const LOCAL_LABEL = "Local: ";
119068
119071
  const NETWORK_LABEL = "Network: ";
119069
- const isLocalhost = (url) => {
119070
- var _url;
119071
- return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
119072
- };
119072
+ const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
119073
119073
  if (host && host !== _constants.DEFAULT_DEV_HOST) {
119074
119074
  return [
119075
119075
  {
@@ -119100,7 +119100,7 @@ var require_prettyInstructions2 = __commonJS({
119100
119100
  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);
119101
119101
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
119102
119102
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
119103
- let message = "App running at:\n\n";
119103
+ let message = "\n";
119104
119104
  if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
119105
119105
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
119106
119106
  `).join("");
@@ -119162,9 +119162,8 @@ var require_require2 = __commonJS({
119162
119162
  });
119163
119163
  var _fs = require_fs2();
119164
119164
  var compatRequire = (filePath, interop = true) => {
119165
- var _mod;
119166
119165
  const mod = require(filePath);
119167
- const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
119166
+ const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
119168
119167
  return rtnESMDefault ? mod.default : mod;
119169
119168
  };
119170
119169
  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": [
@@ -30,10 +30,10 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@scripts/jest-config": "2.35.0",
34
- "@modern-js/generator-utils": "3.2.1",
35
- "@modern-js/generator-common": "3.2.1",
36
- "@scripts/build": "2.35.0"
33
+ "@modern-js/generator-utils": "3.2.2",
34
+ "@modern-js/generator-common": "3.2.2",
35
+ "@scripts/jest-config": "2.35.1",
36
+ "@scripts/build": "2.35.1"
37
37
  },
38
38
  "sideEffects": false,
39
39
  "publishConfig": {