@modern-js/entry-generator 3.2.0 → 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 +26 -28
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -34238,8 +34238,6 @@ var require_chainId = __commonJS({
|
|
|
34238
34238
|
STYLE: "style-loader",
|
|
34239
34239
|
/** postcss-loader */
|
|
34240
34240
|
POSTCSS: "postcss",
|
|
34241
|
-
/** markdown-loader */
|
|
34242
|
-
MARKDOWN: "markdown",
|
|
34243
34241
|
/** ignore-css-loader */
|
|
34244
34242
|
IGNORE_CSS: "ignore-css",
|
|
34245
34243
|
/** css-modules-typescript-loader */
|
|
@@ -34320,7 +34318,9 @@ var require_chainId = __commonJS({
|
|
|
34320
34318
|
/** HtmlAsyncChunkPlugin */
|
|
34321
34319
|
HTML_ASYNC_CHUNK: "html-async-chunk",
|
|
34322
34320
|
/** SWC_POLYFILL_CHECKER */
|
|
34323
|
-
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
|
|
34321
|
+
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
|
|
34322
|
+
/** RouterPlugin */
|
|
34323
|
+
ROUTER_MANIFEST: "route-plugin"
|
|
34324
34324
|
},
|
|
34325
34325
|
/** Predefined minimizers */
|
|
34326
34326
|
MINIMIZER: {
|
|
@@ -34776,12 +34776,11 @@ var require_config = __commonJS({
|
|
|
34776
34776
|
var _constants = require_constants();
|
|
34777
34777
|
var _type = require_type();
|
|
34778
34778
|
var isSSR = (config) => {
|
|
34779
|
-
var _server, _server1;
|
|
34780
34779
|
const { server } = config;
|
|
34781
|
-
if (
|
|
34780
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
|
34782
34781
|
return true;
|
|
34783
34782
|
}
|
|
34784
|
-
if ((
|
|
34783
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
|
34785
34784
|
for (const name of Object.keys(server.ssrByEntries)) {
|
|
34786
34785
|
if (server.ssrByEntries[name]) {
|
|
34787
34786
|
return true;
|
|
@@ -34791,29 +34790,28 @@ var require_config = __commonJS({
|
|
|
34791
34790
|
return false;
|
|
34792
34791
|
};
|
|
34793
34792
|
var isUseSSRBundle = (config) => {
|
|
34794
|
-
var _output;
|
|
34795
34793
|
const { output: output2 } = config;
|
|
34796
|
-
if (
|
|
34794
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
|
34797
34795
|
return true;
|
|
34798
34796
|
}
|
|
34799
34797
|
return isSSR(config);
|
|
34800
34798
|
};
|
|
34801
34799
|
var isServiceWorker = (config) => {
|
|
34802
|
-
var _deploy_worker
|
|
34800
|
+
var _deploy_worker;
|
|
34803
34801
|
const { output: output2, deploy } = config;
|
|
34804
|
-
if ((
|
|
34802
|
+
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))) {
|
|
34805
34803
|
return true;
|
|
34806
34804
|
}
|
|
34807
34805
|
return false;
|
|
34808
34806
|
};
|
|
34809
34807
|
var isRouterV5 = (config) => {
|
|
34810
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
|
34811
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
|
34808
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
|
34809
|
+
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";
|
|
34812
34810
|
};
|
|
34813
34811
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
|
34814
|
-
var _config_source
|
|
34812
|
+
var _config_source;
|
|
34815
34813
|
const ssgConfig = config.output.ssg;
|
|
34816
|
-
const useSSG = isSingleEntry2(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
|
34814
|
+
const useSSG = isSingleEntry2(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]);
|
|
34817
34815
|
return useSSG;
|
|
34818
34816
|
};
|
|
34819
34817
|
var isSingleEntry2 = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
|
@@ -35392,9 +35390,14 @@ var require_logger = __commonJS({
|
|
|
35392
35390
|
label: "info",
|
|
35393
35391
|
level: "info"
|
|
35394
35392
|
},
|
|
35393
|
+
ready: {
|
|
35394
|
+
color: "green",
|
|
35395
|
+
label: "ready",
|
|
35396
|
+
level: "info"
|
|
35397
|
+
},
|
|
35395
35398
|
success: {
|
|
35396
35399
|
color: "green",
|
|
35397
|
-
label: "
|
|
35400
|
+
label: "success",
|
|
35398
35401
|
level: "info"
|
|
35399
35402
|
},
|
|
35400
35403
|
warn: {
|
|
@@ -35574,7 +35577,7 @@ var require_alias = __commonJS({
|
|
|
35574
35577
|
};
|
|
35575
35578
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
|
35576
35579
|
var getAliasConfig = (aliasOption, option) => {
|
|
35577
|
-
var _tsconfig_compilerOptions,
|
|
35580
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
|
35578
35581
|
const isTsProject2 = _fs.default.existsSync(option.tsconfigPath);
|
|
35579
35582
|
const alias = mergeAlias(aliasOption);
|
|
35580
35583
|
if (!isTsProject2) {
|
|
@@ -35586,12 +35589,12 @@ var require_alias = __commonJS({
|
|
|
35586
35589
|
};
|
|
35587
35590
|
}
|
|
35588
35591
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
|
35589
|
-
const baseUrl =
|
|
35592
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
|
35590
35593
|
return {
|
|
35591
35594
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
|
35592
35595
|
paths: {
|
|
35593
35596
|
...alias,
|
|
35594
|
-
...
|
|
35597
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
|
35595
35598
|
},
|
|
35596
35599
|
isTsPath: true,
|
|
35597
35600
|
isTsProject: isTsProject2
|
|
@@ -35986,7 +35989,7 @@ var require_port = __commonJS({
|
|
|
35986
35989
|
if (strictPort) {
|
|
35987
35990
|
throw new Error(`Port "${original}" is occupied, please choose another one.`);
|
|
35988
35991
|
} else if (!slient) {
|
|
35989
|
-
_logger.logger.info(`
|
|
35992
|
+
_logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
|
|
35990
35993
|
}
|
|
35991
35994
|
}
|
|
35992
35995
|
return port;
|
|
@@ -36038,10 +36041,7 @@ var require_prettyInstructions = __commonJS({
|
|
|
36038
36041
|
var getAddressUrls = (protocol = "http", port, host) => {
|
|
36039
36042
|
const LOCAL_LABEL = "Local: ";
|
|
36040
36043
|
const NETWORK_LABEL = "Network: ";
|
|
36041
|
-
const isLocalhost = (url) =>
|
|
36042
|
-
var _url;
|
|
36043
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
|
36044
|
-
};
|
|
36044
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
|
36045
36045
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
|
36046
36046
|
return [
|
|
36047
36047
|
{
|
|
@@ -36072,7 +36072,7 @@ var require_prettyInstructions = __commonJS({
|
|
|
36072
36072
|
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);
|
|
36073
36073
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
|
36074
36074
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
|
36075
|
-
let message = "
|
|
36075
|
+
let message = "\n";
|
|
36076
36076
|
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
|
36077
36077
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
|
36078
36078
|
`).join("");
|
|
@@ -36134,9 +36134,8 @@ var require_require = __commonJS({
|
|
|
36134
36134
|
});
|
|
36135
36135
|
var _fs = require_fs();
|
|
36136
36136
|
var compatRequire = (filePath, interop = true) => {
|
|
36137
|
-
var _mod;
|
|
36138
36137
|
const mod = require(filePath);
|
|
36139
|
-
const rtnESMDefault = interop && (
|
|
36138
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
|
36140
36139
|
return rtnESMDefault ? mod.default : mod;
|
|
36141
36140
|
};
|
|
36142
36141
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
|
@@ -117668,7 +117667,6 @@ var BooleanConfigName = {
|
|
|
117668
117667
|
|
|
117669
117668
|
// ../../generator-common/dist/esm-node/mwa/entry.js
|
|
117670
117669
|
var getEntryNameSchema = (extra = {}) => {
|
|
117671
|
-
var _extra;
|
|
117672
117670
|
return {
|
|
117673
117671
|
type: "string",
|
|
117674
117672
|
title: i18n.t(localeKeys.entry.name),
|
|
@@ -117687,7 +117685,7 @@ var getEntryNameSchema = (extra = {}) => {
|
|
|
117687
117685
|
dependencies: [],
|
|
117688
117686
|
fulfill: {
|
|
117689
117687
|
state: {
|
|
117690
|
-
visible: !(
|
|
117688
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isEmptySrc)
|
|
117691
117689
|
}
|
|
117692
117690
|
}
|
|
117693
117691
|
}
|
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,12 +30,12 @@
|
|
|
30
30
|
"@types/node": "^14",
|
|
31
31
|
"jest": "^29",
|
|
32
32
|
"typescript": "^5",
|
|
33
|
-
"@modern-js/utils": "2.
|
|
34
|
-
"@modern-js/
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@scripts/
|
|
38
|
-
"@scripts/
|
|
33
|
+
"@modern-js/generator-utils": "3.2.2",
|
|
34
|
+
"@modern-js/utils": "2.35.1",
|
|
35
|
+
"@modern-js/generator-common": "3.2.2",
|
|
36
|
+
"@modern-js/plugin-i18n": "2.35.1",
|
|
37
|
+
"@scripts/build": "2.35.1",
|
|
38
|
+
"@scripts/jest-config": "2.35.1"
|
|
39
39
|
},
|
|
40
40
|
"sideEffects": false,
|
|
41
41
|
"publishConfig": {
|