@modern-js/repo-generator 0.0.0-next-20221017080123 → 0.0.0-next-20221020075751
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 +47 -18
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -112736,7 +112736,7 @@ var init_zh = __esmMin(() => {
|
|
|
112736
112736
|
},
|
|
112737
112737
|
refactor: {
|
|
112738
112738
|
self: "\u81EA\u52A8\u91CD\u6784",
|
|
112739
|
-
|
|
112739
|
+
react_router_5: "\u4F7F\u7528 React Router v5"
|
|
112740
112740
|
}
|
|
112741
112741
|
},
|
|
112742
112742
|
"boolean": {
|
|
@@ -112835,7 +112835,7 @@ var init_en = __esmMin(() => {
|
|
|
112835
112835
|
},
|
|
112836
112836
|
refactor: {
|
|
112837
112837
|
self: "Automatic refactor",
|
|
112838
|
-
|
|
112838
|
+
react_router_5: "Use React Router v5"
|
|
112839
112839
|
}
|
|
112840
112840
|
},
|
|
112841
112841
|
"boolean": {
|
|
@@ -113441,7 +113441,7 @@ var init_common3 = __esmMin(() => {
|
|
|
113441
113441
|
ActionFunction2["Proxy"] = "proxy";
|
|
113442
113442
|
})(ActionFunction || (ActionFunction = {}));
|
|
113443
113443
|
(function(ActionRefactor2) {
|
|
113444
|
-
ActionRefactor2["
|
|
113444
|
+
ActionRefactor2["ReactRouter5"] = "react_router_5";
|
|
113445
113445
|
})(ActionRefactor || (ActionRefactor = {}));
|
|
113446
113446
|
ActionTypeText = (_ActionTypeText = {}, _defineProperty(_ActionTypeText, ActionType.Function, function() {
|
|
113447
113447
|
return i18n.t(localeKeys.action["function"].self);
|
|
@@ -113484,20 +113484,17 @@ var init_common3 = __esmMin(() => {
|
|
|
113484
113484
|
}), _defineProperty(_ActionFunctionText, ActionFunction.Proxy, function() {
|
|
113485
113485
|
return i18n.t(localeKeys.action["function"].proxy);
|
|
113486
113486
|
}), _ActionFunctionText);
|
|
113487
|
-
ActionRefactorText = _defineProperty({}, ActionRefactor.
|
|
113488
|
-
return i18n.t(localeKeys.action.refactor.
|
|
113487
|
+
ActionRefactorText = _defineProperty({}, ActionRefactor.ReactRouter5, function() {
|
|
113488
|
+
return i18n.t(localeKeys.action.refactor.react_router_5);
|
|
113489
113489
|
});
|
|
113490
113490
|
ActionTypeTextMap = (_ActionTypeTextMap = {}, _defineProperty(_ActionTypeTextMap, ActionType.Element, ActionElementText), _defineProperty(_ActionTypeTextMap, ActionType.Function, ActionFunctionText), _defineProperty(_ActionTypeTextMap, ActionType.Refactor, ActionRefactorText), _ActionTypeTextMap);
|
|
113491
113491
|
});
|
|
113492
|
-
var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, getMWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWANewActionGenerators;
|
|
113492
|
+
var _MWAActionTypesMap, _MWAActionFunctionsDe, _MWAActionFunctionsDe2, _MWAActionFunctionsAp, _ActionType$Element, _ActionType$Function, _MWANewActionGenerato, MWAActionTypes, MWAActionFunctions, MWAActionElements, MWAActionReactors, MWAActionTypesMap, getMWANewActionSchema, MWAActionFunctionsDevDependencies, MWAActionFunctionsDependencies, MWAActionFunctionsAppendTypeContent, MWAActionRefactorDependencies, MWAActionReactorAppendTypeContent, MWANewActionGenerators;
|
|
113493
113493
|
var init_mwa2 = __esmMin(() => {
|
|
113494
113494
|
init_defineProperty();
|
|
113495
113495
|
init_common3();
|
|
113496
113496
|
init_locale2();
|
|
113497
|
-
MWAActionTypes = [
|
|
113498
|
-
ActionType.Element,
|
|
113499
|
-
ActionType.Function
|
|
113500
|
-
];
|
|
113497
|
+
MWAActionTypes = [ActionType.Element, ActionType.Function, ActionType.Refactor];
|
|
113501
113498
|
MWAActionFunctions = [
|
|
113502
113499
|
ActionFunction.TailwindCSS,
|
|
113503
113500
|
ActionFunction.Less,
|
|
@@ -113511,15 +113508,18 @@ var init_mwa2 = __esmMin(() => {
|
|
|
113511
113508
|
ActionFunction.Proxy
|
|
113512
113509
|
];
|
|
113513
113510
|
MWAActionElements = [ActionElement.Entry, ActionElement.Server];
|
|
113514
|
-
MWAActionReactors = [ActionRefactor.
|
|
113511
|
+
MWAActionReactors = [ActionRefactor.ReactRouter5];
|
|
113515
113512
|
MWAActionTypesMap = (_MWAActionTypesMap = {}, _defineProperty(_MWAActionTypesMap, ActionType.Element, MWAActionElements), _defineProperty(_MWAActionTypesMap, ActionType.Function, MWAActionFunctions), _defineProperty(_MWAActionTypesMap, ActionType.Refactor, MWAActionReactors), _MWAActionTypesMap);
|
|
113516
113513
|
getMWANewActionSchema = function getMWANewActionSchema2() {
|
|
113517
113514
|
var _properties;
|
|
113518
113515
|
var extra = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
113519
|
-
var _extra$funcMap = extra.funcMap, funcMap = _extra$funcMap === void 0 ? {} : _extra$funcMap;
|
|
113516
|
+
var _extra$funcMap = extra.funcMap, funcMap = _extra$funcMap === void 0 ? {} : _extra$funcMap, _extra$refactorMap = extra.refactorMap, refactorMap = _extra$refactorMap === void 0 ? {} : _extra$refactorMap;
|
|
113520
113517
|
var funcs = MWAActionFunctions.filter(function(func) {
|
|
113521
113518
|
return !funcMap[func];
|
|
113522
113519
|
});
|
|
113520
|
+
var refactors = MWAActionReactors.filter(function(reactor) {
|
|
113521
|
+
return !refactorMap[reactor];
|
|
113522
|
+
});
|
|
113523
113523
|
return {
|
|
113524
113524
|
type: "object",
|
|
113525
113525
|
properties: (_properties = {
|
|
@@ -113528,6 +113528,8 @@ var init_mwa2 = __esmMin(() => {
|
|
|
113528
113528
|
title: i18n.t(localeKeys.action.self),
|
|
113529
113529
|
"enum": MWAActionTypes.filter(function(type) {
|
|
113530
113530
|
return type === ActionType.Function ? funcs.length > 0 : true;
|
|
113531
|
+
}).filter(function(type) {
|
|
113532
|
+
return type === ActionType.Refactor ? refactors.length > 0 : true;
|
|
113531
113533
|
}).map(function(type) {
|
|
113532
113534
|
return {
|
|
113533
113535
|
value: type,
|
|
@@ -113570,13 +113572,32 @@ var init_mwa2 = __esmMin(() => {
|
|
|
113570
113572
|
}
|
|
113571
113573
|
}
|
|
113572
113574
|
}]
|
|
113575
|
+
}), _defineProperty(_properties, ActionType.Refactor, {
|
|
113576
|
+
type: "string",
|
|
113577
|
+
title: ActionTypeText[ActionType.Refactor](),
|
|
113578
|
+
"enum": refactors.map(function(refactor) {
|
|
113579
|
+
return {
|
|
113580
|
+
value: refactor,
|
|
113581
|
+
label: ActionRefactorText[refactor]()
|
|
113582
|
+
};
|
|
113583
|
+
}),
|
|
113584
|
+
"x-reactions": [{
|
|
113585
|
+
dependencies: ["actionType"],
|
|
113586
|
+
fulfill: {
|
|
113587
|
+
state: {
|
|
113588
|
+
visible: '{{$deps[0] === "refactor"}}'
|
|
113589
|
+
}
|
|
113590
|
+
}
|
|
113591
|
+
}]
|
|
113573
113592
|
}), _properties)
|
|
113574
113593
|
};
|
|
113575
113594
|
};
|
|
113576
113595
|
MWAActionFunctionsDevDependencies = (_MWAActionFunctionsDe = {}, _defineProperty(_MWAActionFunctionsDe, ActionFunction.Less, "@modern-js/plugin-less"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Sass, "@modern-js/plugin-sass"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.SSG, "@modern-js/plugin-ssg"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Test, "@modern-js/plugin-testing"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.E2ETest, "@modern-js/plugin-e2e"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Storybook, "@modern-js/plugin-storybook"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.Proxy, "@modern-js/plugin-proxy"), _defineProperty(_MWAActionFunctionsDe, ActionFunction.TailwindCSS, "tailwindcss"), _MWAActionFunctionsDe);
|
|
113577
113596
|
MWAActionFunctionsDependencies = (_MWAActionFunctionsDe2 = {}, _defineProperty(_MWAActionFunctionsDe2, ActionFunction.BFF, "@modern-js/plugin-bff"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.MicroFrontend, "@modern-js/plugin-garfish"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.I18n, "@modern-js/plugin-i18n"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.TailwindCSS, "@modern-js/plugin-tailwindcss"), _defineProperty(_MWAActionFunctionsDe2, ActionFunction.Polyfill, "@modern-js/plugin-polyfill"), _MWAActionFunctionsDe2);
|
|
113578
|
-
MWAActionFunctionsAppendTypeContent =
|
|
113579
|
-
|
|
113597
|
+
MWAActionFunctionsAppendTypeContent = (_MWAActionFunctionsAp = {}, _defineProperty(_MWAActionFunctionsAp, ActionFunction.MicroFrontend, "/// <reference types='@modern-js/plugin-garfish/types' />"), _defineProperty(_MWAActionFunctionsAp, ActionFunction.Test, "/// <reference types='@modern-js/plugin-testing/types' />"), _MWAActionFunctionsAp);
|
|
113598
|
+
MWAActionRefactorDependencies = _defineProperty({}, ActionRefactor.ReactRouter5, "@modern-js/plugin-router-legacy");
|
|
113599
|
+
MWAActionReactorAppendTypeContent = _defineProperty({}, ActionRefactor.ReactRouter5, "/// <reference types='@modern-js/plugin-router-legacy/types' />");
|
|
113600
|
+
MWANewActionGenerators = (_MWANewActionGenerato = {}, _defineProperty(_MWANewActionGenerato, ActionType.Element, (_ActionType$Element = {}, _defineProperty(_ActionType$Element, ActionElement.Entry, "@modern-js/entry-generator"), _defineProperty(_ActionType$Element, ActionElement.Server, "@modern-js/server-generator"), _ActionType$Element)), _defineProperty(_MWANewActionGenerato, ActionType.Function, (_ActionType$Function = {}, _defineProperty(_ActionType$Function, ActionFunction.TailwindCSS, "@modern-js/tailwindcss-generator"), _defineProperty(_ActionType$Function, ActionFunction.Less, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Sass, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.BFF, "@modern-js/bff-generator"), _defineProperty(_ActionType$Function, ActionFunction.MicroFrontend, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.I18n, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Test, "@modern-js/test-generator"), _defineProperty(_ActionType$Function, ActionFunction.E2ETest, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Doc, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Storybook, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.SSG, "@modern-js/ssg-generator"), _defineProperty(_ActionType$Function, ActionFunction.Polyfill, "@modern-js/dependence-generator"), _defineProperty(_ActionType$Function, ActionFunction.Proxy, "@modern-js/dependence-generator"), _ActionType$Function)), _defineProperty(_MWANewActionGenerato, ActionType.Refactor, _defineProperty({}, ActionRefactor.ReactRouter5, "@modern-js/router-legacy-generator")), _MWANewActionGenerato);
|
|
113580
113601
|
});
|
|
113581
113602
|
var _ModuleActionFunction, _ModuleActionFunction2, _ModuleActionFunction3, _ActionType$Function2, ModuleActionTypes, ModuleActionFunctions, ModuleActionTypesMap, ModuleSpecialSchemaMap, getModuleNewActionSchema, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, ModuleActionFunctionsDependencies, ModuleNewActionGenerators;
|
|
113582
113603
|
var init_module2 = __esmMin(() => {
|
|
@@ -113727,7 +113748,9 @@ __export2(treeshaking_exports5, {
|
|
|
113727
113748
|
MWAActionFunctionsAppendTypeContent: () => MWAActionFunctionsAppendTypeContent,
|
|
113728
113749
|
MWAActionFunctionsDependencies: () => MWAActionFunctionsDependencies,
|
|
113729
113750
|
MWAActionFunctionsDevDependencies: () => MWAActionFunctionsDevDependencies,
|
|
113751
|
+
MWAActionReactorAppendTypeContent: () => MWAActionReactorAppendTypeContent,
|
|
113730
113752
|
MWAActionReactors: () => MWAActionReactors,
|
|
113753
|
+
MWAActionRefactorDependencies: () => MWAActionRefactorDependencies,
|
|
113731
113754
|
MWAActionTypes: () => MWAActionTypes,
|
|
113732
113755
|
MWAActionTypesMap: () => MWAActionTypesMap,
|
|
113733
113756
|
MWADefaultBffConfig: () => MWADefaultBffConfig,
|
|
@@ -144977,7 +145000,7 @@ var require_node9 = __commonJSMin((exports) => {
|
|
|
144977
145000
|
const version5 = await getPackageVersion(packageName, registry2);
|
|
144978
145001
|
return version5;
|
|
144979
145002
|
};
|
|
144980
|
-
if (!packageName.startsWith("@modern-js")) {
|
|
145003
|
+
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
|
144981
145004
|
return getLatetPluginVersion();
|
|
144982
145005
|
}
|
|
144983
145006
|
const pkgPath = _path.default.join(__require.resolve(_generatorCommon.SolutionToolsMap[solution], {
|
|
@@ -146157,8 +146180,14 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146157
146180
|
const enable = (0, _utils.hasEnabledFunction)(func, _generatorCommon.MWAActionFunctionsDependencies, _generatorCommon.MWAActionFunctionsDevDependencies, {}, cwd);
|
|
146158
146181
|
funcMap[func] = enable;
|
|
146159
146182
|
});
|
|
146183
|
+
const refactorMap = {};
|
|
146184
|
+
_generatorCommon.MWAActionReactors.forEach((refactor) => {
|
|
146185
|
+
const enable = (0, _utils.hasEnabledFunction)(refactor, _generatorCommon.MWAActionRefactorDependencies, {}, {}, cwd);
|
|
146186
|
+
refactorMap[refactor] = enable;
|
|
146187
|
+
});
|
|
146160
146188
|
const ans = await appAPI.getInputBySchemaFunc(_generatorCommon.getMWANewActionSchema, _objectSpread(_objectSpread({}, UserConfig), {}, {
|
|
146161
|
-
funcMap
|
|
146189
|
+
funcMap,
|
|
146190
|
+
refactorMap
|
|
146162
146191
|
}));
|
|
146163
146192
|
const actionType = ans.actionType;
|
|
146164
146193
|
const action2 = ans[actionType];
|
|
@@ -146172,7 +146201,7 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146172
146201
|
});
|
|
146173
146202
|
};
|
|
146174
146203
|
const devDependency = _generatorCommon.MWAActionFunctionsDevDependencies[action2];
|
|
146175
|
-
const dependency = _generatorCommon.MWAActionFunctionsDependencies[action2];
|
|
146204
|
+
const dependency = _generatorCommon.MWAActionFunctionsDependencies[action2] || _generatorCommon.MWAActionRefactorDependencies[action2];
|
|
146176
146205
|
const finalConfig = (0, _lodash.merge)(UserConfig, ans, {
|
|
146177
146206
|
locale: UserConfig.locale || locale,
|
|
146178
146207
|
packageManager: UserConfig.packageManager || await (0, _generatorUtils.getPackageManager)(cwd)
|
|
@@ -146183,7 +146212,7 @@ var require_mwa = __commonJSMin((exports) => {
|
|
|
146183
146212
|
dependencies: dependency ? {
|
|
146184
146213
|
[dependency]: `${await getMwaPluginVersion(dependency)}`
|
|
146185
146214
|
} : {},
|
|
146186
|
-
appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[action2]
|
|
146215
|
+
appendTypeContent: _generatorCommon.MWAActionFunctionsAppendTypeContent[action2] || _generatorCommon.MWAActionReactorAppendTypeContent[action2]
|
|
146187
146216
|
});
|
|
146188
146217
|
const task = [{
|
|
146189
146218
|
name: generator,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-20221020075751",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"files": [
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/runtime": "^7.18.0",
|
|
26
|
-
"@modern-js/base-generator": "0.0.0-next-
|
|
26
|
+
"@modern-js/base-generator": "0.0.0-next-20221020075751",
|
|
27
27
|
"@modern-js/codesmith": "1.6.3",
|
|
28
28
|
"@modern-js/codesmith-api-app": "1.6.3",
|
|
29
|
-
"@modern-js/generator-common": "0.0.0-next-
|
|
30
|
-
"@modern-js/generator-plugin": "0.0.0-next-
|
|
31
|
-
"@modern-js/generator-utils": "0.0.0-next-
|
|
32
|
-
"@modern-js/module-generator": "0.0.0-next-
|
|
33
|
-
"@modern-js/monorepo-generator": "0.0.0-next-
|
|
34
|
-
"@modern-js/mwa-generator": "0.0.0-next-
|
|
35
|
-
"@modern-js/utils": "0.0.0-next-
|
|
36
|
-
"@scripts/build": "0.0.0-next-
|
|
37
|
-
"@scripts/jest-config": "0.0.0-next-
|
|
29
|
+
"@modern-js/generator-common": "0.0.0-next-20221020075751",
|
|
30
|
+
"@modern-js/generator-plugin": "0.0.0-next-20221020075751",
|
|
31
|
+
"@modern-js/generator-utils": "0.0.0-next-20221020075751",
|
|
32
|
+
"@modern-js/module-generator": "0.0.0-next-20221020075751",
|
|
33
|
+
"@modern-js/monorepo-generator": "0.0.0-next-20221020075751",
|
|
34
|
+
"@modern-js/mwa-generator": "0.0.0-next-20221020075751",
|
|
35
|
+
"@modern-js/utils": "0.0.0-next-20221020075751",
|
|
36
|
+
"@scripts/build": "0.0.0-next-20221020075751",
|
|
37
|
+
"@scripts/jest-config": "0.0.0-next-20221020075751",
|
|
38
38
|
"@types/jest": "^27",
|
|
39
39
|
"@types/node": "^14",
|
|
40
40
|
"jest": "^27",
|