@modern-js/mwa-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 +30 -37
- package/package.json +11 -11
- package/templates/base-template/README.md.handlebars +4 -4
package/dist/index.js
CHANGED
|
@@ -115230,8 +115230,6 @@ var require_chainId2 = __commonJS({
|
|
|
115230
115230
|
STYLE: "style-loader",
|
|
115231
115231
|
/** postcss-loader */
|
|
115232
115232
|
POSTCSS: "postcss",
|
|
115233
|
-
/** markdown-loader */
|
|
115234
|
-
MARKDOWN: "markdown",
|
|
115235
115233
|
/** ignore-css-loader */
|
|
115236
115234
|
IGNORE_CSS: "ignore-css",
|
|
115237
115235
|
/** css-modules-typescript-loader */
|
|
@@ -115312,7 +115310,9 @@ var require_chainId2 = __commonJS({
|
|
|
115312
115310
|
/** HtmlAsyncChunkPlugin */
|
|
115313
115311
|
HTML_ASYNC_CHUNK: "html-async-chunk",
|
|
115314
115312
|
/** SWC_POLYFILL_CHECKER */
|
|
115315
|
-
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
|
|
115313
|
+
SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
|
|
115314
|
+
/** RouterPlugin */
|
|
115315
|
+
ROUTER_MANIFEST: "route-plugin"
|
|
115316
115316
|
},
|
|
115317
115317
|
/** Predefined minimizers */
|
|
115318
115318
|
MINIMIZER: {
|
|
@@ -115768,12 +115768,11 @@ var require_config4 = __commonJS({
|
|
|
115768
115768
|
var _constants = require_constants2();
|
|
115769
115769
|
var _type = require_type2();
|
|
115770
115770
|
var isSSR = (config) => {
|
|
115771
|
-
var _server, _server1;
|
|
115772
115771
|
const { server } = config;
|
|
115773
|
-
if (
|
|
115772
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
|
115774
115773
|
return true;
|
|
115775
115774
|
}
|
|
115776
|
-
if ((
|
|
115775
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
|
115777
115776
|
for (const name of Object.keys(server.ssrByEntries)) {
|
|
115778
115777
|
if (server.ssrByEntries[name]) {
|
|
115779
115778
|
return true;
|
|
@@ -115783,29 +115782,28 @@ var require_config4 = __commonJS({
|
|
|
115783
115782
|
return false;
|
|
115784
115783
|
};
|
|
115785
115784
|
var isUseSSRBundle = (config) => {
|
|
115786
|
-
var _output;
|
|
115787
115785
|
const { output: output2 } = config;
|
|
115788
|
-
if (
|
|
115786
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
|
115789
115787
|
return true;
|
|
115790
115788
|
}
|
|
115791
115789
|
return isSSR(config);
|
|
115792
115790
|
};
|
|
115793
115791
|
var isServiceWorker = (config) => {
|
|
115794
|
-
var _deploy_worker
|
|
115792
|
+
var _deploy_worker;
|
|
115795
115793
|
const { output: output2, deploy } = config;
|
|
115796
|
-
if ((
|
|
115794
|
+
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))) {
|
|
115797
115795
|
return true;
|
|
115798
115796
|
}
|
|
115799
115797
|
return false;
|
|
115800
115798
|
};
|
|
115801
115799
|
var isRouterV5 = (config) => {
|
|
115802
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
|
115803
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
|
115800
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
|
115801
|
+
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";
|
|
115804
115802
|
};
|
|
115805
115803
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
|
115806
|
-
var _config_source
|
|
115804
|
+
var _config_source;
|
|
115807
115805
|
const ssgConfig = config.output.ssg;
|
|
115808
|
-
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
|
115806
|
+
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]);
|
|
115809
115807
|
return useSSG;
|
|
115810
115808
|
};
|
|
115811
115809
|
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
|
@@ -116384,9 +116382,14 @@ var require_logger3 = __commonJS({
|
|
|
116384
116382
|
label: "info",
|
|
116385
116383
|
level: "info"
|
|
116386
116384
|
},
|
|
116385
|
+
ready: {
|
|
116386
|
+
color: "green",
|
|
116387
|
+
label: "ready",
|
|
116388
|
+
level: "info"
|
|
116389
|
+
},
|
|
116387
116390
|
success: {
|
|
116388
116391
|
color: "green",
|
|
116389
|
-
label: "
|
|
116392
|
+
label: "success",
|
|
116390
116393
|
level: "info"
|
|
116391
116394
|
},
|
|
116392
116395
|
warn: {
|
|
@@ -116566,7 +116569,7 @@ var require_alias2 = __commonJS({
|
|
|
116566
116569
|
};
|
|
116567
116570
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
|
116568
116571
|
var getAliasConfig = (aliasOption, option) => {
|
|
116569
|
-
var _tsconfig_compilerOptions,
|
|
116572
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
|
116570
116573
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
|
116571
116574
|
const alias = mergeAlias(aliasOption);
|
|
116572
116575
|
if (!isTsProject) {
|
|
@@ -116578,12 +116581,12 @@ var require_alias2 = __commonJS({
|
|
|
116578
116581
|
};
|
|
116579
116582
|
}
|
|
116580
116583
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
|
116581
|
-
const baseUrl =
|
|
116584
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
|
116582
116585
|
return {
|
|
116583
116586
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
|
116584
116587
|
paths: {
|
|
116585
116588
|
...alias,
|
|
116586
|
-
...
|
|
116589
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
|
116587
116590
|
},
|
|
116588
116591
|
isTsPath: true,
|
|
116589
116592
|
isTsProject
|
|
@@ -116978,7 +116981,7 @@ var require_port2 = __commonJS({
|
|
|
116978
116981
|
if (strictPort) {
|
|
116979
116982
|
throw new Error(`Port "${original}" is occupied, please choose another one.`);
|
|
116980
116983
|
} else if (!slient) {
|
|
116981
|
-
_logger.logger.info(`
|
|
116984
|
+
_logger.logger.info(`Port ${original} is in use. ${_compiled.chalk.yellow(`using port ${port}.`)}`);
|
|
116982
116985
|
}
|
|
116983
116986
|
}
|
|
116984
116987
|
return port;
|
|
@@ -117030,10 +117033,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
|
117030
117033
|
var getAddressUrls = (protocol = "http", port, host) => {
|
|
117031
117034
|
const LOCAL_LABEL = "Local: ";
|
|
117032
117035
|
const NETWORK_LABEL = "Network: ";
|
|
117033
|
-
const isLocalhost = (url) =>
|
|
117034
|
-
var _url;
|
|
117035
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
|
117036
|
-
};
|
|
117036
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
|
117037
117037
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
|
117038
117038
|
return [
|
|
117039
117039
|
{
|
|
@@ -117064,7 +117064,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
|
117064
117064
|
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);
|
|
117065
117065
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
|
117066
117066
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
|
117067
|
-
let message = "
|
|
117067
|
+
let message = "\n";
|
|
117068
117068
|
if ((0, _is.isSingleEntry)(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) || apiOnly) {
|
|
117069
117069
|
message += urls.map(({ label, url }) => ` ${_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${_compiled.chalk.cyanBright(normalizeUrl(`${url}/${routes[0].urlPath}`))}
|
|
117070
117070
|
`).join("");
|
|
@@ -117126,9 +117126,8 @@ var require_require2 = __commonJS({
|
|
|
117126
117126
|
});
|
|
117127
117127
|
var _fs = require_fs2();
|
|
117128
117128
|
var compatRequire = (filePath, interop = true) => {
|
|
117129
|
-
var _mod;
|
|
117130
117129
|
const mod = require(filePath);
|
|
117131
|
-
const rtnESMDefault = interop && (
|
|
117130
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
|
117132
117131
|
return rtnESMDefault ? mod.default : mod;
|
|
117133
117132
|
};
|
|
117134
117133
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
|
@@ -132506,14 +132505,10 @@ var PackageManagerName = {
|
|
|
132506
132505
|
[PackageManager.Npm]: "npm"
|
|
132507
132506
|
};
|
|
132508
132507
|
var getPackageManagerSchema = (extra = {}) => {
|
|
132509
|
-
var _extra, _extra1;
|
|
132510
132508
|
return {
|
|
132511
132509
|
type: "string",
|
|
132512
132510
|
title: i18n2.t(localeKeys2.packageManager.self),
|
|
132513
|
-
enum: Object.values(PackageManager).filter((packageManager) => {
|
|
132514
|
-
var _extra2;
|
|
132515
|
-
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
|
132516
|
-
}).map((packageManager) => ({
|
|
132511
|
+
enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
|
|
132517
132512
|
value: packageManager,
|
|
132518
132513
|
label: PackageManagerName[packageManager]
|
|
132519
132514
|
})),
|
|
@@ -132522,7 +132517,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
132522
132517
|
dependencies: [],
|
|
132523
132518
|
fulfill: {
|
|
132524
132519
|
state: {
|
|
132525
|
-
visible: !(
|
|
132520
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
|
132526
132521
|
}
|
|
132527
132522
|
}
|
|
132528
132523
|
}
|
|
@@ -132532,16 +132527,15 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
132532
132527
|
|
|
132533
132528
|
// ../../generator-common/dist/esm-node/common/packageName.js
|
|
132534
132529
|
var getPackageNameSchema = (extra = {}) => {
|
|
132535
|
-
var _extra, _extra1, _extra2;
|
|
132536
132530
|
return {
|
|
132537
132531
|
type: "string",
|
|
132538
|
-
title: (
|
|
132532
|
+
title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
|
132539
132533
|
"x-reactions": [
|
|
132540
132534
|
{
|
|
132541
132535
|
dependencies: [],
|
|
132542
132536
|
fulfill: {
|
|
132543
132537
|
state: {
|
|
132544
|
-
visible: Boolean(
|
|
132538
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa)
|
|
132545
132539
|
}
|
|
132546
132540
|
}
|
|
132547
132541
|
}
|
|
@@ -132558,7 +132552,6 @@ var getPackageNameSchema = (extra = {}) => {
|
|
|
132558
132552
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
|
132559
132553
|
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
|
132560
132554
|
var getPackagePathSchema = (extra) => {
|
|
132561
|
-
var _extra;
|
|
132562
132555
|
return {
|
|
132563
132556
|
type: "string",
|
|
132564
132557
|
title: i18n2.t(localeKeys2.packagePath.self),
|
|
@@ -132570,7 +132563,7 @@ var getPackagePathSchema = (extra) => {
|
|
|
132570
132563
|
fulfill: {
|
|
132571
132564
|
state: {
|
|
132572
132565
|
value: "{{$deps[0]}}",
|
|
132573
|
-
visible: Boolean(
|
|
132566
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
|
|
132574
132567
|
}
|
|
132575
132568
|
}
|
|
132576
132569
|
}
|
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/
|
|
33
|
-
"@modern-js/generator-utils": "3.2.
|
|
34
|
-
"@modern-js/
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/
|
|
38
|
-
"@modern-js/
|
|
39
|
-
"@modern-js/
|
|
40
|
-
"@scripts/build": "2.
|
|
41
|
-
"@scripts/jest-config": "2.
|
|
32
|
+
"@modern-js/base-generator": "3.2.2",
|
|
33
|
+
"@modern-js/generator-utils": "3.2.2",
|
|
34
|
+
"@modern-js/dependence-generator": "3.2.2",
|
|
35
|
+
"@modern-js/packages-generator": "3.2.2",
|
|
36
|
+
"@modern-js/rspack-generator": "3.2.2",
|
|
37
|
+
"@modern-js/plugin-i18n": "2.35.1",
|
|
38
|
+
"@modern-js/entry-generator": "3.2.2",
|
|
39
|
+
"@modern-js/generator-common": "3.2.2",
|
|
40
|
+
"@scripts/build": "2.35.1",
|
|
41
|
+
"@scripts/jest-config": "2.35.1"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"publishConfig": {
|
|
@@ -14,25 +14,25 @@ Install the dependencies:
|
|
|
14
14
|
|
|
15
15
|
Start the dev server:
|
|
16
16
|
|
|
17
|
-
```
|
|
17
|
+
```bash
|
|
18
18
|
{{packageManager}} dev
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Enable optional features or add a new entry:
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```bash
|
|
24
24
|
{{packageManager}} new
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Build the app for production:
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```bash
|
|
30
30
|
{{packageManager}} build
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Preview the production build locally:
|
|
34
34
|
|
|
35
|
-
```
|
|
35
|
+
```bash
|
|
36
36
|
{{packageManager}} serve
|
|
37
37
|
```
|
|
38
38
|
|