@modern-js/repo-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.
- package/dist/index.js +40 -56
- package/package.json +11 -11
package/dist/index.js
CHANGED
@@ -124142,8 +124142,6 @@ var require_chainId2 = __commonJS({
|
|
124142
124142
|
STYLE: "style-loader",
|
124143
124143
|
/** postcss-loader */
|
124144
124144
|
POSTCSS: "postcss",
|
124145
|
-
/** markdown-loader */
|
124146
|
-
MARKDOWN: "markdown",
|
124147
124145
|
/** ignore-css-loader */
|
124148
124146
|
IGNORE_CSS: "ignore-css",
|
124149
124147
|
/** css-modules-typescript-loader */
|
@@ -124224,7 +124222,9 @@ var require_chainId2 = __commonJS({
|
|
124224
124222
|
/** HtmlAsyncChunkPlugin */
|
124225
124223
|
HTML_ASYNC_CHUNK: "html-async-chunk",
|
124226
124224
|
/** SWC_POLYFILL_CHECKER */
|
124227
|
-
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
|
124225
|
+
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
|
124226
|
+
/** RouterPlugin */
|
124227
|
+
ROUTER_MANIFEST: "route-plugin"
|
124228
124228
|
},
|
124229
124229
|
/** Predefined minimizers */
|
124230
124230
|
MINIMIZER: {
|
@@ -124680,12 +124680,11 @@ var require_config4 = __commonJS({
|
|
124680
124680
|
var _constants = require_constants3();
|
124681
124681
|
var _type = require_type2();
|
124682
124682
|
var isSSR = (config) => {
|
124683
|
-
var _server, _server1;
|
124684
124683
|
const { server } = config;
|
124685
|
-
if (
|
124684
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
124686
124685
|
return true;
|
124687
124686
|
}
|
124688
|
-
if ((
|
124687
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
124689
124688
|
for (const name of Object.keys(server.ssrByEntries)) {
|
124690
124689
|
if (server.ssrByEntries[name]) {
|
124691
124690
|
return true;
|
@@ -124695,29 +124694,28 @@ var require_config4 = __commonJS({
|
|
124695
124694
|
return false;
|
124696
124695
|
};
|
124697
124696
|
var isUseSSRBundle = (config) => {
|
124698
|
-
var _output;
|
124699
124697
|
const { output: output2 } = config;
|
124700
|
-
if (
|
124698
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
124701
124699
|
return true;
|
124702
124700
|
}
|
124703
124701
|
return isSSR(config);
|
124704
124702
|
};
|
124705
124703
|
var isServiceWorker = (config) => {
|
124706
|
-
var _deploy_worker
|
124704
|
+
var _deploy_worker;
|
124707
124705
|
const { output: output2, deploy } = config;
|
124708
|
-
if ((
|
124706
|
+
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))) {
|
124709
124707
|
return true;
|
124710
124708
|
}
|
124711
124709
|
return false;
|
124712
124710
|
};
|
124713
124711
|
var isRouterV5 = (config) => {
|
124714
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
124715
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
124712
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
124713
|
+
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";
|
124716
124714
|
};
|
124717
124715
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
124718
|
-
var _config_source
|
124716
|
+
var _config_source;
|
124719
124717
|
const ssgConfig = config.output.ssg;
|
124720
|
-
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
124718
|
+
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]);
|
124721
124719
|
return useSSG;
|
124722
124720
|
};
|
124723
124721
|
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
@@ -125296,9 +125294,14 @@ var require_logger3 = __commonJS({
|
|
125296
125294
|
label: "info",
|
125297
125295
|
level: "info"
|
125298
125296
|
},
|
125297
|
+
ready: {
|
125298
|
+
color: "green",
|
125299
|
+
label: "ready",
|
125300
|
+
level: "info"
|
125301
|
+
},
|
125299
125302
|
success: {
|
125300
125303
|
color: "green",
|
125301
|
-
label: "
|
125304
|
+
label: "success",
|
125302
125305
|
level: "info"
|
125303
125306
|
},
|
125304
125307
|
warn: {
|
@@ -125478,7 +125481,7 @@ var require_alias2 = __commonJS({
|
|
125478
125481
|
};
|
125479
125482
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
125480
125483
|
var getAliasConfig = (aliasOption, option) => {
|
125481
|
-
var _tsconfig_compilerOptions,
|
125484
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
125482
125485
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
125483
125486
|
const alias = mergeAlias(aliasOption);
|
125484
125487
|
if (!isTsProject) {
|
@@ -125490,12 +125493,12 @@ var require_alias2 = __commonJS({
|
|
125490
125493
|
};
|
125491
125494
|
}
|
125492
125495
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
125493
|
-
const baseUrl =
|
125496
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
125494
125497
|
return {
|
125495
125498
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
125496
125499
|
paths: {
|
125497
125500
|
...alias,
|
125498
|
-
...
|
125501
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
125499
125502
|
},
|
125500
125503
|
isTsPath: true,
|
125501
125504
|
isTsProject
|
@@ -125890,7 +125893,7 @@ var require_port2 = __commonJS({
|
|
125890
125893
|
if (strictPort) {
|
125891
125894
|
throw new Error(`Port "${original}" is occupied, please choose another one.`);
|
125892
125895
|
} else if (!slient) {
|
125893
|
-
_logger.logger.info(`
|
125896
|
+
_logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
|
125894
125897
|
}
|
125895
125898
|
}
|
125896
125899
|
return port;
|
@@ -125942,10 +125945,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
125942
125945
|
var getAddressUrls = (protocol = "http", port, host) => {
|
125943
125946
|
const LOCAL_LABEL = "Local: ";
|
125944
125947
|
const NETWORK_LABEL = "Network: ";
|
125945
|
-
const isLocalhost = (url) =>
|
125946
|
-
var _url;
|
125947
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
125948
|
-
};
|
125948
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
125949
125949
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
125950
125950
|
return [
|
125951
125951
|
{
|
@@ -125976,7 +125976,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
125976
125976
|
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);
|
125977
125977
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
125978
125978
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
125979
|
-
let message = "
|
125979
|
+
let message = "\n";
|
125980
125980
|
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
125981
125981
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
125982
125982
|
`).join("");
|
@@ -126038,9 +126038,8 @@ var require_require2 = __commonJS({
|
|
126038
126038
|
});
|
126039
126039
|
var _fs = require_fs2();
|
126040
126040
|
var compatRequire = (filePath, interop = true) => {
|
126041
|
-
var _mod;
|
126042
126041
|
const mod = require(filePath);
|
126043
|
-
const rtnESMDefault = interop && (
|
126042
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
126044
126043
|
return rtnESMDefault ? mod.default : mod;
|
126045
126044
|
};
|
126046
126045
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
@@ -145771,18 +145770,12 @@ var getSolutionSchema = (extra = {}) => {
|
|
145771
145770
|
type: "string",
|
145772
145771
|
title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
|
145773
145772
|
enum: (() => {
|
145774
|
-
var
|
145775
|
-
const items = ((
|
145776
|
-
|
145777
|
-
|
145778
|
-
})
|
145779
|
-
|
145780
|
-
return {
|
145781
|
-
value: solution,
|
145782
|
-
label: ((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
145783
|
-
};
|
145784
|
-
});
|
145785
|
-
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) {
|
145773
|
+
var _extra_customPlugin_custom, _extra_customPlugin;
|
145774
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values((extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolution : Solution)).filter((solution) => !((extra === null || extra === void 0 ? void 0 : extra.isSubProject) && solution === Solution.Monorepo)).map((solution) => ({
|
145775
|
+
value: solution,
|
145776
|
+
label: (extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
145777
|
+
}));
|
145778
|
+
if (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.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) {
|
145786
145779
|
return [
|
145787
145780
|
...items,
|
145788
145781
|
{
|
@@ -145798,8 +145791,7 @@ var getSolutionSchema = (extra = {}) => {
|
|
145798
145791
|
};
|
145799
145792
|
};
|
145800
145793
|
var getScenesSchema = (extra = {}) => {
|
145801
|
-
|
145802
|
-
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;
|
145794
|
+
const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
|
145803
145795
|
return {
|
145804
145796
|
type: "object",
|
145805
145797
|
properties: hasPlugin ? {
|
@@ -145807,17 +145799,15 @@ var getScenesSchema = (extra = {}) => {
|
|
145807
145799
|
type: "string",
|
145808
145800
|
title: i18n2.t(localeKeys2.scenes.self),
|
145809
145801
|
enum: (() => {
|
145810
|
-
|
145811
|
-
const
|
145812
|
-
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) => ({
|
145802
|
+
const solution = (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
|
145803
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
|
145813
145804
|
value: plugin.key,
|
145814
145805
|
label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
|
145815
145806
|
}));
|
145816
145807
|
if (solution && solution !== "custom") {
|
145817
|
-
var _extra52;
|
145818
145808
|
items.unshift({
|
145819
145809
|
value: solution,
|
145820
|
-
label: `${(
|
145810
|
+
label: `${(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
|
145821
145811
|
});
|
145822
145812
|
}
|
145823
145813
|
return items;
|
@@ -145873,14 +145863,10 @@ var PackageManagerName = {
|
|
145873
145863
|
[PackageManager.Npm]: "npm"
|
145874
145864
|
};
|
145875
145865
|
var getPackageManagerSchema = (extra = {}) => {
|
145876
|
-
var _extra, _extra1;
|
145877
145866
|
return {
|
145878
145867
|
type: "string",
|
145879
145868
|
title: i18n2.t(localeKeys2.packageManager.self),
|
145880
|
-
enum: Object.values(PackageManager).filter((packageManager) => {
|
145881
|
-
var _extra2;
|
145882
|
-
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
145883
|
-
}).map((packageManager) => ({
|
145869
|
+
enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
|
145884
145870
|
value: packageManager,
|
145885
145871
|
label: PackageManagerName[packageManager]
|
145886
145872
|
})),
|
@@ -145889,7 +145875,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
145889
145875
|
dependencies: [],
|
145890
145876
|
fulfill: {
|
145891
145877
|
state: {
|
145892
|
-
visible: !(
|
145878
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
145893
145879
|
}
|
145894
145880
|
}
|
145895
145881
|
}
|
@@ -145899,16 +145885,15 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
145899
145885
|
|
145900
145886
|
// ../../generator-common/dist/esm-node/common/packageName.js
|
145901
145887
|
var getPackageNameSchema = (extra = {}) => {
|
145902
|
-
var _extra, _extra1, _extra2;
|
145903
145888
|
return {
|
145904
145889
|
type: "string",
|
145905
|
-
title: (
|
145890
|
+
title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
145906
145891
|
"x-reactions": [
|
145907
145892
|
{
|
145908
145893
|
dependencies: [],
|
145909
145894
|
fulfill: {
|
145910
145895
|
state: {
|
145911
|
-
visible: Boolean(
|
145896
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa)
|
145912
145897
|
}
|
145913
145898
|
}
|
145914
145899
|
}
|
@@ -145925,7 +145910,6 @@ var getPackageNameSchema = (extra = {}) => {
|
|
145925
145910
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
145926
145911
|
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
145927
145912
|
var getPackagePathSchema = (extra) => {
|
145928
|
-
var _extra;
|
145929
145913
|
return {
|
145930
145914
|
type: "string",
|
145931
145915
|
title: i18n2.t(localeKeys2.packagePath.self),
|
@@ -145937,7 +145921,7 @@ var getPackagePathSchema = (extra) => {
|
|
145937
145921
|
fulfill: {
|
145938
145922
|
state: {
|
145939
145923
|
value: "{{$deps[0]}}",
|
145940
|
-
visible: Boolean(
|
145924
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
|
145941
145925
|
}
|
145942
145926
|
}
|
145943
145927
|
}
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.2.
|
18
|
+
"version": "3.2.2",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"main": "./dist/index.js",
|
21
21
|
"files": [
|
@@ -29,16 +29,16 @@
|
|
29
29
|
"@types/node": "^14",
|
30
30
|
"jest": "^29",
|
31
31
|
"typescript": "^5",
|
32
|
-
"@modern-js/generator-
|
33
|
-
"@modern-js/module-generator": "3.2.
|
34
|
-
"@modern-js/monorepo-generator": "3.2.
|
35
|
-
"@modern-js/mwa-generator": "3.2.
|
36
|
-
"@modern-js/utils": "2.35.
|
37
|
-
"@modern-js/generator-
|
38
|
-
"@modern-js/generator-common": "3.2.
|
39
|
-
"@modern-js/base-generator": "3.2.
|
40
|
-
"@scripts/jest-config": "2.35.
|
41
|
-
"@scripts/build": "2.35.
|
32
|
+
"@modern-js/generator-utils": "3.2.2",
|
33
|
+
"@modern-js/module-generator": "3.2.2",
|
34
|
+
"@modern-js/monorepo-generator": "3.2.2",
|
35
|
+
"@modern-js/mwa-generator": "3.2.2",
|
36
|
+
"@modern-js/utils": "2.35.1",
|
37
|
+
"@modern-js/generator-plugin": "3.2.2",
|
38
|
+
"@modern-js/generator-common": "3.2.2",
|
39
|
+
"@modern-js/base-generator": "3.2.2",
|
40
|
+
"@scripts/jest-config": "2.35.1",
|
41
|
+
"@scripts/build": "2.35.1"
|
42
42
|
},
|
43
43
|
"sideEffects": false,
|
44
44
|
"publishConfig": {
|