@modern-js/monorepo-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 +27 -32
- package/package.json +9 -9
package/dist/index.js
CHANGED
@@ -116827,8 +116827,6 @@ var require_chainId2 = __commonJS({
|
|
116827
116827
|
STYLE: "style-loader",
|
116828
116828
|
/** postcss-loader */
|
116829
116829
|
POSTCSS: "postcss",
|
116830
|
-
/** markdown-loader */
|
116831
|
-
MARKDOWN: "markdown",
|
116832
116830
|
/** ignore-css-loader */
|
116833
116831
|
IGNORE_CSS: "ignore-css",
|
116834
116832
|
/** css-modules-typescript-loader */
|
@@ -116909,7 +116907,9 @@ var require_chainId2 = __commonJS({
|
|
116909
116907
|
/** HtmlAsyncChunkPlugin */
|
116910
116908
|
HTML_ASYNC_CHUNK: "html-async-chunk",
|
116911
116909
|
/** SWC_POLYFILL_CHECKER */
|
116912
|
-
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
|
116910
|
+
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
|
116911
|
+
/** RouterPlugin */
|
116912
|
+
ROUTER_MANIFEST: "route-plugin"
|
116913
116913
|
},
|
116914
116914
|
/** Predefined minimizers */
|
116915
116915
|
MINIMIZER: {
|
@@ -117365,12 +117365,11 @@ var require_config4 = __commonJS({
|
|
117365
117365
|
var _constants = require_constants2();
|
117366
117366
|
var _type = require_type2();
|
117367
117367
|
var isSSR = (config) => {
|
117368
|
-
var _server, _server1;
|
117369
117368
|
const { server } = config;
|
117370
|
-
if (
|
117369
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
117371
117370
|
return true;
|
117372
117371
|
}
|
117373
|
-
if ((
|
117372
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
117374
117373
|
for (const name of Object.keys(server.ssrByEntries)) {
|
117375
117374
|
if (server.ssrByEntries[name]) {
|
117376
117375
|
return true;
|
@@ -117380,29 +117379,28 @@ var require_config4 = __commonJS({
|
|
117380
117379
|
return false;
|
117381
117380
|
};
|
117382
117381
|
var isUseSSRBundle = (config) => {
|
117383
|
-
var _output;
|
117384
117382
|
const { output: output2 } = config;
|
117385
|
-
if (
|
117383
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
117386
117384
|
return true;
|
117387
117385
|
}
|
117388
117386
|
return isSSR(config);
|
117389
117387
|
};
|
117390
117388
|
var isServiceWorker = (config) => {
|
117391
|
-
var _deploy_worker
|
117389
|
+
var _deploy_worker;
|
117392
117390
|
const { output: output2, deploy } = config;
|
117393
|
-
if ((
|
117391
|
+
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))) {
|
117394
117392
|
return true;
|
117395
117393
|
}
|
117396
117394
|
return false;
|
117397
117395
|
};
|
117398
117396
|
var isRouterV5 = (config) => {
|
117399
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
117400
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
117397
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
117398
|
+
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";
|
117401
117399
|
};
|
117402
117400
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
117403
|
-
var _config_source
|
117401
|
+
var _config_source;
|
117404
117402
|
const ssgConfig = config.output.ssg;
|
117405
|
-
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
117403
|
+
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]);
|
117406
117404
|
return useSSG;
|
117407
117405
|
};
|
117408
117406
|
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
@@ -117981,9 +117979,14 @@ var require_logger3 = __commonJS({
|
|
117981
117979
|
label: "info",
|
117982
117980
|
level: "info"
|
117983
117981
|
},
|
117982
|
+
ready: {
|
117983
|
+
color: "green",
|
117984
|
+
label: "ready",
|
117985
|
+
level: "info"
|
117986
|
+
},
|
117984
117987
|
success: {
|
117985
117988
|
color: "green",
|
117986
|
-
label: "
|
117989
|
+
label: "success",
|
117987
117990
|
level: "info"
|
117988
117991
|
},
|
117989
117992
|
warn: {
|
@@ -118163,7 +118166,7 @@ var require_alias2 = __commonJS({
|
|
118163
118166
|
};
|
118164
118167
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
118165
118168
|
var getAliasConfig = (aliasOption, option) => {
|
118166
|
-
var _tsconfig_compilerOptions,
|
118169
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
118167
118170
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
118168
118171
|
const alias = mergeAlias(aliasOption);
|
118169
118172
|
if (!isTsProject) {
|
@@ -118175,12 +118178,12 @@ var require_alias2 = __commonJS({
|
|
118175
118178
|
};
|
118176
118179
|
}
|
118177
118180
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
118178
|
-
const baseUrl =
|
118181
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
118179
118182
|
return {
|
118180
118183
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
118181
118184
|
paths: {
|
118182
118185
|
...alias,
|
118183
|
-
...
|
118186
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
118184
118187
|
},
|
118185
118188
|
isTsPath: true,
|
118186
118189
|
isTsProject
|
@@ -118575,7 +118578,7 @@ var require_port2 = __commonJS({
|
|
118575
118578
|
if (strictPort) {
|
118576
118579
|
throw new Error(`Port "${original}" is occupied, please choose another one.`);
|
118577
118580
|
} else if (!slient) {
|
118578
|
-
_logger.logger.info(`
|
118581
|
+
_logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
|
118579
118582
|
}
|
118580
118583
|
}
|
118581
118584
|
return port;
|
@@ -118627,10 +118630,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
118627
118630
|
var getAddressUrls = (protocol = "http", port, host) => {
|
118628
118631
|
const LOCAL_LABEL = "Local: ";
|
118629
118632
|
const NETWORK_LABEL = "Network: ";
|
118630
|
-
const isLocalhost = (url) =>
|
118631
|
-
var _url;
|
118632
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
118633
|
-
};
|
118633
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
118634
118634
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
118635
118635
|
return [
|
118636
118636
|
{
|
@@ -118661,7 +118661,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
118661
118661
|
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);
|
118662
118662
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
118663
118663
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
118664
|
-
let message = "
|
118664
|
+
let message = "\n";
|
118665
118665
|
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
118666
118666
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
118667
118667
|
`).join("");
|
@@ -118723,9 +118723,8 @@ var require_require2 = __commonJS({
|
|
118723
118723
|
});
|
118724
118724
|
var _fs = require_fs2();
|
118725
118725
|
var compatRequire = (filePath, interop = true) => {
|
118726
|
-
var _mod;
|
118727
118726
|
const mod = require(filePath);
|
118728
|
-
const rtnESMDefault = interop && (
|
118727
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
118729
118728
|
return rtnESMDefault ? mod.default : mod;
|
118730
118729
|
};
|
118731
118730
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
@@ -134765,14 +134764,10 @@ var PackageManagerName = {
|
|
134765
134764
|
[PackageManager.Npm]: "npm"
|
134766
134765
|
};
|
134767
134766
|
var getPackageManagerSchema = (extra = {}) => {
|
134768
|
-
var _extra, _extra1;
|
134769
134767
|
return {
|
134770
134768
|
type: "string",
|
134771
134769
|
title: i18n2.t(localeKeys2.packageManager.self),
|
134772
|
-
enum: Object.values(PackageManager).filter((packageManager) => {
|
134773
|
-
var _extra2;
|
134774
|
-
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
134775
|
-
}).map((packageManager) => ({
|
134770
|
+
enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
|
134776
134771
|
value: packageManager,
|
134777
134772
|
label: PackageManagerName[packageManager]
|
134778
134773
|
})),
|
@@ -134781,7 +134776,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
134781
134776
|
dependencies: [],
|
134782
134777
|
fulfill: {
|
134783
134778
|
state: {
|
134784
|
-
visible: !(
|
134779
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
134785
134780
|
}
|
134786
134781
|
}
|
134787
134782
|
}
|
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": [
|
@@ -30,14 +30,14 @@
|
|
30
30
|
"@types/node": "^14",
|
31
31
|
"jest": "^29",
|
32
32
|
"typescript": "^5",
|
33
|
-
"@modern-js/base-generator": "3.2.
|
34
|
-
"@modern-js/plugin-i18n": "2.35.
|
35
|
-
"@modern-js/packages-generator": "3.2.
|
36
|
-
"@modern-js/generator-
|
37
|
-
"@modern-js/generator
|
38
|
-
"@modern-js/
|
39
|
-
"@scripts/build": "2.35.
|
40
|
-
"@scripts/jest-config": "2.35.
|
33
|
+
"@modern-js/base-generator": "3.2.2",
|
34
|
+
"@modern-js/plugin-i18n": "2.35.1",
|
35
|
+
"@modern-js/packages-generator": "3.2.2",
|
36
|
+
"@modern-js/generator-common": "3.2.2",
|
37
|
+
"@modern-js/changeset-generator": "3.2.2",
|
38
|
+
"@modern-js/generator-utils": "3.2.2",
|
39
|
+
"@scripts/build": "2.35.1",
|
40
|
+
"@scripts/jest-config": "2.35.1"
|
41
41
|
},
|
42
42
|
"sideEffects": false,
|
43
43
|
"publishConfig": {
|