ya-git-jira 1.5.0 → 2.0.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/.opencode/skills/architecture/SKILL.md +45 -0
- package/.opencode/skills/code-style/SKILL.md +76 -0
- package/.opencode/skills/git-confluence/SKILL.md +82 -0
- package/.opencode/skills/git-jira/SKILL.md +63 -0
- package/.opencode/skills/git-lab/SKILL.md +102 -0
- package/AGENTS.md +50 -0
- package/README.md +121 -71
- package/bin/git-api.ts +70 -0
- package/bin/git-confluence-page-search.ts +58 -0
- package/bin/git-confluence-page-show.ts +61 -0
- package/bin/git-confluence-page-update.ts +77 -0
- package/bin/git-confluence-page.ts +28 -0
- package/bin/git-confluence-space-list.ts +34 -0
- package/bin/git-confluence-space.ts +24 -0
- package/bin/git-confluence-whoami.ts +33 -0
- package/bin/git-confluence.ts +27 -0
- package/bin/git-jira-start.ts +1 -1
- package/bin/git-jira-whoami.ts +32 -0
- package/bin/git-jira.ts +2 -0
- package/bin/git-lab-project-mr-list.ts +57 -0
- package/bin/git-lab-project-mr.ts +24 -0
- package/bin/git-lab-project-pipeline-jobs.ts +46 -0
- package/bin/git-lab-project-pipeline-latest.ts +47 -0
- package/bin/git-lab-project-pipeline-log.ts +49 -0
- package/bin/git-lab-project-pipeline.ts +6 -0
- package/bin/git-lab-project.ts +5 -1
- package/bin/gitj-install-skills.ts +126 -0
- package/bin/gitj.ts +12 -0
- package/dist/bin/git-api.js +2156 -0
- package/dist/bin/git-bump.js +136 -125
- package/dist/bin/git-confluence-page-search.js +2079 -0
- package/dist/bin/{git-lab-projects.js → git-confluence-page-show.js} +294 -250
- package/dist/bin/{git-lab-projects-whereami.js → git-confluence-page-update.js} +300 -206
- package/dist/bin/git-confluence-page.js +2186 -0
- package/dist/bin/{git-lab-groups.js → git-confluence-space-list.js} +279 -210
- package/dist/bin/git-confluence-space.js +2073 -0
- package/dist/bin/git-confluence-whoami.js +2060 -0
- package/dist/bin/git-confluence.js +2251 -0
- package/dist/bin/git-jira-issue-list.js +144 -129
- package/dist/bin/git-jira-issue-show.js +144 -129
- package/dist/bin/git-jira-issue.js +148 -133
- package/dist/bin/git-jira-start.js +146 -131
- package/dist/bin/{git-lab-namespaces.js → git-jira-whoami.js} +214 -226
- package/dist/bin/git-jira.js +178 -143
- package/dist/bin/git-lab-group-list.js +326 -394
- package/dist/bin/git-lab-group.js +328 -396
- package/dist/bin/git-lab-merge-active.js +326 -394
- package/dist/bin/git-lab-merge-todo.js +326 -394
- package/dist/bin/git-lab-merge-train-list.js +294 -388
- package/dist/bin/git-lab-merge-train.js +296 -390
- package/dist/bin/git-lab-merge.js +335 -403
- package/dist/bin/git-lab-namespace-list.js +145 -135
- package/dist/bin/git-lab-namespace.js +147 -137
- package/dist/bin/git-lab-project-list.js +293 -387
- package/dist/bin/git-lab-project-mr-list.js +2740 -0
- package/dist/bin/git-lab-project-mr.js +2752 -0
- package/dist/bin/git-lab-project-pipeline-jobs.js +2734 -0
- package/dist/bin/git-lab-project-pipeline-latest.js +2736 -0
- package/dist/bin/git-lab-project-pipeline-list.js +328 -396
- package/dist/bin/git-lab-project-pipeline-log.js +2739 -0
- package/dist/bin/git-lab-project-pipeline.js +442 -407
- package/dist/bin/git-lab-project-whereami.js +297 -391
- package/dist/bin/git-lab-project.js +568 -403
- package/dist/bin/git-lab-whoami.js +149 -139
- package/dist/bin/git-lab.js +581 -454
- package/dist/bin/{git-lab-projects-list.js → gitj-install-skills.js} +226 -268
- package/dist/bin/gitj.js +1384 -578
- package/dist/index.js +379 -300
- package/index.ts +1 -0
- package/lib/api.ts +177 -0
- package/lib/confluence/api.ts +132 -0
- package/lib/confluence/config.ts +25 -0
- package/lib/confluence/index.ts +3 -0
- package/lib/confluence/types.ts +59 -0
- package/lib/git.ts +3 -3
- package/lib/gitlab/config.ts +5 -5
- package/lib/gitlab/index.ts +1 -0
- package/lib/gitlab/job.ts +31 -0
- package/lib/gitlab/merge-request.ts +20 -0
- package/lib/gitlab/pipeline.ts +28 -1
- package/lib/gitlab/project.ts +14 -5
- package/lib/help.ts +40 -0
- package/lib/jira.ts +11 -6
- package/lib/spawn.ts +3 -3
- package/package.json +18 -2
- package/tests/all-help.test.ts +6 -1
- package/tests/gitj.test.ts +1 -1
- package/tests/help-all.test.ts +29 -0
- package/bun.lockb +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __toESM = (mod, isNodeMode, target) => {
|
|
@@ -17,11 +17,9 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
20
|
-
var __require =
|
|
21
|
-
return import.meta.require(id);
|
|
22
|
-
};
|
|
20
|
+
var __require = import.meta.require;
|
|
23
21
|
|
|
24
|
-
//
|
|
22
|
+
// node_modules/commander/lib/error.js
|
|
25
23
|
var require_error = __commonJS((exports) => {
|
|
26
24
|
class CommanderError extends Error {
|
|
27
25
|
constructor(exitCode, code, message) {
|
|
@@ -45,12 +43,8 @@ var require_error = __commonJS((exports) => {
|
|
|
45
43
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
46
44
|
});
|
|
47
45
|
|
|
48
|
-
//
|
|
46
|
+
// node_modules/commander/lib/argument.js
|
|
49
47
|
var require_argument = __commonJS((exports) => {
|
|
50
|
-
var humanReadableArgName = function(arg) {
|
|
51
|
-
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
52
|
-
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
53
|
-
};
|
|
54
48
|
var { InvalidArgumentError } = require_error();
|
|
55
49
|
|
|
56
50
|
class Argument {
|
|
@@ -120,11 +114,15 @@ var require_argument = __commonJS((exports) => {
|
|
|
120
114
|
return this;
|
|
121
115
|
}
|
|
122
116
|
}
|
|
117
|
+
function humanReadableArgName(arg) {
|
|
118
|
+
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
119
|
+
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
120
|
+
}
|
|
123
121
|
exports.Argument = Argument;
|
|
124
122
|
exports.humanReadableArgName = humanReadableArgName;
|
|
125
123
|
});
|
|
126
124
|
|
|
127
|
-
//
|
|
125
|
+
// node_modules/commander/lib/help.js
|
|
128
126
|
var require_help = __commonJS((exports) => {
|
|
129
127
|
var { humanReadableArgName } = require_argument();
|
|
130
128
|
|
|
@@ -301,7 +299,8 @@ var require_help = __commonJS((exports) => {
|
|
|
301
299
|
return term;
|
|
302
300
|
}
|
|
303
301
|
function formatList(textArray) {
|
|
304
|
-
return textArray.join(
|
|
302
|
+
return textArray.join(`
|
|
303
|
+
`).replace(/^/gm, " ".repeat(itemIndentWidth));
|
|
305
304
|
}
|
|
306
305
|
let output = [`Usage: ${helper.commandUsage(cmd)}`, ""];
|
|
307
306
|
const commandDescription = helper.commandDescription(cmd);
|
|
@@ -334,7 +333,8 @@ var require_help = __commonJS((exports) => {
|
|
|
334
333
|
if (commandList.length > 0) {
|
|
335
334
|
output = output.concat(["Commands:", formatList(commandList), ""]);
|
|
336
335
|
}
|
|
337
|
-
return output.join(
|
|
336
|
+
return output.join(`
|
|
337
|
+
`);
|
|
338
338
|
}
|
|
339
339
|
padWidth(cmd, helper) {
|
|
340
340
|
return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
|
|
@@ -348,42 +348,29 @@ var require_help = __commonJS((exports) => {
|
|
|
348
348
|
if (columnWidth < minColumnWidth)
|
|
349
349
|
return str;
|
|
350
350
|
const leadingStr = str.slice(0, indent);
|
|
351
|
-
const columnText = str.slice(indent).replace(
|
|
351
|
+
const columnText = str.slice(indent).replace(`\r
|
|
352
|
+
`, `
|
|
353
|
+
`);
|
|
352
354
|
const indentString = " ".repeat(indent);
|
|
353
355
|
const zeroWidthSpace = "\u200B";
|
|
354
356
|
const breaks = `\\s${zeroWidthSpace}`;
|
|
355
|
-
const regex = new RegExp(
|
|
357
|
+
const regex = new RegExp(`
|
|
358
|
+
|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, "g");
|
|
356
359
|
const lines = columnText.match(regex) || [];
|
|
357
360
|
return leadingStr + lines.map((line, i) => {
|
|
358
|
-
if (line ===
|
|
361
|
+
if (line === `
|
|
362
|
+
`)
|
|
359
363
|
return "";
|
|
360
364
|
return (i > 0 ? indentString : "") + line.trimEnd();
|
|
361
|
-
}).join(
|
|
365
|
+
}).join(`
|
|
366
|
+
`);
|
|
362
367
|
}
|
|
363
368
|
}
|
|
364
369
|
exports.Help = Help;
|
|
365
370
|
});
|
|
366
371
|
|
|
367
|
-
//
|
|
372
|
+
// node_modules/commander/lib/option.js
|
|
368
373
|
var require_option = __commonJS((exports) => {
|
|
369
|
-
var camelcase = function(str) {
|
|
370
|
-
return str.split("-").reduce((str2, word) => {
|
|
371
|
-
return str2 + word[0].toUpperCase() + word.slice(1);
|
|
372
|
-
});
|
|
373
|
-
};
|
|
374
|
-
var splitOptionFlags = function(flags) {
|
|
375
|
-
let shortFlag;
|
|
376
|
-
let longFlag;
|
|
377
|
-
const flagParts = flags.split(/[ |,]+/);
|
|
378
|
-
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1]))
|
|
379
|
-
shortFlag = flagParts.shift();
|
|
380
|
-
longFlag = flagParts.shift();
|
|
381
|
-
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
|
382
|
-
shortFlag = longFlag;
|
|
383
|
-
longFlag = undefined;
|
|
384
|
-
}
|
|
385
|
-
return { shortFlag, longFlag };
|
|
386
|
-
};
|
|
387
374
|
var { InvalidArgumentError } = require_error();
|
|
388
375
|
|
|
389
376
|
class Option {
|
|
@@ -511,14 +498,33 @@ var require_option = __commonJS((exports) => {
|
|
|
511
498
|
return option.negate === (negativeValue === value);
|
|
512
499
|
}
|
|
513
500
|
}
|
|
501
|
+
function camelcase(str) {
|
|
502
|
+
return str.split("-").reduce((str2, word) => {
|
|
503
|
+
return str2 + word[0].toUpperCase() + word.slice(1);
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
function splitOptionFlags(flags) {
|
|
507
|
+
let shortFlag;
|
|
508
|
+
let longFlag;
|
|
509
|
+
const flagParts = flags.split(/[ |,]+/);
|
|
510
|
+
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1]))
|
|
511
|
+
shortFlag = flagParts.shift();
|
|
512
|
+
longFlag = flagParts.shift();
|
|
513
|
+
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
|
514
|
+
shortFlag = longFlag;
|
|
515
|
+
longFlag = undefined;
|
|
516
|
+
}
|
|
517
|
+
return { shortFlag, longFlag };
|
|
518
|
+
}
|
|
514
519
|
exports.Option = Option;
|
|
515
520
|
exports.splitOptionFlags = splitOptionFlags;
|
|
516
521
|
exports.DualOptions = DualOptions;
|
|
517
522
|
});
|
|
518
523
|
|
|
519
|
-
//
|
|
524
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
520
525
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
521
|
-
var
|
|
526
|
+
var maxDistance = 3;
|
|
527
|
+
function editDistance(a, b) {
|
|
522
528
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
523
529
|
return Math.max(a.length, b.length);
|
|
524
530
|
const d = [];
|
|
@@ -543,8 +549,8 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
543
549
|
}
|
|
544
550
|
}
|
|
545
551
|
return d[a.length][b.length];
|
|
546
|
-
}
|
|
547
|
-
|
|
552
|
+
}
|
|
553
|
+
function suggestSimilar(word, candidates) {
|
|
548
554
|
if (!candidates || candidates.length === 0)
|
|
549
555
|
return "";
|
|
550
556
|
candidates = Array.from(new Set(candidates));
|
|
@@ -576,67 +582,25 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
576
582
|
similar = similar.map((candidate) => `--${candidate}`);
|
|
577
583
|
}
|
|
578
584
|
if (similar.length > 1) {
|
|
579
|
-
return
|
|
585
|
+
return `
|
|
586
|
+
(Did you mean one of ${similar.join(", ")}?)`;
|
|
580
587
|
}
|
|
581
588
|
if (similar.length === 1) {
|
|
582
|
-
return
|
|
589
|
+
return `
|
|
590
|
+
(Did you mean ${similar[0]}?)`;
|
|
583
591
|
}
|
|
584
592
|
return "";
|
|
585
|
-
}
|
|
586
|
-
var maxDistance = 3;
|
|
593
|
+
}
|
|
587
594
|
exports.suggestSimilar = suggestSimilar;
|
|
588
595
|
});
|
|
589
596
|
|
|
590
|
-
//
|
|
597
|
+
// node_modules/commander/lib/command.js
|
|
591
598
|
var require_command = __commonJS((exports) => {
|
|
592
|
-
var
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
};
|
|
599
|
-
var incrementNodeInspectorPort = function(args) {
|
|
600
|
-
return args.map((arg) => {
|
|
601
|
-
if (!arg.startsWith("--inspect")) {
|
|
602
|
-
return arg;
|
|
603
|
-
}
|
|
604
|
-
let debugOption;
|
|
605
|
-
let debugHost = "127.0.0.1";
|
|
606
|
-
let debugPort = "9229";
|
|
607
|
-
let match;
|
|
608
|
-
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
609
|
-
debugOption = match[1];
|
|
610
|
-
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
|
611
|
-
debugOption = match[1];
|
|
612
|
-
if (/^\d+$/.test(match[3])) {
|
|
613
|
-
debugPort = match[3];
|
|
614
|
-
} else {
|
|
615
|
-
debugHost = match[3];
|
|
616
|
-
}
|
|
617
|
-
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
|
618
|
-
debugOption = match[1];
|
|
619
|
-
debugHost = match[3];
|
|
620
|
-
debugPort = match[4];
|
|
621
|
-
}
|
|
622
|
-
if (debugOption && debugPort !== "0") {
|
|
623
|
-
return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
|
|
624
|
-
}
|
|
625
|
-
return arg;
|
|
626
|
-
});
|
|
627
|
-
};
|
|
628
|
-
var getCommandAndParents = function(startCommand) {
|
|
629
|
-
const result = [];
|
|
630
|
-
for (let command = startCommand;command; command = command.parent) {
|
|
631
|
-
result.push(command);
|
|
632
|
-
}
|
|
633
|
-
return result;
|
|
634
|
-
};
|
|
635
|
-
var EventEmitter = import.meta.require("events").EventEmitter;
|
|
636
|
-
var childProcess = import.meta.require("child_process");
|
|
637
|
-
var path = import.meta.require("path");
|
|
638
|
-
var fs = import.meta.require("fs");
|
|
639
|
-
var process2 = import.meta.require("process");
|
|
599
|
+
var EventEmitter = __require("events").EventEmitter;
|
|
600
|
+
var childProcess = __require("child_process");
|
|
601
|
+
var path = __require("path");
|
|
602
|
+
var fs = __require("fs");
|
|
603
|
+
var process2 = __require("process");
|
|
640
604
|
var { Argument, humanReadableArgName } = require_argument();
|
|
641
605
|
var { CommanderError } = require_error();
|
|
642
606
|
var { Help } = require_help();
|
|
@@ -853,8 +817,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
853
817
|
this._exitCallback = (err) => {
|
|
854
818
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
855
819
|
throw err;
|
|
856
|
-
} else {
|
|
857
|
-
}
|
|
820
|
+
} else {}
|
|
858
821
|
};
|
|
859
822
|
}
|
|
860
823
|
return this;
|
|
@@ -1491,11 +1454,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1491
1454
|
return getCommandAndParents(this).reduce((combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()), {});
|
|
1492
1455
|
}
|
|
1493
1456
|
error(message, errorOptions) {
|
|
1494
|
-
this._outputConfiguration.outputError(`${message}
|
|
1457
|
+
this._outputConfiguration.outputError(`${message}
|
|
1458
|
+
`, this._outputConfiguration.writeErr);
|
|
1495
1459
|
if (typeof this._showHelpAfterError === "string") {
|
|
1496
|
-
this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
1460
|
+
this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
1461
|
+
`);
|
|
1497
1462
|
} else if (this._showHelpAfterError) {
|
|
1498
|
-
this._outputConfiguration.writeErr(
|
|
1463
|
+
this._outputConfiguration.writeErr(`
|
|
1464
|
+
`);
|
|
1499
1465
|
this.outputHelp({ error: true });
|
|
1500
1466
|
}
|
|
1501
1467
|
const config = errorOptions || {};
|
|
@@ -1505,7 +1471,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1505
1471
|
}
|
|
1506
1472
|
_parseOptionsEnv() {
|
|
1507
1473
|
this.options.forEach((option) => {
|
|
1508
|
-
if (option.envVar &&
|
|
1474
|
+
if (option.envVar && option.envVar in process2.env) {
|
|
1509
1475
|
const optionKey = option.attributeName();
|
|
1510
1476
|
if (this.getOptionValue(optionKey) === undefined || ["default", "config", "env"].includes(this.getOptionValueSource(optionKey))) {
|
|
1511
1477
|
if (option.required || option.optional) {
|
|
@@ -1614,7 +1580,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1614
1580
|
this._versionOptionName = versionOption.attributeName();
|
|
1615
1581
|
this.options.push(versionOption);
|
|
1616
1582
|
this.on("option:" + versionOption.name(), () => {
|
|
1617
|
-
this._outputConfiguration.writeOut(`${str}
|
|
1583
|
+
this._outputConfiguration.writeOut(`${str}
|
|
1584
|
+
`);
|
|
1618
1585
|
this._exit(0, "commander.version", str);
|
|
1619
1586
|
});
|
|
1620
1587
|
return this;
|
|
@@ -1642,7 +1609,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1642
1609
|
command = this.commands[this.commands.length - 1];
|
|
1643
1610
|
}
|
|
1644
1611
|
if (alias === command._name)
|
|
1645
|
-
throw new Error("Command alias can
|
|
1612
|
+
throw new Error("Command alias can't be the same as its name");
|
|
1646
1613
|
command._aliases.push(alias);
|
|
1647
1614
|
return this;
|
|
1648
1615
|
}
|
|
@@ -1756,16 +1723,60 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1756
1723
|
helpStr = text;
|
|
1757
1724
|
}
|
|
1758
1725
|
if (helpStr) {
|
|
1759
|
-
context.write(`${helpStr}
|
|
1726
|
+
context.write(`${helpStr}
|
|
1727
|
+
`);
|
|
1760
1728
|
}
|
|
1761
1729
|
});
|
|
1762
1730
|
return this;
|
|
1763
1731
|
}
|
|
1764
1732
|
}
|
|
1733
|
+
function outputHelpIfRequested(cmd, args) {
|
|
1734
|
+
const helpOption = cmd._hasHelpOption && args.find((arg) => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
|
|
1735
|
+
if (helpOption) {
|
|
1736
|
+
cmd.outputHelp();
|
|
1737
|
+
cmd._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
function incrementNodeInspectorPort(args) {
|
|
1741
|
+
return args.map((arg) => {
|
|
1742
|
+
if (!arg.startsWith("--inspect")) {
|
|
1743
|
+
return arg;
|
|
1744
|
+
}
|
|
1745
|
+
let debugOption;
|
|
1746
|
+
let debugHost = "127.0.0.1";
|
|
1747
|
+
let debugPort = "9229";
|
|
1748
|
+
let match;
|
|
1749
|
+
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
1750
|
+
debugOption = match[1];
|
|
1751
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
|
1752
|
+
debugOption = match[1];
|
|
1753
|
+
if (/^\d+$/.test(match[3])) {
|
|
1754
|
+
debugPort = match[3];
|
|
1755
|
+
} else {
|
|
1756
|
+
debugHost = match[3];
|
|
1757
|
+
}
|
|
1758
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
|
1759
|
+
debugOption = match[1];
|
|
1760
|
+
debugHost = match[3];
|
|
1761
|
+
debugPort = match[4];
|
|
1762
|
+
}
|
|
1763
|
+
if (debugOption && debugPort !== "0") {
|
|
1764
|
+
return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
|
|
1765
|
+
}
|
|
1766
|
+
return arg;
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
function getCommandAndParents(startCommand) {
|
|
1770
|
+
const result = [];
|
|
1771
|
+
for (let command = startCommand;command; command = command.parent) {
|
|
1772
|
+
result.push(command);
|
|
1773
|
+
}
|
|
1774
|
+
return result;
|
|
1775
|
+
}
|
|
1765
1776
|
exports.Command = Command;
|
|
1766
1777
|
});
|
|
1767
1778
|
|
|
1768
|
-
//
|
|
1779
|
+
// node_modules/commander/index.js
|
|
1769
1780
|
var require_commander = __commonJS((exports, module) => {
|
|
1770
1781
|
var { Argument } = require_argument();
|
|
1771
1782
|
var { Command } = require_command();
|
|
@@ -1783,9 +1794,25 @@ var require_commander = __commonJS((exports, module) => {
|
|
|
1783
1794
|
exports.Option = Option;
|
|
1784
1795
|
});
|
|
1785
1796
|
|
|
1786
|
-
//
|
|
1797
|
+
// node_modules/ms/index.js
|
|
1787
1798
|
var require_ms = __commonJS((exports, module) => {
|
|
1788
|
-
var
|
|
1799
|
+
var s = 1000;
|
|
1800
|
+
var m = s * 60;
|
|
1801
|
+
var h = m * 60;
|
|
1802
|
+
var d = h * 24;
|
|
1803
|
+
var w = d * 7;
|
|
1804
|
+
var y = d * 365.25;
|
|
1805
|
+
module.exports = function(val, options) {
|
|
1806
|
+
options = options || {};
|
|
1807
|
+
var type = typeof val;
|
|
1808
|
+
if (type === "string" && val.length > 0) {
|
|
1809
|
+
return parse(val);
|
|
1810
|
+
} else if (type === "number" && isFinite(val)) {
|
|
1811
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
1812
|
+
}
|
|
1813
|
+
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
1814
|
+
};
|
|
1815
|
+
function parse(str) {
|
|
1789
1816
|
str = String(str);
|
|
1790
1817
|
if (str.length > 100) {
|
|
1791
1818
|
return;
|
|
@@ -1838,8 +1865,8 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
1838
1865
|
default:
|
|
1839
1866
|
return;
|
|
1840
1867
|
}
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1868
|
+
}
|
|
1869
|
+
function fmtShort(ms) {
|
|
1843
1870
|
var msAbs = Math.abs(ms);
|
|
1844
1871
|
if (msAbs >= d) {
|
|
1845
1872
|
return Math.round(ms / d) + "d";
|
|
@@ -1854,8 +1881,8 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
1854
1881
|
return Math.round(ms / s) + "s";
|
|
1855
1882
|
}
|
|
1856
1883
|
return ms + "ms";
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1884
|
+
}
|
|
1885
|
+
function fmtLong(ms) {
|
|
1859
1886
|
var msAbs = Math.abs(ms);
|
|
1860
1887
|
if (msAbs >= d) {
|
|
1861
1888
|
return plural(ms, msAbs, d, "day");
|
|
@@ -1870,32 +1897,16 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
1870
1897
|
return plural(ms, msAbs, s, "second");
|
|
1871
1898
|
}
|
|
1872
1899
|
return ms + " ms";
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1900
|
+
}
|
|
1901
|
+
function plural(ms, msAbs, n, name) {
|
|
1875
1902
|
var isPlural = msAbs >= n * 1.5;
|
|
1876
1903
|
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
1877
|
-
}
|
|
1878
|
-
var s = 1000;
|
|
1879
|
-
var m = s * 60;
|
|
1880
|
-
var h = m * 60;
|
|
1881
|
-
var d = h * 24;
|
|
1882
|
-
var w = d * 7;
|
|
1883
|
-
var y = d * 365.25;
|
|
1884
|
-
module.exports = function(val, options) {
|
|
1885
|
-
options = options || {};
|
|
1886
|
-
var type = typeof val;
|
|
1887
|
-
if (type === "string" && val.length > 0) {
|
|
1888
|
-
return parse(val);
|
|
1889
|
-
} else if (type === "number" && isFinite(val)) {
|
|
1890
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
1891
|
-
}
|
|
1892
|
-
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
1893
|
-
};
|
|
1904
|
+
}
|
|
1894
1905
|
});
|
|
1895
1906
|
|
|
1896
|
-
//
|
|
1907
|
+
// node_modules/debug/src/common.js
|
|
1897
1908
|
var require_common = __commonJS((exports, module) => {
|
|
1898
|
-
|
|
1909
|
+
function setup(env) {
|
|
1899
1910
|
createDebug.debug = createDebug;
|
|
1900
1911
|
createDebug.default = createDebug;
|
|
1901
1912
|
createDebug.coerce = coerce;
|
|
@@ -2050,68 +2061,12 @@ var require_common = __commonJS((exports, module) => {
|
|
|
2050
2061
|
}
|
|
2051
2062
|
createDebug.enable(createDebug.load());
|
|
2052
2063
|
return createDebug;
|
|
2053
|
-
}
|
|
2064
|
+
}
|
|
2054
2065
|
module.exports = setup;
|
|
2055
2066
|
});
|
|
2056
2067
|
|
|
2057
|
-
//
|
|
2068
|
+
// node_modules/debug/src/browser.js
|
|
2058
2069
|
var require_browser = __commonJS((exports, module) => {
|
|
2059
|
-
var useColors = function() {
|
|
2060
|
-
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
2061
|
-
return true;
|
|
2062
|
-
}
|
|
2063
|
-
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
2064
|
-
return false;
|
|
2065
|
-
}
|
|
2066
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
2067
|
-
};
|
|
2068
|
-
var formatArgs = function(args) {
|
|
2069
|
-
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + exports.humanize(this.diff);
|
|
2070
|
-
if (!this.useColors) {
|
|
2071
|
-
return;
|
|
2072
|
-
}
|
|
2073
|
-
const c = "color: " + this.color;
|
|
2074
|
-
args.splice(1, 0, c, "color: inherit");
|
|
2075
|
-
let index = 0;
|
|
2076
|
-
let lastC = 0;
|
|
2077
|
-
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
2078
|
-
if (match === "%%") {
|
|
2079
|
-
return;
|
|
2080
|
-
}
|
|
2081
|
-
index++;
|
|
2082
|
-
if (match === "%c") {
|
|
2083
|
-
lastC = index;
|
|
2084
|
-
}
|
|
2085
|
-
});
|
|
2086
|
-
args.splice(lastC, 0, c);
|
|
2087
|
-
};
|
|
2088
|
-
var save = function(namespaces) {
|
|
2089
|
-
try {
|
|
2090
|
-
if (namespaces) {
|
|
2091
|
-
exports.storage.setItem("debug", namespaces);
|
|
2092
|
-
} else {
|
|
2093
|
-
exports.storage.removeItem("debug");
|
|
2094
|
-
}
|
|
2095
|
-
} catch (error) {
|
|
2096
|
-
}
|
|
2097
|
-
};
|
|
2098
|
-
var load = function() {
|
|
2099
|
-
let r;
|
|
2100
|
-
try {
|
|
2101
|
-
r = exports.storage.getItem("debug");
|
|
2102
|
-
} catch (error) {
|
|
2103
|
-
}
|
|
2104
|
-
if (!r && typeof process !== "undefined" && ("env" in process)) {
|
|
2105
|
-
r = process.env.DEBUG;
|
|
2106
|
-
}
|
|
2107
|
-
return r;
|
|
2108
|
-
};
|
|
2109
|
-
var localstorage = function() {
|
|
2110
|
-
try {
|
|
2111
|
-
return localStorage;
|
|
2112
|
-
} catch (error) {
|
|
2113
|
-
}
|
|
2114
|
-
};
|
|
2115
2070
|
exports.formatArgs = formatArgs;
|
|
2116
2071
|
exports.save = save;
|
|
2117
2072
|
exports.load = load;
|
|
@@ -2204,184 +2159,85 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
2204
2159
|
"#FFCC00",
|
|
2205
2160
|
"#FFCC33"
|
|
2206
2161
|
];
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
var { formatters } = module.exports;
|
|
2211
|
-
formatters.j = function(v) {
|
|
2212
|
-
try {
|
|
2213
|
-
return JSON.stringify(v);
|
|
2214
|
-
} catch (error) {
|
|
2215
|
-
return "[UnexpectedJSONParseError]: " + error.message;
|
|
2162
|
+
function useColors() {
|
|
2163
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
2164
|
+
return true;
|
|
2216
2165
|
}
|
|
2217
|
-
|
|
2218
|
-
});
|
|
2219
|
-
|
|
2220
|
-
// /home/jim/node_modules/has-flag/index.js
|
|
2221
|
-
var require_has_flag = __commonJS((exports, module) => {
|
|
2222
|
-
module.exports = (flag, argv = process.argv) => {
|
|
2223
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
2224
|
-
const position = argv.indexOf(prefix + flag);
|
|
2225
|
-
const terminatorPosition = argv.indexOf("--");
|
|
2226
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
2227
|
-
};
|
|
2228
|
-
});
|
|
2229
|
-
|
|
2230
|
-
// /home/jim/node_modules/supports-color/index.js
|
|
2231
|
-
var require_supports_color = __commonJS((exports, module) => {
|
|
2232
|
-
var translateLevel = function(level) {
|
|
2233
|
-
if (level === 0) {
|
|
2166
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
2234
2167
|
return false;
|
|
2235
2168
|
}
|
|
2236
|
-
return
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
};
|
|
2243
|
-
var supportsColor = function(haveStream, streamIsTTY) {
|
|
2244
|
-
if (forceColor === 0) {
|
|
2245
|
-
return 0;
|
|
2246
|
-
}
|
|
2247
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
2248
|
-
return 3;
|
|
2249
|
-
}
|
|
2250
|
-
if (hasFlag("color=256")) {
|
|
2251
|
-
return 2;
|
|
2252
|
-
}
|
|
2253
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
2254
|
-
return 0;
|
|
2255
|
-
}
|
|
2256
|
-
const min = forceColor || 0;
|
|
2257
|
-
if (env.TERM === "dumb") {
|
|
2258
|
-
return min;
|
|
2169
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
2170
|
+
}
|
|
2171
|
+
function formatArgs(args) {
|
|
2172
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
2173
|
+
if (!this.useColors) {
|
|
2174
|
+
return;
|
|
2259
2175
|
}
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2176
|
+
const c = "color: " + this.color;
|
|
2177
|
+
args.splice(1, 0, c, "color: inherit");
|
|
2178
|
+
let index = 0;
|
|
2179
|
+
let lastC = 0;
|
|
2180
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
2181
|
+
if (match === "%%") {
|
|
2182
|
+
return;
|
|
2264
2183
|
}
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
|
|
2269
|
-
return 1;
|
|
2184
|
+
index++;
|
|
2185
|
+
if (match === "%c") {
|
|
2186
|
+
lastC = index;
|
|
2270
2187
|
}
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
switch (env.TERM_PROGRAM) {
|
|
2282
|
-
case "iTerm.app":
|
|
2283
|
-
return version >= 3 ? 3 : 2;
|
|
2284
|
-
case "Apple_Terminal":
|
|
2285
|
-
return 2;
|
|
2188
|
+
});
|
|
2189
|
+
args.splice(lastC, 0, c);
|
|
2190
|
+
}
|
|
2191
|
+
exports.log = console.debug || console.log || (() => {});
|
|
2192
|
+
function save(namespaces) {
|
|
2193
|
+
try {
|
|
2194
|
+
if (namespaces) {
|
|
2195
|
+
exports.storage.setItem("debug", namespaces);
|
|
2196
|
+
} else {
|
|
2197
|
+
exports.storage.removeItem("debug");
|
|
2286
2198
|
}
|
|
2287
|
-
}
|
|
2288
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
2289
|
-
return 2;
|
|
2290
|
-
}
|
|
2291
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
2292
|
-
return 1;
|
|
2293
|
-
}
|
|
2294
|
-
if ("COLORTERM" in env) {
|
|
2295
|
-
return 1;
|
|
2296
|
-
}
|
|
2297
|
-
return min;
|
|
2298
|
-
};
|
|
2299
|
-
var getSupportLevel = function(stream) {
|
|
2300
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
2301
|
-
return translateLevel(level);
|
|
2302
|
-
};
|
|
2303
|
-
var os = import.meta.require("os");
|
|
2304
|
-
var tty = import.meta.require("tty");
|
|
2305
|
-
var hasFlag = require_has_flag();
|
|
2306
|
-
var { env } = process;
|
|
2307
|
-
var forceColor;
|
|
2308
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
2309
|
-
forceColor = 0;
|
|
2310
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
2311
|
-
forceColor = 1;
|
|
2199
|
+
} catch (error) {}
|
|
2312
2200
|
}
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2201
|
+
function load() {
|
|
2202
|
+
let r;
|
|
2203
|
+
try {
|
|
2204
|
+
r = exports.storage.getItem("debug");
|
|
2205
|
+
} catch (error) {}
|
|
2206
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
2207
|
+
r = process.env.DEBUG;
|
|
2320
2208
|
}
|
|
2209
|
+
return r;
|
|
2321
2210
|
}
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2211
|
+
function localstorage() {
|
|
2212
|
+
try {
|
|
2213
|
+
return localStorage;
|
|
2214
|
+
} catch (error) {}
|
|
2215
|
+
}
|
|
2216
|
+
module.exports = require_common()(exports);
|
|
2217
|
+
var { formatters } = module.exports;
|
|
2218
|
+
formatters.j = function(v) {
|
|
2219
|
+
try {
|
|
2220
|
+
return JSON.stringify(v);
|
|
2221
|
+
} catch (error) {
|
|
2222
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
2223
|
+
}
|
|
2326
2224
|
};
|
|
2327
2225
|
});
|
|
2328
2226
|
|
|
2329
|
-
//
|
|
2227
|
+
// node_modules/debug/src/node.js
|
|
2330
2228
|
var require_node = __commonJS((exports, module) => {
|
|
2331
|
-
var
|
|
2332
|
-
|
|
2333
|
-
};
|
|
2334
|
-
var formatArgs = function(args) {
|
|
2335
|
-
const { namespace: name, useColors: useColors2 } = this;
|
|
2336
|
-
if (useColors2) {
|
|
2337
|
-
const c = this.color;
|
|
2338
|
-
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
2339
|
-
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
2340
|
-
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
2341
|
-
args.push(colorCode + "m+" + exports.humanize(this.diff) + "\x1B[0m");
|
|
2342
|
-
} else {
|
|
2343
|
-
args[0] = getDate() + name + " " + args[0];
|
|
2344
|
-
}
|
|
2345
|
-
};
|
|
2346
|
-
var getDate = function() {
|
|
2347
|
-
if (exports.inspectOpts.hideDate) {
|
|
2348
|
-
return "";
|
|
2349
|
-
}
|
|
2350
|
-
return new Date().toISOString() + " ";
|
|
2351
|
-
};
|
|
2352
|
-
var log = function(...args) {
|
|
2353
|
-
return process.stderr.write(util.format(...args) + "\n");
|
|
2354
|
-
};
|
|
2355
|
-
var save = function(namespaces) {
|
|
2356
|
-
if (namespaces) {
|
|
2357
|
-
process.env.DEBUG = namespaces;
|
|
2358
|
-
} else {
|
|
2359
|
-
delete process.env.DEBUG;
|
|
2360
|
-
}
|
|
2361
|
-
};
|
|
2362
|
-
var load = function() {
|
|
2363
|
-
return process.env.DEBUG;
|
|
2364
|
-
};
|
|
2365
|
-
var init = function(debug) {
|
|
2366
|
-
debug.inspectOpts = {};
|
|
2367
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
2368
|
-
for (let i = 0;i < keys.length; i++) {
|
|
2369
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
2370
|
-
}
|
|
2371
|
-
};
|
|
2372
|
-
var tty = import.meta.require("tty");
|
|
2373
|
-
var util = import.meta.require("util");
|
|
2229
|
+
var tty = __require("tty");
|
|
2230
|
+
var util = __require("util");
|
|
2374
2231
|
exports.init = init;
|
|
2375
2232
|
exports.log = log;
|
|
2376
2233
|
exports.formatArgs = formatArgs;
|
|
2377
2234
|
exports.save = save;
|
|
2378
2235
|
exports.load = load;
|
|
2379
2236
|
exports.useColors = useColors;
|
|
2380
|
-
exports.destroy = util.deprecate(() => {
|
|
2381
|
-
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
2237
|
+
exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
2382
2238
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
2383
2239
|
try {
|
|
2384
|
-
const supportsColor =
|
|
2240
|
+
const supportsColor = (()=>{throw new Error("Cannot require module "+"supports-color");})();
|
|
2385
2241
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
2386
2242
|
exports.colors = [
|
|
2387
2243
|
20,
|
|
@@ -2462,8 +2318,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
2462
2318
|
221
|
|
2463
2319
|
];
|
|
2464
2320
|
}
|
|
2465
|
-
} catch (error) {
|
|
2466
|
-
}
|
|
2321
|
+
} catch (error) {}
|
|
2467
2322
|
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
2468
2323
|
return /^debug_/i.test(key);
|
|
2469
2324
|
}).reduce((obj, key) => {
|
|
@@ -2483,11 +2338,56 @@ var require_node = __commonJS((exports, module) => {
|
|
|
2483
2338
|
obj[prop] = val;
|
|
2484
2339
|
return obj;
|
|
2485
2340
|
}, {});
|
|
2341
|
+
function useColors() {
|
|
2342
|
+
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
2343
|
+
}
|
|
2344
|
+
function formatArgs(args) {
|
|
2345
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
2346
|
+
if (useColors2) {
|
|
2347
|
+
const c = this.color;
|
|
2348
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
2349
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
2350
|
+
args[0] = prefix + args[0].split(`
|
|
2351
|
+
`).join(`
|
|
2352
|
+
` + prefix);
|
|
2353
|
+
args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
2354
|
+
} else {
|
|
2355
|
+
args[0] = getDate() + name + " " + args[0];
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
function getDate() {
|
|
2359
|
+
if (exports.inspectOpts.hideDate) {
|
|
2360
|
+
return "";
|
|
2361
|
+
}
|
|
2362
|
+
return new Date().toISOString() + " ";
|
|
2363
|
+
}
|
|
2364
|
+
function log(...args) {
|
|
2365
|
+
return process.stderr.write(util.format(...args) + `
|
|
2366
|
+
`);
|
|
2367
|
+
}
|
|
2368
|
+
function save(namespaces) {
|
|
2369
|
+
if (namespaces) {
|
|
2370
|
+
process.env.DEBUG = namespaces;
|
|
2371
|
+
} else {
|
|
2372
|
+
delete process.env.DEBUG;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
function load() {
|
|
2376
|
+
return process.env.DEBUG;
|
|
2377
|
+
}
|
|
2378
|
+
function init(debug) {
|
|
2379
|
+
debug.inspectOpts = {};
|
|
2380
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
2381
|
+
for (let i = 0;i < keys.length; i++) {
|
|
2382
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2486
2385
|
module.exports = require_common()(exports);
|
|
2487
2386
|
var { formatters } = module.exports;
|
|
2488
2387
|
formatters.o = function(v) {
|
|
2489
2388
|
this.inspectOpts.colors = this.useColors;
|
|
2490
|
-
return util.inspect(v, this.inspectOpts).split(
|
|
2389
|
+
return util.inspect(v, this.inspectOpts).split(`
|
|
2390
|
+
`).map((str) => str.trim()).join(" ");
|
|
2491
2391
|
};
|
|
2492
2392
|
formatters.O = function(v) {
|
|
2493
2393
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -2495,7 +2395,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
2495
2395
|
};
|
|
2496
2396
|
});
|
|
2497
2397
|
|
|
2498
|
-
//
|
|
2398
|
+
// node_modules/debug/src/index.js
|
|
2499
2399
|
var require_src = __commonJS((exports, module) => {
|
|
2500
2400
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
2501
2401
|
module.exports = require_browser();
|
|
@@ -2504,8 +2404,8 @@ var require_src = __commonJS((exports, module) => {
|
|
|
2504
2404
|
}
|
|
2505
2405
|
});
|
|
2506
2406
|
|
|
2507
|
-
//
|
|
2508
|
-
var
|
|
2407
|
+
// node_modules/commander/esm.mjs
|
|
2408
|
+
var import__ = __toESM(require_commander(), 1);
|
|
2509
2409
|
var {
|
|
2510
2410
|
program,
|
|
2511
2411
|
createCommand,
|
|
@@ -2518,9 +2418,9 @@ var {
|
|
|
2518
2418
|
Argument,
|
|
2519
2419
|
Option,
|
|
2520
2420
|
Help
|
|
2521
|
-
} =
|
|
2421
|
+
} = import__.default;
|
|
2522
2422
|
|
|
2523
|
-
//
|
|
2423
|
+
// lib/package.ts
|
|
2524
2424
|
import path from "path";
|
|
2525
2425
|
import fs from "fs";
|
|
2526
2426
|
function findPackageJson() {
|
|
@@ -2543,13 +2443,16 @@ async function getPackageJson() {
|
|
|
2543
2443
|
const packageJsonText = fs.readFileSync(packagePath, "utf8");
|
|
2544
2444
|
return JSON.parse(packageJsonText);
|
|
2545
2445
|
}
|
|
2446
|
+
var packageJsonPromise = getPackageJson();
|
|
2546
2447
|
async function getPackageVersion() {
|
|
2547
2448
|
const packageJson = await packageJsonPromise;
|
|
2548
2449
|
return packageJson.version;
|
|
2549
2450
|
}
|
|
2550
|
-
var packageJsonPromise = getPackageJson();
|
|
2551
2451
|
|
|
2552
|
-
//
|
|
2452
|
+
// lib/spawn.ts
|
|
2453
|
+
var defaultOptions = {
|
|
2454
|
+
expectQuiet: false
|
|
2455
|
+
};
|
|
2553
2456
|
async function spawn(args, options = defaultOptions) {
|
|
2554
2457
|
const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe" });
|
|
2555
2458
|
const stdout = new Response(proc.stdout);
|
|
@@ -2564,19 +2467,16 @@ async function spawn(args, options = defaultOptions) {
|
|
|
2564
2467
|
}
|
|
2565
2468
|
return { out: out.trim(), err: err.trim(), code };
|
|
2566
2469
|
}
|
|
2567
|
-
async function doCommand(args) {
|
|
2568
|
-
const { out, err } = await spawn(args);
|
|
2470
|
+
async function doCommand(args, options = defaultOptions) {
|
|
2471
|
+
const { out, err } = await spawn(args, options);
|
|
2569
2472
|
if (err)
|
|
2570
2473
|
console.error(err);
|
|
2571
2474
|
return out;
|
|
2572
2475
|
}
|
|
2573
|
-
var defaultOptions = {
|
|
2574
|
-
expectQuiet: false
|
|
2575
|
-
};
|
|
2576
2476
|
|
|
2577
|
-
//
|
|
2578
|
-
async function getConfig(key) {
|
|
2579
|
-
return doCommand(["git", "config", "--get", key]);
|
|
2477
|
+
// lib/git.ts
|
|
2478
|
+
async function getConfig(key, options = defaultOptions) {
|
|
2479
|
+
return doCommand(["git", "config", "--get", key], options);
|
|
2580
2480
|
}
|
|
2581
2481
|
async function createBranch(name) {
|
|
2582
2482
|
return doCommand(["git", "checkout", "-b", name]);
|
|
@@ -2588,25 +2488,24 @@ async function getRemote() {
|
|
|
2588
2488
|
return doCommand(["git", "ls-remote", "--get-url", "origin"]);
|
|
2589
2489
|
}
|
|
2590
2490
|
|
|
2591
|
-
//
|
|
2491
|
+
// lib/gitlab/config.ts
|
|
2492
|
+
var gitEmailP = getConfig("user.email");
|
|
2493
|
+
var gitlabEmailP = getConfig("gitlab.user", { expectQuiet: true });
|
|
2494
|
+
var hostP = getConfig("gitlab.host");
|
|
2495
|
+
var tokenP = getConfig("gitlab.token");
|
|
2592
2496
|
async function getGitlabConfig() {
|
|
2593
|
-
const host = await hostP;
|
|
2594
|
-
|
|
2595
|
-
throw new Error("gitlab.host not in git config");
|
|
2596
|
-
const user = await userP;
|
|
2497
|
+
const host = await hostP || "gitlab.com";
|
|
2498
|
+
const user = await gitEmailP || await gitlabEmailP;
|
|
2597
2499
|
if (!user)
|
|
2598
|
-
throw new Error("user.email
|
|
2500
|
+
throw new Error("Neither user.email nor gitlab.email in git config");
|
|
2599
2501
|
const token = await tokenP;
|
|
2600
2502
|
if (!token)
|
|
2601
2503
|
throw new Error("gitlab.token not in git config");
|
|
2602
2504
|
return { host, user, token };
|
|
2603
2505
|
}
|
|
2604
|
-
var hostP = getConfig("gitlab.host");
|
|
2605
|
-
var userP = getConfig("user.email");
|
|
2606
|
-
var tokenP = getConfig("gitlab.token");
|
|
2607
2506
|
|
|
2608
|
-
//
|
|
2609
|
-
|
|
2507
|
+
// lib/gitlab/api.ts
|
|
2508
|
+
function getNextLink(link) {
|
|
2610
2509
|
if (!link) {
|
|
2611
2510
|
return;
|
|
2612
2511
|
}
|
|
@@ -2614,7 +2513,7 @@ var getNextLink = function(link) {
|
|
|
2614
2513
|
const match = link.match(regex);
|
|
2615
2514
|
const next = match ? match[1] : undefined;
|
|
2616
2515
|
return next;
|
|
2617
|
-
}
|
|
2516
|
+
}
|
|
2618
2517
|
async function gitlabApi(endpoint) {
|
|
2619
2518
|
if (endpoint.startsWith("/")) {
|
|
2620
2519
|
console.warn(`gitlabApi: endpoint ${endpoint} starts with /, removing it`);
|
|
@@ -2648,14 +2547,14 @@ async function gitlabApi(endpoint) {
|
|
|
2648
2547
|
return result;
|
|
2649
2548
|
}
|
|
2650
2549
|
|
|
2651
|
-
//
|
|
2550
|
+
// lib/gitlab/project.ts
|
|
2652
2551
|
import path2 from "path";
|
|
2653
2552
|
|
|
2654
|
-
//
|
|
2553
|
+
// lib/gitlab/dlog.ts
|
|
2655
2554
|
var import_debug = __toESM(require_src(), 1);
|
|
2656
2555
|
var dlog = import_debug.default("gitlab");
|
|
2657
2556
|
|
|
2658
|
-
//
|
|
2557
|
+
// lib/gitlab/project.ts
|
|
2659
2558
|
async function getProjects(match) {
|
|
2660
2559
|
let search = "";
|
|
2661
2560
|
if (match) {
|
|
@@ -2687,7 +2586,7 @@ async function findProject(ssh_url) {
|
|
|
2687
2586
|
});
|
|
2688
2587
|
return project;
|
|
2689
2588
|
}
|
|
2690
|
-
async function
|
|
2589
|
+
async function projectScopedRequest(endpoint) {
|
|
2691
2590
|
if (endpoint.startsWith("/")) {
|
|
2692
2591
|
console.warn(`gitlabApi: endpoint ${endpoint} starts with /, removing it`);
|
|
2693
2592
|
endpoint = endpoint.slice(1);
|
|
@@ -2700,27 +2599,34 @@ async function projectScopedGet(endpoint) {
|
|
|
2700
2599
|
throw new Error(`Could not find project for remote ${remote}`);
|
|
2701
2600
|
}
|
|
2702
2601
|
const base = `https://${host}/api/v4/projects/${project.id}`;
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2602
|
+
const sep = endpoint.includes("?") ? "&" : "?";
|
|
2603
|
+
const uri = `${base}/${endpoint}${sep}per_page=100`;
|
|
2604
|
+
dlog(`projectScopedRequest uri: ${uri}`);
|
|
2705
2605
|
const headers = new Headers;
|
|
2706
|
-
headers.append("Accept", "application/json");
|
|
2707
2606
|
headers.append("Private-Token", token);
|
|
2708
2607
|
const options = {
|
|
2709
2608
|
method,
|
|
2710
2609
|
headers
|
|
2711
2610
|
};
|
|
2712
2611
|
const request = new Request(uri, options);
|
|
2713
|
-
|
|
2612
|
+
return await fetch(request);
|
|
2613
|
+
}
|
|
2614
|
+
async function projectScopedGet(endpoint) {
|
|
2615
|
+
const response = await projectScopedRequest(endpoint);
|
|
2714
2616
|
return await response.json();
|
|
2715
2617
|
}
|
|
2618
|
+
async function projectScopedGetText(endpoint) {
|
|
2619
|
+
const response = await projectScopedRequest(endpoint);
|
|
2620
|
+
return await response.text();
|
|
2621
|
+
}
|
|
2716
2622
|
|
|
2717
|
-
//
|
|
2623
|
+
// lib/is_main.ts
|
|
2718
2624
|
import path3 from "path";
|
|
2719
|
-
|
|
2625
|
+
function justBase(filename) {
|
|
2720
2626
|
const ext = path3.extname(filename);
|
|
2721
2627
|
const base = path3.basename(filename, ext);
|
|
2722
2628
|
return base;
|
|
2723
|
-
}
|
|
2629
|
+
}
|
|
2724
2630
|
function isMain(self) {
|
|
2725
2631
|
const arg1 = Bun.argv[1];
|
|
2726
2632
|
const argv1Base = justBase(arg1);
|
|
@@ -2729,7 +2635,8 @@ function isMain(self) {
|
|
|
2729
2635
|
return result;
|
|
2730
2636
|
}
|
|
2731
2637
|
|
|
2732
|
-
//
|
|
2638
|
+
// bin/git-lab-project-whereami.ts
|
|
2639
|
+
var version = await getPackageVersion();
|
|
2733
2640
|
function create() {
|
|
2734
2641
|
const program2 = new Command;
|
|
2735
2642
|
program2.version(version).name("whereami").description("Show current project based on current directory").option("-v, --verbose", "Verbose output").action(async (options) => {
|
|
@@ -2739,21 +2646,20 @@ function create() {
|
|
|
2739
2646
|
process.exit(1);
|
|
2740
2647
|
}
|
|
2741
2648
|
console.log(`Remote: ${ssh_url}`);
|
|
2742
|
-
const
|
|
2743
|
-
if (!
|
|
2649
|
+
const project = await findProject(ssh_url);
|
|
2650
|
+
if (!project) {
|
|
2744
2651
|
console.error(`No project!`);
|
|
2745
2652
|
process.exit(1);
|
|
2746
2653
|
}
|
|
2747
2654
|
if (options.verbose) {
|
|
2748
|
-
console.log(
|
|
2655
|
+
console.log(project);
|
|
2749
2656
|
} else {
|
|
2750
|
-
const { id, name, path_with_namespace, ssh_url_to_repo } =
|
|
2657
|
+
const { id, name, path_with_namespace, ssh_url_to_repo } = project;
|
|
2751
2658
|
console.log({ id, name, path_with_namespace, ssh_url_to_repo });
|
|
2752
2659
|
}
|
|
2753
2660
|
});
|
|
2754
2661
|
return program2;
|
|
2755
2662
|
}
|
|
2756
|
-
var version = await getPackageVersion();
|
|
2757
2663
|
var git_lab_project_whereami_default = create;
|
|
2758
2664
|
if (isMain("git-lab-project-whereami")) {
|
|
2759
2665
|
await create().parseAsync(Bun.argv);
|