@modern-js/mwa-generator 3.0.11 → 3.1.0
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 +150 -3
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -136168,7 +136168,7 @@ var require_format2 = __commonJS({
|
|
|
136168
136168
|
if (typeof stats === "object") {
|
|
136169
136169
|
const fileName = stats.moduleName ? `File: ${stats.moduleName}
|
|
136170
136170
|
` : "";
|
|
136171
|
-
const mainMessage = stats.message;
|
|
136171
|
+
const mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
|
|
136172
136172
|
const details = stats.details ? `
|
|
136173
136173
|
Details: ${stats.details}
|
|
136174
136174
|
` : "";
|
|
@@ -139529,6 +139529,143 @@ var require_getTargetDir = __commonJS({
|
|
|
139529
139529
|
}
|
|
139530
139530
|
});
|
|
139531
139531
|
|
|
139532
|
+
// ../../../toolkit/utils/dist/babel.js
|
|
139533
|
+
var require_babel = __commonJS({
|
|
139534
|
+
"../../../toolkit/utils/dist/babel.js"(exports, module2) {
|
|
139535
|
+
var __defProp2 = Object.defineProperty;
|
|
139536
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
139537
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
139538
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
139539
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
139540
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
139541
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
139542
|
+
var __spreadValues2 = (a, b) => {
|
|
139543
|
+
for (var prop in b || (b = {}))
|
|
139544
|
+
if (__hasOwnProp2.call(b, prop))
|
|
139545
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
139546
|
+
if (__getOwnPropSymbols2)
|
|
139547
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
139548
|
+
if (__propIsEnum2.call(b, prop))
|
|
139549
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
139550
|
+
}
|
|
139551
|
+
return a;
|
|
139552
|
+
};
|
|
139553
|
+
var __export2 = (target, all) => {
|
|
139554
|
+
for (var name in all)
|
|
139555
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
139556
|
+
};
|
|
139557
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
139558
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
139559
|
+
for (let key of __getOwnPropNames2(from))
|
|
139560
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
139561
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
139562
|
+
}
|
|
139563
|
+
return to;
|
|
139564
|
+
};
|
|
139565
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
139566
|
+
var babel_exports = {};
|
|
139567
|
+
__export2(babel_exports, {
|
|
139568
|
+
applyUserBabelConfig: () => applyUserBabelConfig,
|
|
139569
|
+
getBabelUtils: () => getBabelUtils
|
|
139570
|
+
});
|
|
139571
|
+
module2.exports = __toCommonJS2(babel_exports);
|
|
139572
|
+
var import_path4 = require("path");
|
|
139573
|
+
var import_applyOptionsChain = require_applyOptionsChain2();
|
|
139574
|
+
var import_ensureArray = require_ensureArray2();
|
|
139575
|
+
var import_path22 = require_path2();
|
|
139576
|
+
var formatPath = (originPath) => {
|
|
139577
|
+
if ((0, import_path4.isAbsolute)(originPath)) {
|
|
139578
|
+
return originPath.split(import_path4.sep).join("/");
|
|
139579
|
+
}
|
|
139580
|
+
return originPath;
|
|
139581
|
+
};
|
|
139582
|
+
var getPluginItemName = (item) => {
|
|
139583
|
+
if (typeof item === "string") {
|
|
139584
|
+
return formatPath(item);
|
|
139585
|
+
}
|
|
139586
|
+
if (Array.isArray(item) && typeof item[0] === "string") {
|
|
139587
|
+
return formatPath(item[0]);
|
|
139588
|
+
}
|
|
139589
|
+
return null;
|
|
139590
|
+
};
|
|
139591
|
+
var addPlugins = (plugins, config) => {
|
|
139592
|
+
if (config.plugins) {
|
|
139593
|
+
config.plugins.push(...plugins);
|
|
139594
|
+
} else {
|
|
139595
|
+
config.plugins = plugins;
|
|
139596
|
+
}
|
|
139597
|
+
};
|
|
139598
|
+
var addPresets = (presets, config) => {
|
|
139599
|
+
if (config.presets) {
|
|
139600
|
+
config.presets.push(...presets);
|
|
139601
|
+
} else {
|
|
139602
|
+
config.presets = presets;
|
|
139603
|
+
}
|
|
139604
|
+
};
|
|
139605
|
+
var removePlugins = (plugins, config) => {
|
|
139606
|
+
if (!config.plugins) {
|
|
139607
|
+
return;
|
|
139608
|
+
}
|
|
139609
|
+
const removeList = (0, import_ensureArray.ensureArray)(plugins);
|
|
139610
|
+
config.plugins = config.plugins.filter((item) => {
|
|
139611
|
+
const name = getPluginItemName(item);
|
|
139612
|
+
if (name) {
|
|
139613
|
+
return !removeList.find((removeItem) => name.includes(removeItem));
|
|
139614
|
+
}
|
|
139615
|
+
return true;
|
|
139616
|
+
});
|
|
139617
|
+
};
|
|
139618
|
+
var removePresets = (presets, config) => {
|
|
139619
|
+
if (!config.presets) {
|
|
139620
|
+
return;
|
|
139621
|
+
}
|
|
139622
|
+
const removeList = (0, import_ensureArray.ensureArray)(presets);
|
|
139623
|
+
config.presets = config.presets.filter((item) => {
|
|
139624
|
+
const name = getPluginItemName(item);
|
|
139625
|
+
if (name) {
|
|
139626
|
+
return !removeList.find((removeItem) => name.includes(removeItem));
|
|
139627
|
+
}
|
|
139628
|
+
return true;
|
|
139629
|
+
});
|
|
139630
|
+
};
|
|
139631
|
+
var modifyPresetOptions = (presetName, options, presets = []) => {
|
|
139632
|
+
presets.forEach((preset, index) => {
|
|
139633
|
+
if (Array.isArray(preset)) {
|
|
139634
|
+
if (typeof preset[0] === "string" && (0, import_path22.normalizeToPosixPath)(preset[0]).includes(presetName)) {
|
|
139635
|
+
preset[1] = __spreadValues2(__spreadValues2({}, preset[1] || {}), options);
|
|
139636
|
+
}
|
|
139637
|
+
} else if (typeof preset === "string" && (0, import_path22.normalizeToPosixPath)(preset).includes(presetName)) {
|
|
139638
|
+
presets[index] = [preset, options];
|
|
139639
|
+
}
|
|
139640
|
+
});
|
|
139641
|
+
};
|
|
139642
|
+
var getBabelUtils = (config) => {
|
|
139643
|
+
const noop = () => {
|
|
139644
|
+
};
|
|
139645
|
+
return {
|
|
139646
|
+
addPlugins: (plugins) => addPlugins(plugins, config),
|
|
139647
|
+
addPresets: (presets) => addPresets(presets, config),
|
|
139648
|
+
removePlugins: (plugins) => removePlugins(plugins, config),
|
|
139649
|
+
removePresets: (presets) => removePresets(presets, config),
|
|
139650
|
+
// `addIncludes` and `addExcludes` are noop functions by default,
|
|
139651
|
+
// It can be overridden by `extraBabelUtils`.
|
|
139652
|
+
addIncludes: noop,
|
|
139653
|
+
addExcludes: noop,
|
|
139654
|
+
// Compat `presetEnvOptions` and `presetReactOptions` in Eden.
|
|
139655
|
+
modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
|
|
139656
|
+
modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
|
|
139657
|
+
};
|
|
139658
|
+
};
|
|
139659
|
+
var applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
|
|
139660
|
+
if (userBabelConfig) {
|
|
139661
|
+
const babelUtils = __spreadValues2(__spreadValues2({}, getBabelUtils(defaultOptions)), extraBabelUtils);
|
|
139662
|
+
return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
|
|
139663
|
+
}
|
|
139664
|
+
return defaultOptions;
|
|
139665
|
+
};
|
|
139666
|
+
}
|
|
139667
|
+
});
|
|
139668
|
+
|
|
139532
139669
|
// ../../../toolkit/utils/dist/index.js
|
|
139533
139670
|
var require_dist3 = __commonJS({
|
|
139534
139671
|
"../../../toolkit/utils/dist/index.js"(exports, module2) {
|
|
@@ -139592,6 +139729,7 @@ var require_dist3 = __commonJS({
|
|
|
139592
139729
|
__reExport(src_exports2, require_getCoreJsVersion(), module2.exports);
|
|
139593
139730
|
__reExport(src_exports2, require_react(), module2.exports);
|
|
139594
139731
|
__reExport(src_exports2, require_getTargetDir(), module2.exports);
|
|
139732
|
+
__reExport(src_exports2, require_babel(), module2.exports);
|
|
139595
139733
|
}
|
|
139596
139734
|
});
|
|
139597
139735
|
|
|
@@ -139681,6 +139819,7 @@ var ZH_LOCALE = {
|
|
|
139681
139819
|
self: "请选择你想创建的工程类型",
|
|
139682
139820
|
mwa: "Web 应用",
|
|
139683
139821
|
module: "Npm 模块",
|
|
139822
|
+
doc: "文档站",
|
|
139684
139823
|
monorepo: "Monorepo",
|
|
139685
139824
|
custom: "自定义",
|
|
139686
139825
|
default: "默认"
|
|
@@ -139777,6 +139916,7 @@ var EN_LOCALE = {
|
|
|
139777
139916
|
self: "Please select the solution you want to create",
|
|
139778
139917
|
mwa: "Web App",
|
|
139779
139918
|
module: "Npm Module",
|
|
139919
|
+
doc: "Doc Site",
|
|
139780
139920
|
monorepo: "Monorepo",
|
|
139781
139921
|
custom: "Custom Solution",
|
|
139782
139922
|
default: "Default"
|
|
@@ -139883,6 +140023,7 @@ var BooleanConfig = /* @__PURE__ */ ((BooleanConfig2) => {
|
|
|
139883
140023
|
var Solution = /* @__PURE__ */ ((Solution2) => {
|
|
139884
140024
|
Solution2["MWA"] = "mwa";
|
|
139885
140025
|
Solution2["Module"] = "module";
|
|
140026
|
+
Solution2["Doc"] = "doc";
|
|
139886
140027
|
Solution2["Monorepo"] = "monorepo";
|
|
139887
140028
|
return Solution2;
|
|
139888
140029
|
})(Solution || {});
|
|
@@ -139895,6 +140036,10 @@ var SolutionToolsMap = {
|
|
|
139895
140036
|
"module"
|
|
139896
140037
|
/* Module */
|
|
139897
140038
|
]: "@modern-js/module-tools",
|
|
140039
|
+
[
|
|
140040
|
+
"doc"
|
|
140041
|
+
/* Doc */
|
|
140042
|
+
]: "@modern-js/doc-tools",
|
|
139898
140043
|
[
|
|
139899
140044
|
"monorepo"
|
|
139900
140045
|
/* Monorepo */
|
|
@@ -139986,7 +140131,7 @@ var getPackageNameSchema = (extra = {}) => {
|
|
|
139986
140131
|
dependencies: [],
|
|
139987
140132
|
fulfill: {
|
|
139988
140133
|
state: {
|
|
139989
|
-
visible: Boolean(extra == null ? void 0 : extra.isMonorepoSubProject) || !(extra == null ? void 0 : extra.isMwa)
|
|
140134
|
+
visible: Boolean(extra == null ? void 0 : extra.isMonorepoSubProject) || !(extra == null ? void 0 : extra.isMwa) && !(extra == null ? void 0 : extra.isDoc)
|
|
139990
140135
|
}
|
|
139991
140136
|
}
|
|
139992
140137
|
}
|
|
@@ -140160,10 +140305,12 @@ function validatePackageName(value, packages, options) {
|
|
|
140160
140305
|
return { success: true };
|
|
140161
140306
|
}
|
|
140162
140307
|
function validatePackagePath(value, projectDir, options) {
|
|
140163
|
-
const { isMwa, isPublic, isTest } = options || {};
|
|
140308
|
+
const { isMwa, isPublic, isTest, isDoc } = options || {};
|
|
140164
140309
|
let dir = "apps";
|
|
140165
140310
|
if (isMwa && isTest) {
|
|
140166
140311
|
dir = "examples";
|
|
140312
|
+
} else if (isDoc) {
|
|
140313
|
+
dir = "website";
|
|
140167
140314
|
} else {
|
|
140168
140315
|
dir = isPublic ? "packages" : "features";
|
|
140169
140316
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "3.0
|
|
14
|
+
"version": "3.1.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"files": [
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"@modern-js/codesmith": "2.0.5",
|
|
24
24
|
"@modern-js/codesmith-api-app": "2.0.5",
|
|
25
25
|
"@modern-js/codesmith-api-json": "2.0.5",
|
|
26
|
-
"@types/jest": "^
|
|
26
|
+
"@types/jest": "^29",
|
|
27
27
|
"@types/node": "^14",
|
|
28
|
-
"jest": "^
|
|
28
|
+
"jest": "^29",
|
|
29
29
|
"typescript": "^4",
|
|
30
|
-
"@modern-js/generator
|
|
31
|
-
"@modern-js/
|
|
32
|
-
"@modern-js/generator-utils": "3.0
|
|
33
|
-
"@modern-js/packages-generator": "3.0
|
|
34
|
-
"@modern-js/
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/dependence-generator": "3.0
|
|
37
|
-
"@modern-js/
|
|
38
|
-
"@scripts/build": "2.
|
|
39
|
-
"@scripts/jest-config": "2.
|
|
30
|
+
"@modern-js/base-generator": "3.1.0",
|
|
31
|
+
"@modern-js/generator-common": "3.1.0",
|
|
32
|
+
"@modern-js/generator-utils": "3.1.0",
|
|
33
|
+
"@modern-js/packages-generator": "3.1.0",
|
|
34
|
+
"@modern-js/rspack-generator": "3.1.0",
|
|
35
|
+
"@modern-js/plugin-i18n": "2.10.0",
|
|
36
|
+
"@modern-js/dependence-generator": "3.1.0",
|
|
37
|
+
"@modern-js/entry-generator": "3.1.0",
|
|
38
|
+
"@scripts/build": "2.10.0",
|
|
39
|
+
"@scripts/jest-config": "2.10.0"
|
|
40
40
|
},
|
|
41
41
|
"sideEffects": false,
|
|
42
42
|
"publishConfig": {
|