cmyr-template-cli 1.21.0 → 1.21.1
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/plopfile.js +32 -4
- package/package.json +1 -1
package/dist/plopfile.js
CHANGED
|
@@ -79,6 +79,7 @@ const COMMON_DEPENDENCIES = {
|
|
|
79
79
|
devDependencies: {
|
|
80
80
|
'@types/fs-extra': '^9.0.4',
|
|
81
81
|
'@types/lodash': '^4.14.165',
|
|
82
|
+
'@types/lodash-es': '^4.17.4',
|
|
82
83
|
'@types/md5': '^2.3.1',
|
|
83
84
|
},
|
|
84
85
|
dependencies: {
|
|
@@ -89,17 +90,37 @@ const COMMON_DEPENDENCIES = {
|
|
|
89
90
|
'fs-extra': '^10.0.0',
|
|
90
91
|
'isomorphic-unfetch': '^3.1.0',
|
|
91
92
|
lodash: '^4.17.20',
|
|
93
|
+
'lodash-es': '^4.17.21',
|
|
92
94
|
md5: '^2.3.0',
|
|
93
95
|
'push-all-in-one': '^2.2.0',
|
|
96
|
+
'leancloud-storage': '^4.15.0',
|
|
94
97
|
},
|
|
95
98
|
};
|
|
96
|
-
const
|
|
99
|
+
const VUE2_DEPENDENCIES = {
|
|
97
100
|
devDependencies: {},
|
|
98
101
|
dependencies: {
|
|
102
|
+
'@smallwei/avue': '2.9.4',
|
|
103
|
+
'@vueuse/core': '^10.4.1',
|
|
99
104
|
'element-ui': '^2.15.7',
|
|
100
105
|
vuetify: '^2.6.3',
|
|
101
106
|
},
|
|
102
107
|
};
|
|
108
|
+
const VUE3_DEPENDENCIES = {
|
|
109
|
+
devDependencies: {},
|
|
110
|
+
dependencies: {
|
|
111
|
+
'@smallwei/avue': '^3.2.20',
|
|
112
|
+
'@vueuse/core': '^10.4.1',
|
|
113
|
+
'element-plus': '^2.3.14',
|
|
114
|
+
vuetify: '^3.3.14',
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
const WEB_DEPENDENCIES = {
|
|
118
|
+
devDependencies: {},
|
|
119
|
+
dependencies: {
|
|
120
|
+
'animate.css': '^4.1.1',
|
|
121
|
+
'normalize.css': '^8.0.1',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
103
124
|
async function createGiteeRepo(data) {
|
|
104
125
|
try {
|
|
105
126
|
const formData = new URLSearchParams();
|
|
@@ -392,7 +413,7 @@ async function initCommonDependencies(projectPath, answers) {
|
|
|
392
413
|
])));
|
|
393
414
|
const devDependencies = Object.fromEntries(await Promise.all(commonDependencies
|
|
394
415
|
.map((name) => `@types/${name}`)
|
|
395
|
-
.filter((name) => { var _a
|
|
416
|
+
.filter((name) => { var _a; return (_a = COMMON_DEPENDENCIES === null || COMMON_DEPENDENCIES === void 0 ? void 0 : COMMON_DEPENDENCIES.devDependencies) === null || _a === void 0 ? void 0 : _a[name]; })
|
|
396
417
|
.map(async (name) => [
|
|
397
418
|
name,
|
|
398
419
|
`^${await getNpmPackageVersion(name)}`,
|
|
@@ -1193,8 +1214,15 @@ module.exports = function (plop) {
|
|
|
1193
1214
|
default: [],
|
|
1194
1215
|
choices(answers) {
|
|
1195
1216
|
const choices = Object.keys(COMMON_DEPENDENCIES.dependencies);
|
|
1196
|
-
|
|
1197
|
-
|
|
1217
|
+
const vue2List = ['vite2-vue2', 'nuxt', 'uni', 'vue'].map((e) => `${e}-template`);
|
|
1218
|
+
if (vue2List.includes(answers.template)) {
|
|
1219
|
+
choices.push(...Object.keys(VUE2_DEPENDENCIES.dependencies));
|
|
1220
|
+
}
|
|
1221
|
+
else if (/(vue|vite)/.test(answers.template)) {
|
|
1222
|
+
choices.push(...Object.keys(VUE3_DEPENDENCIES.dependencies));
|
|
1223
|
+
}
|
|
1224
|
+
if (/(vue|vite|react|nuxt)/.test(answers.template)) {
|
|
1225
|
+
choices.push(...Object.keys(WEB_DEPENDENCIES.dependencies));
|
|
1198
1226
|
}
|
|
1199
1227
|
return choices;
|
|
1200
1228
|
},
|