@modern-js/repo-generator 0.0.0-canary-20211223065901 → 0.0.0-canary-20211223152722
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/js/node/main.js +283 -194
- package/package.json +8 -8
package/dist/js/node/main.js
CHANGED
|
@@ -101637,6 +101637,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
101637
101637
|
value: true
|
|
101638
101638
|
}));
|
|
101639
101639
|
exports.SubSolutionText = exports.SubSolutionSchema = exports.SubSolutionGenerator = exports.SubSolution = exports.SolutionText = exports.SolutionSchema = exports.SolutionGenerator = exports.Solution = exports.EslintGenerator = exports.EntryGenerator = exports.ElectronGenerator = exports.DependenceGenerator = exports.ChangesetGenerator = exports.BaseGenerator = void 0;
|
|
101640
|
+
exports.getSolutionNameFromSubSolution = getSolutionNameFromSubSolution;
|
|
101640
101641
|
|
|
101641
101642
|
var _locale = __webpack_require__(94646);
|
|
101642
101643
|
|
|
@@ -101712,7 +101713,7 @@ const SolutionSchema = {
|
|
|
101712
101713
|
if (data.solution && data.solution !== 'custom') {
|
|
101713
101714
|
items.push({
|
|
101714
101715
|
key: data.solution,
|
|
101715
|
-
label: SolutionText[data.solution]
|
|
101716
|
+
label: `${SolutionText[data.solution]()}(${_locale.i18n.t(_locale.localeKeys.solution.default)})`
|
|
101716
101717
|
});
|
|
101717
101718
|
}
|
|
101718
101719
|
|
|
@@ -101775,7 +101776,7 @@ const SubSolutionSchema = {
|
|
|
101775
101776
|
if (data.solution && data.solution !== 'custom') {
|
|
101776
101777
|
items.push({
|
|
101777
101778
|
key: data.solution,
|
|
101778
|
-
label: SolutionText[data.solution]
|
|
101779
|
+
label: `${SolutionText[data.solution]()}(${_locale.i18n.t(_locale.localeKeys.solution.default)})`
|
|
101779
101780
|
});
|
|
101780
101781
|
}
|
|
101781
101782
|
|
|
@@ -102023,7 +102024,8 @@ const EN_LOCALE = {
|
|
|
102023
102024
|
mwa: 'MWA Solution',
|
|
102024
102025
|
module: 'Module Solution',
|
|
102025
102026
|
monorepo: 'Monorepo Solution',
|
|
102026
|
-
custom: 'Custom Solution'
|
|
102027
|
+
custom: 'Custom Solution',
|
|
102028
|
+
default: 'Default'
|
|
102027
102029
|
},
|
|
102028
102030
|
scenes: {
|
|
102029
102031
|
self: 'Please select the scense you want to create'
|
|
@@ -102188,7 +102190,8 @@ const ZH_LOCALE = {
|
|
|
102188
102190
|
mwa: '应用',
|
|
102189
102191
|
module: '模块',
|
|
102190
102192
|
monorepo: '项目组',
|
|
102191
|
-
custom: '自定义'
|
|
102193
|
+
custom: '自定义',
|
|
102194
|
+
default: '默认'
|
|
102192
102195
|
},
|
|
102193
102196
|
scenes: {
|
|
102194
102197
|
self: '请选择项目场景'
|
|
@@ -103339,7 +103342,7 @@ exports.MWANewActionGenerators = MWANewActionGenerators;
|
|
|
103339
103342
|
|
|
103340
103343
|
/***/ }),
|
|
103341
103344
|
|
|
103342
|
-
/***/
|
|
103345
|
+
/***/ 97763:
|
|
103343
103346
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
103344
103347
|
|
|
103345
103348
|
"use strict";
|
|
@@ -103359,6 +103362,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
103359
103362
|
"PluginInputContext": () => (/* reexport */ PluginInputContext),
|
|
103360
103363
|
"PluginNewAPI": () => (/* reexport */ PluginNewAPI),
|
|
103361
103364
|
"PluginNpmAPI": () => (/* reexport */ PluginNpmAPI),
|
|
103365
|
+
"PluginType": () => (/* reexport */ PluginType),
|
|
103362
103366
|
"installPlugins": () => (/* reexport */ utils_installPlugins)
|
|
103363
103367
|
});
|
|
103364
103368
|
|
|
@@ -103397,9 +103401,6 @@ var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_);
|
|
|
103397
103401
|
// EXTERNAL MODULE: ../../../../node_modules/.pnpm/package-json@7.0.0/node_modules/package-json/index.js
|
|
103398
103402
|
var package_json = __webpack_require__(27499);
|
|
103399
103403
|
var package_json_default = /*#__PURE__*/__webpack_require__.n(package_json);
|
|
103400
|
-
// EXTERNAL MODULE: ../../../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/index.js
|
|
103401
|
-
var lib = __webpack_require__(96576);
|
|
103402
|
-
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|
103403
103404
|
// EXTERNAL MODULE: ../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js
|
|
103404
103405
|
var get = __webpack_require__(71189);
|
|
103405
103406
|
var get_default = /*#__PURE__*/__webpack_require__.n(get);
|
|
@@ -103482,14 +103483,46 @@ class I18n {
|
|
|
103482
103483
|
}
|
|
103483
103484
|
|
|
103484
103485
|
|
|
103485
|
-
;// CONCATENATED MODULE: ../../generator-
|
|
103486
|
+
;// CONCATENATED MODULE: ../../generator-utils/dist/js/modern/locale/zh.js
|
|
103486
103487
|
const ZH_LOCALE = {
|
|
103488
|
+
packageName: {
|
|
103489
|
+
exit: '项目名称 {value} 已存在'
|
|
103490
|
+
},
|
|
103491
|
+
pacakgePath: {
|
|
103492
|
+
exit: '目录 {value} 已存在'
|
|
103493
|
+
}
|
|
103494
|
+
};
|
|
103495
|
+
;// CONCATENATED MODULE: ../../generator-utils/dist/js/modern/locale/en.js
|
|
103496
|
+
const EN_LOCALE = {
|
|
103497
|
+
packageName: {
|
|
103498
|
+
exit: 'package name `{value}` is already exists'
|
|
103499
|
+
},
|
|
103500
|
+
pacakgePath: {
|
|
103501
|
+
exit: 'package path {value} is already exists'
|
|
103502
|
+
}
|
|
103503
|
+
};
|
|
103504
|
+
;// CONCATENATED MODULE: ../../generator-utils/dist/js/modern/locale/index.js
|
|
103505
|
+
|
|
103506
|
+
|
|
103507
|
+
|
|
103508
|
+
const locale_i18n = new I18n();
|
|
103509
|
+
const locale_localeKeys = locale_i18n.init('zh', {
|
|
103510
|
+
zh: ZH_LOCALE,
|
|
103511
|
+
en: EN_LOCALE
|
|
103512
|
+
});
|
|
103513
|
+
|
|
103514
|
+
// EXTERNAL MODULE: ../../../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/index.js
|
|
103515
|
+
var lib = __webpack_require__(96576);
|
|
103516
|
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|
103517
|
+
;// CONCATENATED MODULE: ../../generator-common/dist/js/modern/locale/zh.js
|
|
103518
|
+
const zh_ZH_LOCALE = {
|
|
103487
103519
|
solution: {
|
|
103488
103520
|
self: '请选择你想创建的工程类型',
|
|
103489
103521
|
mwa: '应用',
|
|
103490
103522
|
module: '模块',
|
|
103491
103523
|
monorepo: '项目组',
|
|
103492
|
-
custom: '自定义'
|
|
103524
|
+
custom: '自定义',
|
|
103525
|
+
default: '默认'
|
|
103493
103526
|
},
|
|
103494
103527
|
scenes: {
|
|
103495
103528
|
self: '请选择项目场景'
|
|
@@ -103608,13 +103641,14 @@ const ZH_LOCALE = {
|
|
|
103608
103641
|
}
|
|
103609
103642
|
};
|
|
103610
103643
|
;// CONCATENATED MODULE: ../../generator-common/dist/js/modern/locale/en.js
|
|
103611
|
-
const
|
|
103644
|
+
const en_EN_LOCALE = {
|
|
103612
103645
|
solution: {
|
|
103613
103646
|
self: 'Please select the solution you want to create',
|
|
103614
103647
|
mwa: 'MWA Solution',
|
|
103615
103648
|
module: 'Module Solution',
|
|
103616
103649
|
monorepo: 'Monorepo Solution',
|
|
103617
|
-
custom: 'Custom Solution'
|
|
103650
|
+
custom: 'Custom Solution',
|
|
103651
|
+
default: 'Default'
|
|
103618
103652
|
},
|
|
103619
103653
|
scenes: {
|
|
103620
103654
|
self: 'Please select the scense you want to create'
|
|
@@ -103736,10 +103770,10 @@ const EN_LOCALE = {
|
|
|
103736
103770
|
|
|
103737
103771
|
|
|
103738
103772
|
|
|
103739
|
-
const
|
|
103740
|
-
const
|
|
103741
|
-
zh:
|
|
103742
|
-
en:
|
|
103773
|
+
const modern_locale_i18n = new I18n();
|
|
103774
|
+
const modern_locale_localeKeys = modern_locale_i18n.init('zh', {
|
|
103775
|
+
zh: zh_ZH_LOCALE,
|
|
103776
|
+
en: en_EN_LOCALE
|
|
103743
103777
|
});
|
|
103744
103778
|
|
|
103745
103779
|
;// CONCATENATED MODULE: ../../generator-common/dist/js/modern/common/package-manager.js
|
|
@@ -103758,7 +103792,7 @@ const PackageManagerName = {
|
|
|
103758
103792
|
const PackageManagerSchema = {
|
|
103759
103793
|
key: 'packageManager',
|
|
103760
103794
|
type: ['string'],
|
|
103761
|
-
label: () =>
|
|
103795
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.packageManager.self),
|
|
103762
103796
|
mutualExclusion: true,
|
|
103763
103797
|
when: (_values, extra) => !(extra !== null && extra !== void 0 && extra.isMonorepoSubProject),
|
|
103764
103798
|
items: Object.values(PackageManager).map(packageManager => ({
|
|
@@ -103797,22 +103831,22 @@ let SubSolution;
|
|
|
103797
103831
|
})(SubSolution || (SubSolution = {}));
|
|
103798
103832
|
|
|
103799
103833
|
const SolutionText = {
|
|
103800
|
-
[Solution.MWA]: () =>
|
|
103801
|
-
[Solution.Module]: () =>
|
|
103802
|
-
[Solution.Monorepo]: () =>
|
|
103834
|
+
[Solution.MWA]: () => modern_locale_i18n.t(modern_locale_localeKeys.solution.mwa),
|
|
103835
|
+
[Solution.Module]: () => modern_locale_i18n.t(modern_locale_localeKeys.solution.module),
|
|
103836
|
+
[Solution.Monorepo]: () => modern_locale_i18n.t(modern_locale_localeKeys.solution.monorepo)
|
|
103803
103837
|
};
|
|
103804
103838
|
const SubSolutionText = {
|
|
103805
|
-
[SubSolution.MWA]: () =>
|
|
103806
|
-
[SubSolution.MWATest]: () =>
|
|
103807
|
-
[SubSolution.Module]: () =>
|
|
103808
|
-
[SubSolution.InnerModule]: () =>
|
|
103839
|
+
[SubSolution.MWA]: () => modern_locale_i18n.t(modern_locale_localeKeys.sub_solution.mwa),
|
|
103840
|
+
[SubSolution.MWATest]: () => modern_locale_i18n.t(modern_locale_localeKeys.sub_solution.mwa_test),
|
|
103841
|
+
[SubSolution.Module]: () => modern_locale_i18n.t(modern_locale_localeKeys.sub_solution.module),
|
|
103842
|
+
[SubSolution.InnerModule]: () => modern_locale_i18n.t(modern_locale_localeKeys.sub_solution.inner_module)
|
|
103809
103843
|
};
|
|
103810
103844
|
const SolutionSchema = {
|
|
103811
103845
|
key: 'solution_schema',
|
|
103812
103846
|
isObject: true,
|
|
103813
103847
|
items: [{
|
|
103814
103848
|
key: 'solution',
|
|
103815
|
-
label: () =>
|
|
103849
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.solution.self),
|
|
103816
103850
|
type: ['string'],
|
|
103817
103851
|
mutualExclusion: true,
|
|
103818
103852
|
items: (_data, extra) => {
|
|
@@ -103826,7 +103860,7 @@ const SolutionSchema = {
|
|
|
103826
103860
|
if (extra !== null && extra !== void 0 && (_extra$customPlugin = extra.customPlugin) !== null && _extra$customPlugin !== void 0 && (_extra$customPlugin$c = _extra$customPlugin.custom) !== null && _extra$customPlugin$c !== void 0 && _extra$customPlugin$c.length) {
|
|
103827
103861
|
return [...items, {
|
|
103828
103862
|
key: 'custom',
|
|
103829
|
-
label:
|
|
103863
|
+
label: modern_locale_i18n.t(modern_locale_localeKeys.solution.custom)
|
|
103830
103864
|
}];
|
|
103831
103865
|
}
|
|
103832
103866
|
|
|
@@ -103834,7 +103868,7 @@ const SolutionSchema = {
|
|
|
103834
103868
|
}
|
|
103835
103869
|
}, {
|
|
103836
103870
|
key: 'scenes',
|
|
103837
|
-
label: () =>
|
|
103871
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.scenes.self),
|
|
103838
103872
|
type: ['string'],
|
|
103839
103873
|
mutualExclusion: true,
|
|
103840
103874
|
when: (data, extra) => (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[data.solution] && extra.customPlugin[data.solution].length > 0,
|
|
@@ -103847,7 +103881,7 @@ const SolutionSchema = {
|
|
|
103847
103881
|
if (data.solution && data.solution !== 'custom') {
|
|
103848
103882
|
items.push({
|
|
103849
103883
|
key: data.solution,
|
|
103850
|
-
label: SolutionText[data.solution]
|
|
103884
|
+
label: `${SolutionText[data.solution]()}(${modern_locale_i18n.t(modern_locale_localeKeys.solution["default"])})`
|
|
103851
103885
|
});
|
|
103852
103886
|
}
|
|
103853
103887
|
|
|
@@ -103855,7 +103889,6 @@ const SolutionSchema = {
|
|
|
103855
103889
|
}
|
|
103856
103890
|
}]
|
|
103857
103891
|
};
|
|
103858
|
-
|
|
103859
103892
|
function getSolutionNameFromSubSolution(solution) {
|
|
103860
103893
|
if (solution === SubSolution.MWATest) {
|
|
103861
103894
|
return Solution.MWA;
|
|
@@ -103867,13 +103900,12 @@ function getSolutionNameFromSubSolution(solution) {
|
|
|
103867
103900
|
|
|
103868
103901
|
return solution;
|
|
103869
103902
|
}
|
|
103870
|
-
|
|
103871
103903
|
const SubSolutionSchema = {
|
|
103872
103904
|
key: 'sub_solution_schema',
|
|
103873
103905
|
isObject: true,
|
|
103874
103906
|
items: [{
|
|
103875
103907
|
key: 'solution',
|
|
103876
|
-
label: () =>
|
|
103908
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.sub_solution.self),
|
|
103877
103909
|
type: ['string'],
|
|
103878
103910
|
mutualExclusion: true,
|
|
103879
103911
|
items: (_data, extra) => {
|
|
@@ -103887,7 +103919,7 @@ const SubSolutionSchema = {
|
|
|
103887
103919
|
if (extra !== null && extra !== void 0 && (_extra$customPlugin2 = extra.customPlugin) !== null && _extra$customPlugin2 !== void 0 && (_extra$customPlugin2$ = _extra$customPlugin2.custom) !== null && _extra$customPlugin2$ !== void 0 && _extra$customPlugin2$.length) {
|
|
103888
103920
|
return [...items, {
|
|
103889
103921
|
key: 'custom',
|
|
103890
|
-
label:
|
|
103922
|
+
label: modern_locale_i18n.t(modern_locale_localeKeys.solution.custom)
|
|
103891
103923
|
}];
|
|
103892
103924
|
}
|
|
103893
103925
|
|
|
@@ -103895,7 +103927,7 @@ const SubSolutionSchema = {
|
|
|
103895
103927
|
}
|
|
103896
103928
|
}, {
|
|
103897
103929
|
key: 'scenes',
|
|
103898
|
-
label: () =>
|
|
103930
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.scenes.self),
|
|
103899
103931
|
type: ['string'],
|
|
103900
103932
|
mutualExclusion: true,
|
|
103901
103933
|
when: (data, extra) => (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)] && extra.customPlugin[getSolutionNameFromSubSolution(data.solution)].length > 0,
|
|
@@ -103909,7 +103941,7 @@ const SubSolutionSchema = {
|
|
|
103909
103941
|
if (data.solution && data.solution !== 'custom') {
|
|
103910
103942
|
items.push({
|
|
103911
103943
|
key: data.solution,
|
|
103912
|
-
label: SolutionText[data.solution]
|
|
103944
|
+
label: `${SolutionText[data.solution]()}(${modern_locale_i18n.t(modern_locale_localeKeys.solution["default"])})`
|
|
103913
103945
|
});
|
|
103914
103946
|
}
|
|
103915
103947
|
|
|
@@ -103944,8 +103976,8 @@ let BooleanConfig;
|
|
|
103944
103976
|
})(BooleanConfig || (BooleanConfig = {}));
|
|
103945
103977
|
|
|
103946
103978
|
const BooleanConfigName = {
|
|
103947
|
-
[BooleanConfig.NO]: () =>
|
|
103948
|
-
[BooleanConfig.YES]: () =>
|
|
103979
|
+
[BooleanConfig.NO]: () => modern_locale_i18n.t(modern_locale_localeKeys.boolean.no),
|
|
103980
|
+
[BooleanConfig.YES]: () => modern_locale_i18n.t(modern_locale_localeKeys.boolean.yes)
|
|
103949
103981
|
};
|
|
103950
103982
|
const BooleanSchemas = [{
|
|
103951
103983
|
key: BooleanConfig.NO,
|
|
@@ -103958,14 +103990,14 @@ const BooleanSchemas = [{
|
|
|
103958
103990
|
|
|
103959
103991
|
const PackageNameSchema = {
|
|
103960
103992
|
key: 'packageName',
|
|
103961
|
-
label: (_, extra) => extra !== null && extra !== void 0 && extra.isMonorepoSubProject ?
|
|
103993
|
+
label: (_, extra) => extra !== null && extra !== void 0 && extra.isMonorepoSubProject ? modern_locale_i18n.t(modern_locale_localeKeys.packageName.sub_name) : modern_locale_i18n.t(modern_locale_localeKeys.packageName.self),
|
|
103962
103994
|
type: ['string'],
|
|
103963
103995
|
when: (_, extra) => Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra !== null && extra !== void 0 && extra.isMwa),
|
|
103964
103996
|
validate: value => {
|
|
103965
103997
|
if (!value) {
|
|
103966
103998
|
return {
|
|
103967
103999
|
success: false,
|
|
103968
|
-
message:
|
|
104000
|
+
message: modern_locale_i18n.t(modern_locale_localeKeys.packageName.no_empty)
|
|
103969
104001
|
};
|
|
103970
104002
|
}
|
|
103971
104003
|
|
|
@@ -103979,7 +104011,7 @@ const PackageNameSchema = {
|
|
|
103979
104011
|
const PackagePathRegex = new RegExp('^[a-z0-9]*[-_/]?([a-z0-9]*[-_]?[a-z0-9]*)*[-_/]?[a-z0-9-_]+$');
|
|
103980
104012
|
const PackagePathSchema = {
|
|
103981
104013
|
key: 'packagePath',
|
|
103982
|
-
label: () =>
|
|
104014
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.packagePath.self),
|
|
103983
104015
|
type: ['string'],
|
|
103984
104016
|
when: (_, extra) => Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject),
|
|
103985
104017
|
state: {
|
|
@@ -103992,14 +104024,14 @@ const PackagePathSchema = {
|
|
|
103992
104024
|
if (!value) {
|
|
103993
104025
|
return {
|
|
103994
104026
|
success: false,
|
|
103995
|
-
message:
|
|
104027
|
+
message: modern_locale_i18n.t(modern_locale_localeKeys.packagePath.no_empty)
|
|
103996
104028
|
};
|
|
103997
104029
|
}
|
|
103998
104030
|
|
|
103999
104031
|
if (!PackagePathRegex.test(value)) {
|
|
104000
104032
|
return {
|
|
104001
104033
|
success: false,
|
|
104002
|
-
message:
|
|
104034
|
+
message: modern_locale_i18n.t(modern_locale_localeKeys.packagePath.format)
|
|
104003
104035
|
};
|
|
104004
104036
|
}
|
|
104005
104037
|
|
|
@@ -104024,7 +104056,7 @@ const LanguageName = {
|
|
|
104024
104056
|
const LanguageSchema = {
|
|
104025
104057
|
key: 'language',
|
|
104026
104058
|
type: ['string'],
|
|
104027
|
-
label: () =>
|
|
104059
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.language.self),
|
|
104028
104060
|
mutualExclusion: true,
|
|
104029
104061
|
items: Object.values(Language).map(language => ({
|
|
104030
104062
|
key: language,
|
|
@@ -104037,7 +104069,7 @@ const LanguageSchema = {
|
|
|
104037
104069
|
const EnableLessSchema = {
|
|
104038
104070
|
key: 'enableLess',
|
|
104039
104071
|
type: ['string'],
|
|
104040
|
-
label: () =>
|
|
104072
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.needModifyConfig.enableLess),
|
|
104041
104073
|
mutualExclusion: true,
|
|
104042
104074
|
state: {
|
|
104043
104075
|
value: BooleanConfig.NO
|
|
@@ -104047,7 +104079,7 @@ const EnableLessSchema = {
|
|
|
104047
104079
|
const EnableSassSchema = {
|
|
104048
104080
|
key: 'enableSass',
|
|
104049
104081
|
type: ['string'],
|
|
104050
|
-
label: () =>
|
|
104082
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.needModifyConfig.enableSass),
|
|
104051
104083
|
mutualExclusion: true,
|
|
104052
104084
|
state: {
|
|
104053
104085
|
value: BooleanConfig.NO
|
|
@@ -104073,7 +104105,7 @@ const EnableModuleSassSchema = _objectSpread(_objectSpread({}, EnableSassSchema)
|
|
|
104073
104105
|
});
|
|
104074
104106
|
const NeedModifyModuleConfigSchema = {
|
|
104075
104107
|
key: 'needModifyModuleConfig',
|
|
104076
|
-
label: () =>
|
|
104108
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.needModifyConfig.self),
|
|
104077
104109
|
type: ['string'],
|
|
104078
104110
|
mutualExclusion: true,
|
|
104079
104111
|
state: {
|
|
@@ -104126,7 +104158,7 @@ let RunWay;
|
|
|
104126
104158
|
const RunWaySchema = {
|
|
104127
104159
|
key: 'runWay',
|
|
104128
104160
|
type: ['string'],
|
|
104129
|
-
label: () =>
|
|
104161
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.runWay.self),
|
|
104130
104162
|
mutualExclusion: true,
|
|
104131
104163
|
when: (_, extra) => (extra === null || extra === void 0 ? void 0 : extra.isEmptySrc) === undefined ? true : Boolean(extra === null || extra === void 0 ? void 0 : extra.isEmptySrc),
|
|
104132
104164
|
state: {
|
|
@@ -104134,7 +104166,7 @@ const RunWaySchema = {
|
|
|
104134
104166
|
},
|
|
104135
104167
|
items: Object.values(RunWay).map(runWay => ({
|
|
104136
104168
|
key: runWay,
|
|
104137
|
-
label: () =>
|
|
104169
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.runWay[runWay])
|
|
104138
104170
|
}))
|
|
104139
104171
|
};
|
|
104140
104172
|
let ClientRoute;
|
|
@@ -104148,7 +104180,7 @@ let ClientRoute;
|
|
|
104148
104180
|
const ClientRouteSchema = {
|
|
104149
104181
|
key: 'clientRoute',
|
|
104150
104182
|
type: ['string'],
|
|
104151
|
-
label: () =>
|
|
104183
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.entry.clientRoute.self),
|
|
104152
104184
|
mutualExclusion: true,
|
|
104153
104185
|
when: mwaConfigWhenFunc,
|
|
104154
104186
|
state: {
|
|
@@ -104156,13 +104188,13 @@ const ClientRouteSchema = {
|
|
|
104156
104188
|
},
|
|
104157
104189
|
items: Object.values(ClientRoute).map(clientRoute => ({
|
|
104158
104190
|
key: clientRoute,
|
|
104159
|
-
label: () =>
|
|
104191
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.entry.clientRoute[clientRoute])
|
|
104160
104192
|
}))
|
|
104161
104193
|
};
|
|
104162
104194
|
const DisableStateManagementSchema = {
|
|
104163
104195
|
key: 'disableStateManagement',
|
|
104164
104196
|
type: ['string'],
|
|
104165
|
-
label: () =>
|
|
104197
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.entry.disableStateManagement),
|
|
104166
104198
|
mutualExclusion: true,
|
|
104167
104199
|
when: mwaConfigWhenFunc,
|
|
104168
104200
|
state: {
|
|
@@ -104178,7 +104210,7 @@ const EnableMWASassSchema = common_objectSpread(common_objectSpread({}, EnableSa
|
|
|
104178
104210
|
});
|
|
104179
104211
|
const NeedModifyMWAConfigSchema = {
|
|
104180
104212
|
key: 'needModifyMWAConfig',
|
|
104181
|
-
label: () =>
|
|
104213
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.needModifyConfig.self),
|
|
104182
104214
|
type: ['string'],
|
|
104183
104215
|
mutualExclusion: true,
|
|
104184
104216
|
state: {
|
|
@@ -104198,11 +104230,11 @@ let Framework;
|
|
|
104198
104230
|
const FrameworkSchema = {
|
|
104199
104231
|
key: 'framework',
|
|
104200
104232
|
type: ['string'],
|
|
104201
|
-
label: () =>
|
|
104233
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.framework.self),
|
|
104202
104234
|
mutualExclusion: true,
|
|
104203
104235
|
items: Object.values(Framework).map(framework => ({
|
|
104204
104236
|
key: framework,
|
|
104205
|
-
label: () =>
|
|
104237
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.framework[framework])
|
|
104206
104238
|
}))
|
|
104207
104239
|
};
|
|
104208
104240
|
;// CONCATENATED MODULE: ../../generator-common/dist/js/modern/mwa/project.js
|
|
@@ -104992,7 +105024,7 @@ var PluginFileAPI = /*#__PURE__*/function () {
|
|
|
104992
105024
|
}
|
|
104993
105025
|
|
|
104994
105026
|
_context7.next = 8;
|
|
104995
|
-
return lib.
|
|
105027
|
+
return lib.rm(dir, {
|
|
104996
105028
|
recursive: true
|
|
104997
105029
|
});
|
|
104998
105030
|
|
|
@@ -105988,33 +106020,33 @@ let ActionRefactor;
|
|
|
105988
106020
|
})(ActionRefactor || (ActionRefactor = {}));
|
|
105989
106021
|
|
|
105990
106022
|
const ActionTypeText = {
|
|
105991
|
-
[ActionType.Function]: () =>
|
|
105992
|
-
[ActionType.Element]: () =>
|
|
105993
|
-
[ActionType.Refactor]: () =>
|
|
106023
|
+
[ActionType.Function]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].self),
|
|
106024
|
+
[ActionType.Element]: () => modern_locale_i18n.t(modern_locale_localeKeys.action.element.self),
|
|
106025
|
+
[ActionType.Refactor]: () => modern_locale_i18n.t(modern_locale_localeKeys.action.refactor.self)
|
|
105994
106026
|
};
|
|
105995
106027
|
const ActionElementText = {
|
|
105996
|
-
[ActionElement.Entry]: () =>
|
|
105997
|
-
[ActionElement.Server]: () =>
|
|
106028
|
+
[ActionElement.Entry]: () => modern_locale_i18n.t(modern_locale_localeKeys.action.element.entry),
|
|
106029
|
+
[ActionElement.Server]: () => modern_locale_i18n.t(modern_locale_localeKeys.action.element.server)
|
|
105998
106030
|
};
|
|
105999
106031
|
const ActionFunctionText = {
|
|
106000
|
-
[ActionFunction.UnBundle]: () =>
|
|
106001
|
-
[ActionFunction.TailwindCSS]: () =>
|
|
106002
|
-
[ActionFunction.Less]: () =>
|
|
106003
|
-
[ActionFunction.Sass]: () =>
|
|
106004
|
-
[ActionFunction.BFF]: () =>
|
|
106005
|
-
[ActionFunction.MicroFrontend]: () =>
|
|
106006
|
-
[ActionFunction.Electron]: () =>
|
|
106007
|
-
[ActionFunction.I18n]: () =>
|
|
106008
|
-
[ActionFunction.Test]: () =>
|
|
106009
|
-
[ActionFunction.E2ETest]: () =>
|
|
106010
|
-
[ActionFunction.Doc]: () =>
|
|
106011
|
-
[ActionFunction.Storybook]: () =>
|
|
106012
|
-
[ActionFunction.RuntimeApi]: () =>
|
|
106013
|
-
[ActionFunction.SSG]: () =>
|
|
106014
|
-
[ActionFunction.Deploy]: () =>
|
|
106032
|
+
[ActionFunction.UnBundle]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].unbundle),
|
|
106033
|
+
[ActionFunction.TailwindCSS]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].tailwindcss),
|
|
106034
|
+
[ActionFunction.Less]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].less),
|
|
106035
|
+
[ActionFunction.Sass]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].sass),
|
|
106036
|
+
[ActionFunction.BFF]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].bff),
|
|
106037
|
+
[ActionFunction.MicroFrontend]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].micro_frontend),
|
|
106038
|
+
[ActionFunction.Electron]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].electron),
|
|
106039
|
+
[ActionFunction.I18n]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].i18n),
|
|
106040
|
+
[ActionFunction.Test]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].test),
|
|
106041
|
+
[ActionFunction.E2ETest]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].e2e_test),
|
|
106042
|
+
[ActionFunction.Doc]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].doc),
|
|
106043
|
+
[ActionFunction.Storybook]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].storybook),
|
|
106044
|
+
[ActionFunction.RuntimeApi]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].runtime_api),
|
|
106045
|
+
[ActionFunction.SSG]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].ssg),
|
|
106046
|
+
[ActionFunction.Deploy]: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].deploy)
|
|
106015
106047
|
};
|
|
106016
106048
|
const ActionRefactorText = {
|
|
106017
|
-
[ActionRefactor.BFFToApp]: () =>
|
|
106049
|
+
[ActionRefactor.BFFToApp]: () => modern_locale_i18n.t(modern_locale_localeKeys.action.refactor.bff_to_app)
|
|
106018
106050
|
};
|
|
106019
106051
|
const ActionTypeTextMap = {
|
|
106020
106052
|
[ActionType.Element]: ActionElementText,
|
|
@@ -106040,7 +106072,7 @@ const MWAActionTypesMap = {
|
|
|
106040
106072
|
const MWASpecialSchemaMap = {
|
|
106041
106073
|
[ActionFunction.Storybook]: {
|
|
106042
106074
|
key: ActionFunction.Storybook,
|
|
106043
|
-
label: () =>
|
|
106075
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.action["function"].mwa_storybook)
|
|
106044
106076
|
}
|
|
106045
106077
|
};
|
|
106046
106078
|
const MWANewActionSchema = {
|
|
@@ -106048,7 +106080,7 @@ const MWANewActionSchema = {
|
|
|
106048
106080
|
isObject: true,
|
|
106049
106081
|
items: [{
|
|
106050
106082
|
key: 'actionType',
|
|
106051
|
-
label: () =>
|
|
106083
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.action.self),
|
|
106052
106084
|
type: ['string'],
|
|
106053
106085
|
mutualExclusion: true,
|
|
106054
106086
|
items: MWAActionTypes.map(type => ({
|
|
@@ -106121,7 +106153,7 @@ const ModuleNewActionSchema = {
|
|
|
106121
106153
|
isObject: true,
|
|
106122
106154
|
items: [{
|
|
106123
106155
|
key: 'actionType',
|
|
106124
|
-
label: () =>
|
|
106156
|
+
label: () => modern_locale_i18n.t(modern_locale_localeKeys.action.self),
|
|
106125
106157
|
type: ['string'],
|
|
106126
106158
|
mutualExclusion: true,
|
|
106127
106159
|
items: ModuleActionTypes.map(type => ({
|
|
@@ -109087,7 +109119,7 @@ class modern_I18n {
|
|
|
109087
109119
|
|
|
109088
109120
|
|
|
109089
109121
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@1.0.7/node_modules/@modern-js/codesmith-api-app/dist/js/modern/locale/zh.js
|
|
109090
|
-
const
|
|
109122
|
+
const locale_zh_ZH_LOCALE = {
|
|
109091
109123
|
environment: {
|
|
109092
109124
|
node_version: '请升级 Node 版本至 LIS',
|
|
109093
109125
|
nvm_install: '检测到环境中未安装 nvm,请先安装 nvm',
|
|
@@ -109113,7 +109145,7 @@ const zh_ZH_LOCALE = {
|
|
|
109113
109145
|
}
|
|
109114
109146
|
};
|
|
109115
109147
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@1.0.7/node_modules/@modern-js/codesmith-api-app/dist/js/modern/locale/en.js
|
|
109116
|
-
const
|
|
109148
|
+
const locale_en_EN_LOCALE = {
|
|
109117
109149
|
environment: {
|
|
109118
109150
|
node_version: 'please upgrade node to lts version',
|
|
109119
109151
|
nvm_install: 'please install nvm first',
|
|
@@ -109142,10 +109174,10 @@ const en_EN_LOCALE = {
|
|
|
109142
109174
|
|
|
109143
109175
|
|
|
109144
109176
|
|
|
109145
|
-
const
|
|
109146
|
-
const
|
|
109147
|
-
zh:
|
|
109148
|
-
en:
|
|
109177
|
+
const js_modern_locale_i18n = new modern_I18n();
|
|
109178
|
+
const js_modern_locale_localeKeys = js_modern_locale_i18n.init('zh', {
|
|
109179
|
+
zh: locale_zh_ZH_LOCALE,
|
|
109180
|
+
en: locale_en_EN_LOCALE
|
|
109149
109181
|
});
|
|
109150
109182
|
|
|
109151
109183
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@1.0.7/node_modules/@modern-js/codesmith-api-app/dist/js/modern/index.js
|
|
@@ -109174,7 +109206,7 @@ function modern_defineProperty(obj, key, value) { if (key in obj) { Object.defin
|
|
|
109174
109206
|
setCliQuestionsHandlers(modern_handlers_namespaceObject);
|
|
109175
109207
|
class AppAPI {
|
|
109176
109208
|
constructor(generatorContext, generatorCore) {
|
|
109177
|
-
this.i18n =
|
|
109209
|
+
this.i18n = js_modern_locale_i18n;
|
|
109178
109210
|
this.generatorCore = void 0;
|
|
109179
109211
|
this.generatorContext = void 0;
|
|
109180
109212
|
this.npmApi = void 0;
|
|
@@ -109189,13 +109221,13 @@ class AppAPI {
|
|
|
109189
109221
|
|
|
109190
109222
|
async checkEnvironment() {
|
|
109191
109223
|
if (semver_default().lt(process.versions.node, '12.17.0')) {
|
|
109192
|
-
this.generatorCore.logger.warn(
|
|
109224
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.environment.node_version));
|
|
109193
109225
|
return false;
|
|
109194
109226
|
}
|
|
109195
109227
|
|
|
109196
109228
|
if (!(await canUseYarn()) && !(await canUsePnpm())) {
|
|
109197
109229
|
this.generatorCore.logger.debug("can't use yarn or pnpm");
|
|
109198
|
-
this.generatorCore.logger.warn(
|
|
109230
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.environment.yarn_pnpm));
|
|
109199
109231
|
return false;
|
|
109200
109232
|
}
|
|
109201
109233
|
|
|
@@ -109232,9 +109264,9 @@ class AppAPI {
|
|
|
109232
109264
|
|
|
109233
109265
|
try {
|
|
109234
109266
|
await intallPromise;
|
|
109235
|
-
this.generatorCore.logger.info(
|
|
109267
|
+
this.generatorCore.logger.info(js_modern_locale_i18n.t(js_modern_locale_localeKeys.install.success));
|
|
109236
109268
|
} catch (e) {
|
|
109237
|
-
this.generatorCore.logger.warn(
|
|
109269
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.install.failed, {
|
|
109238
109270
|
command: command || `${packageManager} install`
|
|
109239
109271
|
}));
|
|
109240
109272
|
} // spinner.stop();
|
|
@@ -109266,17 +109298,17 @@ class AppAPI {
|
|
|
109266
109298
|
}
|
|
109267
109299
|
} catch (e) {
|
|
109268
109300
|
this.generatorCore.logger.debug('Dependencies install failed', e);
|
|
109269
|
-
this.generatorCore.logger.warn(
|
|
109301
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.install.failed_no_command));
|
|
109270
109302
|
}
|
|
109271
109303
|
|
|
109272
109304
|
try {
|
|
109273
109305
|
if (!isMonorepoSubProject) {
|
|
109274
109306
|
await this.gitApi.addAndCommit(commitMessage || 'feat: init');
|
|
109275
|
-
this.generatorCore.logger.info(
|
|
109307
|
+
this.generatorCore.logger.info(js_modern_locale_i18n.t(js_modern_locale_localeKeys.git.success));
|
|
109276
109308
|
}
|
|
109277
109309
|
} catch (e) {
|
|
109278
109310
|
this.generatorCore.logger.debug('Git repository create failed', e);
|
|
109279
|
-
this.generatorCore.logger.warn(
|
|
109311
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.git.failed));
|
|
109280
109312
|
}
|
|
109281
109313
|
}
|
|
109282
109314
|
|
|
@@ -109299,7 +109331,7 @@ class AppAPI {
|
|
|
109299
109331
|
}
|
|
109300
109332
|
} catch (e) {
|
|
109301
109333
|
this.generatorCore.logger.debug('base forging failed:', e);
|
|
109302
|
-
this.generatorCore.logger.warn(
|
|
109334
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.templated.failed));
|
|
109303
109335
|
throw new Error('base forging failed');
|
|
109304
109336
|
}
|
|
109305
109337
|
}
|
|
@@ -109323,15 +109355,15 @@ class AppAPI {
|
|
|
109323
109355
|
}
|
|
109324
109356
|
|
|
109325
109357
|
showSuccessInfo(successInfo) {
|
|
109326
|
-
this.generatorCore.logger.info(successInfo ||
|
|
109358
|
+
this.generatorCore.logger.info(successInfo || js_modern_locale_i18n.t(js_modern_locale_localeKeys.success.info));
|
|
109327
109359
|
}
|
|
109328
109360
|
|
|
109329
109361
|
async runSubGenerator(subGenerator, relativePwdPath, config) {
|
|
109330
109362
|
try {
|
|
109331
109363
|
await this.generatorCore.runSubGenerator(subGenerator, relativePwdPath, config);
|
|
109332
109364
|
} catch (e) {
|
|
109333
|
-
this.generatorCore.logger.warn(
|
|
109334
|
-
this.generatorCore.logger.debug(
|
|
109365
|
+
this.generatorCore.logger.warn(js_modern_locale_i18n.t(js_modern_locale_localeKeys.generator.failed));
|
|
109366
|
+
this.generatorCore.logger.debug(js_modern_locale_i18n.t(js_modern_locale_localeKeys.generator.failed), e);
|
|
109335
109367
|
throw new Error('run sub generator failed');
|
|
109336
109368
|
}
|
|
109337
109369
|
}
|
|
@@ -109368,7 +109400,7 @@ class AppAPI {
|
|
|
109368
109400
|
|
|
109369
109401
|
}
|
|
109370
109402
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+generator-common@1.1.3/node_modules/@modern-js/generator-common/dist/js/modern/locale/zh.js
|
|
109371
|
-
const
|
|
109403
|
+
const modern_locale_zh_ZH_LOCALE = {
|
|
109372
109404
|
solution: {
|
|
109373
109405
|
self: '请选择你想创建的工程类型',
|
|
109374
109406
|
mwa: '应用',
|
|
@@ -109489,7 +109521,7 @@ const locale_zh_ZH_LOCALE = {
|
|
|
109489
109521
|
}
|
|
109490
109522
|
};
|
|
109491
109523
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+generator-common@1.1.3/node_modules/@modern-js/generator-common/dist/js/modern/locale/en.js
|
|
109492
|
-
const
|
|
109524
|
+
const modern_locale_en_EN_LOCALE = {
|
|
109493
109525
|
solution: {
|
|
109494
109526
|
self: 'Please select the solution you want to create',
|
|
109495
109527
|
mwa: 'MWA Solution',
|
|
@@ -109613,10 +109645,10 @@ const locale_en_EN_LOCALE = {
|
|
|
109613
109645
|
|
|
109614
109646
|
|
|
109615
109647
|
|
|
109616
|
-
const
|
|
109617
|
-
const
|
|
109618
|
-
zh:
|
|
109619
|
-
en:
|
|
109648
|
+
const dist_js_modern_locale_i18n = new modern_I18n();
|
|
109649
|
+
const dist_js_modern_locale_localeKeys = dist_js_modern_locale_i18n.init('zh', {
|
|
109650
|
+
zh: modern_locale_zh_ZH_LOCALE,
|
|
109651
|
+
en: modern_locale_en_EN_LOCALE
|
|
109620
109652
|
});
|
|
109621
109653
|
|
|
109622
109654
|
;// CONCATENATED MODULE: ../../../../node_modules/.pnpm/@modern-js+generator-common@1.1.3/node_modules/@modern-js/generator-common/dist/js/modern/newAction/common/index.js
|
|
@@ -109663,33 +109695,33 @@ let common_ActionRefactor;
|
|
|
109663
109695
|
})(common_ActionRefactor || (common_ActionRefactor = {}));
|
|
109664
109696
|
|
|
109665
109697
|
const common_ActionTypeText = {
|
|
109666
|
-
[common_ActionType.Function]: () =>
|
|
109667
|
-
[common_ActionType.Element]: () =>
|
|
109668
|
-
[common_ActionType.Refactor]: () =>
|
|
109698
|
+
[common_ActionType.Function]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].self),
|
|
109699
|
+
[common_ActionType.Element]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.element.self),
|
|
109700
|
+
[common_ActionType.Refactor]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.refactor.self)
|
|
109669
109701
|
};
|
|
109670
109702
|
const common_ActionElementText = {
|
|
109671
|
-
[common_ActionElement.Entry]: () =>
|
|
109672
|
-
[common_ActionElement.Server]: () =>
|
|
109703
|
+
[common_ActionElement.Entry]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.element.entry),
|
|
109704
|
+
[common_ActionElement.Server]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.element.server)
|
|
109673
109705
|
};
|
|
109674
109706
|
const common_ActionFunctionText = {
|
|
109675
|
-
[common_ActionFunction.UnBundle]: () =>
|
|
109676
|
-
[common_ActionFunction.TailwindCSS]: () =>
|
|
109677
|
-
[common_ActionFunction.Less]: () =>
|
|
109678
|
-
[common_ActionFunction.Sass]: () =>
|
|
109679
|
-
[common_ActionFunction.BFF]: () =>
|
|
109680
|
-
[common_ActionFunction.MicroFrontend]: () =>
|
|
109681
|
-
[common_ActionFunction.Electron]: () =>
|
|
109682
|
-
[common_ActionFunction.I18n]: () =>
|
|
109683
|
-
[common_ActionFunction.Test]: () =>
|
|
109684
|
-
[common_ActionFunction.E2ETest]: () =>
|
|
109685
|
-
[common_ActionFunction.Doc]: () =>
|
|
109686
|
-
[common_ActionFunction.Storybook]: () =>
|
|
109687
|
-
[common_ActionFunction.RuntimeApi]: () =>
|
|
109688
|
-
[common_ActionFunction.SSG]: () =>
|
|
109689
|
-
[common_ActionFunction.Deploy]: () =>
|
|
109707
|
+
[common_ActionFunction.UnBundle]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].unbundle),
|
|
109708
|
+
[common_ActionFunction.TailwindCSS]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].tailwindcss),
|
|
109709
|
+
[common_ActionFunction.Less]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].less),
|
|
109710
|
+
[common_ActionFunction.Sass]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].sass),
|
|
109711
|
+
[common_ActionFunction.BFF]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].bff),
|
|
109712
|
+
[common_ActionFunction.MicroFrontend]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].micro_frontend),
|
|
109713
|
+
[common_ActionFunction.Electron]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].electron),
|
|
109714
|
+
[common_ActionFunction.I18n]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].i18n),
|
|
109715
|
+
[common_ActionFunction.Test]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].test),
|
|
109716
|
+
[common_ActionFunction.E2ETest]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].e2e_test),
|
|
109717
|
+
[common_ActionFunction.Doc]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].doc),
|
|
109718
|
+
[common_ActionFunction.Storybook]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].storybook),
|
|
109719
|
+
[common_ActionFunction.RuntimeApi]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].runtime_api),
|
|
109720
|
+
[common_ActionFunction.SSG]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].ssg),
|
|
109721
|
+
[common_ActionFunction.Deploy]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].deploy)
|
|
109690
109722
|
};
|
|
109691
109723
|
const common_ActionRefactorText = {
|
|
109692
|
-
[common_ActionRefactor.BFFToApp]: () =>
|
|
109724
|
+
[common_ActionRefactor.BFFToApp]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.refactor.bff_to_app)
|
|
109693
109725
|
};
|
|
109694
109726
|
const common_ActionTypeTextMap = {
|
|
109695
109727
|
[common_ActionType.Element]: common_ActionElementText,
|
|
@@ -109715,7 +109747,7 @@ const mwa_MWAActionTypesMap = {
|
|
|
109715
109747
|
const mwa_MWASpecialSchemaMap = {
|
|
109716
109748
|
[common_ActionFunction.Storybook]: {
|
|
109717
109749
|
key: common_ActionFunction.Storybook,
|
|
109718
|
-
label: () =>
|
|
109750
|
+
label: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action["function"].mwa_storybook)
|
|
109719
109751
|
}
|
|
109720
109752
|
};
|
|
109721
109753
|
const mwa_MWANewActionSchema = {
|
|
@@ -109723,7 +109755,7 @@ const mwa_MWANewActionSchema = {
|
|
|
109723
109755
|
isObject: true,
|
|
109724
109756
|
items: [{
|
|
109725
109757
|
key: 'actionType',
|
|
109726
|
-
label: () =>
|
|
109758
|
+
label: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.self),
|
|
109727
109759
|
type: ['string'],
|
|
109728
109760
|
mutualExclusion: true,
|
|
109729
109761
|
items: mwa_MWAActionTypes.map(type => ({
|
|
@@ -111458,7 +111490,7 @@ const MWANewAction = async options => {
|
|
|
111458
111490
|
throw new Error('config is not a valid json');
|
|
111459
111491
|
}
|
|
111460
111492
|
|
|
111461
|
-
|
|
111493
|
+
dist_js_modern_locale_i18n.changeLanguage({
|
|
111462
111494
|
locale: UserConfig.locale || locale
|
|
111463
111495
|
});
|
|
111464
111496
|
const smith = new CodeSmith({
|
|
@@ -111546,7 +111578,7 @@ const module_ModuleNewActionSchema = {
|
|
|
111546
111578
|
isObject: true,
|
|
111547
111579
|
items: [{
|
|
111548
111580
|
key: 'actionType',
|
|
111549
|
-
label: () =>
|
|
111581
|
+
label: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.action.self),
|
|
111550
111582
|
type: ['string'],
|
|
111551
111583
|
mutualExclusion: true,
|
|
111552
111584
|
items: module_ModuleActionTypes.map(type => ({
|
|
@@ -111614,7 +111646,7 @@ const ModuleNewAction = async options => {
|
|
|
111614
111646
|
throw new Error('config is not a valid json');
|
|
111615
111647
|
}
|
|
111616
111648
|
|
|
111617
|
-
|
|
111649
|
+
dist_js_modern_locale_i18n.changeLanguage({
|
|
111618
111650
|
locale: UserConfig.locale || locale
|
|
111619
111651
|
});
|
|
111620
111652
|
const smith = new CodeSmith({
|
|
@@ -111722,22 +111754,22 @@ let solution_SubSolution;
|
|
|
111722
111754
|
})(solution_SubSolution || (solution_SubSolution = {}));
|
|
111723
111755
|
|
|
111724
111756
|
const solution_SolutionText = {
|
|
111725
|
-
[solution_Solution.MWA]: () =>
|
|
111726
|
-
[solution_Solution.Module]: () =>
|
|
111727
|
-
[solution_Solution.Monorepo]: () =>
|
|
111757
|
+
[solution_Solution.MWA]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.solution.mwa),
|
|
111758
|
+
[solution_Solution.Module]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.solution.module),
|
|
111759
|
+
[solution_Solution.Monorepo]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.solution.monorepo)
|
|
111728
111760
|
};
|
|
111729
111761
|
const solution_SubSolutionText = {
|
|
111730
|
-
[solution_SubSolution.MWA]: () =>
|
|
111731
|
-
[solution_SubSolution.MWATest]: () =>
|
|
111732
|
-
[solution_SubSolution.Module]: () =>
|
|
111733
|
-
[solution_SubSolution.InnerModule]: () =>
|
|
111762
|
+
[solution_SubSolution.MWA]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.sub_solution.mwa),
|
|
111763
|
+
[solution_SubSolution.MWATest]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.sub_solution.mwa_test),
|
|
111764
|
+
[solution_SubSolution.Module]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.sub_solution.module),
|
|
111765
|
+
[solution_SubSolution.InnerModule]: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.sub_solution.inner_module)
|
|
111734
111766
|
};
|
|
111735
111767
|
const solution_SolutionSchema = {
|
|
111736
111768
|
key: 'solution_schema',
|
|
111737
111769
|
isObject: true,
|
|
111738
111770
|
items: [{
|
|
111739
111771
|
key: 'solution',
|
|
111740
|
-
label: () =>
|
|
111772
|
+
label: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.solution.self),
|
|
111741
111773
|
type: ['string'],
|
|
111742
111774
|
mutualExclusion: true,
|
|
111743
111775
|
items: Object.values(solution_Solution).map(solution => ({
|
|
@@ -111751,7 +111783,7 @@ const solution_SubSolutionSchema = {
|
|
|
111751
111783
|
isObject: true,
|
|
111752
111784
|
items: [{
|
|
111753
111785
|
key: 'solution',
|
|
111754
|
-
label: () =>
|
|
111786
|
+
label: () => dist_js_modern_locale_i18n.t(dist_js_modern_locale_localeKeys.sub_solution.self),
|
|
111755
111787
|
type: ['string'],
|
|
111756
111788
|
mutualExclusion: true,
|
|
111757
111789
|
items: Object.values(solution_SubSolution).map(solution => ({
|
|
@@ -111827,7 +111859,7 @@ const MonorepoNewAction = async options => {
|
|
|
111827
111859
|
throw new Error('config is not a valid json');
|
|
111828
111860
|
}
|
|
111829
111861
|
|
|
111830
|
-
|
|
111862
|
+
dist_js_modern_locale_i18n.changeLanguage({
|
|
111831
111863
|
locale: UserConfig.locale || locale
|
|
111832
111864
|
});
|
|
111833
111865
|
const smith = new CodeSmith({
|
|
@@ -112128,7 +112160,7 @@ var LifeCycle;
|
|
|
112128
112160
|
})(LifeCycle || (LifeCycle = {}));
|
|
112129
112161
|
|
|
112130
112162
|
var PluginContext = /*#__PURE__*/function () {
|
|
112131
|
-
function PluginContext(inputs) {
|
|
112163
|
+
function PluginContext(inputs, locale) {
|
|
112132
112164
|
var _this$lifeCycleFuncMa;
|
|
112133
112165
|
|
|
112134
112166
|
context_classCallCheck(this, PluginContext);
|
|
@@ -112148,6 +112180,7 @@ var PluginContext = /*#__PURE__*/function () {
|
|
|
112148
112180
|
this.inputContext = new PluginInputContext(inputs);
|
|
112149
112181
|
this.gitAPI = new PluginGitAPI();
|
|
112150
112182
|
this.fileAPI = new PluginFileAPI();
|
|
112183
|
+
this.locale = locale;
|
|
112151
112184
|
}
|
|
112152
112185
|
|
|
112153
112186
|
context_createClass(PluginContext, [{
|
|
@@ -112179,7 +112212,6 @@ var PluginContext = /*#__PURE__*/function () {
|
|
|
112179
112212
|
this.fileAPI.prepare(generator, projectPath, templatePath);
|
|
112180
112213
|
this.npmAPI = new PluginNpmAPI(projectPath, inputData.packageManager);
|
|
112181
112214
|
this.newAPI = new PluginNewAPI(solution, projectPath, inputData);
|
|
112182
|
-
this.locale = inputData.locale;
|
|
112183
112215
|
}
|
|
112184
112216
|
}, {
|
|
112185
112217
|
key: "onForged",
|
|
@@ -112289,6 +112321,37 @@ function _installPlugins() {
|
|
|
112289
112321
|
}));
|
|
112290
112322
|
return _installPlugins.apply(this, arguments);
|
|
112291
112323
|
}
|
|
112324
|
+
;// CONCATENATED MODULE: ../../generator-plugin/dist/js/treeshaking/locale/zh.js
|
|
112325
|
+
var treeshaking_locale_zh_ZH_LOCALE = {
|
|
112326
|
+
setup_plugin: '获取插件信息中...',
|
|
112327
|
+
plugin_no_meta_error: '插件 {plugin} 应在 package.json 中添加 meta 信息',
|
|
112328
|
+
install_plugin: '正在安装生成器插件...',
|
|
112329
|
+
run_plugin: '正在执行插件操作...'
|
|
112330
|
+
};
|
|
112331
|
+
;// CONCATENATED MODULE: ../../generator-plugin/dist/js/treeshaking/locale/en.js
|
|
112332
|
+
var treeshaking_locale_en_EN_LOCALE = {
|
|
112333
|
+
setup_plugin: 'Get plugin info...',
|
|
112334
|
+
plugin_no_meta_error: 'plugin {plugin} should has meta filed in package.json',
|
|
112335
|
+
install_plugin: 'Install plugin...',
|
|
112336
|
+
run_plugin: 'Run plugin...'
|
|
112337
|
+
};
|
|
112338
|
+
;// CONCATENATED MODULE: ../../generator-plugin/dist/js/treeshaking/locale/index.js
|
|
112339
|
+
|
|
112340
|
+
|
|
112341
|
+
|
|
112342
|
+
var treeshaking_locale_i18n = new I18n();
|
|
112343
|
+
var treeshaking_locale_localeKeys = treeshaking_locale_i18n.init('zh', {
|
|
112344
|
+
zh: treeshaking_locale_zh_ZH_LOCALE,
|
|
112345
|
+
en: treeshaking_locale_en_EN_LOCALE
|
|
112346
|
+
});
|
|
112347
|
+
|
|
112348
|
+
;// CONCATENATED MODULE: ../../generator-plugin/dist/js/treeshaking/common.js
|
|
112349
|
+
var PluginType;
|
|
112350
|
+
|
|
112351
|
+
(function (PluginType) {
|
|
112352
|
+
PluginType["Extend"] = "extend";
|
|
112353
|
+
PluginType["Custom"] = "custom";
|
|
112354
|
+
})(PluginType || (PluginType = {}));
|
|
112292
112355
|
;// CONCATENATED MODULE: ../../generator-plugin/dist/js/treeshaking/index.js
|
|
112293
112356
|
|
|
112294
112357
|
|
|
@@ -112338,8 +112401,12 @@ function treeshaking_createClass(Constructor, protoProps, staticProps) { if (pro
|
|
|
112338
112401
|
|
|
112339
112402
|
|
|
112340
112403
|
|
|
112404
|
+
|
|
112405
|
+
|
|
112341
112406
|
var GeneratorPlugin = /*#__PURE__*/function () {
|
|
112342
112407
|
function GeneratorPlugin(logger, event) {
|
|
112408
|
+
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
|
112409
|
+
|
|
112343
112410
|
treeshaking_classCallCheck(this, GeneratorPlugin);
|
|
112344
112411
|
|
|
112345
112412
|
this.plugins = [];
|
|
@@ -112353,6 +112420,16 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112353
112420
|
if (event) {
|
|
112354
112421
|
event.on('forged', this.handleForged.bind(this));
|
|
112355
112422
|
}
|
|
112423
|
+
|
|
112424
|
+
modern_locale_i18n.changeLanguage({
|
|
112425
|
+
locale: locale
|
|
112426
|
+
});
|
|
112427
|
+
locale_i18n.changeLanguage({
|
|
112428
|
+
locale: locale
|
|
112429
|
+
});
|
|
112430
|
+
treeshaking_locale_i18n.changeLanguage({
|
|
112431
|
+
locale: locale
|
|
112432
|
+
});
|
|
112356
112433
|
}
|
|
112357
112434
|
|
|
112358
112435
|
treeshaking_createClass(GeneratorPlugin, [{
|
|
@@ -112365,7 +112442,8 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112365
112442
|
while (1) {
|
|
112366
112443
|
switch (_context2.prev = _context2.next) {
|
|
112367
112444
|
case 0:
|
|
112368
|
-
|
|
112445
|
+
this.logger.info(treeshaking_locale_i18n.t(treeshaking_locale_localeKeys.setup_plugin));
|
|
112446
|
+
_context2.next = 3;
|
|
112369
112447
|
return Promise.all(plugins.map( /*#__PURE__*/function () {
|
|
112370
112448
|
var _ref = treeshaking_asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(plugin) {
|
|
112371
112449
|
var pkgJSON, _pkgJSON, meta;
|
|
@@ -112400,7 +112478,9 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112400
112478
|
break;
|
|
112401
112479
|
}
|
|
112402
112480
|
|
|
112403
|
-
throw new Error(
|
|
112481
|
+
throw new Error(treeshaking_locale_i18n.t(treeshaking_locale_localeKeys.plugin_no_meta_error, {
|
|
112482
|
+
plugin: plugin
|
|
112483
|
+
}));
|
|
112404
112484
|
|
|
112405
112485
|
case 10:
|
|
112406
112486
|
if (meta.extend) {
|
|
@@ -112424,12 +112504,12 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112424
112504
|
};
|
|
112425
112505
|
}()));
|
|
112426
112506
|
|
|
112427
|
-
case
|
|
112507
|
+
case 3:
|
|
112428
112508
|
case "end":
|
|
112429
112509
|
return _context2.stop();
|
|
112430
112510
|
}
|
|
112431
112511
|
}
|
|
112432
|
-
}, _callee2);
|
|
112512
|
+
}, _callee2, this);
|
|
112433
112513
|
}));
|
|
112434
112514
|
|
|
112435
112515
|
function setupPlugin(_x, _x2) {
|
|
@@ -112510,17 +112590,18 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112510
112590
|
}
|
|
112511
112591
|
}
|
|
112512
112592
|
|
|
112513
|
-
|
|
112593
|
+
this.logger.info(treeshaking_locale_i18n.t(treeshaking_locale_localeKeys.install_plugin));
|
|
112594
|
+
_context3.next = 6;
|
|
112514
112595
|
return utils_installPlugins(plugins, inputData.registry);
|
|
112515
112596
|
|
|
112516
|
-
case
|
|
112597
|
+
case 6:
|
|
112517
112598
|
this.plugins = _context3.sent;
|
|
112518
112599
|
_iterator3 = treeshaking_createForOfIteratorHelper(this.plugins);
|
|
112519
112600
|
|
|
112520
112601
|
try {
|
|
112521
112602
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
112522
112603
|
info = _step3.value;
|
|
112523
|
-
info.context = new PluginContext(SolutionSchemas[solution]);
|
|
112604
|
+
info.context = new PluginContext(SolutionSchemas[solution], inputData.locale);
|
|
112524
112605
|
info.module(info.context.context);
|
|
112525
112606
|
}
|
|
112526
112607
|
} catch (err) {
|
|
@@ -112529,7 +112610,7 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112529
112610
|
_iterator3.f();
|
|
112530
112611
|
}
|
|
112531
112612
|
|
|
112532
|
-
case
|
|
112613
|
+
case 9:
|
|
112533
112614
|
case "end":
|
|
112534
112615
|
return _context3.stop();
|
|
112535
112616
|
}
|
|
@@ -112582,10 +112663,11 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112582
112663
|
while (1) {
|
|
112583
112664
|
switch (_context4.prev = _context4.next) {
|
|
112584
112665
|
case 0:
|
|
112666
|
+
this.logger.info(treeshaking_locale_i18n.t(treeshaking_locale_localeKeys.run_plugin));
|
|
112585
112667
|
generatorPlugin = inputData.generatorPlugin, restData = treeshaking_objectWithoutProperties(inputData, treeshaking_excluded);
|
|
112586
112668
|
|
|
112587
112669
|
if (!(solution !== restData.solution)) {
|
|
112588
|
-
_context4.next =
|
|
112670
|
+
_context4.next = 5;
|
|
112589
112671
|
break;
|
|
112590
112672
|
}
|
|
112591
112673
|
|
|
@@ -112595,15 +112677,15 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112595
112677
|
|
|
112596
112678
|
return _context4.abrupt("return");
|
|
112597
112679
|
|
|
112598
|
-
case
|
|
112680
|
+
case 5:
|
|
112599
112681
|
_iterator5 = treeshaking_createForOfIteratorHelper(this.plugins);
|
|
112600
|
-
_context4.prev =
|
|
112682
|
+
_context4.prev = 6;
|
|
112601
112683
|
|
|
112602
112684
|
_iterator5.s();
|
|
112603
112685
|
|
|
112604
|
-
case
|
|
112686
|
+
case 8:
|
|
112605
112687
|
if ((_step5 = _iterator5.n()).done) {
|
|
112606
|
-
_context4.next =
|
|
112688
|
+
_context4.next = 17;
|
|
112607
112689
|
break;
|
|
112608
112690
|
}
|
|
112609
112691
|
|
|
@@ -112612,43 +112694,43 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112612
112694
|
onForgedFunc = (_info$context4 = info.context) === null || _info$context4 === void 0 ? void 0 : _info$context4.lifeCycleFuncMap[LifeCycle.OnForged];
|
|
112613
112695
|
|
|
112614
112696
|
if (!(onForgedFunc && isFunction_default()(onForgedFunc))) {
|
|
112615
|
-
_context4.next =
|
|
112697
|
+
_context4.next = 15;
|
|
112616
112698
|
break;
|
|
112617
112699
|
}
|
|
112618
112700
|
|
|
112619
|
-
_context4.next =
|
|
112701
|
+
_context4.next = 15;
|
|
112620
112702
|
return onForgedFunc(info.context.forgedAPI, restData);
|
|
112621
112703
|
|
|
112622
|
-
case
|
|
112623
|
-
_context4.next =
|
|
112704
|
+
case 15:
|
|
112705
|
+
_context4.next = 8;
|
|
112624
112706
|
break;
|
|
112625
112707
|
|
|
112626
|
-
case
|
|
112627
|
-
_context4.next =
|
|
112708
|
+
case 17:
|
|
112709
|
+
_context4.next = 22;
|
|
112628
112710
|
break;
|
|
112629
112711
|
|
|
112630
|
-
case
|
|
112631
|
-
_context4.prev =
|
|
112632
|
-
_context4.t0 = _context4["catch"](
|
|
112712
|
+
case 19:
|
|
112713
|
+
_context4.prev = 19;
|
|
112714
|
+
_context4.t0 = _context4["catch"](6);
|
|
112633
112715
|
|
|
112634
112716
|
_iterator5.e(_context4.t0);
|
|
112635
112717
|
|
|
112636
|
-
case
|
|
112637
|
-
_context4.prev =
|
|
112718
|
+
case 22:
|
|
112719
|
+
_context4.prev = 22;
|
|
112638
112720
|
|
|
112639
112721
|
_iterator5.f();
|
|
112640
112722
|
|
|
112641
|
-
return _context4.finish(
|
|
112723
|
+
return _context4.finish(22);
|
|
112642
112724
|
|
|
112643
|
-
case
|
|
112725
|
+
case 25:
|
|
112644
112726
|
_iterator6 = treeshaking_createForOfIteratorHelper(this.plugins);
|
|
112645
|
-
_context4.prev =
|
|
112727
|
+
_context4.prev = 26;
|
|
112646
112728
|
|
|
112647
112729
|
_iterator6.s();
|
|
112648
112730
|
|
|
112649
|
-
case
|
|
112731
|
+
case 28:
|
|
112650
112732
|
if ((_step6 = _iterator6.n()).done) {
|
|
112651
|
-
_context4.next =
|
|
112733
|
+
_context4.next = 36;
|
|
112652
112734
|
break;
|
|
112653
112735
|
}
|
|
112654
112736
|
|
|
@@ -112656,45 +112738,45 @@ var GeneratorPlugin = /*#__PURE__*/function () {
|
|
|
112656
112738
|
afterForged = (_info$context5 = _info.context) === null || _info$context5 === void 0 ? void 0 : _info$context5.lifeCycleFuncMap[LifeCycle.AfterForged];
|
|
112657
112739
|
|
|
112658
112740
|
if (!(afterForged && isFunction_default()(afterForged))) {
|
|
112659
|
-
_context4.next =
|
|
112741
|
+
_context4.next = 34;
|
|
112660
112742
|
break;
|
|
112661
112743
|
}
|
|
112662
112744
|
|
|
112663
|
-
_context4.next =
|
|
112745
|
+
_context4.next = 34;
|
|
112664
112746
|
return afterForged(_info.context.afterForgedAPI, restData);
|
|
112665
112747
|
|
|
112666
|
-
case
|
|
112667
|
-
_context4.next =
|
|
112748
|
+
case 34:
|
|
112749
|
+
_context4.next = 28;
|
|
112668
112750
|
break;
|
|
112669
112751
|
|
|
112670
|
-
case
|
|
112671
|
-
_context4.next =
|
|
112752
|
+
case 36:
|
|
112753
|
+
_context4.next = 41;
|
|
112672
112754
|
break;
|
|
112673
112755
|
|
|
112674
|
-
case
|
|
112675
|
-
_context4.prev =
|
|
112676
|
-
_context4.t1 = _context4["catch"](
|
|
112756
|
+
case 38:
|
|
112757
|
+
_context4.prev = 38;
|
|
112758
|
+
_context4.t1 = _context4["catch"](26);
|
|
112677
112759
|
|
|
112678
112760
|
_iterator6.e(_context4.t1);
|
|
112679
112761
|
|
|
112680
|
-
case
|
|
112681
|
-
_context4.prev =
|
|
112762
|
+
case 41:
|
|
112763
|
+
_context4.prev = 41;
|
|
112682
112764
|
|
|
112683
112765
|
_iterator6.f();
|
|
112684
112766
|
|
|
112685
|
-
return _context4.finish(
|
|
112767
|
+
return _context4.finish(41);
|
|
112686
112768
|
|
|
112687
|
-
case
|
|
112769
|
+
case 44:
|
|
112688
112770
|
if (this.event) {
|
|
112689
112771
|
this.event.emit('handle forged success');
|
|
112690
112772
|
}
|
|
112691
112773
|
|
|
112692
|
-
case
|
|
112774
|
+
case 45:
|
|
112693
112775
|
case "end":
|
|
112694
112776
|
return _context4.stop();
|
|
112695
112777
|
}
|
|
112696
112778
|
}
|
|
112697
|
-
}, _callee4, this, [[
|
|
112779
|
+
}, _callee4, this, [[6, 19, 22, 25], [26, 38, 41, 44]]);
|
|
112698
112780
|
}));
|
|
112699
112781
|
|
|
112700
112782
|
function handleForged(_x6, _x7, _x8, _x9, _x10) {
|
|
@@ -113089,7 +113171,7 @@ var _codesmithApiApp = __webpack_require__(83028);
|
|
|
113089
113171
|
|
|
113090
113172
|
var _generatorCommon = __webpack_require__(50828);
|
|
113091
113173
|
|
|
113092
|
-
var _generatorPlugin = __webpack_require__(
|
|
113174
|
+
var _generatorPlugin = __webpack_require__(97763);
|
|
113093
113175
|
|
|
113094
113176
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
113095
113177
|
|
|
@@ -113122,7 +113204,7 @@ const mergeDefaultConfig = context => {
|
|
|
113122
113204
|
};
|
|
113123
113205
|
|
|
113124
113206
|
const getNeedRunPlugin = (context, generatorPlugin) => {
|
|
113125
|
-
var _customPlugin$
|
|
113207
|
+
var _customPlugin$pluginS;
|
|
113126
113208
|
|
|
113127
113209
|
if (!generatorPlugin) {
|
|
113128
113210
|
return false;
|
|
@@ -113133,30 +113215,36 @@ const getNeedRunPlugin = (context, generatorPlugin) => {
|
|
|
113133
113215
|
customPlugin
|
|
113134
113216
|
} = generatorPlugin;
|
|
113135
113217
|
const {
|
|
113218
|
+
isMonorepo,
|
|
113136
113219
|
solution,
|
|
113137
113220
|
scenes
|
|
113138
113221
|
} = context.config;
|
|
113222
|
+
const pluginSolution = isMonorepo ? (0, _generatorCommon.getSolutionNameFromSubSolution)(solution) : solution;
|
|
113139
113223
|
|
|
113140
|
-
if (!scenes || scenes ===
|
|
113141
|
-
return (extendPlugin === null || extendPlugin === void 0 ? void 0 : extendPlugin[
|
|
113224
|
+
if (!scenes || scenes === pluginSolution) {
|
|
113225
|
+
return (extendPlugin === null || extendPlugin === void 0 ? void 0 : extendPlugin[pluginSolution]) && extendPlugin[pluginSolution].length > 0;
|
|
113142
113226
|
}
|
|
113143
113227
|
|
|
113144
|
-
return Boolean((_customPlugin$
|
|
113228
|
+
return Boolean((_customPlugin$pluginS = customPlugin[pluginSolution]) === null || _customPlugin$pluginS === void 0 ? void 0 : _customPlugin$pluginS.find(plugin => plugin.key === scenes));
|
|
113145
113229
|
};
|
|
113146
113230
|
|
|
113147
113231
|
const handleTemplateFile = async (context, generator, appApi, generatorPlugin) => {
|
|
113232
|
+
const {
|
|
113233
|
+
isMonorepo
|
|
113234
|
+
} = context.config;
|
|
113148
113235
|
const {
|
|
113149
113236
|
solution
|
|
113150
|
-
} = await appApi.getInputBySchema(_generatorCommon.SolutionSchema, _objectSpread(_objectSpread({}, context.config), {}, {
|
|
113237
|
+
} = await appApi.getInputBySchema(isMonorepo ? _generatorCommon.MonorepoNewActionSchema : _generatorCommon.SolutionSchema, _objectSpread(_objectSpread({}, context.config), {}, {
|
|
113151
113238
|
customPlugin: generatorPlugin === null || generatorPlugin === void 0 ? void 0 : generatorPlugin.customPlugin
|
|
113152
113239
|
}));
|
|
113153
|
-
const solutionGenerator =
|
|
113240
|
+
const solutionGenerator = // eslint-disable-next-line no-nested-ternary
|
|
113241
|
+
solution === 'custom' ? _generatorCommon.BaseGenerator : isMonorepo ? _generatorCommon.SubSolutionGenerator[solution] : _generatorCommon.SolutionGenerator[solution];
|
|
113154
113242
|
|
|
113155
113243
|
if (!solution || !solutionGenerator) {
|
|
113156
113244
|
generator.logger.error('solution is not valid ');
|
|
113157
113245
|
}
|
|
113158
113246
|
|
|
113159
|
-
await appApi.runSubGenerator(getGeneratorPath(solutionGenerator, context.config.distTag), undefined, _objectSpread(_objectSpread({}, context.config), {}, {
|
|
113247
|
+
await appApi.runSubGenerator(getGeneratorPath(solutionGenerator, context.config.distTag), undefined, _objectSpread(_objectSpread(_objectSpread({}, isMonorepo ? _generatorCommon.MonorepoNewActionConfig[solution] || {} : {}), context.config), {}, {
|
|
113160
113248
|
hasPlugin: getNeedRunPlugin(context, generatorPlugin),
|
|
113161
113249
|
generatorPlugin
|
|
113162
113250
|
}));
|
|
@@ -113165,9 +113253,10 @@ const handleTemplateFile = async (context, generator, appApi, generatorPlugin) =
|
|
|
113165
113253
|
const handlePlugin = async (context, generator) => {
|
|
113166
113254
|
const {
|
|
113167
113255
|
plugins,
|
|
113168
|
-
registry
|
|
113256
|
+
registry,
|
|
113257
|
+
locale
|
|
113169
113258
|
} = context.config;
|
|
113170
|
-
const generatorPlugin = new _generatorPlugin.GeneratorPlugin(generator.logger, generator.event);
|
|
113259
|
+
const generatorPlugin = new _generatorPlugin.GeneratorPlugin(generator.logger, generator.event, locale);
|
|
113171
113260
|
await generatorPlugin.setupPlugin(plugins, registry);
|
|
113172
113261
|
return generatorPlugin;
|
|
113173
113262
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-canary-
|
|
14
|
+
"version": "0.0.0-canary-20211223152722",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"main": "./dist/js/node/main.js",
|
|
17
17
|
"files": [
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"@modern-js/codesmith": "^1.0.7",
|
|
24
24
|
"@modern-js/codesmith-api-app": "^1.0.7",
|
|
25
25
|
"@modern-js/codesmith-tools": "^1.0.7",
|
|
26
|
-
"@modern-js/generator-common": "^0.0.0-canary-
|
|
26
|
+
"@modern-js/generator-common": "^0.0.0-canary-20211223152722",
|
|
27
27
|
"@modern-js/generator-utils": "^1.1.1",
|
|
28
|
-
"@modern-js/module-generator": "^0.0.0-canary-
|
|
29
|
-
"@modern-js/monorepo-generator": "^0.0.0-canary-
|
|
30
|
-
"@modern-js/mwa-generator": "^0.0.0-canary-
|
|
31
|
-
"@modern-js/base-generator": "^0.0.0-canary-
|
|
32
|
-
"@modern-js/generator-plugin": "^0.0.0-canary-
|
|
28
|
+
"@modern-js/module-generator": "^0.0.0-canary-20211223152722",
|
|
29
|
+
"@modern-js/monorepo-generator": "^0.0.0-canary-20211223152722",
|
|
30
|
+
"@modern-js/mwa-generator": "^0.0.0-canary-20211223152722",
|
|
31
|
+
"@modern-js/base-generator": "^0.0.0-canary-20211223152722",
|
|
32
|
+
"@modern-js/generator-plugin": "^0.0.0-canary-20211223152722",
|
|
33
33
|
"@types/jest": "^26",
|
|
34
34
|
"@types/lodash": "^4.14.168",
|
|
35
35
|
"@types/node": "^14",
|
|
36
36
|
"lodash": "^4.17.21",
|
|
37
37
|
"typescript": "^4",
|
|
38
|
-
"@modern-js/module-tools": "^0.0.0-canary-
|
|
38
|
+
"@modern-js/module-tools": "^0.0.0-canary-20211223152722",
|
|
39
39
|
"@modern-js/plugin-testing": "^1.1.1"
|
|
40
40
|
},
|
|
41
41
|
"sideEffects": false,
|