@modern-js/monorepo-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 +9 -9
package/dist/index.js
CHANGED
@@ -115428,6 +115428,8 @@ var require_chainId = __commonJS({
|
|
115428
115428
|
CSS_MODULES_TS: "css-modules-typescript",
|
115429
115429
|
/** mini-css-extract-plugin.loader */
|
115430
115430
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
115431
|
+
/** resolve-url-loader */
|
115432
|
+
RESOLVE_URL_LOADER_FOR_SASS: "resolve-url-loader",
|
115431
115433
|
/** builder-plugin-image-compress.loader */
|
115432
115434
|
IMAGE_COMPRESS: "image-compress",
|
115433
115435
|
/** builder-plugin-image-compress svgo-loader */
|
@@ -115475,6 +115477,10 @@ var require_chainId = __commonJS({
|
|
115475
115477
|
HTML_NONCE: "html-nonce",
|
115476
115478
|
/** HtmlCrossOriginPlugin */
|
115477
115479
|
HTML_CROSS_ORIGIN: "html-cross-origin",
|
115480
|
+
/** htmlPreconnectPlugin */
|
115481
|
+
HTML_PRECONNECT: "html-preconnect-plugin",
|
115482
|
+
/** htmlDnsPrefetchPlugin */
|
115483
|
+
HTML_DNS_PREFETCH: "html-dns-prefetch-plugin",
|
115478
115484
|
/** MiniCssExtractPlugin */
|
115479
115485
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
115480
115486
|
/** VueLoaderPlugin */
|
@@ -115638,7 +115644,7 @@ var require_constants = __commonJS({
|
|
115638
115644
|
var API_DIR = "api";
|
115639
115645
|
var SERVER_DIR = "server";
|
115640
115646
|
var SHARED_DIR = "shared";
|
115641
|
-
var CONFIG_CACHE_DIR = "./node_modules/.cache/
|
115647
|
+
var CONFIG_CACHE_DIR = "./node_modules/.cache/bundle-require";
|
115642
115648
|
var CONFIG_FILE_EXTENSIONS = [
|
115643
115649
|
".js",
|
115644
115650
|
".ts",
|
@@ -115945,6 +115951,7 @@ var require_config2 = __commonJS({
|
|
115945
115951
|
return isSingleEntry;
|
115946
115952
|
}
|
115947
115953
|
});
|
115954
|
+
var _constants = require_constants();
|
115948
115955
|
var _type = require_type();
|
115949
115956
|
var isSSR = (config) => {
|
115950
115957
|
var _server, _server1;
|
@@ -115982,12 +115989,12 @@ var require_config2 = __commonJS({
|
|
115982
115989
|
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";
|
115983
115990
|
};
|
115984
115991
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
115985
|
-
var _ssgConfig, _ssgConfig1;
|
115992
|
+
var _config_source, _ssgConfig, _ssgConfig1;
|
115986
115993
|
const ssgConfig = config.output.ssg;
|
115987
|
-
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]);
|
115994
|
+
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]);
|
115988
115995
|
return useSSG;
|
115989
115996
|
};
|
115990
|
-
var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName ===
|
115997
|
+
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
115991
115998
|
}
|
115992
115999
|
});
|
115993
116000
|
|
@@ -116534,6 +116541,9 @@ var require_logger2 = __commonJS({
|
|
116534
116541
|
});
|
116535
116542
|
}
|
116536
116543
|
_export(exports, {
|
116544
|
+
isErrorStackMessage: function() {
|
116545
|
+
return isErrorStackMessage;
|
116546
|
+
},
|
116537
116547
|
Logger: function() {
|
116538
116548
|
return Logger;
|
116539
116549
|
},
|
@@ -116584,6 +116594,9 @@ var require_logger2 = __commonJS({
|
|
116584
116594
|
displayLabel: true,
|
116585
116595
|
uppercaseLabel: false
|
116586
116596
|
};
|
116597
|
+
var errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
116598
|
+
var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
116599
|
+
var isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
116587
116600
|
var Logger = class {
|
116588
116601
|
_log(type, message, ...args) {
|
116589
116602
|
if (message === void 0 || message === null) {
|
@@ -116609,6 +116622,9 @@ ${_chalk.default.grey(rest.join("\n"))}`;
|
|
116609
116622
|
} else {
|
116610
116623
|
text = message.message;
|
116611
116624
|
}
|
116625
|
+
} else if (logType.level === "error" && typeof message === "string") {
|
116626
|
+
const lines = message.split("\n");
|
116627
|
+
text = lines.map((line) => isErrorStackMessage(line) ? _chalk.default.gray(line) : line).join("\n");
|
116612
116628
|
} else {
|
116613
116629
|
text = `${message}`;
|
116614
116630
|
}
|
@@ -116790,15 +116806,6 @@ var require_path = __commonJS({
|
|
116790
116806
|
getTemplatePath: function() {
|
116791
116807
|
return getTemplatePath;
|
116792
116808
|
},
|
116793
|
-
compilePathMatcherRegExp: function() {
|
116794
|
-
return compilePathMatcherRegExp;
|
116795
|
-
},
|
116796
|
-
_joinPathParts: function() {
|
116797
|
-
return _joinPathParts;
|
116798
|
-
},
|
116799
|
-
upwardPaths: function() {
|
116800
|
-
return upwardPaths;
|
116801
|
-
},
|
116802
116809
|
getRealTemporaryDirectory: function() {
|
116803
116810
|
return getRealTemporaryDirectory;
|
116804
116811
|
},
|
@@ -116836,20 +116843,6 @@ var require_path = __commonJS({
|
|
116836
116843
|
parts.push((0, _compiled.nanoid)());
|
116837
116844
|
return _path.default.resolve(...parts);
|
116838
116845
|
};
|
116839
|
-
function compilePathMatcherRegExp(match) {
|
116840
|
-
if (typeof match !== "string") {
|
116841
|
-
return match;
|
116842
|
-
}
|
116843
|
-
const escaped = _compiled.lodash.escapeRegExp(match);
|
116844
|
-
return new RegExp(`(?<=\\W|^)${escaped}(?=\\W|$)`);
|
116845
|
-
}
|
116846
|
-
var _joinPathParts = (_part, i, parts) => (0, _compiled.lodash)(parts).filter((part) => ![
|
116847
|
-
"/",
|
116848
|
-
"\\"
|
116849
|
-
].includes(part)).tap((parts2) => parts2.unshift("")).slice(0, i + 2).join("/");
|
116850
|
-
function upwardPaths(start) {
|
116851
|
-
return (0, _compiled.lodash)(start).split(/[/\\]/).filter(Boolean).map(_joinPathParts).reverse().push("/").value();
|
116852
|
-
}
|
116853
116846
|
function getRealTemporaryDirectory() {
|
116854
116847
|
let ret = null;
|
116855
116848
|
try {
|
@@ -117101,84 +117094,6 @@ var require_monorepo = __commonJS({
|
|
117101
117094
|
}
|
117102
117095
|
});
|
117103
117096
|
|
117104
|
-
// ../../../toolkit/utils/dist/cjs/cli/pathSerializer.js
|
117105
|
-
var require_pathSerializer = __commonJS({
|
117106
|
-
"../../../toolkit/utils/dist/cjs/cli/pathSerializer.js"(exports) {
|
117107
|
-
"use strict";
|
117108
|
-
Object.defineProperty(exports, "__esModule", {
|
117109
|
-
value: true
|
117110
|
-
});
|
117111
|
-
function _export(target, all) {
|
117112
|
-
for (var name in all)
|
117113
|
-
Object.defineProperty(target, name, {
|
117114
|
-
enumerable: true,
|
117115
|
-
get: all[name]
|
117116
|
-
});
|
117117
|
-
}
|
117118
|
-
_export(exports, {
|
117119
|
-
matchUpwardPathsAsUnknown: function() {
|
117120
|
-
return matchUpwardPathsAsUnknown;
|
117121
|
-
},
|
117122
|
-
applyPathMatcher: function() {
|
117123
|
-
return applyPathMatcher;
|
117124
|
-
},
|
117125
|
-
applyMatcherReplacement: function() {
|
117126
|
-
return applyMatcherReplacement;
|
117127
|
-
},
|
117128
|
-
createDefaultPathMatchers: function() {
|
117129
|
-
return createDefaultPathMatchers;
|
117130
|
-
}
|
117131
|
-
});
|
117132
|
-
var _interop_require_default = require_interop_require_default();
|
117133
|
-
var _os = /* @__PURE__ */ _interop_require_default._(require("os"));
|
117134
|
-
var _lodash = /* @__PURE__ */ _interop_require_default._(require_lodash4());
|
117135
|
-
var _path = require_path();
|
117136
|
-
var matchUpwardPathsAsUnknown = (p) => (0, _lodash.default)((0, _path.upwardPaths)((0, _path.normalizeToPosixPath)(p))).map((match) => ({
|
117137
|
-
match,
|
117138
|
-
mark: "unknown"
|
117139
|
-
})).slice(1, -1).value();
|
117140
|
-
function applyPathMatcher(matcher, str, options = {}) {
|
117141
|
-
const regex2 = (0, _path.compilePathMatcherRegExp)(matcher.match);
|
117142
|
-
const replacer = (substring, ...args) => {
|
117143
|
-
if (options.minPartials && (0, _path.splitPathString)(substring).length < options.minPartials) {
|
117144
|
-
return substring;
|
117145
|
-
}
|
117146
|
-
const ret = typeof matcher.mark === "string" ? matcher.mark : matcher.mark(substring, ...args);
|
117147
|
-
return `<${_lodash.default.snakeCase(ret).toUpperCase()}>`;
|
117148
|
-
};
|
117149
|
-
return str.replace(regex2, replacer);
|
117150
|
-
}
|
117151
|
-
function applyMatcherReplacement(matchers, str, options = {}) {
|
117152
|
-
return matchers.reduce((ret, matcher) => {
|
117153
|
-
return applyPathMatcher(matcher, ret, options);
|
117154
|
-
}, str);
|
117155
|
-
}
|
117156
|
-
var createDefaultPathMatchers = (root) => {
|
117157
|
-
const ret = [
|
117158
|
-
{
|
117159
|
-
match: RegExp("(?<=\\/)(\\.pnpm\\/.+?\\/node_modules)(?=\\/)"),
|
117160
|
-
mark: "pnpmInner"
|
117161
|
-
}
|
117162
|
-
];
|
117163
|
-
const tmpdir = (0, _path.getRealTemporaryDirectory)();
|
117164
|
-
tmpdir && ret.push({
|
117165
|
-
match: tmpdir,
|
117166
|
-
mark: "temp"
|
117167
|
-
});
|
117168
|
-
ret.push({
|
117169
|
-
match: _os.default.tmpdir(),
|
117170
|
-
mark: "temp"
|
117171
|
-
});
|
117172
|
-
ret.push({
|
117173
|
-
match: _os.default.homedir(),
|
117174
|
-
mark: "home"
|
117175
|
-
});
|
117176
|
-
ret.push(...matchUpwardPathsAsUnknown(root));
|
117177
|
-
return ret;
|
117178
|
-
};
|
117179
|
-
}
|
117180
|
-
});
|
117181
|
-
|
117182
117097
|
// ../../../toolkit/utils/dist/cjs/cli/port.js
|
117183
117098
|
var require_port = __commonJS({
|
117184
117099
|
"../../../toolkit/utils/dist/cjs/cli/port.js"(exports) {
|
@@ -117313,19 +117228,19 @@ var require_prettyInstructions = __commonJS({
|
|
117313
117228
|
}, []);
|
117314
117229
|
};
|
117315
117230
|
var prettyInstructions = (appContext, config) => {
|
117316
|
-
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
117231
|
+
var _appContext_builder_context_devServer, _appContext_builder, _config_dev, _config_source;
|
117317
117232
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
117318
117233
|
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);
|
117319
117234
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
117320
117235
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
117321
117236
|
let message = "App running at:\n\n";
|
117322
|
-
if ((0, _is.isSingleEntry)(entrypoints) || apiOnly) {
|
117237
|
+
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
117323
117238
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
117324
117239
|
`).join("");
|
117325
117240
|
} else {
|
117326
117241
|
const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
|
117327
117242
|
urls.forEach(({ label, url }) => {
|
117328
|
-
message += ` ${_compiled.chalk.bold(`> ${label}`)}
|
117243
|
+
message += ` ${_compiled.chalk.bold(`> ${label}`)}${routes.length === 0 ? _compiled.chalk.cyanBright(url) : ""}
|
117329
117244
|
`;
|
117330
117245
|
routes.forEach(({ entryName, urlPath, isSSR }) => {
|
117331
117246
|
if (!checkedEntries.includes(entryName)) {
|
@@ -117574,7 +117489,6 @@ var require_cli = __commonJS({
|
|
117574
117489
|
_export_star._(require_monorepo(), exports);
|
117575
117490
|
_export_star._(require_package4(), exports);
|
117576
117491
|
_export_star._(require_path(), exports);
|
117577
|
-
_export_star._(require_pathSerializer(), exports);
|
117578
117492
|
_export_star._(require_port(), exports);
|
117579
117493
|
_export_star._(require_prettyInstructions(), exports);
|
117580
117494
|
_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": [
|
@@ -30,14 +30,14 @@
|
|
30
30
|
"@types/node": "^14",
|
31
31
|
"jest": "^29",
|
32
32
|
"typescript": "^5",
|
33
|
-
"@modern-js/
|
34
|
-
"@modern-js/
|
35
|
-
"@modern-js/
|
36
|
-
"@modern-js/
|
37
|
-
"@modern-js/generator
|
38
|
-
"@modern-js/
|
39
|
-
"@scripts/
|
40
|
-
"@scripts/
|
33
|
+
"@modern-js/changeset-generator": "3.1.31",
|
34
|
+
"@modern-js/plugin-i18n": "2.29.0",
|
35
|
+
"@modern-js/packages-generator": "3.1.31",
|
36
|
+
"@modern-js/generator-common": "3.1.31",
|
37
|
+
"@modern-js/base-generator": "3.1.31",
|
38
|
+
"@modern-js/generator-utils": "3.1.31",
|
39
|
+
"@scripts/build": "2.29.0",
|
40
|
+
"@scripts/jest-config": "2.29.0"
|
41
41
|
},
|
42
42
|
"sideEffects": false,
|
43
43
|
"publishConfig": {
|