@modern-js/repo-generator 0.0.0-next-1690784628608 → 0.0.0-next-1690813010932

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 +11 -108
  2. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -122780,6 +122780,10 @@ var require_chainId = __commonJS({
122780
122780
  HTML_NONCE: "html-nonce",
122781
122781
  /** HtmlCrossOriginPlugin */
122782
122782
  HTML_CROSS_ORIGIN: "html-cross-origin",
122783
+ /** htmlPreconnectPlugin */
122784
+ HTML_PRECONNECT: "html-preconnect-plugin",
122785
+ /** htmlDnsPrefetchPlugin */
122786
+ HTML_DNS_PREFETCH: "html-dns-prefetch-plugin",
122783
122787
  /** MiniCssExtractPlugin */
122784
122788
  MINI_CSS_EXTRACT: "mini-css-extract",
122785
122789
  /** VueLoaderPlugin */
@@ -123250,6 +123254,7 @@ var require_config2 = __commonJS({
123250
123254
  return isSingleEntry;
123251
123255
  }
123252
123256
  });
123257
+ var _constants = require_constants2();
123253
123258
  var _type = require_type();
123254
123259
  var isSSR = (config) => {
123255
123260
  var _server, _server1;
@@ -123287,12 +123292,12 @@ var require_config2 = __commonJS({
123287
123292
  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";
123288
123293
  };
123289
123294
  var isSSGEntry = (config, entryName, entrypoints) => {
123290
- var _ssgConfig, _ssgConfig1;
123295
+ var _config_source, _ssgConfig, _ssgConfig1;
123291
123296
  const ssgConfig = config.output.ssg;
123292
- 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]);
123297
+ 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]);
123293
123298
  return useSSG;
123294
123299
  };
123295
- var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
123300
+ var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
123296
123301
  }
123297
123302
  });
123298
123303
 
