@dosu/cli 0.53.0-beta.11 → 0.53.0-beta.12
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/bin/dosu.js +33 -15
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -5018,7 +5018,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
5018
5018
|
function getVersionString() {
|
|
5019
5019
|
return `v${VERSION}`;
|
|
5020
5020
|
}
|
|
5021
|
-
var VERSION = "0.53.0-beta.
|
|
5021
|
+
var VERSION = "0.53.0-beta.12", INSTALL_CHANNEL = "npm";
|
|
5022
5022
|
|
|
5023
5023
|
// src/debug/logger.ts
|
|
5024
5024
|
import {
|
|
@@ -5712,12 +5712,34 @@ function answeredEcho(message, answer) {
|
|
|
5712
5712
|
function optionLabel(option) {
|
|
5713
5713
|
return option.label ?? String(option.value);
|
|
5714
5714
|
}
|
|
5715
|
+
function viewport(count, cursor3, top, rows, chrome) {
|
|
5716
|
+
const visible = Math.min(count, Math.max(4, (rows ?? 24) - chrome));
|
|
5717
|
+
let next = top;
|
|
5718
|
+
if (cursor3 < next)
|
|
5719
|
+
next = cursor3;
|
|
5720
|
+
if (cursor3 >= next + visible)
|
|
5721
|
+
next = cursor3 - visible + 1;
|
|
5722
|
+
next = Math.max(0, Math.min(next, count - visible));
|
|
5723
|
+
return { top: next, visible, above: next, below: count - next - visible };
|
|
5724
|
+
}
|
|
5725
|
+
function moreAbove(n2) {
|
|
5726
|
+
return n2 > 0 ? [import_picocolors11.default.dim(` ↑ ${n2} more`)] : [];
|
|
5727
|
+
}
|
|
5728
|
+
function moreBelow(n2) {
|
|
5729
|
+
return n2 > 0 ? [import_picocolors11.default.dim(` ↓ ${n2} more`)] : [];
|
|
5730
|
+
}
|
|
5715
5731
|
function select(opts, io = {}) {
|
|
5732
|
+
const { output } = resolveIO(io);
|
|
5716
5733
|
let selected = 0;
|
|
5734
|
+
let top = 0;
|
|
5717
5735
|
const labelWidth = Math.max(...opts.options.map((o2) => optionLabel(o2).length));
|
|
5718
5736
|
return runInteractive({
|
|
5719
5737
|
render() {
|
|
5720
|
-
const
|
|
5738
|
+
const count = opts.options.length;
|
|
5739
|
+
const view = viewport(count, selected, top, output.rows, 8);
|
|
5740
|
+
top = view.top;
|
|
5741
|
+
const rows = opts.options.slice(top, top + view.visible).map((option, offset) => {
|
|
5742
|
+
const index = top + offset;
|
|
5721
5743
|
const label = optionLabel(option).padEnd(labelWidth);
|
|
5722
5744
|
const hint = option.hint ? ` ${import_picocolors11.default.dim(option.hint)}` : "";
|
|
5723
5745
|
return index === selected ? `${brand(POINTER2)} ${import_picocolors11.default.bold(brand(label))}${hint}` : ` ${import_picocolors11.default.dim(label)}${hint}`;
|
|
@@ -5725,7 +5747,9 @@ function select(opts, io = {}) {
|
|
|
5725
5747
|
return [
|
|
5726
5748
|
import_picocolors11.default.bold(opts.message),
|
|
5727
5749
|
"",
|
|
5750
|
+
...moreAbove(view.above),
|
|
5728
5751
|
...rows,
|
|
5752
|
+
...moreBelow(view.below),
|
|
5729
5753
|
"",
|
|
5730
5754
|
import_picocolors11.default.dim(`↑↓ move ${DOT} enter select ${DOT} esc cancel`)
|
|
5731
5755
|
];
|
|
@@ -5763,13 +5787,9 @@ function multiselect2(opts, io = {}) {
|
|
|
5763
5787
|
return runInteractive({
|
|
5764
5788
|
render() {
|
|
5765
5789
|
const count = opts.options.length;
|
|
5766
|
-
const
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
if (cursor3 >= top + visible)
|
|
5770
|
-
top = cursor3 - visible + 1;
|
|
5771
|
-
top = Math.max(0, Math.min(top, count - visible));
|
|
5772
|
-
const rows = opts.options.slice(top, top + visible).map((option, offset) => {
|
|
5790
|
+
const view = viewport(count, cursor3, top, output.rows, 9);
|
|
5791
|
+
top = view.top;
|
|
5792
|
+
const rows = opts.options.slice(top, top + view.visible).map((option, offset) => {
|
|
5773
5793
|
const index = top + offset;
|
|
5774
5794
|
const isPicked = picked.has(option.value);
|
|
5775
5795
|
const box = isPicked ? brand(BOX_ON) : import_picocolors11.default.dim(BOX_OFF);
|
|
@@ -5778,15 +5798,13 @@ function multiselect2(opts, io = {}) {
|
|
|
5778
5798
|
const suffix = status ? ` ${status}` : "";
|
|
5779
5799
|
return index === cursor3 ? `${brand(POINTER2)} ${box} ${import_picocolors11.default.bold(brand(label))}${suffix}` : ` ${box} ${import_picocolors11.default.dim(label)}${suffix}`;
|
|
5780
5800
|
});
|
|
5781
|
-
const above = top;
|
|
5782
|
-
const below = count - top - visible;
|
|
5783
5801
|
const summary = opts.summary?.(pickedValues());
|
|
5784
5802
|
return [
|
|
5785
5803
|
import_picocolors11.default.bold(opts.message),
|
|
5786
5804
|
"",
|
|
5787
|
-
...
|
|
5805
|
+
...moreAbove(view.above),
|
|
5788
5806
|
...rows,
|
|
5789
|
-
...
|
|
5807
|
+
...moreBelow(view.below),
|
|
5790
5808
|
"",
|
|
5791
5809
|
...error ? [import_picocolors11.default.yellow(error)] : summary ? [import_picocolors11.default.dim(summary)] : [],
|
|
5792
5810
|
import_picocolors11.default.dim(`↑↓ move ${DOT} space toggle ${DOT} a all ${DOT} enter confirm ${DOT} esc cancel`)
|
|
@@ -73519,7 +73537,7 @@ var init_settings = __esm(() => {
|
|
|
73519
73537
|
});
|
|
73520
73538
|
|
|
73521
73539
|
// src/telemetry/debug-id.ts
|
|
73522
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
73540
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "acac034b-488b-746c-6475-6e2164756e21";
|
|
73523
73541
|
|
|
73524
73542
|
// src/telemetry/telemetry.ts
|
|
73525
73543
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
@@ -84636,4 +84654,4 @@ execute().catch((err) => {
|
|
|
84636
84654
|
process.exit(1);
|
|
84637
84655
|
});
|
|
84638
84656
|
|
|
84639
|
-
//# debugId=
|
|
84657
|
+
//# debugId=acac034b-488b-746c-6475-6e2164756e21
|