gcb-client 0.7.1 → 0.8.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/CHANGELOG.md +23 -2
- package/bin/gcb.js +6 -6
- package/lib/commands/gh.d.ts +3 -3
- package/lib/commands/gh.d.ts.map +1 -1
- package/lib/commands/gh.js +95 -47
- package/lib/commands/gh.js.map +1 -1
- package/lib/commands/host-submit.d.ts +8 -8
- package/lib/commands/host-submit.d.ts.map +1 -1
- package/lib/commands/host-submit.js +32 -22
- package/lib/commands/host-submit.js.map +1 -1
- package/lib/commands/logs.d.ts +2 -2
- package/lib/commands/logs.d.ts.map +1 -1
- package/lib/commands/logs.js +17 -11
- package/lib/commands/logs.js.map +1 -1
- package/lib/commands/pr.d.ts +2 -2
- package/lib/commands/pr.d.ts.map +1 -1
- package/lib/commands/pr.js +186 -69
- package/lib/commands/pr.js.map +1 -1
- package/lib/commands/probe.d.ts +2 -2
- package/lib/commands/probe.d.ts.map +1 -1
- package/lib/commands/probe.js +19 -13
- package/lib/commands/probe.js.map +1 -1
- package/lib/commands/remotes.d.ts +24 -21
- package/lib/commands/remotes.d.ts.map +1 -1
- package/lib/commands/remotes.js +71 -53
- package/lib/commands/remotes.js.map +1 -1
- package/lib/commands/repo.d.ts.map +1 -1
- package/lib/commands/repo.js +26 -16
- package/lib/commands/repo.js.map +1 -1
- package/lib/commands/setup.d.ts +7 -7
- package/lib/commands/setup.d.ts.map +1 -1
- package/lib/commands/setup.js +38 -27
- package/lib/commands/setup.js.map +1 -1
- package/lib/helper.d.ts +27 -27
- package/lib/helper.d.ts.map +1 -1
- package/lib/helper.js +82 -66
- package/lib/helper.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -8
- package/lib/index.js.map +1 -1
- package/lib/primary.d.ts +5 -5
- package/lib/primary.d.ts.map +1 -1
- package/lib/primary.js +5 -5
- package/lib/primary.js.map +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -11,13 +11,13 @@ export { runHelper } from './helper.js';
|
|
|
11
11
|
* The dispatch below reads the same table, so this cannot list a subcommand that does not run and a
|
|
12
12
|
* new action shows up in the help without a second edit.
|
|
13
13
|
*
|
|
14
|
-
* @param domain -
|
|
15
|
-
* @returns
|
|
14
|
+
* @param domain - The command before the colon, e.g. `pr`.
|
|
15
|
+
* @returns The subcommands, joined for one usage line.
|
|
16
16
|
*/
|
|
17
17
|
function cataloguedSubcommands(domain) {
|
|
18
18
|
return Object.values(GH_ACTIONS)
|
|
19
|
-
.filter(
|
|
20
|
-
.map(
|
|
19
|
+
.filter(action => action.command[0] === domain)
|
|
20
|
+
.map(action => action.command[1])
|
|
21
21
|
.join('|');
|
|
22
22
|
}
|
|
23
23
|
export const CLIENT_HELP = `gcb-client — container-side git credential helper and broker client.
|
|
@@ -68,20 +68,25 @@ export async function runClient(argv, primary) {
|
|
|
68
68
|
// second list: a subcommand the catalog does not have stays with the flag-only lifecycle.
|
|
69
69
|
// Bare `pr` asks the catalog too, where `run` needs no branch: the flag-only path would only
|
|
70
70
|
// tell it that --repo is required.
|
|
71
|
-
if (rest.length === 0)
|
|
71
|
+
if (rest.length === 0) {
|
|
72
72
|
return (await choose()).run(['pr']);
|
|
73
|
+
}
|
|
73
74
|
const sub = rest[0];
|
|
74
|
-
if (sub === 'review' &&
|
|
75
|
+
if (sub === 'review' &&
|
|
76
|
+
rest.some(argument => argument === '--id' || argument.startsWith('--id='))) {
|
|
75
77
|
return (await import('./commands/pr.js')).runPr(rest.slice(1));
|
|
76
78
|
}
|
|
77
|
-
if (sub === 'create' &&
|
|
79
|
+
if (sub === 'create' &&
|
|
80
|
+
(await import('./commands/gh.js')).actionHasAsUser('pr:create', rest)) {
|
|
78
81
|
// `pr create` is the catalogued action, but `--as-user` is the flag-only lifecycle's flag.
|
|
79
82
|
// Accept the obvious spelling instead of making the caller discover that `create` must go.
|
|
80
83
|
return (await import('./commands/pr.js')).runPr(rest.slice(1));
|
|
81
84
|
}
|
|
82
85
|
if (sub !== undefined && Object.hasOwn(GH_ACTIONS, `pr:${sub}`)) {
|
|
83
86
|
if (await actionAsksHelp('pr', sub, rest)) {
|
|
84
|
-
return (await import('./commands/gh.js')).runGh(['pr', ...rest], {
|
|
87
|
+
return (await import('./commands/gh.js')).runGh(['pr', ...rest], {
|
|
88
|
+
unreachableExitCode: 3,
|
|
89
|
+
});
|
|
85
90
|
}
|
|
86
91
|
return (await choose()).run(['pr', ...rest], { unreachableExitCode: 3 });
|
|
87
92
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAKtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;SAC9C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SAChC,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;eASZ,qBAAqB,CAAC,IAAI,CAAC;0CACA,qBAAqB,CAAC,KAAK,CAAC;oCAClC,qBAAqB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;mEAcC,CAAA;AAEnE,2FAA2F;AAC3F,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ACd,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,SAAS;CACf,CAAA"}
|
package/lib/primary.d.ts
CHANGED
|
@@ -15,12 +15,12 @@ export declare const GH_PRIMARY: Primary;
|
|
|
15
15
|
/**
|
|
16
16
|
* Resolve the configured primary.
|
|
17
17
|
*
|
|
18
|
-
* Only `gh` is implemented; an unknown name fails closed instead of falling back to a different
|
|
19
|
-
*
|
|
18
|
+
* Only `gh` is implemented; an unknown name fails closed instead of falling back to a different CLI
|
|
19
|
+
* that would interpret the argv differently.
|
|
20
20
|
*
|
|
21
|
-
* @param env -
|
|
22
|
-
* @param primaries -
|
|
23
|
-
* @returns
|
|
21
|
+
* @param env - The environment to read `GCB_PRIMARY` from.
|
|
22
|
+
* @param primaries - The available adapters, keyed by name.
|
|
23
|
+
* @returns The selected primary.
|
|
24
24
|
*/
|
|
25
25
|
export declare function primaryFromEnv(env?: NodeJS.ProcessEnv, primaries?: Readonly<Record<string, Primary>>): Primary;
|
|
26
26
|
//# sourceMappingURL=primary.d.ts.map
|
package/lib/primary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primary.d.ts","sourceRoot":"","sources":["../src/primary.ts"],"names":[],"mappings":"AAUA,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"primary.d.ts","sourceRoot":"","sources":["../src/primary.ts"],"names":[],"mappings":"AAUA,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACnC;AAED,gDAAgD;AAChD,MAAM,WAAW,OAAO;IACtB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iCAAiC;IACjC,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC3E;AAED,wBAAwB;AACxB,eAAO,MAAM,UAAU,EAAE,OAGxB,CAAA;AAKD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,SAAS,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAqB,GAC/D,OAAO,CAQT"}
|
package/lib/primary.js
CHANGED
|
@@ -16,12 +16,12 @@ const DEFAULT_PRIMARIES = { [GH_PRIMARY.name]: GH_PRIMARY };
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolve the configured primary.
|
|
18
18
|
*
|
|
19
|
-
* Only `gh` is implemented; an unknown name fails closed instead of falling back to a different
|
|
20
|
-
*
|
|
19
|
+
* Only `gh` is implemented; an unknown name fails closed instead of falling back to a different CLI
|
|
20
|
+
* that would interpret the argv differently.
|
|
21
21
|
*
|
|
22
|
-
* @param env -
|
|
23
|
-
* @param primaries -
|
|
24
|
-
* @returns
|
|
22
|
+
* @param env - The environment to read `GCB_PRIMARY` from.
|
|
23
|
+
* @param primaries - The available adapters, keyed by name.
|
|
24
|
+
* @returns The selected primary.
|
|
25
25
|
*/
|
|
26
26
|
export function primaryFromEnv(env = process.env, primaries = DEFAULT_PRIMARIES) {
|
|
27
27
|
const configured = env['GCB_PRIMARY'] ?? GH_PRIMARY.name;
|
package/lib/primary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primary.js","sourceRoot":"","sources":["../src/primary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"primary.js","sourceRoot":"","sources":["../src/primary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAgBxC,wBAAwB;AACxB,MAAM,CAAC,MAAM,UAAU,GAAY;IACjC,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;CAC7C,CAAA;AAED,4CAA4C;AAC5C,MAAM,iBAAiB,GAAsC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAA;AAE9F;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAG,GAAsB,OAAO,CAAC,GAAG,EACpC,SAAS,GAAsC,iBAAiB;IAEhE,MAAM,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,IAAI,CAAA;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACzF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnD,IAAI,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,SAAS,EAAE,CAAC,CAAA;IACpF,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcb-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Container-side gcb client: credential helper, setup, and socket-backed commands.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "JounQin <admin@1stg.me>",
|
|
7
|
-
"homepage": "https://github.com/code-vaults/git-credential-broker#readme",
|
|
8
6
|
"repository": {
|
|
9
7
|
"type": "git",
|
|
10
8
|
"url": "git+https://github.com/code-vaults/git-credential-broker.git"
|
|
11
9
|
},
|
|
12
|
-
"
|
|
10
|
+
"homepage": "https://github.com/code-vaults/git-credential-broker#readme",
|
|
11
|
+
"author": "JounQin <admin@1stg.me>",
|
|
12
|
+
"license": "MIT",
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=24"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
17
|
"gcb": "./bin/gcb.js"
|
|
18
18
|
},
|
|
19
|
-
"files": [
|
|
20
|
-
"lib",
|
|
21
|
-
"bin"
|
|
22
|
-
],
|
|
23
19
|
"exports": {
|
|
24
20
|
".": {
|
|
25
21
|
"types": "./lib/index.d.ts",
|
|
26
22
|
"default": "./lib/index.js"
|
|
27
23
|
}
|
|
28
24
|
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"lib"
|
|
28
|
+
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"gcb-core": "0.
|
|
30
|
+
"gcb-core": "0.8.1"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public",
|