@modern-js/repo-generator 3.1.30 → 3.1.31
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.
- package/dist/index.js +23 -109
- package/package.json +12 -12
package/dist/index.js
CHANGED
@@ -122731,6 +122731,8 @@ var require_chainId = __commonJS({
|
|
122731
122731
|
CSS_MODULES_TS: "css-modules-typescript",
|
122732
122732
|
/** mini-css-extract-plugin.loader */
|
122733
122733
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
122734
|
+
/** resolve-url-loader */
|
122735
|
+
RESOLVE_URL_LOADER_FOR_SASS: "resolve-url-loader",
|
122734
122736
|
/** builder-plugin-image-compress.loader */
|
122735
122737
|
IMAGE_COMPRESS: "image-compress",
|
122736
122738
|
/** builder-plugin-image-compress svgo-loader */
|
@@ -122778,6 +122780,10 @@ var require_chainId = __commonJS({
|
|
122778
122780
|
HTML_NONCE: "html-nonce",
|
122779
122781
|
/** HtmlCrossOriginPlugin */
|
122780
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",
|
122781
122787
|
/** MiniCssExtractPlugin */
|
122782
122788
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
122783
122789
|
/** VueLoaderPlugin */
|
@@ -122941,7 +122947,7 @@ var require_constants2 = __commonJS({
|
|
122941
122947
|
var API_DIR = "api";
|
122942
122948
|
var SERVER_DIR = "server";
|
122943
122949
|
var SHARED_DIR = "shared";
|
122944
|
-
var CONFIG_CACHE_DIR = "./node_modules/.cache/
|
122950
|
+
var CONFIG_CACHE_DIR = "./node_modules/.cache/bundle-require";
|
122945
122951
|
var CONFIG_FILE_EXTENSIONS = [
|
122946
122952
|
".js",
|
122947
122953
|
".ts",
|
@@ -123248,6 +123254,7 @@ var require_config2 = __commonJS({
|
|
123248
123254
|
return isSingleEntry;
|
123249
123255
|
}
|
123250
123256
|
});
|
123257
|
+
var _constants = require_constants2();
|
123251
123258
|
var _type = require_type();
|
123252
123259
|
var isSSR = (config) => {
|
123253
123260
|
var _server, _server1;
|
@@ -123285,12 +123292,12 @@ var require_config2 = __commonJS({
|
|
123285
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";
|
123286
123293
|
};
|
123287
123294
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
123288
|
-
var _ssgConfig, _ssgConfig1;
|
123295
|
+
var _config_source, _ssgConfig, _ssgConfig1;
|
123289
123296
|
const ssgConfig = config.output.ssg;
|
123290
|
-
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]);
|
123291
123298
|
return useSSG;
|
123292
123299
|
};
|
123293
|
-
var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName ===
|
123300
|
+
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
123294
123301
|
}
|
123295
123302
|
});
|
123296
123303
|
|
@@ -123837,6 +123844,9 @@ var require_logger2 = __commonJS({
|
|
123837
123844
|
});
|
123838
123845
|
}
|
123839
123846
|
_export(exports, {
|
123847
|
+
isErrorStackMessage: function() {
|
123848
|
+
return isErrorStackMessage;
|
123849
|
+
},
|
123840
123850
|
Logger: function() {
|
123841
123851
|
return Logger2;
|
123842
123852
|
},
|
@@ -123887,6 +123897,9 @@ var require_logger2 = __commonJS({
|
|
123887
123897
|
displayLabel: true,
|
123888
123898
|
uppercaseLabel: false
|
123889
123899
|
};
|
123900
|
+
var errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
123901
|
+
var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
123902
|
+
var isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
123890
123903
|
var Logger2 = class {
|
123891
123904
|
_log(type, message, ...args) {
|
123892
123905
|
if (message === void 0 || message === null) {
|
@@ -123912,6 +123925,9 @@ ${_chalk.default.grey(rest.join("\n"))}`;
|
|
123912
123925
|
} else {
|
123913
123926
|
text = message.message;
|
123914
123927
|
}
|
123928
|
+
} else if (logType.level === "error" && typeof message === "string") {
|
123929
|
+
const lines = message.split("\n");
|
123930
|
+
text = lines.map((line) => isErrorStackMessage(line) ? _chalk.default.gray(line) : line).join("\n");
|
123915
123931
|
} else {
|
123916
123932
|
text = `${message}`;
|
123917
123933
|
}
|
@@ -124093,15 +124109,6 @@ var require_path = __commonJS({
|
|
124093
124109
|
getTemplatePath: function() {
|
124094
124110
|
return getTemplatePath;
|
124095
124111
|
},
|
124096
|
-
compilePathMatcherRegExp: function() {
|
124097
|
-
return compilePathMatcherRegExp;
|
124098
|
-
},
|
124099
|
-
_joinPathParts: function() {
|
124100
|
-
return _joinPathParts;
|
124101
|
-
},
|
124102
|
-
upwardPaths: function() {
|
124103
|
-
return upwardPaths;
|
124104
|
-
},
|
124105
124112
|
getRealTemporaryDirectory: function() {
|
124106
124113
|
return getRealTemporaryDirectory;
|
124107
124114
|
},
|
@@ -124139,20 +124146,6 @@ var require_path = __commonJS({
|
|
124139
124146
|
parts.push((0, _compiled.nanoid)());
|
124140
124147
|
return _path.default.resolve(...parts);
|
124141
124148
|
};
|
124142
|
-
function compilePathMatcherRegExp(match) {
|
124143
|
-
if (typeof match !== "string") {
|
124144
|
-
return match;
|
124145
|
-
}
|
124146
|
-
const escaped = _compiled.lodash.escapeRegExp(match);
|
124147
|
-
return new RegExp(`(?<=\\W|^)${escaped}(?=\\W|$)`);
|
124148
|
-
}
|
124149
|
-
var _joinPathParts = (_part, i, parts) => (0, _compiled.lodash)(parts).filter((part) => ![
|
124150
|
-
"/",
|
124151
|
-
"\\"
|
124152
|
-
].includes(part)).tap((parts2) => parts2.unshift("")).slice(0, i + 2).join("/");
|
124153
|
-
function upwardPaths(start) {
|
124154
|
-
return (0, _compiled.lodash)(start).split(/[/\\]/).filter(Boolean).map(_joinPathParts).reverse().push("/").value();
|
124155
|
-
}
|
124156
124149
|
function getRealTemporaryDirectory() {
|
124157
124150
|
let ret = null;
|
124158
124151
|
try {
|
@@ -124404,84 +124397,6 @@ var require_monorepo = __commonJS({
|
|
124404
124397
|
}
|
124405
124398
|
});
|
124406
124399
|
|
124407
|
-
// ../../../toolkit/utils/dist/cjs/cli/pathSerializer.js
|
124408
|
-
var require_pathSerializer = __commonJS({
|
124409
|
-
"../../../toolkit/utils/dist/cjs/cli/pathSerializer.js"(exports) {
|
124410
|
-
"use strict";
|
124411
|
-
Object.defineProperty(exports, "__esModule", {
|
124412
|
-
value: true
|
124413
|
-
});
|
124414
|
-
function _export(target, all) {
|
124415
|
-
for (var name in all)
|
124416
|
-
Object.defineProperty(target, name, {
|
124417
|
-
enumerable: true,
|
124418
|
-
get: all[name]
|
124419
|
-
});
|
124420
|
-
}
|
124421
|
-
_export(exports, {
|
124422
|
-
matchUpwardPathsAsUnknown: function() {
|
124423
|
-
return matchUpwardPathsAsUnknown;
|
124424
|
-
},
|
124425
|
-
applyPathMatcher: function() {
|
124426
|
-
return applyPathMatcher;
|
124427
|
-
},
|
124428
|
-
applyMatcherReplacement: function() {
|
124429
|
-
return applyMatcherReplacement;
|
124430
|
-
},
|
124431
|
-
createDefaultPathMatchers: function() {
|
124432
|
-
return createDefaultPathMatchers;
|
124433
|
-
}
|
124434
|
-
});
|
124435
|
-
var _interop_require_default = require_interop_require_default();
|
124436
|
-
var _os = /* @__PURE__ */ _interop_require_default._(require("os"));
|
124437
|
-
var _lodash = /* @__PURE__ */ _interop_require_default._(require_lodash4());
|
124438
|
-
var _path = require_path();
|
124439
|
-
var matchUpwardPathsAsUnknown = (p) => (0, _lodash.default)((0, _path.upwardPaths)((0, _path.normalizeToPosixPath)(p))).map((match) => ({
|
124440
|
-
match,
|
124441
|
-
mark: "unknown"
|
124442
|
-
})).slice(1, -1).value();
|
124443
|
-
function applyPathMatcher(matcher, str, options = {}) {
|
124444
|
-
const regex2 = (0, _path.compilePathMatcherRegExp)(matcher.match);
|
124445
|
-
const replacer = (substring, ...args) => {
|
124446
|
-
if (options.minPartials && (0, _path.splitPathString)(substring).length < options.minPartials) {
|
124447
|
-
return substring;
|
124448
|
-
}
|
124449
|
-
const ret = typeof matcher.mark === "string" ? matcher.mark : matcher.mark(substring, ...args);
|
124450
|
-
return `<${_lodash.default.snakeCase(ret).toUpperCase()}>`;
|
124451
|
-
};
|
124452
|
-
return str.replace(regex2, replacer);
|
124453
|
-
}
|
124454
|
-
function applyMatcherReplacement(matchers, str, options = {}) {
|
124455
|
-
return matchers.reduce((ret, matcher) => {
|
124456
|
-
return applyPathMatcher(matcher, ret, options);
|
124457
|
-
}, str);
|
124458
|
-
}
|
124459
|
-
var createDefaultPathMatchers = (root) => {
|
124460
|
-
const ret = [
|
124461
|
-
{
|
124462
|
-
match: RegExp("(?<=\\/)(\\.pnpm\\/.+?\\/node_modules)(?=\\/)"),
|
124463
|
-
mark: "pnpmInner"
|
124464
|
-
}
|
124465
|
-
];
|
124466
|
-
const tmpdir = (0, _path.getRealTemporaryDirectory)();
|
124467
|
-
tmpdir && ret.push({
|
124468
|
-
match: tmpdir,
|
124469
|
-
mark: "temp"
|
124470
|
-
});
|
124471
|
-
ret.push({
|
124472
|
-
match: _os.default.tmpdir(),
|
124473
|
-
mark: "temp"
|
124474
|
-
});
|
124475
|
-
ret.push({
|
124476
|
-
match: _os.default.homedir(),
|
124477
|
-
mark: "home"
|
124478
|
-
});
|
124479
|
-
ret.push(...matchUpwardPathsAsUnknown(root));
|
124480
|
-
return ret;
|
124481
|
-
};
|
124482
|
-
}
|
124483
|
-
});
|
124484
|
-
|
124485
124400
|
// ../../../toolkit/utils/dist/cjs/cli/port.js
|
124486
124401
|
var require_port = __commonJS({
|
124487
124402
|
"../../../toolkit/utils/dist/cjs/cli/port.js"(exports) {
|
@@ -124616,19 +124531,19 @@ var require_prettyInstructions = __commonJS({
|
|
124616
124531
|
}, []);
|
124617
124532
|
};
|
124618
124533
|
var prettyInstructions = (appContext, config) => {
|
124619
|
-
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
124534
|
+
var _appContext_builder_context_devServer, _appContext_builder, _config_dev, _config_source;
|
124620
124535
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
124621
124536
|
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);
|
124622
124537
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
124623
124538
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
124624
124539
|
let message = "App running at:\n\n";
|
124625
|
-
if ((0, _is.isSingleEntry)(entrypoints) || apiOnly) {
|
124540
|
+
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
124626
124541
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
124627
124542
|
`).join("");
|
124628
124543
|
} else {
|
124629
124544
|
const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
|
124630
124545
|
urls.forEach(({ label, url }) => {
|
124631
|
-
message += ` ${_compiled.chalk.bold(`> ${label}`)}
|
124546
|
+
message += ` ${_compiled.chalk.bold(`> ${label}`)}${routes.length === 0 ? _compiled.chalk.cyanBright(url) : ""}
|
124632
124547
|
`;
|
124633
124548
|
routes.forEach(({ entryName, urlPath, isSSR }) => {
|
124634
124549
|
if (!checkedEntries.includes(entryName)) {
|
@@ -124877,7 +124792,6 @@ var require_cli = __commonJS({
|
|
124877
124792
|
_export_star._(require_monorepo(), exports);
|
124878
124793
|
_export_star._(require_package5(), exports);
|
124879
124794
|
_export_star._(require_path(), exports);
|
124880
|
-
_export_star._(require_pathSerializer(), exports);
|
124881
124795
|
_export_star._(require_port(), exports);
|
124882
124796
|
_export_star._(require_prettyInstructions(), exports);
|
124883
124797
|
_export_star._(require_require(), exports);
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.1.
|
18
|
+
"version": "3.1.31",
|
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-
|
33
|
-
"@modern-js/module-generator": "3.1.
|
34
|
-
"@modern-js/monorepo-generator": "3.1.
|
35
|
-
"@modern-js/mwa-generator": "3.1.
|
36
|
-
"@modern-js/doc-generator": "3.1.
|
37
|
-
"@modern-js/utils": "2.
|
38
|
-
"@modern-js/generator-
|
39
|
-
"@modern-js/generator
|
40
|
-
"@
|
41
|
-
"@
|
42
|
-
"@scripts/build": "2.
|
32
|
+
"@modern-js/generator-common": "3.1.31",
|
33
|
+
"@modern-js/module-generator": "3.1.31",
|
34
|
+
"@modern-js/monorepo-generator": "3.1.31",
|
35
|
+
"@modern-js/mwa-generator": "3.1.31",
|
36
|
+
"@modern-js/doc-generator": "3.1.31",
|
37
|
+
"@modern-js/utils": "2.29.0",
|
38
|
+
"@modern-js/generator-plugin": "3.1.31",
|
39
|
+
"@modern-js/base-generator": "3.1.31",
|
40
|
+
"@scripts/jest-config": "2.29.0",
|
41
|
+
"@modern-js/generator-utils": "3.1.31",
|
42
|
+
"@scripts/build": "2.29.0"
|
43
43
|
},
|
44
44
|
"sideEffects": false,
|
45
45
|
"publishConfig": {
|