@modern-js/repo-generator 3.4.16 → 3.5.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 +438 -463
- package/package.json +10 -10
- package/src/index.ts +6 -6
package/dist/index.js
CHANGED
@@ -68874,7 +68874,6 @@ __export(src_exports, {
|
|
68874
68874
|
default: () => src_default
|
68875
68875
|
});
|
68876
68876
|
module.exports = __toCommonJS(src_exports);
|
68877
|
-
var import_lodash14 = require("@modern-js/utils/lodash");
|
68878
68877
|
|
68879
68878
|
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
|
68880
68879
|
var LoggerLevel;
|
@@ -83724,98 +83723,6 @@ var I18n2 = class {
|
|
83724
83723
|
}
|
83725
83724
|
};
|
83726
83725
|
|
83727
|
-
// ../../generator-common/dist/esm-node/locale/zh.js
|
83728
|
-
var ZH_LOCALE2 = {
|
83729
|
-
solution: {
|
83730
|
-
self: "请选择你想创建的工程类型",
|
83731
|
-
mwa: "Web 应用",
|
83732
|
-
module: "Npm 模块",
|
83733
|
-
custom: "自定义",
|
83734
|
-
default: "默认"
|
83735
|
-
},
|
83736
|
-
scenes: {
|
83737
|
-
self: "请选择项目场景"
|
83738
|
-
},
|
83739
|
-
sub_solution: {
|
83740
|
-
self: "请选择你想创建的工程类型",
|
83741
|
-
mwa: "Web 应用",
|
83742
|
-
module: "Npm 模块"
|
83743
|
-
},
|
83744
|
-
action: {
|
83745
|
-
self: "请选择你想要的操作",
|
83746
|
-
function: {
|
83747
|
-
self: "启用可选功能",
|
83748
|
-
question: "请选择功能名称",
|
83749
|
-
tailwindcss: "启用「Tailwind CSS」 支持",
|
83750
|
-
bff: "启用「BFF」功能",
|
83751
|
-
micro_frontend: "启用「微前端」模式",
|
83752
|
-
i18n: "启用「国际化(i18n)」功能",
|
83753
|
-
storybookV7: "启用「Storybook」V7",
|
83754
|
-
runtime_api: "启用「Runtime API」",
|
83755
|
-
ssg: "启用「SSG」功能",
|
83756
|
-
polyfill: "启用「基于 UA 的 Polyfill」功能",
|
83757
|
-
proxy: "启用「全局代理」",
|
83758
|
-
swc: "启用「SWC 编译」",
|
83759
|
-
module_doc: "启动「模块文档」功能"
|
83760
|
-
},
|
83761
|
-
element: {
|
83762
|
-
self: "创建工程元素",
|
83763
|
-
question: "请选择创建元素类型",
|
83764
|
-
entry: "新建「应用入口」",
|
83765
|
-
server: "新建「自定义 Web Server」源码目录"
|
83766
|
-
},
|
83767
|
-
refactor: {
|
83768
|
-
self: "自动重构",
|
83769
|
-
question: "请选择重构类型",
|
83770
|
-
react_router_5: "使用 React Router v5"
|
83771
|
-
}
|
83772
|
-
},
|
83773
|
-
boolean: {
|
83774
|
-
yes: "是",
|
83775
|
-
no: "否"
|
83776
|
-
},
|
83777
|
-
language: {
|
83778
|
-
self: "请选择开发语言"
|
83779
|
-
},
|
83780
|
-
packageManager: {
|
83781
|
-
self: "请选择包管理工具"
|
83782
|
-
},
|
83783
|
-
entry: {
|
83784
|
-
name: "请填写入口名称",
|
83785
|
-
no_empty: "入口名称不能为空!",
|
83786
|
-
no_pages: '入口名称不支持 "pages"!'
|
83787
|
-
},
|
83788
|
-
packageName: {
|
83789
|
-
self: "请填写项目名称",
|
83790
|
-
sub_name: "请填写子项目名称",
|
83791
|
-
no_empty: "项目名称不能为空!"
|
83792
|
-
},
|
83793
|
-
packagePath: {
|
83794
|
-
self: "请填写子项目目录名称",
|
83795
|
-
no_empty: "目录名称不能为空!",
|
83796
|
-
format: "目录名称只能使用小写字母、数字和分隔线(-)、下划线(_)和目录分隔符(/)"
|
83797
|
-
},
|
83798
|
-
framework: {
|
83799
|
-
self: "请选择运行时框架",
|
83800
|
-
egg: "Egg",
|
83801
|
-
express: "Express",
|
83802
|
-
koa: "Koa",
|
83803
|
-
nest: "Nest"
|
83804
|
-
},
|
83805
|
-
bff: {
|
83806
|
-
bffType: {
|
83807
|
-
self: "请选择 BFF 类型",
|
83808
|
-
func: "函数模式",
|
83809
|
-
framework: "框架模式"
|
83810
|
-
}
|
83811
|
-
},
|
83812
|
-
buildTools: {
|
83813
|
-
self: "请选择构建工具",
|
83814
|
-
webpack: "webpack",
|
83815
|
-
rspack: "Rspack (实验性)"
|
83816
|
-
}
|
83817
|
-
};
|
83818
|
-
|
83819
83726
|
// ../../generator-common/dist/esm-node/locale/en.js
|
83820
83727
|
var EN_LOCALE2 = {
|
83821
83728
|
solution: {
|
@@ -83900,11 +83807,93 @@ var EN_LOCALE2 = {
|
|
83900
83807
|
func: "Function",
|
83901
83808
|
framework: "Framework"
|
83902
83809
|
}
|
83810
|
+
}
|
83811
|
+
};
|
83812
|
+
|
83813
|
+
// ../../generator-common/dist/esm-node/locale/zh.js
|
83814
|
+
var ZH_LOCALE2 = {
|
83815
|
+
solution: {
|
83816
|
+
self: "请选择你想创建的工程类型",
|
83817
|
+
mwa: "Web 应用",
|
83818
|
+
module: "Npm 模块",
|
83819
|
+
custom: "自定义",
|
83820
|
+
default: "默认"
|
83821
|
+
},
|
83822
|
+
scenes: {
|
83823
|
+
self: "请选择项目场景"
|
83824
|
+
},
|
83825
|
+
sub_solution: {
|
83826
|
+
self: "请选择你想创建的工程类型",
|
83827
|
+
mwa: "Web 应用",
|
83828
|
+
module: "Npm 模块"
|
83829
|
+
},
|
83830
|
+
action: {
|
83831
|
+
self: "请选择你想要的操作",
|
83832
|
+
function: {
|
83833
|
+
self: "启用可选功能",
|
83834
|
+
question: "请选择功能名称",
|
83835
|
+
tailwindcss: "启用「Tailwind CSS」 支持",
|
83836
|
+
bff: "启用「BFF」功能",
|
83837
|
+
micro_frontend: "启用「微前端」模式",
|
83838
|
+
i18n: "启用「国际化(i18n)」功能",
|
83839
|
+
storybookV7: "启用「Storybook」V7",
|
83840
|
+
runtime_api: "启用「Runtime API」",
|
83841
|
+
ssg: "启用「SSG」功能",
|
83842
|
+
polyfill: "启用「基于 UA 的 Polyfill」功能",
|
83843
|
+
proxy: "启用「全局代理」",
|
83844
|
+
swc: "启用「SWC 编译」",
|
83845
|
+
module_doc: "启动「模块文档」功能"
|
83846
|
+
},
|
83847
|
+
element: {
|
83848
|
+
self: "创建工程元素",
|
83849
|
+
question: "请选择创建元素类型",
|
83850
|
+
entry: "新建「应用入口」",
|
83851
|
+
server: "新建「自定义 Web Server」源码目录"
|
83852
|
+
},
|
83853
|
+
refactor: {
|
83854
|
+
self: "自动重构",
|
83855
|
+
question: "请选择重构类型",
|
83856
|
+
react_router_5: "使用 React Router v5"
|
83857
|
+
}
|
83858
|
+
},
|
83859
|
+
boolean: {
|
83860
|
+
yes: "是",
|
83861
|
+
no: "否"
|
83862
|
+
},
|
83863
|
+
language: {
|
83864
|
+
self: "请选择开发语言"
|
83865
|
+
},
|
83866
|
+
packageManager: {
|
83867
|
+
self: "请选择包管理工具"
|
83868
|
+
},
|
83869
|
+
entry: {
|
83870
|
+
name: "请填写入口名称",
|
83871
|
+
no_empty: "入口名称不能为空!",
|
83872
|
+
no_pages: '入口名称不支持 "pages"!'
|
83873
|
+
},
|
83874
|
+
packageName: {
|
83875
|
+
self: "请填写项目名称",
|
83876
|
+
sub_name: "请填写子项目名称",
|
83877
|
+
no_empty: "项目名称不能为空!"
|
83878
|
+
},
|
83879
|
+
packagePath: {
|
83880
|
+
self: "请填写子项目目录名称",
|
83881
|
+
no_empty: "目录名称不能为空!",
|
83882
|
+
format: "目录名称只能使用小写字母、数字和分隔线(-)、下划线(_)和目录分隔符(/)"
|
83883
|
+
},
|
83884
|
+
framework: {
|
83885
|
+
self: "请选择运行时框架",
|
83886
|
+
egg: "Egg",
|
83887
|
+
express: "Express",
|
83888
|
+
koa: "Koa",
|
83889
|
+
nest: "Nest"
|
83903
83890
|
},
|
83904
|
-
|
83905
|
-
|
83906
|
-
|
83907
|
-
|
83891
|
+
bff: {
|
83892
|
+
bffType: {
|
83893
|
+
self: "请选择 BFF 类型",
|
83894
|
+
func: "函数模式",
|
83895
|
+
framework: "框架模式"
|
83896
|
+
}
|
83908
83897
|
}
|
83909
83898
|
};
|
83910
83899
|
|
@@ -84145,21 +84134,6 @@ var Framework;
|
|
84145
84134
|
Framework2["Express"] = "express";
|
84146
84135
|
Framework2["Koa"] = "koa";
|
84147
84136
|
})(Framework || (Framework = {}));
|
84148
|
-
var BuildTools;
|
84149
|
-
(function(BuildTools2) {
|
84150
|
-
BuildTools2["Webpack"] = "webpack";
|
84151
|
-
BuildTools2["Rspack"] = "rspack";
|
84152
|
-
})(BuildTools || (BuildTools = {}));
|
84153
|
-
var getBuildToolsSchema = (_extra = {}) => {
|
84154
|
-
return {
|
84155
|
-
type: "string",
|
84156
|
-
title: i18n2.t(localeKeys2.buildTools.self),
|
84157
|
-
enum: Object.values(BuildTools).map((tool) => ({
|
84158
|
-
value: tool,
|
84159
|
-
label: i18n2.t(localeKeys2.buildTools[tool])
|
84160
|
-
}))
|
84161
|
-
};
|
84162
|
-
};
|
84163
84137
|
|
84164
84138
|
// ../../generator-common/dist/esm-node/mwa/project.js
|
84165
84139
|
var getMWASchemaProperties = (extra) => {
|
@@ -84167,8 +84141,7 @@ var getMWASchemaProperties = (extra) => {
|
|
84167
84141
|
packageName: getPackageNameSchema(extra),
|
84168
84142
|
packagePath: getPackagePathSchema(extra),
|
84169
84143
|
language: getLanguageSchema(extra),
|
84170
|
-
packageManager: getPackageManagerSchema(extra)
|
84171
|
-
buildTools: getBuildToolsSchema(extra)
|
84144
|
+
packageManager: getPackageManagerSchema(extra)
|
84172
84145
|
};
|
84173
84146
|
};
|
84174
84147
|
var getMWASchema = (extra = {}) => {
|
@@ -84180,8 +84153,7 @@ var getMWASchema = (extra = {}) => {
|
|
84180
84153
|
var MWADefaultConfig = {
|
84181
84154
|
language: Language.TS,
|
84182
84155
|
packageManager: PackageManager.Pnpm,
|
84183
|
-
needModifyMWAConfig: BooleanConfig.NO
|
84184
|
-
buildTools: BuildTools.Webpack
|
84156
|
+
needModifyMWAConfig: BooleanConfig.NO
|
84185
84157
|
};
|
84186
84158
|
|
84187
84159
|
// ../../generator-common/dist/esm-node/newAction/common/index.js
|
@@ -84531,47 +84503,208 @@ var SolutionSchemas = {
|
|
84531
84503
|
custom: getBaseSchema
|
84532
84504
|
};
|
84533
84505
|
|
84534
|
-
//
|
84535
|
-
|
84536
|
-
|
84537
|
-
|
84538
|
-
|
84539
|
-
|
84540
|
-
|
84541
|
-
|
84542
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
84543
|
-
].join("|");
|
84544
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
84545
|
-
}
|
84546
|
-
function stripAnsi2(string) {
|
84547
|
-
if (typeof string !== "string") {
|
84548
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
84506
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
84507
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
84508
|
+
try {
|
84509
|
+
var info = gen[key](arg);
|
84510
|
+
var value = info.value;
|
84511
|
+
} catch (error) {
|
84512
|
+
reject(error);
|
84513
|
+
return;
|
84549
84514
|
}
|
84550
|
-
|
84515
|
+
if (info.done)
|
84516
|
+
resolve(value);
|
84517
|
+
else
|
84518
|
+
Promise.resolve(value).then(_next, _throw);
|
84519
|
+
}
|
84520
|
+
function _async_to_generator(fn) {
|
84521
|
+
return function() {
|
84522
|
+
var self3 = this, args = arguments;
|
84523
|
+
return new Promise(function(resolve, reject) {
|
84524
|
+
var gen = fn.apply(self3, args);
|
84525
|
+
function _next(value) {
|
84526
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
84527
|
+
}
|
84528
|
+
function _throw(err) {
|
84529
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
84530
|
+
}
|
84531
|
+
_next(void 0);
|
84532
|
+
});
|
84533
|
+
};
|
84551
84534
|
}
|
84552
84535
|
|
84553
|
-
//
|
84554
|
-
|
84555
|
-
|
84556
|
-
|
84557
|
-
|
84558
|
-
packagePath: {
|
84559
|
-
exit: "目录 {value} 已存在"
|
84560
|
-
}
|
84561
|
-
};
|
84536
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
84537
|
+
function _class_call_check(instance, Constructor) {
|
84538
|
+
if (!(instance instanceof Constructor))
|
84539
|
+
throw new TypeError("Cannot call a class as a function");
|
84540
|
+
}
|
84562
84541
|
|
84563
|
-
//
|
84564
|
-
|
84565
|
-
|
84566
|
-
|
84567
|
-
}
|
84568
|
-
|
84569
|
-
|
84570
|
-
|
84571
|
-
};
|
84542
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
84543
|
+
function _define_property(obj, key, value) {
|
84544
|
+
if (key in obj) {
|
84545
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
84546
|
+
} else
|
84547
|
+
obj[key] = value;
|
84548
|
+
return obj;
|
84549
|
+
}
|
84572
84550
|
|
84573
|
-
//
|
84574
|
-
|
84551
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
84552
|
+
function _object_spread(target) {
|
84553
|
+
for (var i = 1; i < arguments.length; i++) {
|
84554
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
84555
|
+
var ownKeys2 = Object.keys(source);
|
84556
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
84557
|
+
ownKeys2 = ownKeys2.concat(
|
84558
|
+
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
84559
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
84560
|
+
})
|
84561
|
+
);
|
84562
|
+
}
|
84563
|
+
ownKeys2.forEach(function(key) {
|
84564
|
+
_define_property(target, key, source[key]);
|
84565
|
+
});
|
84566
|
+
}
|
84567
|
+
return target;
|
84568
|
+
}
|
84569
|
+
|
84570
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
84571
|
+
function ownKeys(object, enumerableOnly) {
|
84572
|
+
var keys = Object.keys(object);
|
84573
|
+
if (Object.getOwnPropertySymbols) {
|
84574
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
84575
|
+
if (enumerableOnly) {
|
84576
|
+
symbols = symbols.filter(function(sym) {
|
84577
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
84578
|
+
});
|
84579
|
+
}
|
84580
|
+
keys.push.apply(keys, symbols);
|
84581
|
+
}
|
84582
|
+
return keys;
|
84583
|
+
}
|
84584
|
+
function _object_spread_props(target, source) {
|
84585
|
+
source = source != null ? source : {};
|
84586
|
+
if (Object.getOwnPropertyDescriptors)
|
84587
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
84588
|
+
else {
|
84589
|
+
ownKeys(Object(source)).forEach(function(key) {
|
84590
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84591
|
+
});
|
84592
|
+
}
|
84593
|
+
return target;
|
84594
|
+
}
|
84595
|
+
|
84596
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
84597
|
+
function _object_without_properties_loose(source, excluded) {
|
84598
|
+
if (source == null)
|
84599
|
+
return {};
|
84600
|
+
var target = {};
|
84601
|
+
var sourceKeys = Object.keys(source);
|
84602
|
+
var key, i;
|
84603
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
84604
|
+
key = sourceKeys[i];
|
84605
|
+
if (excluded.indexOf(key) >= 0)
|
84606
|
+
continue;
|
84607
|
+
target[key] = source[key];
|
84608
|
+
}
|
84609
|
+
return target;
|
84610
|
+
}
|
84611
|
+
|
84612
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
84613
|
+
function _object_without_properties(source, excluded) {
|
84614
|
+
if (source == null)
|
84615
|
+
return {};
|
84616
|
+
var target = _object_without_properties_loose(source, excluded);
|
84617
|
+
var key, i;
|
84618
|
+
if (Object.getOwnPropertySymbols) {
|
84619
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
84620
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
84621
|
+
key = sourceSymbolKeys[i];
|
84622
|
+
if (excluded.indexOf(key) >= 0)
|
84623
|
+
continue;
|
84624
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
84625
|
+
continue;
|
84626
|
+
target[key] = source[key];
|
84627
|
+
}
|
84628
|
+
}
|
84629
|
+
return target;
|
84630
|
+
}
|
84631
|
+
|
84632
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
84633
|
+
function _array_like_to_array(arr, len) {
|
84634
|
+
if (len == null || len > arr.length)
|
84635
|
+
len = arr.length;
|
84636
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
84637
|
+
arr2[i] = arr[i];
|
84638
|
+
return arr2;
|
84639
|
+
}
|
84640
|
+
|
84641
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
84642
|
+
function _array_without_holes(arr) {
|
84643
|
+
if (Array.isArray(arr))
|
84644
|
+
return _array_like_to_array(arr);
|
84645
|
+
}
|
84646
|
+
|
84647
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
84648
|
+
function _iterable_to_array(iter) {
|
84649
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
84650
|
+
return Array.from(iter);
|
84651
|
+
}
|
84652
|
+
}
|
84653
|
+
|
84654
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
84655
|
+
function _non_iterable_spread() {
|
84656
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84657
|
+
}
|
84658
|
+
|
84659
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
84660
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
84661
|
+
if (!o)
|
84662
|
+
return;
|
84663
|
+
if (typeof o === "string")
|
84664
|
+
return _array_like_to_array(o, minLen);
|
84665
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84666
|
+
if (n === "Object" && o.constructor)
|
84667
|
+
n = o.constructor.name;
|
84668
|
+
if (n === "Map" || n === "Set")
|
84669
|
+
return Array.from(n);
|
84670
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
84671
|
+
return _array_like_to_array(o, minLen);
|
84672
|
+
}
|
84673
|
+
|
84674
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
84675
|
+
function _to_consumable_array(arr) {
|
84676
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
84677
|
+
}
|
84678
|
+
|
84679
|
+
// ../../generator-plugin/dist/esm/index.js
|
84680
|
+
var import_path17 = __toESM(require("path"));
|
84681
|
+
|
84682
|
+
// ../../generator-utils/dist/esm/index.js
|
84683
|
+
var import_path12 = __toESM(require("path"));
|
84684
|
+
var import_utils52 = require("@modern-js/utils");
|
84685
|
+
|
84686
|
+
// ../../generator-utils/dist/esm/locale/en.js
|
84687
|
+
var EN_LOCALE3 = {
|
84688
|
+
packageName: {
|
84689
|
+
exit: "package name `{value}` is already exists"
|
84690
|
+
},
|
84691
|
+
packagePath: {
|
84692
|
+
exit: "package path {value} is already exists"
|
84693
|
+
}
|
84694
|
+
};
|
84695
|
+
|
84696
|
+
// ../../generator-utils/dist/esm/locale/zh.js
|
84697
|
+
var ZH_LOCALE3 = {
|
84698
|
+
packageName: {
|
84699
|
+
exit: "项目名称 {value} 已存在"
|
84700
|
+
},
|
84701
|
+
packagePath: {
|
84702
|
+
exit: "目录 {value} 已存在"
|
84703
|
+
}
|
84704
|
+
};
|
84705
|
+
|
84706
|
+
// ../../generator-utils/dist/esm/locale/index.js
|
84707
|
+
var i18n3 = new I18n2();
|
84575
84708
|
var localeKeys3 = i18n3.init("en", {
|
84576
84709
|
zh: ZH_LOCALE3,
|
84577
84710
|
en: EN_LOCALE3
|
@@ -84653,6 +84786,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
|
|
84653
84786
|
return currentVersion;
|
84654
84787
|
}
|
84655
84788
|
|
84789
|
+
// ../../generator-utils/dist/esm/utils/stripAnsi.js
|
84790
|
+
function ansiRegex2({ onlyFirst = false } = {}) {
|
84791
|
+
const pattern = [
|
84792
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
84793
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
84794
|
+
].join("|");
|
84795
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
84796
|
+
}
|
84797
|
+
function stripAnsi3(string) {
|
84798
|
+
if (typeof string !== "string") {
|
84799
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
84800
|
+
}
|
84801
|
+
return string.replace(ansiRegex2(), "");
|
84802
|
+
}
|
84803
|
+
|
84656
84804
|
// ../../generator-utils/dist/esm/utils/getGeneratorPath.js
|
84657
84805
|
var import_path11 = __toESM(require("path"));
|
84658
84806
|
var getGeneratorPath = (generator, distTag, paths) => {
|
@@ -84686,7 +84834,7 @@ async function getPackageVersion(packageName, registry2) {
|
|
84686
84834
|
}
|
84687
84835
|
const result = await (0, import_utils52.execa)("pnpm", args);
|
84688
84836
|
spinner.stop();
|
84689
|
-
return
|
84837
|
+
return stripAnsi3(result.stdout);
|
84690
84838
|
}
|
84691
84839
|
if (await (0, import_utils52.canUseNpm)()) {
|
84692
84840
|
const args = [
|
@@ -84699,7 +84847,7 @@ async function getPackageVersion(packageName, registry2) {
|
|
84699
84847
|
}
|
84700
84848
|
const result = await (0, import_utils52.execa)("npm", args);
|
84701
84849
|
spinner.stop();
|
84702
|
-
return
|
84850
|
+
return stripAnsi3(result.stdout);
|
84703
84851
|
}
|
84704
84852
|
spinner.stop();
|
84705
84853
|
throw new Error("not found npm, please install npm before");
|
@@ -84724,199 +84872,25 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
84724
84872
|
pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
84725
84873
|
paths: [
|
84726
84874
|
cwd
|
84727
|
-
]
|
84728
|
-
}), "../..", "package.json");
|
84729
|
-
}
|
84730
|
-
if (import_utils52.fs.existsSync(pkgPath)) {
|
84731
|
-
const pkgInfo = import_utils52.fs.readJSONSync(pkgPath);
|
84732
|
-
const modernVersion = pkgInfo.version;
|
84733
|
-
if (typeof modernVersion !== "string") {
|
84734
|
-
return getLatetPluginVersion();
|
84735
|
-
}
|
84736
|
-
const version = await getAvailableVersion(packageName, modernVersion, registry2);
|
84737
|
-
if (!await isPackageExist(`${packageName}@${version}`)) {
|
84738
|
-
return getLatetPluginVersion();
|
84739
|
-
}
|
84740
|
-
return version;
|
84741
|
-
}
|
84742
|
-
return getLatetPluginVersion();
|
84743
|
-
}
|
84744
|
-
|
84745
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
84746
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
84747
|
-
try {
|
84748
|
-
var info = gen[key](arg);
|
84749
|
-
var value = info.value;
|
84750
|
-
} catch (error) {
|
84751
|
-
reject(error);
|
84752
|
-
return;
|
84753
|
-
}
|
84754
|
-
if (info.done)
|
84755
|
-
resolve(value);
|
84756
|
-
else
|
84757
|
-
Promise.resolve(value).then(_next, _throw);
|
84758
|
-
}
|
84759
|
-
function _async_to_generator(fn) {
|
84760
|
-
return function() {
|
84761
|
-
var self3 = this, args = arguments;
|
84762
|
-
return new Promise(function(resolve, reject) {
|
84763
|
-
var gen = fn.apply(self3, args);
|
84764
|
-
function _next(value) {
|
84765
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
84766
|
-
}
|
84767
|
-
function _throw(err) {
|
84768
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
84769
|
-
}
|
84770
|
-
_next(void 0);
|
84771
|
-
});
|
84772
|
-
};
|
84773
|
-
}
|
84774
|
-
|
84775
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
84776
|
-
function _class_call_check(instance, Constructor) {
|
84777
|
-
if (!(instance instanceof Constructor))
|
84778
|
-
throw new TypeError("Cannot call a class as a function");
|
84779
|
-
}
|
84780
|
-
|
84781
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
84782
|
-
function _define_property(obj, key, value) {
|
84783
|
-
if (key in obj) {
|
84784
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
84785
|
-
} else
|
84786
|
-
obj[key] = value;
|
84787
|
-
return obj;
|
84788
|
-
}
|
84789
|
-
|
84790
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
84791
|
-
function _object_spread(target) {
|
84792
|
-
for (var i = 1; i < arguments.length; i++) {
|
84793
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
84794
|
-
var ownKeys2 = Object.keys(source);
|
84795
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
84796
|
-
ownKeys2 = ownKeys2.concat(
|
84797
|
-
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
84798
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
84799
|
-
})
|
84800
|
-
);
|
84801
|
-
}
|
84802
|
-
ownKeys2.forEach(function(key) {
|
84803
|
-
_define_property(target, key, source[key]);
|
84804
|
-
});
|
84805
|
-
}
|
84806
|
-
return target;
|
84807
|
-
}
|
84808
|
-
|
84809
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
84810
|
-
function ownKeys(object, enumerableOnly) {
|
84811
|
-
var keys = Object.keys(object);
|
84812
|
-
if (Object.getOwnPropertySymbols) {
|
84813
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
84814
|
-
if (enumerableOnly) {
|
84815
|
-
symbols = symbols.filter(function(sym) {
|
84816
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
84817
|
-
});
|
84818
|
-
}
|
84819
|
-
keys.push.apply(keys, symbols);
|
84820
|
-
}
|
84821
|
-
return keys;
|
84822
|
-
}
|
84823
|
-
function _object_spread_props(target, source) {
|
84824
|
-
source = source != null ? source : {};
|
84825
|
-
if (Object.getOwnPropertyDescriptors)
|
84826
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
84827
|
-
else {
|
84828
|
-
ownKeys(Object(source)).forEach(function(key) {
|
84829
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84830
|
-
});
|
84831
|
-
}
|
84832
|
-
return target;
|
84833
|
-
}
|
84834
|
-
|
84835
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
84836
|
-
function _object_without_properties_loose(source, excluded) {
|
84837
|
-
if (source == null)
|
84838
|
-
return {};
|
84839
|
-
var target = {};
|
84840
|
-
var sourceKeys = Object.keys(source);
|
84841
|
-
var key, i;
|
84842
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
84843
|
-
key = sourceKeys[i];
|
84844
|
-
if (excluded.indexOf(key) >= 0)
|
84845
|
-
continue;
|
84846
|
-
target[key] = source[key];
|
84847
|
-
}
|
84848
|
-
return target;
|
84849
|
-
}
|
84850
|
-
|
84851
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
84852
|
-
function _object_without_properties(source, excluded) {
|
84853
|
-
if (source == null)
|
84854
|
-
return {};
|
84855
|
-
var target = _object_without_properties_loose(source, excluded);
|
84856
|
-
var key, i;
|
84857
|
-
if (Object.getOwnPropertySymbols) {
|
84858
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
84859
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
84860
|
-
key = sourceSymbolKeys[i];
|
84861
|
-
if (excluded.indexOf(key) >= 0)
|
84862
|
-
continue;
|
84863
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
84864
|
-
continue;
|
84865
|
-
target[key] = source[key];
|
84866
|
-
}
|
84867
|
-
}
|
84868
|
-
return target;
|
84869
|
-
}
|
84870
|
-
|
84871
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
84872
|
-
function _array_like_to_array(arr, len) {
|
84873
|
-
if (len == null || len > arr.length)
|
84874
|
-
len = arr.length;
|
84875
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
84876
|
-
arr2[i] = arr[i];
|
84877
|
-
return arr2;
|
84878
|
-
}
|
84879
|
-
|
84880
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
84881
|
-
function _array_without_holes(arr) {
|
84882
|
-
if (Array.isArray(arr))
|
84883
|
-
return _array_like_to_array(arr);
|
84884
|
-
}
|
84885
|
-
|
84886
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
84887
|
-
function _iterable_to_array(iter) {
|
84888
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
84889
|
-
return Array.from(iter);
|
84890
|
-
}
|
84891
|
-
}
|
84892
|
-
|
84893
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
84894
|
-
function _non_iterable_spread() {
|
84895
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84896
|
-
}
|
84897
|
-
|
84898
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
84899
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
84900
|
-
if (!o)
|
84901
|
-
return;
|
84902
|
-
if (typeof o === "string")
|
84903
|
-
return _array_like_to_array(o, minLen);
|
84904
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84905
|
-
if (n === "Object" && o.constructor)
|
84906
|
-
n = o.constructor.name;
|
84907
|
-
if (n === "Map" || n === "Set")
|
84908
|
-
return Array.from(n);
|
84909
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
84910
|
-
return _array_like_to_array(o, minLen);
|
84911
|
-
}
|
84912
|
-
|
84913
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
84914
|
-
function _to_consumable_array(arr) {
|
84915
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
84875
|
+
]
|
84876
|
+
}), "../..", "package.json");
|
84877
|
+
}
|
84878
|
+
if (import_utils52.fs.existsSync(pkgPath)) {
|
84879
|
+
const pkgInfo = import_utils52.fs.readJSONSync(pkgPath);
|
84880
|
+
const modernVersion = pkgInfo.version;
|
84881
|
+
if (typeof modernVersion !== "string") {
|
84882
|
+
return getLatetPluginVersion();
|
84883
|
+
}
|
84884
|
+
const version = await getAvailableVersion(packageName, modernVersion, registry2);
|
84885
|
+
if (!await isPackageExist(`${packageName}@${version}`)) {
|
84886
|
+
return getLatetPluginVersion();
|
84887
|
+
}
|
84888
|
+
return version;
|
84889
|
+
}
|
84890
|
+
return getLatetPluginVersion();
|
84916
84891
|
}
|
84917
84892
|
|
84918
84893
|
// ../../generator-plugin/dist/esm/index.js
|
84919
|
-
var import_path17 = __toESM(require("path"));
|
84920
84894
|
var import_lodash13 = require("@modern-js/utils/lodash");
|
84921
84895
|
|
84922
84896
|
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
@@ -85253,6 +85227,20 @@ function _addManyFiles() {
|
|
85253
85227
|
return _addManyFiles.apply(this, arguments);
|
85254
85228
|
}
|
85255
85229
|
|
85230
|
+
// ../../generator-plugin/dist/esm/context/ejs.js
|
85231
|
+
var import_ejs2 = __toESM(require_ejs());
|
85232
|
+
var PluginEjsAPI = /* @__PURE__ */ function() {
|
85233
|
+
"use strict";
|
85234
|
+
function PluginEjsAPI2() {
|
85235
|
+
_class_call_check(this, PluginEjsAPI2);
|
85236
|
+
}
|
85237
|
+
var _proto = PluginEjsAPI2.prototype;
|
85238
|
+
_proto.renderString = function renderString3(template, data) {
|
85239
|
+
return import_ejs2.default.render(template, data) || "";
|
85240
|
+
};
|
85241
|
+
return PluginEjsAPI2;
|
85242
|
+
}();
|
85243
|
+
|
85256
85244
|
// ../../generator-plugin/dist/esm/context/handlebars.js
|
85257
85245
|
var handlebars2 = __toESM(require_lib());
|
85258
85246
|
var PluginHandlebarsAPI = /* @__PURE__ */ function() {
|
@@ -85294,20 +85282,6 @@ var PluginHandlebarsAPI = /* @__PURE__ */ function() {
|
|
85294
85282
|
return PluginHandlebarsAPI2;
|
85295
85283
|
}();
|
85296
85284
|
|
85297
|
-
// ../../generator-plugin/dist/esm/context/ejs.js
|
85298
|
-
var import_ejs2 = __toESM(require_ejs());
|
85299
|
-
var PluginEjsAPI = /* @__PURE__ */ function() {
|
85300
|
-
"use strict";
|
85301
|
-
function PluginEjsAPI2() {
|
85302
|
-
_class_call_check(this, PluginEjsAPI2);
|
85303
|
-
}
|
85304
|
-
var _proto = PluginEjsAPI2.prototype;
|
85305
|
-
_proto.renderString = function renderString3(template, data) {
|
85306
|
-
return import_ejs2.default.render(template, data) || "";
|
85307
|
-
};
|
85308
|
-
return PluginEjsAPI2;
|
85309
|
-
}();
|
85310
|
-
|
85311
85285
|
// ../../generator-plugin/dist/esm/context/file.js
|
85312
85286
|
var FileType2;
|
85313
85287
|
(function(FileType22) {
|
@@ -85861,88 +85835,6 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
85861
85835
|
return PluginInputContext2;
|
85862
85836
|
}();
|
85863
85837
|
|
85864
|
-
// ../../generator-plugin/dist/esm/context/npm.js
|
85865
|
-
var PluginNpmAPI = /* @__PURE__ */ function() {
|
85866
|
-
"use strict";
|
85867
|
-
function PluginNpmAPI2(projectPath, packageManager) {
|
85868
|
-
_class_call_check(this, PluginNpmAPI2);
|
85869
|
-
this.projectPath = "";
|
85870
|
-
this.projectPath = projectPath;
|
85871
|
-
this.packageManager = packageManager;
|
85872
|
-
}
|
85873
|
-
var _proto = PluginNpmAPI2.prototype;
|
85874
|
-
_proto.install = function install() {
|
85875
|
-
var _this = this;
|
85876
|
-
return _async_to_generator(function() {
|
85877
|
-
return __generator(this, function(_state) {
|
85878
|
-
switch (_state.label) {
|
85879
|
-
case 0:
|
85880
|
-
if (!(_this.packageManager === PackageManager.Pnpm))
|
85881
|
-
return [
|
85882
|
-
3,
|
85883
|
-
2
|
85884
|
-
];
|
85885
|
-
return [
|
85886
|
-
4,
|
85887
|
-
pnpmInstall({
|
85888
|
-
cwd: _this.projectPath
|
85889
|
-
})
|
85890
|
-
];
|
85891
|
-
case 1:
|
85892
|
-
_state.sent();
|
85893
|
-
return [
|
85894
|
-
3,
|
85895
|
-
6
|
85896
|
-
];
|
85897
|
-
case 2:
|
85898
|
-
if (!(_this.packageManager === PackageManager.Yarn))
|
85899
|
-
return [
|
85900
|
-
3,
|
85901
|
-
4
|
85902
|
-
];
|
85903
|
-
return [
|
85904
|
-
4,
|
85905
|
-
yarnInstall({
|
85906
|
-
cwd: _this.projectPath
|
85907
|
-
})
|
85908
|
-
];
|
85909
|
-
case 3:
|
85910
|
-
_state.sent();
|
85911
|
-
return [
|
85912
|
-
3,
|
85913
|
-
6
|
85914
|
-
];
|
85915
|
-
case 4:
|
85916
|
-
return [
|
85917
|
-
4,
|
85918
|
-
npmInstall({
|
85919
|
-
cwd: _this.projectPath
|
85920
|
-
})
|
85921
|
-
];
|
85922
|
-
case 5:
|
85923
|
-
_state.sent();
|
85924
|
-
_state.label = 6;
|
85925
|
-
case 6:
|
85926
|
-
return [
|
85927
|
-
2
|
85928
|
-
];
|
85929
|
-
}
|
85930
|
-
});
|
85931
|
-
})();
|
85932
|
-
};
|
85933
|
-
_create_class(PluginNpmAPI2, [
|
85934
|
-
{
|
85935
|
-
key: "method",
|
85936
|
-
get: function get4() {
|
85937
|
-
return {
|
85938
|
-
install: this.install.bind(this)
|
85939
|
-
};
|
85940
|
-
}
|
85941
|
-
}
|
85942
|
-
]);
|
85943
|
-
return PluginNpmAPI2;
|
85944
|
-
}();
|
85945
|
-
|
85946
85838
|
// ../../new-action/dist/esm/utils/index.js
|
85947
85839
|
var import_path15 = __toESM(require("path"));
|
85948
85840
|
var import_utils56 = require("@modern-js/utils");
|
@@ -86340,6 +86232,88 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
86340
86232
|
return PluginNewAPI2;
|
86341
86233
|
}();
|
86342
86234
|
|
86235
|
+
// ../../generator-plugin/dist/esm/context/npm.js
|
86236
|
+
var PluginNpmAPI = /* @__PURE__ */ function() {
|
86237
|
+
"use strict";
|
86238
|
+
function PluginNpmAPI2(projectPath, packageManager) {
|
86239
|
+
_class_call_check(this, PluginNpmAPI2);
|
86240
|
+
this.projectPath = "";
|
86241
|
+
this.projectPath = projectPath;
|
86242
|
+
this.packageManager = packageManager;
|
86243
|
+
}
|
86244
|
+
var _proto = PluginNpmAPI2.prototype;
|
86245
|
+
_proto.install = function install() {
|
86246
|
+
var _this = this;
|
86247
|
+
return _async_to_generator(function() {
|
86248
|
+
return __generator(this, function(_state) {
|
86249
|
+
switch (_state.label) {
|
86250
|
+
case 0:
|
86251
|
+
if (!(_this.packageManager === PackageManager.Pnpm))
|
86252
|
+
return [
|
86253
|
+
3,
|
86254
|
+
2
|
86255
|
+
];
|
86256
|
+
return [
|
86257
|
+
4,
|
86258
|
+
pnpmInstall({
|
86259
|
+
cwd: _this.projectPath
|
86260
|
+
})
|
86261
|
+
];
|
86262
|
+
case 1:
|
86263
|
+
_state.sent();
|
86264
|
+
return [
|
86265
|
+
3,
|
86266
|
+
6
|
86267
|
+
];
|
86268
|
+
case 2:
|
86269
|
+
if (!(_this.packageManager === PackageManager.Yarn))
|
86270
|
+
return [
|
86271
|
+
3,
|
86272
|
+
4
|
86273
|
+
];
|
86274
|
+
return [
|
86275
|
+
4,
|
86276
|
+
yarnInstall({
|
86277
|
+
cwd: _this.projectPath
|
86278
|
+
})
|
86279
|
+
];
|
86280
|
+
case 3:
|
86281
|
+
_state.sent();
|
86282
|
+
return [
|
86283
|
+
3,
|
86284
|
+
6
|
86285
|
+
];
|
86286
|
+
case 4:
|
86287
|
+
return [
|
86288
|
+
4,
|
86289
|
+
npmInstall({
|
86290
|
+
cwd: _this.projectPath
|
86291
|
+
})
|
86292
|
+
];
|
86293
|
+
case 5:
|
86294
|
+
_state.sent();
|
86295
|
+
_state.label = 6;
|
86296
|
+
case 6:
|
86297
|
+
return [
|
86298
|
+
2
|
86299
|
+
];
|
86300
|
+
}
|
86301
|
+
});
|
86302
|
+
})();
|
86303
|
+
};
|
86304
|
+
_create_class(PluginNpmAPI2, [
|
86305
|
+
{
|
86306
|
+
key: "method",
|
86307
|
+
get: function get4() {
|
86308
|
+
return {
|
86309
|
+
install: this.install.bind(this)
|
86310
|
+
};
|
86311
|
+
}
|
86312
|
+
}
|
86313
|
+
]);
|
86314
|
+
return PluginNpmAPI2;
|
86315
|
+
}();
|
86316
|
+
|
86343
86317
|
// ../../generator-plugin/dist/esm/context/index.js
|
86344
86318
|
var LifeCycle2;
|
86345
86319
|
(function(LifeCycle22) {
|
@@ -86401,6 +86375,29 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
86401
86375
|
return PluginContext2;
|
86402
86376
|
}();
|
86403
86377
|
|
86378
|
+
// ../../generator-plugin/dist/esm/locale/en.js
|
86379
|
+
var EN_LOCALE4 = {
|
86380
|
+
setup_plugin: "Get plugin info...",
|
86381
|
+
plugin_no_meta_error: "plugin {plugin} should has meta filed in package.json",
|
86382
|
+
install_plugin: "Install plugin...",
|
86383
|
+
run_plugin: "Run plugin..."
|
86384
|
+
};
|
86385
|
+
|
86386
|
+
// ../../generator-plugin/dist/esm/locale/zh.js
|
86387
|
+
var ZH_LOCALE4 = {
|
86388
|
+
setup_plugin: "获取插件信息中...",
|
86389
|
+
plugin_no_meta_error: "插件 {plugin} 应在 package.json 中添加 meta 信息",
|
86390
|
+
install_plugin: "正在安装生成器插件...",
|
86391
|
+
run_plugin: "正在执行插件操作..."
|
86392
|
+
};
|
86393
|
+
|
86394
|
+
// ../../generator-plugin/dist/esm/locale/index.js
|
86395
|
+
var i18n4 = new I18n2();
|
86396
|
+
var localeKeys4 = i18n4.init("en", {
|
86397
|
+
zh: ZH_LOCALE4,
|
86398
|
+
en: EN_LOCALE4
|
86399
|
+
});
|
86400
|
+
|
86404
86401
|
// ../../generator-plugin/dist/esm/utils/index.js
|
86405
86402
|
var import_path16 = __toESM(require("path"));
|
86406
86403
|
|
@@ -86534,29 +86531,6 @@ function _installPlugins() {
|
|
86534
86531
|
return _installPlugins.apply(this, arguments);
|
86535
86532
|
}
|
86536
86533
|
|
86537
|
-
// ../../generator-plugin/dist/esm/locale/zh.js
|
86538
|
-
var ZH_LOCALE4 = {
|
86539
|
-
setup_plugin: "获取插件信息中...",
|
86540
|
-
plugin_no_meta_error: "插件 {plugin} 应在 package.json 中添加 meta 信息",
|
86541
|
-
install_plugin: "正在安装生成器插件...",
|
86542
|
-
run_plugin: "正在执行插件操作..."
|
86543
|
-
};
|
86544
|
-
|
86545
|
-
// ../../generator-plugin/dist/esm/locale/en.js
|
86546
|
-
var EN_LOCALE4 = {
|
86547
|
-
setup_plugin: "Get plugin info...",
|
86548
|
-
plugin_no_meta_error: "plugin {plugin} should has meta filed in package.json",
|
86549
|
-
install_plugin: "Install plugin...",
|
86550
|
-
run_plugin: "Run plugin..."
|
86551
|
-
};
|
86552
|
-
|
86553
|
-
// ../../generator-plugin/dist/esm/locale/index.js
|
86554
|
-
var i18n4 = new I18n2();
|
86555
|
-
var localeKeys4 = i18n4.init("en", {
|
86556
|
-
zh: ZH_LOCALE4,
|
86557
|
-
en: EN_LOCALE4
|
86558
|
-
});
|
86559
|
-
|
86560
86534
|
// ../../generator-plugin/dist/esm/index.js
|
86561
86535
|
var GeneratorPlugin = /* @__PURE__ */ function() {
|
86562
86536
|
"use strict";
|
@@ -86996,6 +86970,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86996
86970
|
}();
|
86997
86971
|
|
86998
86972
|
// src/index.ts
|
86973
|
+
var import_lodash14 = require("@modern-js/utils/lodash");
|
86999
86974
|
var mergeDefaultConfig = (context) => {
|
87000
86975
|
const { defaultSolution } = context.config;
|
87001
86976
|
if (defaultSolution) {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.
|
18
|
+
"version": "3.5.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"main": "./dist/index.js",
|
21
21
|
"files": [
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"/dist/index.js"
|
24
24
|
],
|
25
25
|
"dependencies": {
|
26
|
-
"@modern-js/utils": "2.
|
26
|
+
"@modern-js/utils": "2.59.0"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
29
|
"@modern-js/codesmith": "2.4.1",
|
@@ -32,14 +32,14 @@
|
|
32
32
|
"@types/node": "^14",
|
33
33
|
"jest": "^29",
|
34
34
|
"typescript": "^5",
|
35
|
-
"@modern-js/base-generator": "3.
|
36
|
-
"@modern-js/generator-
|
37
|
-
"@modern-js/generator-
|
38
|
-
"@modern-js/
|
39
|
-
"@modern-js/generator
|
40
|
-
"@modern-js/mwa-generator": "3.
|
41
|
-
"@scripts/build": "2.
|
42
|
-
"@scripts/jest-config": "2.
|
35
|
+
"@modern-js/base-generator": "3.5.0",
|
36
|
+
"@modern-js/generator-plugin": "3.5.0",
|
37
|
+
"@modern-js/generator-common": "3.5.0",
|
38
|
+
"@modern-js/generator-utils": "3.5.0",
|
39
|
+
"@modern-js/module-generator": "3.5.0",
|
40
|
+
"@modern-js/mwa-generator": "3.5.0",
|
41
|
+
"@scripts/build": "2.59.0",
|
42
|
+
"@scripts/jest-config": "2.59.0"
|
43
43
|
},
|
44
44
|
"sideEffects": false,
|
45
45
|
"publishConfig": {
|
package/src/index.ts
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
import { merge } from '@modern-js/utils/lodash';
|
2
1
|
import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
3
2
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
4
3
|
import {
|
5
|
-
|
6
|
-
getSolutionSchema,
|
7
|
-
SolutionGenerator,
|
4
|
+
BaseGenerator,
|
8
5
|
type Solution,
|
9
6
|
SolutionDefaultConfig,
|
10
|
-
|
7
|
+
SolutionGenerator,
|
11
8
|
getScenesSchema,
|
9
|
+
getSolutionSchema,
|
10
|
+
i18n,
|
12
11
|
} from '@modern-js/generator-common';
|
13
|
-
import { getGeneratorPath } from '@modern-js/generator-utils';
|
14
12
|
import { GeneratorPlugin } from '@modern-js/generator-plugin';
|
13
|
+
import { getGeneratorPath } from '@modern-js/generator-utils';
|
14
|
+
import { merge } from '@modern-js/utils/lodash';
|
15
15
|
|
16
16
|
const mergeDefaultConfig = (context: GeneratorContext) => {
|
17
17
|
const { defaultSolution } = context.config;
|