@varlet/cli 1.24.5-alpha.1640959607891 → 1.24.5-alpha.1640960313747
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/lib/commands/release.js +14 -25
- package/package.json +5 -5
package/lib/commands/release.js
CHANGED
|
@@ -51,13 +51,6 @@ var path_1 = require("path");
|
|
|
51
51
|
var fs_extra_1 = require("fs-extra");
|
|
52
52
|
var changelog_1 = require("./changelog");
|
|
53
53
|
var releaseTypes = ['premajor', 'preminor', 'prepatch', 'major', 'minor', 'patch'];
|
|
54
|
-
function delay() {
|
|
55
|
-
return new Promise(function (resolve) {
|
|
56
|
-
setTimeout(function () {
|
|
57
|
-
resolve();
|
|
58
|
-
}, 1000);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
54
|
function isWorktreeEmpty() {
|
|
62
55
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
56
|
var ret;
|
|
@@ -136,11 +129,11 @@ function updateVersion(version) {
|
|
|
136
129
|
}
|
|
137
130
|
function release() {
|
|
138
131
|
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
-
var currentVersion, name_1, ret, type, isPreRelease, expectVersion, confirm_1,
|
|
132
|
+
var currentVersion, name_1, ret, type, isPreRelease, expectVersion, confirm_1, e_1, error_1;
|
|
140
133
|
return __generator(this, function (_a) {
|
|
141
134
|
switch (_a.label) {
|
|
142
135
|
case 0:
|
|
143
|
-
_a.trys.push([0,
|
|
136
|
+
_a.trys.push([0, 12, , 13]);
|
|
144
137
|
currentVersion = require((0, path_1.resolve)(constant_1.CWD, 'package.json')).version;
|
|
145
138
|
if (!currentVersion) {
|
|
146
139
|
logger_1.default.error('Your package is missing the version field');
|
|
@@ -191,32 +184,28 @@ function release() {
|
|
|
191
184
|
case 6: return [4 /*yield*/, publish(isPreRelease)];
|
|
192
185
|
case 7:
|
|
193
186
|
_a.sent();
|
|
194
|
-
if (!isPreRelease) return [3 /*break*/,
|
|
187
|
+
if (!isPreRelease) return [3 /*break*/, 11];
|
|
195
188
|
_a.label = 8;
|
|
196
189
|
case 8:
|
|
197
|
-
_a.trys.push([8,
|
|
198
|
-
return [4 /*yield*/,
|
|
190
|
+
_a.trys.push([8, 10, , 11]);
|
|
191
|
+
return [4 /*yield*/, Promise.all([(0, execa_1.default)('git', ['restore', 'package.json']), (0, execa_1.default)('git', ['restore', '**/package.json'])])
|
|
192
|
+
// eslint-disable-next-line no-empty
|
|
193
|
+
];
|
|
199
194
|
case 9:
|
|
200
195
|
_a.sent();
|
|
201
|
-
return [
|
|
196
|
+
return [3 /*break*/, 11];
|
|
202
197
|
case 10:
|
|
203
|
-
ret_1 = _a.sent();
|
|
204
|
-
console.log(ret_1.stderr);
|
|
205
|
-
console.log(ret_1.stdout);
|
|
206
|
-
return [3 /*break*/, 12];
|
|
207
|
-
case 11:
|
|
208
198
|
e_1 = _a.sent();
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
case 12:
|
|
199
|
+
return [3 /*break*/, 11];
|
|
200
|
+
case 11:
|
|
212
201
|
logger_1.default.success("Release version ".concat(expectVersion, " successfully!"));
|
|
213
|
-
return [3 /*break*/,
|
|
214
|
-
case
|
|
202
|
+
return [3 /*break*/, 13];
|
|
203
|
+
case 12:
|
|
215
204
|
error_1 = _a.sent();
|
|
216
205
|
logger_1.default.error(error_1.toString());
|
|
217
206
|
process.exit(1);
|
|
218
|
-
return [3 /*break*/,
|
|
219
|
-
case
|
|
207
|
+
return [3 /*break*/, 13];
|
|
208
|
+
case 13: return [2 /*return*/];
|
|
220
209
|
}
|
|
221
210
|
});
|
|
222
211
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "1.24.5-alpha.
|
|
3
|
+
"version": "1.24.5-alpha.1640960313747",
|
|
4
4
|
"description": "cli of varlet",
|
|
5
5
|
"bin": {
|
|
6
6
|
"varlet-cli": "./lib/index.js"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"gitHead": "ee9c3866bedad96c86365b0f9888a3a6bb781b1f",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@varlet/icons": "1.24.5-alpha.
|
|
33
|
-
"@varlet/markdown-vite-plugin": "1.24.5-alpha.
|
|
34
|
-
"@varlet/touch-emulator": "1.24.5-alpha.
|
|
32
|
+
"@varlet/icons": "1.24.5-alpha.1640960313747",
|
|
33
|
+
"@varlet/markdown-vite-plugin": "1.24.5-alpha.1640960313747",
|
|
34
|
+
"@varlet/touch-emulator": "1.24.5-alpha.1640960313747",
|
|
35
35
|
"@babel/core": "^7.14.8",
|
|
36
36
|
"@babel/preset-env": "^7.14.8",
|
|
37
37
|
"@babel/preset-typescript": "^7.14.5",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/lodash-es": "^4.17.5"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@varlet/touch-emulator": "1.24.5-alpha.
|
|
76
|
+
"@varlet/touch-emulator": "1.24.5-alpha.1640960313747",
|
|
77
77
|
"@vue/test-utils": "^2.0.0-rc.6",
|
|
78
78
|
"vue": "3.2.16",
|
|
79
79
|
"vue-router": "4.0.12",
|