bdy 1.25.43-dev-pr → 1.25.44-stage
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/distTs/package.json +6 -5
- package/distTs/src/api/client.js +1 -191
- package/distTs/src/cliError.js +0 -5
- package/distTs/src/cliIndex.js +0 -3
- package/distTs/src/command/login.js +1 -1
- package/distTs/src/output/pipeline.js +56 -54
- package/distTs/src/output.js +22 -85
- package/distTs/src/texts.js +1 -510
- package/distTs/src/tunnel/output/interactive/tunnel.js +10 -14
- package/distTs/src/tunnel/output/noninteractive/tunnel.js +1 -3
- package/distTs/src/utils.js +6 -142
- package/package.json +6 -5
- package/distTs/src/autocomplete.js +0 -90
- package/distTs/src/command/artifact/downloadDir.js +0 -110
- package/distTs/src/command/autocomplete/install.js +0 -16
- package/distTs/src/command/autocomplete/uninstall.js +0 -16
- package/distTs/src/command/autocomplete.js +0 -14
- package/distTs/src/command/environment/resolve.js +0 -39
- package/distTs/src/command/package/create.js +0 -64
- package/distTs/src/command/package/delete.js +0 -38
- package/distTs/src/command/package/docker/login.js +0 -26
- package/distTs/src/command/package/docker.js +0 -11
- package/distTs/src/command/package/download.js +0 -138
- package/distTs/src/command/package/get.js +0 -36
- package/distTs/src/command/package/list.js +0 -31
- package/distTs/src/command/package/publish.js +0 -241
- package/distTs/src/command/package/version/delete.js +0 -39
- package/distTs/src/command/package/version/get.js +0 -45
- package/distTs/src/command/package/version/list.js +0 -47
- package/distTs/src/command/package/version.js +0 -16
- package/distTs/src/command/package.js +0 -26
- package/distTs/src/command/pipeline/run/apply.js +0 -62
- package/distTs/src/command/pr/comment/add.js +0 -66
- package/distTs/src/command/pr/comment/list.js +0 -167
- package/distTs/src/command/pr/comment/status.js +0 -50
- package/distTs/src/command/pr/comment.js +0 -19
- package/distTs/src/command/pr/create.js +0 -44
- package/distTs/src/command/pr/diff.js +0 -337
- package/distTs/src/command/pr/file/list.js +0 -139
- package/distTs/src/command/pr/file/mark.js +0 -45
- package/distTs/src/command/pr/file.js +0 -16
- package/distTs/src/command/pr/get.js +0 -29
- package/distTs/src/command/pr/list.js +0 -79
- package/distTs/src/command/pr/merge.js +0 -67
- package/distTs/src/command/pr/review/request.js +0 -30
- package/distTs/src/command/pr/review/start.js +0 -29
- package/distTs/src/command/pr/review/verdict.js +0 -81
- package/distTs/src/command/pr/review.js +0 -18
- package/distTs/src/command/pr/shared.js +0 -704
- package/distTs/src/command/pr/state.js +0 -38
- package/distTs/src/command/pr/summary.js +0 -341
- package/distTs/src/command/pr/update.js +0 -56
- package/distTs/src/command/pr/updateBranch.js +0 -22
- package/distTs/src/command/pr/versions.js +0 -42
- package/distTs/src/command/pr.js +0 -39
- package/distTs/src/command/scrape/validation.js +0 -154
- package/distTs/src/command/scrape.js +0 -144
- package/distTs/src/command/suiteLink.js +0 -14
- package/distTs/src/command/tests/visual/result/download.js +0 -31
- package/distTs/src/command/tests/visual/result/get.js +0 -68
- package/distTs/src/command/tests/visual/result/list.js +0 -49
- package/distTs/src/command/tests/visual/result.js +0 -23
- package/distTs/src/command/tests/visual/session/get.js +0 -70
- package/distTs/src/command/tests/visual/session/list.js +0 -69
- package/distTs/src/command/tests/visual/session/open.js +0 -22
- package/distTs/src/command/tests/visual/session/reviewUrl.js +0 -37
- package/distTs/src/command/tests/visual/session/update.js +0 -26
- package/distTs/src/command/tests/visual/shared/context.js +0 -144
- package/distTs/src/command/tests/visual/shared/diffRegions.js +0 -172
- package/distTs/src/command/tests/visual/shared/format.js +0 -21
- package/distTs/src/command/tests/visual/shared/lookup.js +0 -107
- package/distTs/src/command/tests/visual/shared/options.js +0 -90
- package/distTs/src/command/tests/visual/shared/review.js +0 -146
- package/distTs/src/command/tests/visual/shared/reviewUrl.js +0 -62
- package/distTs/src/command/tests/visual/shared/session.js +0 -217
- package/distTs/src/command/tests/visual/snapshot/get.js +0 -46
- package/distTs/src/command/tests/visual/snapshot/list.js +0 -68
- package/distTs/src/command/tests/visual/snapshot/open.js +0 -26
- package/distTs/src/command/tests/visual/snapshot/reviewUrl.js +0 -48
- package/distTs/src/command/tests/visual/snapshot.js +0 -28
- package/distTs/src/command/tests/visual/suite/create.js +0 -38
- package/distTs/src/command/tests/visual/suite/delete.js +0 -29
- package/distTs/src/command/tests/visual/suite/get.js +0 -43
- package/distTs/src/command/tests/visual/suite/list.js +0 -35
- package/distTs/src/command/tests/visual/suite/open.js +0 -20
- package/distTs/src/command/tests/visual/suite/update.js +0 -47
- package/distTs/src/command/tests/visual/suite.js +0 -30
- package/distTs/src/command/ut/upload.js +0 -86
- package/distTs/src/command/ut.js +0 -12
- package/distTs/src/command/vt/close.js +0 -27
- package/distTs/src/command/vt/compare/validation.js +0 -46
- package/distTs/src/command/vt/compare.js +0 -100
- package/distTs/src/command/vt/exec.js +0 -82
- package/distTs/src/command/vt/installBrowser.js +0 -20
- package/distTs/src/command/vt/shared/validation.js +0 -145
- package/distTs/src/command/vt/storybook.js +0 -138
- package/distTs/src/command/vt.js +0 -20
- package/distTs/src/command/yaml/agents.js +0 -88
- package/distTs/src/command/yaml/init.js +0 -110
- package/distTs/src/main.js +0 -190
- package/distTs/src/types/options.js +0 -2
- package/distTs/src/types/scrape.js +0 -2
- package/distTs/src/types/visualTests.js +0 -2
package/distTs/src/output.js
CHANGED
|
@@ -98,61 +98,61 @@ class Output {
|
|
|
98
98
|
return chalk_1.default.hex('#00C9FF')(text);
|
|
99
99
|
}
|
|
100
100
|
static getTermKitCyanColor(text) {
|
|
101
|
-
return `^C${
|
|
101
|
+
return `^C${text}^:`;
|
|
102
102
|
}
|
|
103
103
|
static getBlueColor(text) {
|
|
104
104
|
return chalk_1.default.hex('#1A86FD')(text);
|
|
105
105
|
}
|
|
106
106
|
static getTermKitBlueColor(text) {
|
|
107
|
-
return `^B${
|
|
107
|
+
return `^B${text}^:`;
|
|
108
108
|
}
|
|
109
109
|
static getPurpleColor(text) {
|
|
110
110
|
return chalk_1.default.hex('#A06BC4')(text);
|
|
111
111
|
}
|
|
112
112
|
static getTermKitPurpleColor(text) {
|
|
113
|
-
return `^M${
|
|
113
|
+
return `^M${text}^:`;
|
|
114
114
|
}
|
|
115
115
|
static getMutedColor(text) {
|
|
116
116
|
return chalk_1.default.hex('#8B8D98')(text);
|
|
117
117
|
}
|
|
118
118
|
static getTermKitMutedColor(text) {
|
|
119
|
-
return `^w${
|
|
119
|
+
return `^w${text}^:`;
|
|
120
120
|
}
|
|
121
121
|
static getDimColor(text) {
|
|
122
122
|
return chalk_1.default.hex('#4A4A4A')(text);
|
|
123
123
|
}
|
|
124
124
|
static getTermKitDimColor(text) {
|
|
125
|
-
return `^K${
|
|
125
|
+
return `^K${text}^:`;
|
|
126
126
|
}
|
|
127
127
|
static getArgColor(text) {
|
|
128
128
|
return chalk_1.default.hex('#5A8AB5')(text);
|
|
129
129
|
}
|
|
130
130
|
static getTermKitArgColor(text) {
|
|
131
|
-
return `^B${
|
|
131
|
+
return `^B${text}^:`;
|
|
132
132
|
}
|
|
133
133
|
static getLabelColor(text) {
|
|
134
134
|
return chalk_1.default.hex('#D1D5DB')(text);
|
|
135
135
|
}
|
|
136
136
|
static getTermKitLabelColor(text) {
|
|
137
|
-
return `^W${
|
|
137
|
+
return `^W${text}^:`;
|
|
138
138
|
}
|
|
139
139
|
static getGreenColor(text) {
|
|
140
140
|
return chalk_1.default.greenBright(text);
|
|
141
141
|
}
|
|
142
142
|
static getTermKitGreenColor(text) {
|
|
143
|
-
return `^G${
|
|
143
|
+
return `^G${text}^:`;
|
|
144
144
|
}
|
|
145
145
|
static getYellowColor(text) {
|
|
146
146
|
return chalk_1.default.yellow(text);
|
|
147
147
|
}
|
|
148
148
|
static getTermKitYellowColor(text) {
|
|
149
|
-
return `^Y${
|
|
149
|
+
return `^Y${text}^:`;
|
|
150
150
|
}
|
|
151
151
|
static getRedColor(text) {
|
|
152
152
|
return chalk_1.default.redBright(text);
|
|
153
153
|
}
|
|
154
154
|
static getTermKitRedColor(text) {
|
|
155
|
-
return `^R${
|
|
155
|
+
return `^R${text}^:`;
|
|
156
156
|
}
|
|
157
157
|
static getInquirerTheme() {
|
|
158
158
|
return {
|
|
@@ -191,7 +191,7 @@ class Output {
|
|
|
191
191
|
this.clearUndici();
|
|
192
192
|
this.clearTerminal();
|
|
193
193
|
if (msg)
|
|
194
|
-
|
|
194
|
+
getTerminal()(`${msg}\n`);
|
|
195
195
|
process.exit(0);
|
|
196
196
|
}
|
|
197
197
|
static exitCode(code) {
|
|
@@ -200,29 +200,17 @@ class Output {
|
|
|
200
200
|
process.exit(code);
|
|
201
201
|
}
|
|
202
202
|
static newline() {
|
|
203
|
-
|
|
203
|
+
getTerminal()('\n');
|
|
204
204
|
this.inlineOutput = false;
|
|
205
205
|
}
|
|
206
206
|
static muted(txt, newLine = true) {
|
|
207
207
|
this.normal(this.getMutedColor(txt), newLine);
|
|
208
208
|
}
|
|
209
|
-
// Plain text, colored with chalk (the get*Color helpers). Written as is:
|
|
210
|
-
// terminal-kit would read ^x as markup and % as printf formatting, and so
|
|
211
|
-
// drop characters from user content and code (a ^ with the character after
|
|
212
|
-
// it, e.g. [^/]+ shown as []+).
|
|
213
209
|
static normal(txt, newLine = true) {
|
|
214
|
-
process.stdout.write(newLine ? `${txt}\n` : txt);
|
|
215
|
-
this.inlineOutput = !newLine;
|
|
216
|
-
}
|
|
217
|
-
// Text with terminal-kit markup, built with the getTermKit*Color helpers
|
|
218
|
-
// (they escape what they color). markupOnly: ^ markup without printf
|
|
219
|
-
// formatting, the same as ScreenBuffer.put, so one escaped string renders
|
|
220
|
-
// the same in both.
|
|
221
|
-
static markup(txt, newLine = true) {
|
|
222
210
|
let msg = txt;
|
|
223
211
|
if (newLine)
|
|
224
212
|
msg += '\n';
|
|
225
|
-
getTerminal()
|
|
213
|
+
getTerminal()(msg);
|
|
226
214
|
this.inlineOutput = !newLine;
|
|
227
215
|
}
|
|
228
216
|
static progress(quiet, output = this.normal.bind(this)) {
|
|
@@ -251,11 +239,13 @@ class Output {
|
|
|
251
239
|
return this.data(`No examples for ${command}.`);
|
|
252
240
|
this.data(`EXAMPLES:\n${examples.map((example) => ` ### ${example.description}\n ${example.command}`).join('\n')}`);
|
|
253
241
|
}
|
|
254
|
-
//
|
|
255
|
-
//
|
|
256
|
-
//
|
|
242
|
+
// For payload embedded in terminal-kit markup (e.g. a dimmed log line):
|
|
243
|
+
// neutralizes the ^-markup and %-formatting the payload would otherwise
|
|
244
|
+
// trigger, so it renders verbatim while the surrounding markup still
|
|
245
|
+
// works. Only for strings printed via terminal() - ScreenBuffer.put does
|
|
246
|
+
// not printf-format, so there %% would render double.
|
|
257
247
|
static escapeTermKit(txt) {
|
|
258
|
-
return txt.replace(
|
|
248
|
+
return txt.replace(/[%^]/g, '$&$&');
|
|
259
249
|
}
|
|
260
250
|
static writeStderr(txt) {
|
|
261
251
|
process.stderr.write(`${txt}\n`);
|
|
@@ -389,7 +379,7 @@ class Output {
|
|
|
389
379
|
if (!this.s && this.isTTY()) {
|
|
390
380
|
this.s = await getTerminal().spinner();
|
|
391
381
|
if (txt)
|
|
392
|
-
|
|
382
|
+
getTerminal()(` ${txt}`);
|
|
393
383
|
}
|
|
394
384
|
}
|
|
395
385
|
static agentTunnels(tunnels) {
|
|
@@ -413,7 +403,7 @@ class Output {
|
|
|
413
403
|
}
|
|
414
404
|
static newCliVersion(version) {
|
|
415
405
|
getTerminal().gray(`New version available (${version}). Run `);
|
|
416
|
-
|
|
406
|
+
getTerminal()(' bdy version ');
|
|
417
407
|
getTerminal().gray(`for details.\n\n`);
|
|
418
408
|
}
|
|
419
409
|
static newCliDockerVersion(version) {
|
|
@@ -469,45 +459,7 @@ class Output {
|
|
|
469
459
|
const table = [...Object.entries(data)];
|
|
470
460
|
this.table(table, false);
|
|
471
461
|
}
|
|
472
|
-
|
|
473
|
-
* terminal-kit's ANSI parser knows only the 16 basic colors: in `38;5;145`
|
|
474
|
-
* (256 colors) it takes the 5 for blink, and `38;2;r;g;b` (truecolor) turns
|
|
475
|
-
* into dim. This rewrites both to the nearest basic foreground color.
|
|
476
|
-
*/
|
|
477
|
-
static toBasicAnsi(text) {
|
|
478
|
-
const basic = (r, g, b) => {
|
|
479
|
-
const max = Math.max(r, g, b);
|
|
480
|
-
const min = Math.min(r, g, b);
|
|
481
|
-
// greys: dark grey (90) or white (37)
|
|
482
|
-
if (max - min < 40)
|
|
483
|
-
return max < 180 ? 90 : 37;
|
|
484
|
-
const bright = max > 200;
|
|
485
|
-
// a channel counts when it is close to the strongest one
|
|
486
|
-
const code = (r > max * 0.7 ? 1 : 0) + (g > max * 0.7 ? 2 : 0) + (b > max * 0.7 ? 4 : 0);
|
|
487
|
-
return (bright ? 90 : 30) + code;
|
|
488
|
-
};
|
|
489
|
-
const fromIndex = (n) => {
|
|
490
|
-
if (n < 8)
|
|
491
|
-
return 30 + n;
|
|
492
|
-
if (n < 16)
|
|
493
|
-
return 90 + n - 8;
|
|
494
|
-
if (n >= 232) {
|
|
495
|
-
const v = 8 + (n - 232) * 10;
|
|
496
|
-
return basic(v, v, v);
|
|
497
|
-
}
|
|
498
|
-
const c = n - 16;
|
|
499
|
-
const level = (x) => (x === 0 ? 0 : 55 + x * 40);
|
|
500
|
-
return basic(level(Math.floor(c / 36)), level(Math.floor(c / 6) % 6), level(c % 6));
|
|
501
|
-
};
|
|
502
|
-
const esc = String.fromCharCode(27);
|
|
503
|
-
return text
|
|
504
|
-
.replace(new RegExp(`${esc}\\[38;5;(\\d+)m`, 'g'), (_, n) => `${esc}[${fromIndex(Number(n))}m`)
|
|
505
|
-
.replace(new RegExp(`${esc}\\[38;2;(\\d+);(\\d+);(\\d+)m`, 'g'), (_, r, g, b) => `${esc}[${basic(Number(r), Number(g), Number(b))}m`);
|
|
506
|
-
}
|
|
507
|
-
/** `ansi`: cells may carry chalk colors (widths are measured without the escape codes). */
|
|
508
|
-
static table(data, firstRowBlue = true, ansi = false) {
|
|
509
|
-
if (ansi)
|
|
510
|
-
data = data.map((row) => row.map((cell) => this.toBasicAnsi(cell)));
|
|
462
|
+
static table(data, firstRowBlue = true) {
|
|
511
463
|
// apply padding
|
|
512
464
|
for (let i = 0; i < data.length; i += 1) {
|
|
513
465
|
for (let j = 0; j < data[i].length; j += 1) {
|
|
@@ -529,23 +481,8 @@ class Output {
|
|
|
529
481
|
};
|
|
530
482
|
if (firstRowBlue)
|
|
531
483
|
opts.firstRowTextAttr = { color: 'blue' };
|
|
532
|
-
if (ansi)
|
|
533
|
-
opts.contentHasMarkup = 'ansi';
|
|
534
484
|
getTerminal().table(data, opts);
|
|
535
485
|
}
|
|
536
|
-
/**
|
|
537
|
-
* A table in a terminal; in a pipe (an agent, a script) one `cell · cell`
|
|
538
|
-
* line per row instead, as padding every column to its widest cell is mostly
|
|
539
|
-
* whitespace there.
|
|
540
|
-
*/
|
|
541
|
-
static tableOrRows(data, ansi = false) {
|
|
542
|
-
if (this.isStdOutTTY()) {
|
|
543
|
-
this.table(data, true, ansi);
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
for (const row of data)
|
|
547
|
-
this.normal(row.join(' · '));
|
|
548
|
-
}
|
|
549
486
|
static configTunnels(tunnels) {
|
|
550
487
|
const OutputNoninteractiveConfigTunnels = require('./tunnel/output/noninteractive/config/tunnels').default;
|
|
551
488
|
const on = new OutputNoninteractiveConfigTunnels(getTerminal(), tunnels);
|