@emulsify/cli 1.11.4 → 1.12.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/index.js +1 -1
- package/dist/node_modules/.package-lock.json +34 -24
- package/dist/node_modules/@types/node/README.md +2 -2
- package/dist/node_modules/@types/node/assert.d.ts +23 -1
- package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
- package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
- package/dist/node_modules/@types/node/buffer.d.ts +19 -17
- package/dist/node_modules/@types/node/child_process.d.ts +88 -161
- package/dist/node_modules/@types/node/cluster.d.ts +5 -6
- package/dist/node_modules/@types/node/constants.d.ts +14 -12
- package/dist/node_modules/@types/node/crypto.d.ts +237 -166
- package/dist/node_modules/@types/node/dgram.d.ts +15 -14
- package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
- package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
- package/dist/node_modules/@types/node/dns.d.ts +28 -21
- package/dist/node_modules/@types/node/events.d.ts +81 -35
- package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
- package/dist/node_modules/@types/node/fs.d.ts +251 -193
- package/dist/node_modules/@types/node/globals.d.ts +146 -442
- package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
- package/dist/node_modules/@types/node/http.d.ts +136 -31
- package/dist/node_modules/@types/node/http2.d.ts +102 -26
- package/dist/node_modules/@types/node/https.d.ts +94 -60
- package/dist/node_modules/@types/node/index.d.ts +5 -3
- package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
- package/dist/node_modules/@types/node/module.d.ts +362 -138
- package/dist/node_modules/@types/node/net.d.ts +27 -20
- package/dist/node_modules/@types/node/os.d.ts +14 -3
- package/dist/node_modules/@types/node/package.json +4 -89
- package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
- package/dist/node_modules/@types/node/process.d.ts +108 -35
- package/dist/node_modules/@types/node/querystring.d.ts +2 -3
- package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
- package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
- package/dist/node_modules/@types/node/stream.d.ts +963 -1014
- package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/dist/node_modules/@types/node/test.d.ts +1504 -1655
- package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
- package/dist/node_modules/@types/node/timers.d.ts +157 -111
- package/dist/node_modules/@types/node/tls.d.ts +105 -67
- package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
- package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
- package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
- package/dist/node_modules/@types/node/url.d.ts +10 -1
- package/dist/node_modules/@types/node/util.d.ts +28 -3
- package/dist/node_modules/@types/node/v8.d.ts +6 -5
- package/dist/node_modules/@types/node/vm.d.ts +147 -68
- package/dist/node_modules/@types/node/wasi.d.ts +1 -1
- package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
- package/dist/node_modules/@types/node/zlib.d.ts +21 -20
- package/dist/node_modules/debug/package.json +7 -3
- package/dist/node_modules/debug/src/browser.js +2 -1
- package/dist/node_modules/debug/src/common.js +57 -39
- package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
- package/dist/node_modules/fast-uri/LICENSE +3 -1
- package/dist/node_modules/fast-uri/README.md +55 -37
- package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
- package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/dist/node_modules/fast-uri/eslint.config.js +6 -0
- package/dist/node_modules/fast-uri/index.js +98 -61
- package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
- package/dist/node_modules/fast-uri/lib/utils.js +217 -123
- package/dist/node_modules/fast-uri/package.json +44 -14
- package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
- package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
- package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
- package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
- package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
- package/dist/node_modules/fast-uri/test/util.test.js +23 -8
- package/dist/node_modules/fast-uri/tsconfig.json +9 -0
- package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
- package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
- package/dist/node_modules/fs-extra/LICENSE +1 -1
- package/dist/node_modules/fs-extra/README.md +3 -1
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
- package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
- package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
- package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonfile/README.md +1 -1
- package/dist/node_modules/jsonfile/index.js +3 -3
- package/dist/node_modules/jsonfile/package.json +1 -1
- package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
- package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
- package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
- package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
- package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
- package/dist/node_modules/simple-git/package.json +6 -6
- package/dist/node_modules/simple-git/readme.md +8 -0
- package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
- package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
- package/dist/node_modules/undici-types/filereader.d.ts +1 -1
- package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
- package/dist/node_modules/undici-types/package.json +1 -1
- package/dist/node_modules/undici-types/patch.d.ts +0 -38
- package/dist/node_modules/undici-types/readable.d.ts +5 -0
- package/dist/node_modules/undici-types/webidl.d.ts +6 -0
- package/dist/node_modules/undici-types/websocket.d.ts +0 -2
- package/dist/package-lock.json +912 -813
- package/dist/package.json +2 -2
- package/dist/util/getAvailableStarters.js +3 -3
- package/package.json +2 -2
- package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
- package/dist/node_modules/fast-uri/benchmark.js +0 -105
- package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
- package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
5
|
var __esm = (fn, res) => function __init() {
|
|
23
6
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
24
7
|
};
|
|
@@ -38,26 +21,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
38
21
|
return to;
|
|
39
22
|
};
|
|
40
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
|
-
var __async = (__this, __arguments, generator) => {
|
|
42
|
-
return new Promise((resolve, reject) => {
|
|
43
|
-
var fulfilled = (value) => {
|
|
44
|
-
try {
|
|
45
|
-
step(generator.next(value));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
reject(e);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var rejected = (value) => {
|
|
51
|
-
try {
|
|
52
|
-
step(generator.throw(value));
|
|
53
|
-
} catch (e) {
|
|
54
|
-
reject(e);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
58
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
24
|
|
|
62
25
|
// src/lib/args/pathspec.ts
|
|
63
26
|
function pathspec(...paths) {
|
|
@@ -124,9 +87,13 @@ var init_task_configuration_error = __esm({
|
|
|
124
87
|
});
|
|
125
88
|
|
|
126
89
|
// src/lib/utils/util.ts
|
|
90
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
127
91
|
import { exists, FOLDER } from "@kwsites/file-exists";
|
|
128
92
|
function asFunction(source) {
|
|
129
|
-
|
|
93
|
+
if (typeof source !== "function") {
|
|
94
|
+
return NOOP;
|
|
95
|
+
}
|
|
96
|
+
return source;
|
|
130
97
|
}
|
|
131
98
|
function isUserFunction(source) {
|
|
132
99
|
return typeof source === "function" && source !== NOOP;
|
|
@@ -147,7 +114,7 @@ function last(input, offset = 0) {
|
|
|
147
114
|
}
|
|
148
115
|
}
|
|
149
116
|
function isArrayLike(input) {
|
|
150
|
-
return
|
|
117
|
+
return filterHasLength(input);
|
|
151
118
|
}
|
|
152
119
|
function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
153
120
|
return input.split(separator).reduce((output, line) => {
|
|
@@ -200,14 +167,16 @@ function asCamelCase(str) {
|
|
|
200
167
|
});
|
|
201
168
|
}
|
|
202
169
|
function asStringArray(source) {
|
|
203
|
-
return asArray(source).map(
|
|
170
|
+
return asArray(source).map((item) => {
|
|
171
|
+
return item instanceof String ? item : String(item);
|
|
172
|
+
});
|
|
204
173
|
}
|
|
205
174
|
function asNumber(source, onNaN = 0) {
|
|
206
175
|
if (source == null) {
|
|
207
176
|
return onNaN;
|
|
208
177
|
}
|
|
209
178
|
const num = parseInt(source, 10);
|
|
210
|
-
return isNaN(num) ? onNaN : num;
|
|
179
|
+
return Number.isNaN(num) ? onNaN : num;
|
|
211
180
|
}
|
|
212
181
|
function prefixedArray(input, prefix) {
|
|
213
182
|
const output = [];
|
|
@@ -217,13 +186,16 @@ function prefixedArray(input, prefix) {
|
|
|
217
186
|
return output;
|
|
218
187
|
}
|
|
219
188
|
function bufferToString(input) {
|
|
220
|
-
return (Array.isArray(input) ?
|
|
189
|
+
return (Array.isArray(input) ? Buffer2.concat(input) : input).toString("utf-8");
|
|
221
190
|
}
|
|
222
191
|
function pick(source, properties) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
192
|
+
const out = {};
|
|
193
|
+
properties.forEach((key) => {
|
|
194
|
+
if (source[key] !== void 0) {
|
|
195
|
+
out[key] = source[key];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
return out;
|
|
227
199
|
}
|
|
228
200
|
function delay(duration = 0) {
|
|
229
201
|
return new Promise((done) => setTimeout(done, duration));
|
|
@@ -238,6 +210,7 @@ var NULL, NOOP, objectToString;
|
|
|
238
210
|
var init_util = __esm({
|
|
239
211
|
"src/lib/utils/util.ts"() {
|
|
240
212
|
"use strict";
|
|
213
|
+
init_argument_filters();
|
|
241
214
|
NULL = "\0";
|
|
242
215
|
NOOP = () => {
|
|
243
216
|
};
|
|
@@ -262,21 +235,21 @@ function filterPlainObject(input) {
|
|
|
262
235
|
function filterFunction(input) {
|
|
263
236
|
return typeof input === "function";
|
|
264
237
|
}
|
|
265
|
-
var filterArray,
|
|
238
|
+
var filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
|
|
266
239
|
var init_argument_filters = __esm({
|
|
267
240
|
"src/lib/utils/argument-filters.ts"() {
|
|
268
241
|
"use strict";
|
|
269
|
-
init_util();
|
|
270
242
|
init_pathspec();
|
|
243
|
+
init_util();
|
|
271
244
|
filterArray = (input) => {
|
|
272
245
|
return Array.isArray(input);
|
|
273
246
|
};
|
|
247
|
+
filterNumber = (input) => {
|
|
248
|
+
return typeof input === "number";
|
|
249
|
+
};
|
|
274
250
|
filterString = (input) => {
|
|
275
251
|
return typeof input === "string";
|
|
276
252
|
};
|
|
277
|
-
filterStringArray = (input) => {
|
|
278
|
-
return Array.isArray(input) && input.every(filterString);
|
|
279
|
-
};
|
|
280
253
|
filterStringOrStringArray = (input) => {
|
|
281
254
|
return filterString(input) || Array.isArray(input) && input.every(filterString);
|
|
282
255
|
};
|
|
@@ -284,7 +257,7 @@ var init_argument_filters = __esm({
|
|
|
284
257
|
if (input == null || "number|boolean|function".includes(typeof input)) {
|
|
285
258
|
return false;
|
|
286
259
|
}
|
|
287
|
-
return
|
|
260
|
+
return typeof input.length === "number";
|
|
288
261
|
};
|
|
289
262
|
}
|
|
290
263
|
});
|
|
@@ -309,19 +282,22 @@ var GitOutputStreams;
|
|
|
309
282
|
var init_git_output_streams = __esm({
|
|
310
283
|
"src/lib/utils/git-output-streams.ts"() {
|
|
311
284
|
"use strict";
|
|
312
|
-
GitOutputStreams = class {
|
|
285
|
+
GitOutputStreams = class _GitOutputStreams {
|
|
313
286
|
constructor(stdOut, stdErr) {
|
|
314
287
|
this.stdOut = stdOut;
|
|
315
288
|
this.stdErr = stdErr;
|
|
316
289
|
}
|
|
317
290
|
asStrings() {
|
|
318
|
-
return new
|
|
291
|
+
return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
|
|
319
292
|
}
|
|
320
293
|
};
|
|
321
294
|
}
|
|
322
295
|
});
|
|
323
296
|
|
|
324
297
|
// src/lib/utils/line-parser.ts
|
|
298
|
+
function useMatchesDefault() {
|
|
299
|
+
throw new Error(`LineParser:useMatches not implemented`);
|
|
300
|
+
}
|
|
325
301
|
var LineParser, RemoteLineParser;
|
|
326
302
|
var init_line_parser = __esm({
|
|
327
303
|
"src/lib/utils/line-parser.ts"() {
|
|
@@ -329,6 +305,7 @@ var init_line_parser = __esm({
|
|
|
329
305
|
LineParser = class {
|
|
330
306
|
constructor(regExp, useMatches) {
|
|
331
307
|
this.matches = [];
|
|
308
|
+
this.useMatches = useMatchesDefault;
|
|
332
309
|
this.parse = (line, target) => {
|
|
333
310
|
this.resetMatches();
|
|
334
311
|
if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
|
|
@@ -341,9 +318,6 @@ var init_line_parser = __esm({
|
|
|
341
318
|
this.useMatches = useMatches;
|
|
342
319
|
}
|
|
343
320
|
}
|
|
344
|
-
useMatches(target, match) {
|
|
345
|
-
throw new Error(`LineParser:useMatches not implemented`);
|
|
346
|
-
}
|
|
347
321
|
resetMatches() {
|
|
348
322
|
this.matches.length = 0;
|
|
349
323
|
}
|
|
@@ -378,7 +352,7 @@ var init_line_parser = __esm({
|
|
|
378
352
|
function createInstanceConfig(...options) {
|
|
379
353
|
const baseDir = process.cwd();
|
|
380
354
|
const config = Object.assign(
|
|
381
|
-
|
|
355
|
+
{ baseDir, ...defaultOptions },
|
|
382
356
|
...options.filter((o) => typeof o === "object" && o)
|
|
383
357
|
);
|
|
384
358
|
config.baseDir = config.baseDir || baseDir;
|
|
@@ -409,6 +383,12 @@ function appendTaskOptions(options, commands = []) {
|
|
|
409
383
|
commands2.push(value);
|
|
410
384
|
} else if (filterPrimitives(value, ["boolean"])) {
|
|
411
385
|
commands2.push(key + "=" + value);
|
|
386
|
+
} else if (Array.isArray(value)) {
|
|
387
|
+
for (const v of value) {
|
|
388
|
+
if (!filterPrimitives(v, ["string", "number"])) {
|
|
389
|
+
commands2.push(key + "=" + v);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
412
392
|
} else {
|
|
413
393
|
commands2.push(key);
|
|
414
394
|
}
|
|
@@ -430,7 +410,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
|
|
|
430
410
|
}
|
|
431
411
|
function trailingArrayArgument(args) {
|
|
432
412
|
const hasTrailingCallback = typeof last(args) === "function";
|
|
433
|
-
return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
|
|
413
|
+
return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
|
|
434
414
|
}
|
|
435
415
|
function trailingOptionsArgument(args) {
|
|
436
416
|
const hasTrailingCallback = filterFunction(last(args));
|
|
@@ -497,10 +477,10 @@ __export(utils_exports, {
|
|
|
497
477
|
filterArray: () => filterArray,
|
|
498
478
|
filterFunction: () => filterFunction,
|
|
499
479
|
filterHasLength: () => filterHasLength,
|
|
480
|
+
filterNumber: () => filterNumber,
|
|
500
481
|
filterPlainObject: () => filterPlainObject,
|
|
501
482
|
filterPrimitives: () => filterPrimitives,
|
|
502
483
|
filterString: () => filterString,
|
|
503
|
-
filterStringArray: () => filterStringArray,
|
|
504
484
|
filterStringOrStringArray: () => filterStringOrStringArray,
|
|
505
485
|
filterType: () => filterType,
|
|
506
486
|
first: () => first,
|
|
@@ -864,7 +844,7 @@ var init_ConfigList = __esm({
|
|
|
864
844
|
}
|
|
865
845
|
addValue(file, key, value) {
|
|
866
846
|
const values = this.addFile(file);
|
|
867
|
-
if (!
|
|
847
|
+
if (!Object.hasOwn(values, key)) {
|
|
868
848
|
values[key] = value;
|
|
869
849
|
} else if (Array.isArray(values[key])) {
|
|
870
850
|
values[key].push(value);
|
|
@@ -879,7 +859,7 @@ var init_ConfigList = __esm({
|
|
|
879
859
|
|
|
880
860
|
// src/lib/tasks/config.ts
|
|
881
861
|
function asConfigScope(scope, fallback) {
|
|
882
|
-
if (typeof scope === "string" &&
|
|
862
|
+
if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
|
|
883
863
|
return scope;
|
|
884
864
|
}
|
|
885
865
|
return fallback;
|
|
@@ -1098,12 +1078,13 @@ function getResetMode(mode) {
|
|
|
1098
1078
|
return;
|
|
1099
1079
|
}
|
|
1100
1080
|
function isValidResetMode(mode) {
|
|
1101
|
-
return
|
|
1081
|
+
return typeof mode === "string" && validResetModes.includes(mode);
|
|
1102
1082
|
}
|
|
1103
|
-
var ResetMode,
|
|
1083
|
+
var ResetMode, validResetModes;
|
|
1104
1084
|
var init_reset = __esm({
|
|
1105
1085
|
"src/lib/tasks/reset.ts"() {
|
|
1106
1086
|
"use strict";
|
|
1087
|
+
init_utils();
|
|
1107
1088
|
init_task();
|
|
1108
1089
|
ResetMode = /* @__PURE__ */ ((ResetMode2) => {
|
|
1109
1090
|
ResetMode2["MIXED"] = "mixed";
|
|
@@ -1113,7 +1094,7 @@ var init_reset = __esm({
|
|
|
1113
1094
|
ResetMode2["KEEP"] = "keep";
|
|
1114
1095
|
return ResetMode2;
|
|
1115
1096
|
})(ResetMode || {});
|
|
1116
|
-
|
|
1097
|
+
validResetModes = asStringArray(Object.values(ResetMode));
|
|
1117
1098
|
}
|
|
1118
1099
|
});
|
|
1119
1100
|
|
|
@@ -1185,13 +1166,13 @@ var init_git_logger = __esm({
|
|
|
1185
1166
|
});
|
|
1186
1167
|
|
|
1187
1168
|
// src/lib/runners/tasks-pending-queue.ts
|
|
1188
|
-
var
|
|
1169
|
+
var TasksPendingQueue;
|
|
1189
1170
|
var init_tasks_pending_queue = __esm({
|
|
1190
1171
|
"src/lib/runners/tasks-pending-queue.ts"() {
|
|
1191
1172
|
"use strict";
|
|
1192
1173
|
init_git_error();
|
|
1193
1174
|
init_git_logger();
|
|
1194
|
-
|
|
1175
|
+
TasksPendingQueue = class _TasksPendingQueue {
|
|
1195
1176
|
constructor(logLabel = "GitExecutor") {
|
|
1196
1177
|
this.logLabel = logLabel;
|
|
1197
1178
|
this._queue = /* @__PURE__ */ new Map();
|
|
@@ -1250,9 +1231,10 @@ var init_tasks_pending_queue = __esm({
|
|
|
1250
1231
|
static getName(name = "empty") {
|
|
1251
1232
|
return `task:${name}:${++_TasksPendingQueue.counter}`;
|
|
1252
1233
|
}
|
|
1234
|
+
static {
|
|
1235
|
+
this.counter = 0;
|
|
1236
|
+
}
|
|
1253
1237
|
};
|
|
1254
|
-
TasksPendingQueue = _TasksPendingQueue;
|
|
1255
|
-
TasksPendingQueue.counter = 0;
|
|
1256
1238
|
}
|
|
1257
1239
|
});
|
|
1258
1240
|
|
|
@@ -1312,20 +1294,18 @@ var init_git_executor_chain = __esm({
|
|
|
1312
1294
|
this._queue.push(task);
|
|
1313
1295
|
return this._chain = this._chain.then(() => this.attemptTask(task));
|
|
1314
1296
|
}
|
|
1315
|
-
attemptTask(task) {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
});
|
|
1297
|
+
async attemptTask(task) {
|
|
1298
|
+
const onScheduleComplete = await this._scheduler.next();
|
|
1299
|
+
const onQueueComplete = () => this._queue.complete(task);
|
|
1300
|
+
try {
|
|
1301
|
+
const { logger } = this._queue.attempt(task);
|
|
1302
|
+
return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
|
|
1303
|
+
} catch (e) {
|
|
1304
|
+
throw this.onFatalException(task, e);
|
|
1305
|
+
} finally {
|
|
1306
|
+
onQueueComplete();
|
|
1307
|
+
onScheduleComplete();
|
|
1308
|
+
}
|
|
1329
1309
|
}
|
|
1330
1310
|
onFatalException(task, e) {
|
|
1331
1311
|
const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
|
|
@@ -1333,34 +1313,30 @@ var init_git_executor_chain = __esm({
|
|
|
1333
1313
|
this._queue.fatal(gitError);
|
|
1334
1314
|
return gitError;
|
|
1335
1315
|
}
|
|
1336
|
-
attemptRemoteTask(task, logger) {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
return callTaskParser(task.parser, outputStreams.asStrings());
|
|
1357
|
-
});
|
|
1316
|
+
async attemptRemoteTask(task, logger) {
|
|
1317
|
+
const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
|
|
1318
|
+
const args = this._plugins.exec(
|
|
1319
|
+
"spawn.args",
|
|
1320
|
+
[...task.commands],
|
|
1321
|
+
pluginContext(task, task.commands)
|
|
1322
|
+
);
|
|
1323
|
+
const raw = await this.gitResponse(
|
|
1324
|
+
task,
|
|
1325
|
+
binary,
|
|
1326
|
+
args,
|
|
1327
|
+
this.outputHandler,
|
|
1328
|
+
logger.step("SPAWN")
|
|
1329
|
+
);
|
|
1330
|
+
const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
|
|
1331
|
+
logger(`passing response to task's parser as a %s`, task.format);
|
|
1332
|
+
if (isBufferTask(task)) {
|
|
1333
|
+
return callTaskParser(task.parser, outputStreams);
|
|
1334
|
+
}
|
|
1335
|
+
return callTaskParser(task.parser, outputStreams.asStrings());
|
|
1358
1336
|
}
|
|
1359
|
-
attemptEmptyTask(task, logger) {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
return task.parser(this);
|
|
1363
|
-
});
|
|
1337
|
+
async attemptEmptyTask(task, logger) {
|
|
1338
|
+
logger(`empty task bypassing child process to call to task's parser`);
|
|
1339
|
+
return task.parser(this);
|
|
1364
1340
|
}
|
|
1365
1341
|
handleTaskData(task, args, result, logger) {
|
|
1366
1342
|
const { exitCode, rejection, stdOut, stdErr } = result;
|
|
@@ -1369,7 +1345,10 @@ var init_git_executor_chain = __esm({
|
|
|
1369
1345
|
const { error } = this._plugins.exec(
|
|
1370
1346
|
"task.error",
|
|
1371
1347
|
{ error: rejection },
|
|
1372
|
-
|
|
1348
|
+
{
|
|
1349
|
+
...pluginContext(task, args),
|
|
1350
|
+
...result
|
|
1351
|
+
}
|
|
1373
1352
|
);
|
|
1374
1353
|
if (error && task.onError) {
|
|
1375
1354
|
logger.info(`exitCode=%s handling with custom error handler`);
|
|
@@ -1402,79 +1381,80 @@ var init_git_executor_chain = __esm({
|
|
|
1402
1381
|
done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
|
|
1403
1382
|
});
|
|
1404
1383
|
}
|
|
1405
|
-
gitResponse(task, command, args, outputHandler, logger) {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1384
|
+
async gitResponse(task, command, args, outputHandler, logger) {
|
|
1385
|
+
const outputLogger = logger.sibling("output");
|
|
1386
|
+
const spawnOptions = this._plugins.exec(
|
|
1387
|
+
"spawn.options",
|
|
1388
|
+
{
|
|
1389
|
+
cwd: this.cwd,
|
|
1390
|
+
env: this.env,
|
|
1391
|
+
windowsHide: true
|
|
1392
|
+
},
|
|
1393
|
+
pluginContext(task, task.commands)
|
|
1394
|
+
);
|
|
1395
|
+
return new Promise((done) => {
|
|
1396
|
+
const stdOut = [];
|
|
1397
|
+
const stdErr = [];
|
|
1398
|
+
logger.info(`%s %o`, command, args);
|
|
1399
|
+
logger("%O", spawnOptions);
|
|
1400
|
+
let rejection = this._beforeSpawn(task, args);
|
|
1401
|
+
if (rejection) {
|
|
1402
|
+
return done({
|
|
1403
|
+
stdOut,
|
|
1404
|
+
stdErr,
|
|
1405
|
+
exitCode: 9901,
|
|
1406
|
+
rejection
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
this._plugins.exec("spawn.before", void 0, {
|
|
1410
|
+
...pluginContext(task, args),
|
|
1411
|
+
kill(reason) {
|
|
1412
|
+
rejection = reason || rejection;
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
const spawned = spawn(command, args, spawnOptions);
|
|
1416
|
+
spawned.stdout.on(
|
|
1417
|
+
"data",
|
|
1418
|
+
onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
|
|
1419
|
+
);
|
|
1420
|
+
spawned.stderr.on(
|
|
1421
|
+
"data",
|
|
1422
|
+
onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
|
|
1416
1423
|
);
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1424
|
+
spawned.on("error", onErrorReceived(stdErr, logger));
|
|
1425
|
+
if (outputHandler) {
|
|
1426
|
+
logger(`Passing child process stdOut/stdErr to custom outputHandler`);
|
|
1427
|
+
outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
|
|
1428
|
+
}
|
|
1429
|
+
this._plugins.exec("spawn.after", void 0, {
|
|
1430
|
+
...pluginContext(task, args),
|
|
1431
|
+
spawned,
|
|
1432
|
+
close(exitCode, reason) {
|
|
1433
|
+
done({
|
|
1425
1434
|
stdOut,
|
|
1426
1435
|
stdErr,
|
|
1427
|
-
exitCode
|
|
1428
|
-
rejection
|
|
1436
|
+
exitCode,
|
|
1437
|
+
rejection: rejection || reason
|
|
1429
1438
|
});
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1439
|
+
},
|
|
1440
|
+
kill(reason) {
|
|
1441
|
+
if (spawned.killed) {
|
|
1442
|
+
return;
|
|
1434
1443
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
spawned.stdout.on(
|
|
1438
|
-
"data",
|
|
1439
|
-
onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
|
|
1440
|
-
);
|
|
1441
|
-
spawned.stderr.on(
|
|
1442
|
-
"data",
|
|
1443
|
-
onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
|
|
1444
|
-
);
|
|
1445
|
-
spawned.on("error", onErrorReceived(stdErr, logger));
|
|
1446
|
-
if (outputHandler) {
|
|
1447
|
-
logger(`Passing child process stdOut/stdErr to custom outputHandler`);
|
|
1448
|
-
outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
|
|
1444
|
+
rejection = reason;
|
|
1445
|
+
spawned.kill("SIGINT");
|
|
1449
1446
|
}
|
|
1450
|
-
this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
|
|
1451
|
-
spawned,
|
|
1452
|
-
close(exitCode, reason) {
|
|
1453
|
-
done({
|
|
1454
|
-
stdOut,
|
|
1455
|
-
stdErr,
|
|
1456
|
-
exitCode,
|
|
1457
|
-
rejection: rejection || reason
|
|
1458
|
-
});
|
|
1459
|
-
},
|
|
1460
|
-
kill(reason) {
|
|
1461
|
-
if (spawned.killed) {
|
|
1462
|
-
return;
|
|
1463
|
-
}
|
|
1464
|
-
rejection = reason;
|
|
1465
|
-
spawned.kill("SIGINT");
|
|
1466
|
-
}
|
|
1467
|
-
}));
|
|
1468
1447
|
});
|
|
1469
1448
|
});
|
|
1470
1449
|
}
|
|
1471
1450
|
_beforeSpawn(task, args) {
|
|
1472
1451
|
let rejection;
|
|
1473
|
-
this._plugins.exec("spawn.before", void 0,
|
|
1452
|
+
this._plugins.exec("spawn.before", void 0, {
|
|
1453
|
+
...pluginContext(task, args),
|
|
1474
1454
|
kill(reason) {
|
|
1475
1455
|
rejection = reason || rejection;
|
|
1476
1456
|
}
|
|
1477
|
-
})
|
|
1457
|
+
});
|
|
1478
1458
|
return rejection;
|
|
1479
1459
|
}
|
|
1480
1460
|
};
|
|
@@ -1514,7 +1494,7 @@ function taskCallback(task, response, callback = NOOP) {
|
|
|
1514
1494
|
callback(null, data);
|
|
1515
1495
|
};
|
|
1516
1496
|
const onError2 = (err) => {
|
|
1517
|
-
if (
|
|
1497
|
+
if (err?.task === task) {
|
|
1518
1498
|
callback(
|
|
1519
1499
|
err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err,
|
|
1520
1500
|
void 0
|
|
@@ -1644,7 +1624,7 @@ var init_count_objects = __esm({
|
|
|
1644
1624
|
/([a-z-]+): (\d+)$/,
|
|
1645
1625
|
(result, [key, value]) => {
|
|
1646
1626
|
const property = asCamelCase(key);
|
|
1647
|
-
if (
|
|
1627
|
+
if (Object.hasOwn(result, property)) {
|
|
1648
1628
|
result[property] = asNumber(value);
|
|
1649
1629
|
}
|
|
1650
1630
|
}
|
|
@@ -1736,7 +1716,10 @@ function commit_default() {
|
|
|
1736
1716
|
const task = rejectDeprecatedSignatures(message) || commitTask(
|
|
1737
1717
|
asArray(message),
|
|
1738
1718
|
asArray(filterType(rest[0], filterStringOrStringArray, [])),
|
|
1739
|
-
[
|
|
1719
|
+
[
|
|
1720
|
+
...asStringArray(filterType(rest[1], filterArray, [])),
|
|
1721
|
+
...getTrailingOptions(arguments, 0, true)
|
|
1722
|
+
]
|
|
1740
1723
|
);
|
|
1741
1724
|
return this._runTask(task, next);
|
|
1742
1725
|
}
|
|
@@ -1934,8 +1917,8 @@ var init_parse_diff_summary = __esm({
|
|
|
1934
1917
|
const inserted = /(\d+) i/.exec(summary);
|
|
1935
1918
|
const deleted = /(\d+) d/.exec(summary);
|
|
1936
1919
|
result.changed = asNumber(changed);
|
|
1937
|
-
result.insertions = asNumber(inserted
|
|
1938
|
-
result.deletions = asNumber(deleted
|
|
1920
|
+
result.insertions = asNumber(inserted?.[1]);
|
|
1921
|
+
result.deletions = asNumber(deleted?.[1]);
|
|
1939
1922
|
}
|
|
1940
1923
|
)
|
|
1941
1924
|
];
|
|
@@ -1985,7 +1968,7 @@ var init_parse_diff_summary = __esm({
|
|
|
1985
1968
|
(result, [status, similarity, from, _to, to]) => {
|
|
1986
1969
|
result.changed++;
|
|
1987
1970
|
result.files.push({
|
|
1988
|
-
file: to
|
|
1971
|
+
file: to ?? from,
|
|
1989
1972
|
changes: 0,
|
|
1990
1973
|
insertions: 0,
|
|
1991
1974
|
deletions: 0,
|
|
@@ -2115,7 +2098,7 @@ function userOptions(input) {
|
|
|
2115
2098
|
}
|
|
2116
2099
|
function parseLogOptions(opt = {}, customArgs = []) {
|
|
2117
2100
|
const splitter = filterType(opt.splitter, filterString, SPLITTER);
|
|
2118
|
-
const format =
|
|
2101
|
+
const format = filterPlainObject(opt.format) ? opt.format : {
|
|
2119
2102
|
hash: "%H",
|
|
2120
2103
|
date: opt.strictDate === false ? "%ai" : "%aI",
|
|
2121
2104
|
message: "%s",
|
|
@@ -2162,7 +2145,7 @@ function log_default() {
|
|
|
2162
2145
|
const next = trailingFunctionArgument(arguments);
|
|
2163
2146
|
const options = parseLogOptions(
|
|
2164
2147
|
trailingOptionsArgument(arguments),
|
|
2165
|
-
filterType(arguments[0], filterArray)
|
|
2148
|
+
asStringArray(filterType(arguments[0], filterArray, []))
|
|
2166
2149
|
);
|
|
2167
2150
|
const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
|
|
2168
2151
|
return this._runTask(task, next);
|
|
@@ -2534,9 +2517,10 @@ var init_parse_push = __esm({
|
|
|
2534
2517
|
result.repo = repo;
|
|
2535
2518
|
}),
|
|
2536
2519
|
new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
|
|
2537
|
-
result.ref =
|
|
2520
|
+
result.ref = {
|
|
2521
|
+
...result.ref || {},
|
|
2538
2522
|
local
|
|
2539
|
-
}
|
|
2523
|
+
};
|
|
2540
2524
|
}),
|
|
2541
2525
|
new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
|
|
2542
2526
|
result.pushed.push(pushResultPushedItem(local, remote, type));
|
|
@@ -2544,11 +2528,12 @@ var init_parse_push = __esm({
|
|
|
2544
2528
|
new LineParser(
|
|
2545
2529
|
/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
|
|
2546
2530
|
(result, [local, remote, remoteName]) => {
|
|
2547
|
-
result.branch =
|
|
2531
|
+
result.branch = {
|
|
2532
|
+
...result.branch || {},
|
|
2548
2533
|
local,
|
|
2549
2534
|
remote,
|
|
2550
2535
|
remoteName
|
|
2551
|
-
}
|
|
2536
|
+
};
|
|
2552
2537
|
}
|
|
2553
2538
|
),
|
|
2554
2539
|
new LineParser(
|
|
@@ -2570,7 +2555,10 @@ var init_parse_push = __esm({
|
|
|
2570
2555
|
parsePushResult = (stdOut, stdErr) => {
|
|
2571
2556
|
const pushDetail = parsePushDetail(stdOut, stdErr);
|
|
2572
2557
|
const responseDetail = parseRemoteMessages(stdOut, stdErr);
|
|
2573
|
-
return
|
|
2558
|
+
return {
|
|
2559
|
+
...pushDetail,
|
|
2560
|
+
...responseDetail
|
|
2561
|
+
};
|
|
2574
2562
|
};
|
|
2575
2563
|
parsePushDetail = (stdOut, stdErr) => {
|
|
2576
2564
|
return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
|
|
@@ -2802,18 +2790,19 @@ var init_StatusSummary = __esm({
|
|
|
2802
2790
|
const behindReg = /behind (\d+)/;
|
|
2803
2791
|
const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
|
|
2804
2792
|
const trackingReg = /\.{3}(\S*)/;
|
|
2805
|
-
const onEmptyBranchReg = /\son\s(
|
|
2806
|
-
let regexResult;
|
|
2807
|
-
regexResult = aheadReg.exec(line);
|
|
2793
|
+
const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
|
|
2794
|
+
let regexResult = aheadReg.exec(line);
|
|
2808
2795
|
result.ahead = regexResult && +regexResult[1] || 0;
|
|
2809
2796
|
regexResult = behindReg.exec(line);
|
|
2810
2797
|
result.behind = regexResult && +regexResult[1] || 0;
|
|
2811
2798
|
regexResult = currentReg.exec(line);
|
|
2812
|
-
result.current = regexResult
|
|
2799
|
+
result.current = filterType(regexResult?.[1], filterString, null);
|
|
2813
2800
|
regexResult = trackingReg.exec(line);
|
|
2814
|
-
result.tracking = regexResult
|
|
2801
|
+
result.tracking = filterType(regexResult?.[1], filterString, null);
|
|
2815
2802
|
regexResult = onEmptyBranchReg.exec(line);
|
|
2816
|
-
|
|
2803
|
+
if (regexResult) {
|
|
2804
|
+
result.current = filterType(regexResult?.[1], filterString, result.current);
|
|
2805
|
+
}
|
|
2817
2806
|
result.detached = /\(no branch\)/.test(line);
|
|
2818
2807
|
}
|
|
2819
2808
|
]
|
|
@@ -2989,7 +2978,7 @@ var init_simple_git_api = __esm({
|
|
|
2989
2978
|
if (typeof directory === "string") {
|
|
2990
2979
|
return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);
|
|
2991
2980
|
}
|
|
2992
|
-
if (typeof
|
|
2981
|
+
if (typeof directory?.path === "string") {
|
|
2993
2982
|
return this._runTask(
|
|
2994
2983
|
changeWorkingDirectoryTask(
|
|
2995
2984
|
directory.path,
|
|
@@ -3088,7 +3077,7 @@ var init_scheduler = __esm({
|
|
|
3088
3077
|
"use strict";
|
|
3089
3078
|
init_utils();
|
|
3090
3079
|
init_git_logger();
|
|
3091
|
-
createScheduledTask = (() => {
|
|
3080
|
+
createScheduledTask = /* @__PURE__ */ (() => {
|
|
3092
3081
|
let id = 0;
|
|
3093
3082
|
return () => {
|
|
3094
3083
|
id++;
|
|
@@ -3248,10 +3237,14 @@ var init_BranchSummary = __esm({
|
|
|
3248
3237
|
function branchStatus(input) {
|
|
3249
3238
|
return input ? input.charAt(0) : "";
|
|
3250
3239
|
}
|
|
3251
|
-
function parseBranchSummary(stdOut) {
|
|
3252
|
-
return parseStringResponse(
|
|
3240
|
+
function parseBranchSummary(stdOut, currentOnly = false) {
|
|
3241
|
+
return parseStringResponse(
|
|
3242
|
+
new BranchSummaryResult(),
|
|
3243
|
+
currentOnly ? [currentBranchParser] : parsers9,
|
|
3244
|
+
stdOut
|
|
3245
|
+
);
|
|
3253
3246
|
}
|
|
3254
|
-
var parsers9;
|
|
3247
|
+
var parsers9, currentBranchParser;
|
|
3255
3248
|
var init_parse_branch = __esm({
|
|
3256
3249
|
"src/lib/parsers/parse-branch.ts"() {
|
|
3257
3250
|
"use strict";
|
|
@@ -3265,12 +3258,15 @@ var init_parse_branch = __esm({
|
|
|
3265
3258
|
}
|
|
3266
3259
|
),
|
|
3267
3260
|
new LineParser(
|
|
3268
|
-
|
|
3261
|
+
/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
|
|
3269
3262
|
(result, [current, name, commit, label]) => {
|
|
3270
3263
|
result.push(branchStatus(current), false, name, commit, label);
|
|
3271
3264
|
}
|
|
3272
3265
|
)
|
|
3273
3266
|
];
|
|
3267
|
+
currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
|
|
3268
|
+
result.push("*" /* CURRENT */, false, name, "", "");
|
|
3269
|
+
});
|
|
3274
3270
|
}
|
|
3275
3271
|
});
|
|
3276
3272
|
|
|
@@ -3289,6 +3285,7 @@ function containsDeleteBranchCommand(commands) {
|
|
|
3289
3285
|
}
|
|
3290
3286
|
function branchTask(customArgs) {
|
|
3291
3287
|
const isDelete = containsDeleteBranchCommand(customArgs);
|
|
3288
|
+
const isCurrentOnly = customArgs.includes("--show-current");
|
|
3292
3289
|
const commands = ["branch", ...customArgs];
|
|
3293
3290
|
if (commands.length === 1) {
|
|
3294
3291
|
commands.push("-a");
|
|
@@ -3303,16 +3300,17 @@ function branchTask(customArgs) {
|
|
|
3303
3300
|
if (isDelete) {
|
|
3304
3301
|
return parseBranchDeletions(stdOut, stdErr).all[0];
|
|
3305
3302
|
}
|
|
3306
|
-
return parseBranchSummary(stdOut);
|
|
3303
|
+
return parseBranchSummary(stdOut, isCurrentOnly);
|
|
3307
3304
|
}
|
|
3308
3305
|
};
|
|
3309
3306
|
}
|
|
3310
3307
|
function branchLocalTask() {
|
|
3311
|
-
const parser4 = parseBranchSummary;
|
|
3312
3308
|
return {
|
|
3313
3309
|
format: "utf-8",
|
|
3314
3310
|
commands: ["branch", "-v"],
|
|
3315
|
-
parser
|
|
3311
|
+
parser(stdOut) {
|
|
3312
|
+
return parseBranchSummary(stdOut);
|
|
3313
|
+
}
|
|
3316
3314
|
};
|
|
3317
3315
|
}
|
|
3318
3316
|
function deleteBranchesTask(branches, forceDelete = false) {
|
|
@@ -3360,12 +3358,17 @@ var init_branch = __esm({
|
|
|
3360
3358
|
});
|
|
3361
3359
|
|
|
3362
3360
|
// src/lib/responses/CheckIgnore.ts
|
|
3361
|
+
import { normalize } from "node:path";
|
|
3362
|
+
function toPath(input) {
|
|
3363
|
+
const path = input.trim().replace(/^["']|["']$/g, "");
|
|
3364
|
+
return path && normalize(path);
|
|
3365
|
+
}
|
|
3363
3366
|
var parseCheckIgnore;
|
|
3364
3367
|
var init_CheckIgnore = __esm({
|
|
3365
3368
|
"src/lib/responses/CheckIgnore.ts"() {
|
|
3366
3369
|
"use strict";
|
|
3367
3370
|
parseCheckIgnore = (text) => {
|
|
3368
|
-
return text.split(/\n/g).map(
|
|
3371
|
+
return text.split(/\n/g).map(toPath).filter(Boolean);
|
|
3369
3372
|
};
|
|
3370
3373
|
}
|
|
3371
3374
|
});
|
|
@@ -3587,7 +3590,7 @@ function parseGetRemotes(text) {
|
|
|
3587
3590
|
function parseGetRemotesVerbose(text) {
|
|
3588
3591
|
const remotes = {};
|
|
3589
3592
|
forEach(text, ([name, url, purpose]) => {
|
|
3590
|
-
if (!
|
|
3593
|
+
if (!Object.hasOwn(remotes, name)) {
|
|
3591
3594
|
remotes[name] = {
|
|
3592
3595
|
name,
|
|
3593
3596
|
refs: { fetch: "", push: "" }
|
|
@@ -3719,8 +3722,8 @@ var init_sub_module = __esm({
|
|
|
3719
3722
|
|
|
3720
3723
|
// src/lib/responses/TagList.ts
|
|
3721
3724
|
function singleSorted(a, b) {
|
|
3722
|
-
const aIsNum = isNaN(a);
|
|
3723
|
-
const bIsNum = isNaN(b);
|
|
3725
|
+
const aIsNum = Number.isNaN(a);
|
|
3726
|
+
const bIsNum = Number.isNaN(b);
|
|
3724
3727
|
if (aIsNum !== bIsNum) {
|
|
3725
3728
|
return aIsNum ? 1 : -1;
|
|
3726
3729
|
}
|
|
@@ -4370,27 +4373,24 @@ function completionDetectionPlugin({
|
|
|
4370
4373
|
}
|
|
4371
4374
|
return {
|
|
4372
4375
|
type: "spawn.after",
|
|
4373
|
-
action(
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
if (deferClose) {
|
|
4387
|
-
yield delay(50);
|
|
4388
|
-
}
|
|
4389
|
-
close(events.exitCode);
|
|
4390
|
-
} catch (err) {
|
|
4391
|
-
close(events.exitCode, err);
|
|
4376
|
+
async action(_data, { spawned, close }) {
|
|
4377
|
+
const events = createEvents();
|
|
4378
|
+
let deferClose = true;
|
|
4379
|
+
let quickClose = () => void (deferClose = false);
|
|
4380
|
+
spawned.stdout?.on("data", quickClose);
|
|
4381
|
+
spawned.stderr?.on("data", quickClose);
|
|
4382
|
+
spawned.on("error", quickClose);
|
|
4383
|
+
spawned.on("close", (code) => events.close(code));
|
|
4384
|
+
spawned.on("exit", (code) => events.exit(code));
|
|
4385
|
+
try {
|
|
4386
|
+
await events.result;
|
|
4387
|
+
if (deferClose) {
|
|
4388
|
+
await delay(50);
|
|
4392
4389
|
}
|
|
4393
|
-
|
|
4390
|
+
close(events.exitCode);
|
|
4391
|
+
} catch (err) {
|
|
4392
|
+
close(events.exitCode, err);
|
|
4393
|
+
}
|
|
4394
4394
|
}
|
|
4395
4395
|
};
|
|
4396
4396
|
}
|
|
@@ -4513,11 +4513,10 @@ function progressMonitorPlugin(progress) {
|
|
|
4513
4513
|
const onProgress = {
|
|
4514
4514
|
type: "spawn.after",
|
|
4515
4515
|
action(_data, context) {
|
|
4516
|
-
var _a2;
|
|
4517
4516
|
if (!context.commands.includes(progressCommand)) {
|
|
4518
4517
|
return;
|
|
4519
4518
|
}
|
|
4520
|
-
|
|
4519
|
+
context.spawned.stderr?.on("data", (chunk) => {
|
|
4521
4520
|
const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8"));
|
|
4522
4521
|
if (!message) {
|
|
4523
4522
|
return;
|
|
@@ -4554,7 +4553,7 @@ function spawnOptionsPlugin(spawnOptions) {
|
|
|
4554
4553
|
return {
|
|
4555
4554
|
type: "spawn.options",
|
|
4556
4555
|
action(data) {
|
|
4557
|
-
return
|
|
4556
|
+
return { ...options, ...data };
|
|
4558
4557
|
}
|
|
4559
4558
|
};
|
|
4560
4559
|
}
|
|
@@ -4569,16 +4568,14 @@ function timeoutPlugin({
|
|
|
4569
4568
|
return {
|
|
4570
4569
|
type: "spawn.after",
|
|
4571
4570
|
action(_data, context) {
|
|
4572
|
-
var _a2, _b;
|
|
4573
4571
|
let timeout;
|
|
4574
4572
|
function wait() {
|
|
4575
4573
|
timeout && clearTimeout(timeout);
|
|
4576
4574
|
timeout = setTimeout(kill, block);
|
|
4577
4575
|
}
|
|
4578
4576
|
function stop() {
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
(_b2 = context.spawned.stderr) == null ? void 0 : _b2.off("data", wait);
|
|
4577
|
+
context.spawned.stdout?.off("data", wait);
|
|
4578
|
+
context.spawned.stderr?.off("data", wait);
|
|
4582
4579
|
context.spawned.off("exit", stop);
|
|
4583
4580
|
context.spawned.off("close", stop);
|
|
4584
4581
|
timeout && clearTimeout(timeout);
|
|
@@ -4587,8 +4584,8 @@ function timeoutPlugin({
|
|
|
4587
4584
|
stop();
|
|
4588
4585
|
context.kill(new GitPluginError(void 0, "timeout", `block timeout reached`));
|
|
4589
4586
|
}
|
|
4590
|
-
stdOut &&
|
|
4591
|
-
stdErr &&
|
|
4587
|
+
stdOut && context.spawned.stdout?.on("data", wait);
|
|
4588
|
+
stdErr && context.spawned.stderr?.on("data", wait);
|
|
4592
4589
|
context.spawned.on("exit", stop);
|
|
4593
4590
|
context.spawned.on("close", stop);
|
|
4594
4591
|
wait();
|
|
@@ -4631,7 +4628,6 @@ function suffixPathsPlugin() {
|
|
|
4631
4628
|
init_utils();
|
|
4632
4629
|
var Git = require_git();
|
|
4633
4630
|
function gitInstanceFactory(baseDir, options) {
|
|
4634
|
-
var _a2;
|
|
4635
4631
|
const plugins = new PluginStore();
|
|
4636
4632
|
const config = createInstanceConfig(
|
|
4637
4633
|
baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {},
|
|
@@ -4655,7 +4651,7 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
4655
4651
|
config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
|
|
4656
4652
|
plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
|
|
4657
4653
|
config.errors && plugins.add(errorDetectionPlugin(config.errors));
|
|
4658
|
-
customBinaryPlugin(plugins, config.binary,
|
|
4654
|
+
customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
|
|
4659
4655
|
return new Git(config, plugins);
|
|
4660
4656
|
}
|
|
4661
4657
|
|