@kaynooo/cli-pkg 0.15.1 → 0.15.2
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/cli.js +12 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3312,6 +3312,16 @@ var init_state = __esm(() => {
|
|
|
3312
3312
|
};
|
|
3313
3313
|
});
|
|
3314
3314
|
|
|
3315
|
+
// ../kit/src/redraw.ts
|
|
3316
|
+
function overwrite(lines, columns) {
|
|
3317
|
+
return lines.map((line) => textWidth(line) < columns ? `${line}\x1B[K` : `\x1B[2K${line}`).join(`
|
|
3318
|
+
`);
|
|
3319
|
+
}
|
|
3320
|
+
var SYNC_START = "\x1B[?2026h", SYNC_END = "\x1B[?2026l";
|
|
3321
|
+
var init_redraw = __esm(() => {
|
|
3322
|
+
init_format();
|
|
3323
|
+
});
|
|
3324
|
+
|
|
3315
3325
|
// ../kit/src/prompt.ts
|
|
3316
3326
|
import process20 from "process";
|
|
3317
3327
|
function readKeys(input, paste = { active: false }) {
|
|
@@ -3437,8 +3447,7 @@ async function ask(question, { hint, terminal = process20 }, render, press) {
|
|
|
3437
3447
|
const columns = () => stderr.columns || 80;
|
|
3438
3448
|
const draw = (state, last = false) => {
|
|
3439
3449
|
const frame = render(colors, state, { columns: columns(), rows: stderr.rows || 24 });
|
|
3440
|
-
stderr.write(
|
|
3441
|
-
`)}${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}`);
|
|
3450
|
+
stderr.write(`${SYNC_START}\r${overwrite(frame, columns())}\x1B[0J${last || frame.length < 2 ? "" : `\x1B[${frame.length - 1}A`}${last ? "" : "\r"}${SYNC_END}`);
|
|
3442
3451
|
current = state;
|
|
3443
3452
|
};
|
|
3444
3453
|
const redraw = () => draw(current);
|
|
@@ -3487,6 +3496,7 @@ var init_prompt = __esm(() => {
|
|
|
3487
3496
|
init_format();
|
|
3488
3497
|
init_mode();
|
|
3489
3498
|
init_state();
|
|
3499
|
+
init_redraw();
|
|
3490
3500
|
init_style();
|
|
3491
3501
|
WORDS2 = /\s+/;
|
|
3492
3502
|
PROMPT_KEYS = new Set(["up", "down", "pageup", "pagedown", "home", "end", "enter", "cancel", "erase"]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-pkg",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.2",
|
|
5
5
|
"description": "pkg: check an npm package before it is added, for a guessed name, a version under two weeks old and install scripts.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"@kaynooo/utils": "3.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@kaynooo/cli-kit": "0.38.
|
|
36
|
+
"@kaynooo/cli-kit": "0.38.4"
|
|
37
37
|
}
|
|
38
38
|
}
|