@@ -124103,15 +124108,6 @@ var require_path = __commonJS({
124103
124108
  getTemplatePath: function() {
124104
124109
  return getTemplatePath;
124105
124110
  },
124106
- compilePathMatcherRegExp: function() {
124107
- return compilePathMatcherRegExp;
124108
- },
124109
- _joinPathParts: function() {
124110
- return _joinPathParts;
124111
- },
124112
- upwardPaths: function() {
124113
- return upwardPaths;
124114
- },
124115
124111
  getRealTemporaryDirectory: function() {
124116
124112
  return getRealTemporaryDirectory;
124117
124113
  },
@@ -124149,20 +124145,6 @@ var require_path = __commonJS({
124149
124145
  parts.push((0, _compiled.nanoid)());
124150
124146
  return _path.default.resolve(...parts);
124151
124147
  };
124152
- function compilePathMatcherRegExp(match) {
124153
- if (typeof match !== "string") {
124154
- return match;
124155
- }
124156
- const escaped = _compiled.lodash.escapeRegExp(match);
124157
- return new RegExp(`(?<=\\W|^)${escaped}(?=\\W|$)`);
124158
- }
124159
- var _joinPathParts = (_part, i, parts) => (0, _compiled.lodash)(parts).filter((part) => ![
124160
- "/",
124161
- "\\"
124162
- ].includes(part)).tap((parts2) => parts2.unshift("")).slice(0, i + 2).join("/");
124163
- function upwardPaths(start) {
124164
- return (0, _compiled.lodash)(start).split(/[/\\]/).filter(Boolean).map(_joinPathParts).reverse().push("/").value();
124165
- }
124166
124148
  function getRealTemporaryDirectory() {
124167
124149
  let ret = null;
124168
124150
  try {
@@ -124414,84 +124396,6 @@ var require_monorepo = __commonJS({
124414
124396
  }
124415
124397
  });
124416
124398
 
124417
- // ../../../toolkit/utils/dist/cjs/cli/pathSerializer.js
124418
- var require_pathSerializer = __commonJS({
124419
- "../../../toolkit/utils/dist/cjs/cli/pathSerializer.js"(exports) {
124420
- "use strict";
124421
- Object.defineProperty(exports, "__esModule", {
124422
- value: true
124423
- });
124424
- function _export(target, all) {
124425
- for (var name in all)
124426
- Object.defineProperty(target, name, {
124427
- enumerable: true,
124428
- get: all[name]
124429
- });
124430
- }
124431
- _export(exports, {
124432
- matchUpwardPathsAsUnknown: function() {
124433
- return matchUpwardPathsAsUnknown;
124434
- },
124435
- applyPathMatcher: function() {
124436
- return applyPathMatcher;
124437
- },
124438
- applyMatcherReplacement: function() {
124439
- return applyMatcherReplacement;
124440
- },
124441
- createDefaultPathMatchers: function() {
124442
- return createDefaultPathMatchers;
124443
- }
124444
- });
124445
- var _interop_require_default = require_interop_require_default();
124446
- var _os = /* @__PURE__ */ _interop_require_default._(require("os"));
124447
- var _lodash = /* @__PURE__ */ _interop_require_default._(require_lodash4());
124448
- var _path = require_path();
124449
- var matchUpwardPathsAsUnknown = (p) => (0, _lodash.default)((0, _path.upwardPaths)((0, _path.normalizeToPosixPath)(p))).map((match) => ({
124450
- match,
124451
- mark: "unknown"
124452
- })).slice(1, -1).value();
124453
- function applyPathMatcher(matcher, str, options = {}) {
124454
- const regex2 = (0, _path.compilePathMatcherRegExp)(matcher.match);
124455
- const replacer = (substring, ...args) => {
124456
- if (options.minPartials && (0, _path.splitPathString)(substring).length < options.minPartials) {
124457
- return substring;
124458
- }
124459
- const ret = typeof matcher.mark === "string" ? matcher.mark : matcher.mark(substring, ...args);
124460
- return `<${_lodash.default.snakeCase(ret).toUpperCase()}>`;
124461
- };
124462
- return str.replace(regex2, replacer);
124463
- }
124464
- function applyMatcherReplacement(matchers, str, options = {}) {
124465
- return matchers.reduce((ret, matcher) => {
124466
- return applyPathMatcher(matcher, ret, options);
124467
- }, str);
124468
- }
124469
- var createDefaultPathMatchers = (root) => {
124470
- const ret = [
124471
- {
124472
- match: RegExp("(?<=\\/)(\\.pnpm\\/.+?\\/node_modules)(?=\\/)"),
124473
- mark: "pnpmInner"
124474
- }
124475
- ];
124476
- const tmpdir = (0, _path.getRealTemporaryDirectory)();
124477
- tmpdir && ret.push({
124478
- match: tmpdir,
124479
- mark: "temp"
124480
- });
124481
- ret.push({
124482
- match: _os.default.tmpdir(),
124483
- mark: "temp"
124484
- });
124485
- ret.push({
124486
- match: _os.default.homedir(),
124487
- mark: "home"
124488
- });
124489
- ret.push(...matchUpwardPathsAsUnknown(root));
124490
- return ret;
124491
- };
124492
- }
124493
- });
124494
-
124495
124399
  // ../../../toolkit/utils/dist/cjs/cli/port.js
124496
124400
  var require_port = __commonJS({
124497
124401
  "../../../toolkit/utils/dist/cjs/cli/port.js"(exports) {
@@ -124626,19 +124530,19 @@ var require_prettyInstructions = __commonJS({
124626
124530
  }, []);
124627
124531
  };
124628
124532
  var prettyInstructions = (appContext, config) => {
124629
- var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
124533
+ var _appContext_builder_context_devServer, _appContext_builder, _config_dev, _config_source;
124630
124534
  const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
124631
124535
  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);
124632
124536
  const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
124633
124537
  const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
124634
124538
  let message = "App running at:\n\n";
124635
- if ((0, _is.isSingleEntry)(entrypoints) || apiOnly) {
124539
+ if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
124636
124540
  message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
124637
124541
  `).join("");
124638
124542
  } else {
124639
124543
  const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
124640
124544
  urls.forEach(({ label, url }) => {
124641
- message += ` ${_compiled.chalk.bold(`> ${label}`)}
124545
+ message += ` ${_compiled.chalk.bold(`> ${label}`)}${routes.length === 0 ? _compiled.chalk.cyanBright(url) : ""}
124642
124546
  `;
124643
124547
  routes.forEach(({ entryName, urlPath, isSSR }) => {
124644
124548
  if (!checkedEntries.includes(entryName)) {
@@ -124887,7 +124791,6 @@ var require_cli = __commonJS({
124887
124791
  _export_star._(require_monorepo(), exports);
124888
124792
  _export_star._(require_package5(), exports);
124889
124793
  _export_star._(require_path(), exports);
124890
- _export_star._(require_pathSerializer(), exports);
124891
124794
  _export_star._(require_port(), exports);
124892
124795
  _export_star._(require_prettyInstructions(), exports);
124893
124796
  _export_star._(require_require(), exports);
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1690784628608",
18
+ "version": "0.0.0-next-1690813010932",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -29,17 +29,17 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/generator-plugin": "0.0.0-next-1690784628608",
33
- "@modern-js/module-generator": "0.0.0-next-1690784628608",
34
- "@modern-js/monorepo-generator": "0.0.0-next-1690784628608",
35
- "@modern-js/mwa-generator": "0.0.0-next-1690784628608",
36
- "@modern-js/doc-generator": "0.0.0-next-1690784628608",
37
- "@modern-js/utils": "0.0.0-next-1690784628608",
38
- "@modern-js/base-generator": "0.0.0-next-1690784628608",
39
- "@modern-js/generator-common": "0.0.0-next-1690784628608",
40
- "@modern-js/generator-utils": "0.0.0-next-1690784628608",
41
- "@scripts/jest-config": "0.0.0-next-1690784628608",
42
- "@scripts/build": "0.0.0-next-1690784628608"
32
+ "@modern-js/base-generator": "0.0.0-next-1690813010932",
33
+ "@modern-js/generator-common": "0.0.0-next-1690813010932",
34
+ "@modern-js/generator-plugin": "0.0.0-next-1690813010932",
35
+ "@modern-js/generator-utils": "0.0.0-next-1690813010932",
36
+ "@modern-js/module-generator": "0.0.0-next-1690813010932",
37
+ "@modern-js/monorepo-generator": "0.0.0-next-1690813010932",
38
+ "@modern-js/mwa-generator": "0.0.0-next-1690813010932",
39
+ "@modern-js/doc-generator": "0.0.0-next-1690813010932",
40
+ "@modern-js/utils": "0.0.0-next-1690813010932",
41
+ "@scripts/build": "0.0.0-next-1690813010932",
42
+ "@scripts/jest-config": "0.0.0-next-1690813010932"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "publishConfig": {