@modern-js/repo-generator 3.1.29 → 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 +67 -136
- package/package.json +12 -12
package/dist/index.js
CHANGED
@@ -122671,6 +122671,8 @@ var require_chainId = __commonJS({
|
|
122671
122671
|
YAML: "yaml",
|
122672
122672
|
/** Rule for wasm */
|
122673
122673
|
WASM: "wasm",
|
122674
|
+
/** Rule for node */
|
122675
|
+
NODE: "node",
|
122674
122676
|
/** Rule for bff */
|
122675
122677
|
JS_BFF_API: "js-bff-api"
|
122676
122678
|
},
|
@@ -122709,6 +122711,8 @@ var require_chainId = __commonJS({
|
|
122709
122711
|
TOML: "toml",
|
122710
122712
|
/** html-loader */
|
122711
122713
|
HTML: "html",
|
122714
|
+
/** node-loader */
|
122715
|
+
NODE: "html",
|
122712
122716
|
/** babel-loader */
|
122713
122717
|
BABEL: "babel",
|
122714
122718
|
/** esbuild-loader */
|
@@ -122727,6 +122731,8 @@ var require_chainId = __commonJS({
|
|
122727
122731
|
CSS_MODULES_TS: "css-modules-typescript",
|
122728
122732
|
/** mini-css-extract-plugin.loader */
|
122729
122733
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
122734
|
+
/** resolve-url-loader */
|
122735
|
+
RESOLVE_URL_LOADER_FOR_SASS: "resolve-url-loader",
|
122730
122736
|
/** builder-plugin-image-compress.loader */
|
122731
122737
|
IMAGE_COMPRESS: "image-compress",
|
122732
122738
|
/** builder-plugin-image-compress svgo-loader */
|
@@ -122774,6 +122780,10 @@ var require_chainId = __commonJS({
|
|
122774
122780
|
HTML_NONCE: "html-nonce",
|
122775
122781
|
/** HtmlCrossOriginPlugin */
|
122776
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",
|
122777
122787
|
/** MiniCssExtractPlugin */
|
122778
122788
|
MINI_CSS_EXTRACT: "mini-css-extract",
|
122779
122789
|
/** VueLoaderPlugin */
|
@@ -122937,7 +122947,7 @@ var require_constants2 = __commonJS({
|
|
122937
122947
|
var API_DIR = "api";
|
122938
122948
|
var SERVER_DIR = "server";
|
122939
122949
|
var SHARED_DIR = "shared";
|
122940
|
-
var CONFIG_CACHE_DIR = "./node_modules/.cache/
|
122950
|
+
var CONFIG_CACHE_DIR = "./node_modules/.cache/bundle-require";
|
122941
122951
|
var CONFIG_FILE_EXTENSIONS = [
|
122942
122952
|
".js",
|
122943
122953
|
".ts",
|
@@ -122969,7 +122979,6 @@ var require_constants2 = __commonJS({
|
|
122969
122979
|
};
|
122970
122980
|
var INTERNAL_MODULE_TOOLS_PLUGINS = {
|
122971
122981
|
"@modern-js/module-tools": "@modern-js/module-tools",
|
122972
|
-
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
122973
122982
|
"@modern-js/runtime": "@modern-js/runtime/cli",
|
122974
122983
|
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
122975
122984
|
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
@@ -123245,13 +123254,15 @@ var require_config2 = __commonJS({
|
|
123245
123254
|
return isSingleEntry;
|
123246
123255
|
}
|
123247
123256
|
});
|
123257
|
+
var _constants = require_constants2();
|
123248
123258
|
var _type = require_type();
|
123249
123259
|
var isSSR = (config) => {
|
123260
|
+
var _server, _server1;
|
123250
123261
|
const { server } = config;
|
123251
|
-
if (server === null ||
|
123262
|
+
if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
|
123252
123263
|
return true;
|
123253
123264
|
}
|
123254
|
-
if ((server === null ||
|
123265
|
+
if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
123255
123266
|
for (const name of Object.keys(server.ssrByEntries)) {
|
123256
123267
|
if (server.ssrByEntries[name]) {
|
123257
123268
|
return true;
|
@@ -123261,30 +123272,32 @@ var require_config2 = __commonJS({
|
|
123261
123272
|
return false;
|
123262
123273
|
};
|
123263
123274
|
var isUseSSRBundle = (config) => {
|
123275
|
+
var _output;
|
123264
123276
|
const { output: output2 } = config;
|
123265
|
-
if (output2 === null ||
|
123277
|
+
if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
|
123266
123278
|
return true;
|
123267
123279
|
}
|
123268
123280
|
return isSSR(config);
|
123269
123281
|
};
|
123270
123282
|
var isServiceWorker = (config) => {
|
123271
|
-
var _deploy_worker;
|
123283
|
+
var _deploy_worker, _deploy, _output;
|
123272
123284
|
const { output: output2, deploy } = config;
|
123273
|
-
if ((deploy === null ||
|
123285
|
+
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))) {
|
123274
123286
|
return true;
|
123275
123287
|
}
|
123276
123288
|
return false;
|
123277
123289
|
};
|
123278
123290
|
var isRouterV5 = (config) => {
|
123279
|
-
var _config_runtime, _config_runtime1,
|
123280
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (config === null ||
|
123291
|
+
var _config_runtime, _config_runtime_router, _config_runtime1, _config;
|
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";
|
123281
123293
|
};
|
123282
123294
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
123295
|
+
var _config_source, _ssgConfig, _ssgConfig1;
|
123283
123296
|
const ssgConfig = config.output.ssg;
|
123284
|
-
const useSSG = isSingleEntry(entrypoints) ? Boolean(ssgConfig) : ssgConfig === true || typeof (ssgConfig === null ||
|
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]);
|
123285
123298
|
return useSSG;
|
123286
123299
|
};
|
123287
|
-
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;
|
123288
123301
|
}
|
123289
123302
|
});
|
123290
123303
|
|
@@ -123831,6 +123844,9 @@ var require_logger2 = __commonJS({
|
|
123831
123844
|
});
|
123832
123845
|
}
|
123833
123846
|
_export(exports, {
|
123847
|
+
isErrorStackMessage: function() {
|
123848
|
+
return isErrorStackMessage;
|
123849
|
+
},
|
123834
123850
|
Logger: function() {
|
123835
123851
|
return Logger2;
|
123836
123852
|
},
|
@@ -123881,6 +123897,9 @@ var require_logger2 = __commonJS({
|
|
123881
123897
|
displayLabel: true,
|
123882
123898
|
uppercaseLabel: false
|
123883
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);
|
123884
123903
|
var Logger2 = class {
|
123885
123904
|
_log(type, message, ...args) {
|
123886
123905
|
if (message === void 0 || message === null) {
|
@@ -123906,6 +123925,9 @@ ${_chalk.default.grey(rest.join("\n"))}`;
|
|
123906
123925
|
} else {
|
123907
123926
|
text = message.message;
|
123908
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");
|
123909
123931
|
} else {
|
123910
123932
|
text = `${message}`;
|
123911
123933
|
}
|
@@ -124028,7 +124050,7 @@ var require_alias = __commonJS({
|
|
124028
124050
|
};
|
124029
124051
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
124030
124052
|
var getAliasConfig = (aliasOption, option) => {
|
124031
|
-
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
124053
|
+
var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
|
124032
124054
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
124033
124055
|
const alias = mergeAlias(aliasOption);
|
124034
124056
|
if (!isTsProject) {
|
@@ -124040,10 +124062,10 @@ var require_alias = __commonJS({
|
|
124040
124062
|
};
|
124041
124063
|
}
|
124042
124064
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
124043
|
-
const baseUrl = tsconfig === null ||
|
124065
|
+
const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
124044
124066
|
return {
|
124045
124067
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
124046
|
-
paths: __spreadValues(__spreadValues({}, alias), tsconfig === null ||
|
124068
|
+
paths: __spreadValues(__spreadValues({}, alias), (_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths),
|
124047
124069
|
isTsPath: true,
|
124048
124070
|
isTsProject
|
124049
124071
|
};
|
@@ -124087,15 +124109,6 @@ var require_path = __commonJS({
|
|
124087
124109
|
getTemplatePath: function() {
|
124088
124110
|
return getTemplatePath;
|
124089
124111
|
},
|
124090
|
-
compilePathMatcherRegExp: function() {
|
124091
|
-
return compilePathMatcherRegExp;
|
124092
|
-
},
|
124093
|
-
_joinPathParts: function() {
|
124094
|
-
return _joinPathParts;
|
124095
|
-
},
|
124096
|
-
upwardPaths: function() {
|
124097
|
-
return upwardPaths;
|
124098
|
-
},
|
124099
124112
|
getRealTemporaryDirectory: function() {
|
124100
124113
|
return getRealTemporaryDirectory;
|
124101
124114
|
},
|
@@ -124133,20 +124146,6 @@ var require_path = __commonJS({
|
|
124133
124146
|
parts.push((0, _compiled.nanoid)());
|
124134
124147
|
return _path.default.resolve(...parts);
|
124135
124148
|
};
|
124136
|
-
function compilePathMatcherRegExp(match) {
|
124137
|
-
if (typeof match !== "string") {
|
124138
|
-
return match;
|
124139
|
-
}
|
124140
|
-
const escaped = _compiled.lodash.escapeRegExp(match);
|
124141
|
-
return new RegExp(`(?<=\\W|^)${escaped}(?=\\W|$)`);
|
124142
|
-
}
|
124143
|
-
var _joinPathParts = (_part, i, parts) => (0, _compiled.lodash)(parts).filter((part) => ![
|
124144
|
-
"/",
|
124145
|
-
"\\"
|
124146
|
-
].includes(part)).tap((parts2) => parts2.unshift("")).slice(0, i + 2).join("/");
|
124147
|
-
function upwardPaths(start) {
|
124148
|
-
return (0, _compiled.lodash)(start).split(/[/\\]/).filter(Boolean).map(_joinPathParts).reverse().push("/").value();
|
124149
|
-
}
|
124150
124149
|
function getRealTemporaryDirectory() {
|
124151
124150
|
let ret = null;
|
124152
124151
|
try {
|
@@ -124398,84 +124397,6 @@ var require_monorepo = __commonJS({
|
|
124398
124397
|
}
|
124399
124398
|
});
|
124400
124399
|
|
124401
|
-
// ../../../toolkit/utils/dist/cjs/cli/pathSerializer.js
|
124402
|
-
var require_pathSerializer = __commonJS({
|
124403
|
-
"../../../toolkit/utils/dist/cjs/cli/pathSerializer.js"(exports) {
|
124404
|
-
"use strict";
|
124405
|
-
Object.defineProperty(exports, "__esModule", {
|
124406
|
-
value: true
|
124407
|
-
});
|
124408
|
-
function _export(target, all) {
|
124409
|
-
for (var name in all)
|
124410
|
-
Object.defineProperty(target, name, {
|
124411
|
-
enumerable: true,
|
124412
|
-
get: all[name]
|
124413
|
-
});
|
124414
|
-
}
|
124415
|
-
_export(exports, {
|
124416
|
-
matchUpwardPathsAsUnknown: function() {
|
124417
|
-
return matchUpwardPathsAsUnknown;
|
124418
|
-
},
|
124419
|
-
applyPathMatcher: function() {
|
124420
|
-
return applyPathMatcher;
|
124421
|
-
},
|
124422
|
-
applyMatcherReplacement: function() {
|
124423
|
-
return applyMatcherReplacement;
|
124424
|
-
},
|
124425
|
-
createDefaultPathMatchers: function() {
|
124426
|
-
return createDefaultPathMatchers;
|
124427
|
-
}
|
124428
|
-
});
|
124429
|
-
var _interop_require_default = require_interop_require_default();
|
124430
|
-
var _os = /* @__PURE__ */ _interop_require_default._(require("os"));
|
124431
|
-
var _lodash = /* @__PURE__ */ _interop_require_default._(require_lodash4());
|
124432
|
-
var _path = require_path();
|
124433
|
-
var matchUpwardPathsAsUnknown = (p) => (0, _lodash.default)((0, _path.upwardPaths)((0, _path.normalizeToPosixPath)(p))).map((match) => ({
|
124434
|
-
match,
|
124435
|
-
mark: "unknown"
|
124436
|
-
})).slice(1, -1).value();
|
124437
|
-
function applyPathMatcher(matcher, str, options = {}) {
|
124438
|
-
const regex2 = (0, _path.compilePathMatcherRegExp)(matcher.match);
|
124439
|
-
const replacer = (substring, ...args) => {
|
124440
|
-
if (options.minPartials && (0, _path.splitPathString)(substring).length < options.minPartials) {
|
124441
|
-
return substring;
|
124442
|
-
}
|
124443
|
-
const ret = typeof matcher.mark === "string" ? matcher.mark : matcher.mark(substring, ...args);
|
124444
|
-
return `<${_lodash.default.snakeCase(ret).toUpperCase()}>`;
|
124445
|
-
};
|
124446
|
-
return str.replace(regex2, replacer);
|
124447
|
-
}
|
124448
|
-
function applyMatcherReplacement(matchers, str, options = {}) {
|
124449
|
-
return matchers.reduce((ret, matcher) => {
|
124450
|
-
return applyPathMatcher(matcher, ret, options);
|
124451
|
-
}, str);
|
124452
|
-
}
|
124453
|
-
var createDefaultPathMatchers = (root) => {
|
124454
|
-
const ret = [
|
124455
|
-
{
|
124456
|
-
match: RegExp("(?<=\\/)(\\.pnpm\\/.+?\\/node_modules)(?=\\/)"),
|
124457
|
-
mark: "pnpmInner"
|
124458
|
-
}
|
124459
|
-
];
|
124460
|
-
const tmpdir = (0, _path.getRealTemporaryDirectory)();
|
124461
|
-
tmpdir && ret.push({
|
124462
|
-
match: tmpdir,
|
124463
|
-
mark: "temp"
|
124464
|
-
});
|
124465
|
-
ret.push({
|
124466
|
-
match: _os.default.tmpdir(),
|
124467
|
-
mark: "temp"
|
124468
|
-
});
|
124469
|
-
ret.push({
|
124470
|
-
match: _os.default.homedir(),
|
124471
|
-
mark: "home"
|
124472
|
-
});
|
124473
|
-
ret.push(...matchUpwardPathsAsUnknown(root));
|
124474
|
-
return ret;
|
124475
|
-
};
|
124476
|
-
}
|
124477
|
-
});
|
124478
|
-
|
124479
124400
|
// ../../../toolkit/utils/dist/cjs/cli/port.js
|
124480
124401
|
var require_port = __commonJS({
|
124481
124402
|
"../../../toolkit/utils/dist/cjs/cli/port.js"(exports) {
|
@@ -124582,7 +124503,8 @@ var require_prettyInstructions = __commonJS({
|
|
124582
124503
|
const LOCAL_LABEL = "Local: ";
|
124583
124504
|
const NETWORK_LABEL = "Network: ";
|
124584
124505
|
const isLocalhost = (url) => {
|
124585
|
-
|
124506
|
+
var _url;
|
124507
|
+
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
124586
124508
|
};
|
124587
124509
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
124588
124510
|
return [
|
@@ -124609,19 +124531,19 @@ var require_prettyInstructions = __commonJS({
|
|
124609
124531
|
}, []);
|
124610
124532
|
};
|
124611
124533
|
var prettyInstructions = (appContext, config) => {
|
124612
|
-
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
124534
|
+
var _appContext_builder_context_devServer, _appContext_builder, _config_dev, _config_source;
|
124613
124535
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
124614
|
-
const isHttps = (0, _is.isDev)() && ((
|
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);
|
124615
124537
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
124616
124538
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
124617
124539
|
let message = "App running at:\n\n";
|
124618
|
-
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) {
|
124619
124541
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
124620
124542
|
`).join("");
|
124621
124543
|
} else {
|
124622
124544
|
const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
|
124623
124545
|
urls.forEach(({ label, url }) => {
|
124624
|
-
message += ` ${_compiled.chalk.bold(`> ${label}`)}
|
124546
|
+
message += ` ${_compiled.chalk.bold(`> ${label}`)}${routes.length === 0 ? _compiled.chalk.cyanBright(url) : ""}
|
124625
124547
|
`;
|
124626
124548
|
routes.forEach(({ entryName, urlPath, isSSR }) => {
|
124627
124549
|
if (!checkedEntries.includes(entryName)) {
|
@@ -124676,8 +124598,9 @@ var require_require = __commonJS({
|
|
124676
124598
|
});
|
124677
124599
|
var _fs = require_fs();
|
124678
124600
|
var compatRequire = (filePath, interop = true) => {
|
124601
|
+
var _mod;
|
124679
124602
|
const mod = require(filePath);
|
124680
|
-
const rtnESMDefault = interop && (mod === null ||
|
124603
|
+
const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
|
124681
124604
|
return rtnESMDefault ? mod.default : mod;
|
124682
124605
|
};
|
124683
124606
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
@@ -124869,7 +124792,6 @@ var require_cli = __commonJS({
|
|
124869
124792
|
_export_star._(require_monorepo(), exports);
|
124870
124793
|
_export_star._(require_package5(), exports);
|
124871
124794
|
_export_star._(require_path(), exports);
|
124872
|
-
_export_star._(require_pathSerializer(), exports);
|
124873
124795
|
_export_star._(require_port(), exports);
|
124874
124796
|
_export_star._(require_prettyInstructions(), exports);
|
124875
124797
|
_export_star._(require_require(), exports);
|
@@ -144493,16 +144415,18 @@ var getSolutionSchema = (extra = {}) => {
|
|
144493
144415
|
type: "string",
|
144494
144416
|
title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
|
144495
144417
|
enum: (() => {
|
144496
|
-
var _extra_customPlugin,
|
144497
|
-
const items = ((extra === null ||
|
144498
|
-
|
144418
|
+
var _extra, _extra1, _extra_customPlugin_custom, _extra_customPlugin, _extra2;
|
144419
|
+
const items = (((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.solutions) || Object.values(((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepo) ? SubSolution : Solution)).filter((solution) => {
|
144420
|
+
var _extra3;
|
144421
|
+
return !(((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isSubProject) && solution === Solution.Monorepo);
|
144499
144422
|
}).map((solution) => {
|
144423
|
+
var _extra3;
|
144500
144424
|
return {
|
144501
144425
|
value: solution,
|
144502
|
-
label: (extra === null ||
|
144426
|
+
label: ((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
144503
144427
|
};
|
144504
144428
|
});
|
144505
|
-
if (extra === null ||
|
144429
|
+
if ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : (_extra_customPlugin = _extra2.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
|
144506
144430
|
return [
|
144507
144431
|
...items,
|
144508
144432
|
{
|
@@ -144518,7 +144442,8 @@ var getSolutionSchema = (extra = {}) => {
|
|
144518
144442
|
};
|
144519
144443
|
};
|
144520
144444
|
var getScenesSchema = (extra = {}) => {
|
144521
|
-
|
144445
|
+
var _extra, _extra1, _extra2, _extra3, _extra4, _extra5, _extra6;
|
144446
|
+
const hasPlugin = ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.customPlugin) && extra.customPlugin[((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) : (_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.solution] && extra.customPlugin[((_extra4 = extra) === null || _extra4 === void 0 ? void 0 : _extra4.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra5 = extra) === null || _extra5 === void 0 ? void 0 : _extra5.solution) : (_extra6 = extra) === null || _extra6 === void 0 ? void 0 : _extra6.solution].length > 0;
|
144522
144447
|
return {
|
144523
144448
|
type: "object",
|
144524
144449
|
properties: hasPlugin ? {
|
@@ -144526,15 +144451,17 @@ var getScenesSchema = (extra = {}) => {
|
|
144526
144451
|
type: "string",
|
144527
144452
|
title: i18n2.t(localeKeys2.scenes.self),
|
144528
144453
|
enum: (() => {
|
144529
|
-
|
144530
|
-
const
|
144454
|
+
var _extra7, _extra12, _extra22, _extra32, _extra42;
|
144455
|
+
const solution = ((_extra7 = extra) === null || _extra7 === void 0 ? void 0 : _extra7.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra12 = extra) === null || _extra12 === void 0 ? void 0 : _extra12.solution) : (_extra22 = extra) === null || _extra22 === void 0 ? void 0 : _extra22.solution;
|
144456
|
+
const items = (((_extra32 = extra) === null || _extra32 === void 0 ? void 0 : _extra32.customPlugin) ? ((_extra42 = extra) === null || _extra42 === void 0 ? void 0 : _extra42.customPlugin[solution]) || [] : []).map((plugin) => ({
|
144531
144457
|
value: plugin.key,
|
144532
144458
|
label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
|
144533
144459
|
}));
|
144534
144460
|
if (solution && solution !== "custom") {
|
144461
|
+
var _extra52;
|
144535
144462
|
items.unshift({
|
144536
144463
|
value: solution,
|
144537
|
-
label: `${(extra === null ||
|
144464
|
+
label: `${((_extra52 = extra) === null || _extra52 === void 0 ? void 0 : _extra52.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
|
144538
144465
|
});
|
144539
144466
|
}
|
144540
144467
|
return items;
|
@@ -144591,11 +144518,13 @@ var PackageManagerName = {
|
|
144591
144518
|
[PackageManager.Npm]: "npm"
|
144592
144519
|
};
|
144593
144520
|
var getPackageManagerSchema = (extra = {}) => {
|
144521
|
+
var _extra, _extra1;
|
144594
144522
|
return {
|
144595
144523
|
type: "string",
|
144596
144524
|
title: i18n2.t(localeKeys2.packageManager.self),
|
144597
144525
|
enum: Object.values(PackageManager).filter((packageManager) => {
|
144598
|
-
|
144526
|
+
var _extra2;
|
144527
|
+
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
144599
144528
|
}).map((packageManager) => ({
|
144600
144529
|
value: packageManager,
|
144601
144530
|
label: PackageManagerName[packageManager]
|
@@ -144605,7 +144534,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
144605
144534
|
dependencies: [],
|
144606
144535
|
fulfill: {
|
144607
144536
|
state: {
|
144608
|
-
visible: !(extra === null ||
|
144537
|
+
visible: !((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) && !((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isSubProject)
|
144609
144538
|
}
|
144610
144539
|
}
|
144611
144540
|
}
|
@@ -144615,15 +144544,16 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
144615
144544
|
|
144616
144545
|
// ../../generator-common/dist/esm-node/common/packageName.js
|
144617
144546
|
var getPackageNameSchema = (extra = {}) => {
|
144547
|
+
var _extra, _extra1, _extra2, _extra3;
|
144618
144548
|
return {
|
144619
144549
|
type: "string",
|
144620
|
-
title: (extra === null ||
|
144550
|
+
title: ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
144621
144551
|
"x-reactions": [
|
144622
144552
|
{
|
144623
144553
|
dependencies: [],
|
144624
144554
|
fulfill: {
|
144625
144555
|
state: {
|
144626
|
-
visible: Boolean(extra === null ||
|
144556
|
+
visible: Boolean((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) || !((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.isMwa) && !((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isDoc)
|
144627
144557
|
}
|
144628
144558
|
}
|
144629
144559
|
}
|
@@ -144640,6 +144570,7 @@ var getPackageNameSchema = (extra = {}) => {
|
|
144640
144570
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
144641
144571
|
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
144642
144572
|
var getPackagePathSchema = (extra) => {
|
144573
|
+
var _extra;
|
144643
144574
|
return {
|
144644
144575
|
type: "string",
|
144645
144576
|
title: i18n2.t(localeKeys2.packagePath.self),
|
@@ -144651,7 +144582,7 @@ var getPackagePathSchema = (extra) => {
|
|
144651
144582
|
fulfill: {
|
144652
144583
|
state: {
|
144653
144584
|
value: "{{$deps[0]}}",
|
144654
|
-
visible: Boolean(extra === null ||
|
144585
|
+
visible: Boolean((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.isMonorepoSubProject)
|
144655
144586
|
}
|
144656
144587
|
}
|
144657
144588
|
}
|
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-common": "3.1.
|
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-plugin": "3.1.
|
39
|
-
"@modern-js/base-generator": "3.1.
|
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": {
|