kiro-kit 0.3.0 → 0.3.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/dist/index.js +9 -19
- package/dist/index.js.map +1 -1
- package/package.json +73 -65
package/dist/index.js
CHANGED
|
@@ -1233,25 +1233,16 @@ function setupSigintHandler() {
|
|
|
1233
1233
|
async function multiPickPrompt(items) {
|
|
1234
1234
|
const selected = /* @__PURE__ */ new Set();
|
|
1235
1235
|
let cursor = 0;
|
|
1236
|
-
const rl = readline2.createInterface({
|
|
1237
|
-
input: process5.stdin,
|
|
1238
|
-
output: process5.stdout,
|
|
1239
|
-
terminal: false
|
|
1240
|
-
});
|
|
1241
1236
|
if (!process5.stdin.isTTY) {
|
|
1242
|
-
rl.close();
|
|
1243
1237
|
return [];
|
|
1244
1238
|
}
|
|
1245
1239
|
return new Promise((resolve2, reject) => {
|
|
1246
1240
|
let rendered = false;
|
|
1247
1241
|
const render = () => {
|
|
1248
1242
|
if (rendered) {
|
|
1249
|
-
process5.stdout.write(
|
|
1250
|
-
} else {
|
|
1251
|
-
process5.stdout.write("\x1B[s");
|
|
1243
|
+
process5.stdout.write(`\x1B[${items.length + 1}A\r`);
|
|
1252
1244
|
}
|
|
1253
1245
|
rendered = true;
|
|
1254
|
-
process5.stdout.write("\x1B[J");
|
|
1255
1246
|
process5.stdout.write(
|
|
1256
1247
|
color.bold("? Select presets to install:") + color.dim(" (Space to select, <a> toggle all, Enter to confirm)") + "\n"
|
|
1257
1248
|
);
|
|
@@ -1260,7 +1251,7 @@ async function multiPickPrompt(items) {
|
|
|
1260
1251
|
const check = selected.has(i) ? color.green("[x]") : "[ ]";
|
|
1261
1252
|
const name = color.bold(items[i].name.padEnd(12));
|
|
1262
1253
|
const desc = color.dim(`- ${items[i].description}`);
|
|
1263
|
-
process5.stdout.write(
|
|
1254
|
+
process5.stdout.write(`\x1B[2K ${marker} ${check} ${name} ${desc}
|
|
1264
1255
|
`);
|
|
1265
1256
|
}
|
|
1266
1257
|
};
|
|
@@ -1269,6 +1260,11 @@ async function multiPickPrompt(items) {
|
|
|
1269
1260
|
process5.stdin.resume();
|
|
1270
1261
|
process5.stdin.setEncoding("utf-8");
|
|
1271
1262
|
let escBuffer = "";
|
|
1263
|
+
const cleanup = () => {
|
|
1264
|
+
process5.stdin.setRawMode(false);
|
|
1265
|
+
process5.stdin.removeListener("data", onData);
|
|
1266
|
+
process5.stdin.pause();
|
|
1267
|
+
};
|
|
1272
1268
|
const handleArrow = (seq) => {
|
|
1273
1269
|
if (seq === "\x1B[A" || seq === "\x1BOA") {
|
|
1274
1270
|
cursor = (cursor - 1 + items.length) % items.length;
|
|
@@ -1306,18 +1302,12 @@ async function multiPickPrompt(items) {
|
|
|
1306
1302
|
return;
|
|
1307
1303
|
}
|
|
1308
1304
|
if (key === "") {
|
|
1309
|
-
|
|
1310
|
-
process5.stdin.removeListener("data", onData);
|
|
1311
|
-
process5.stdin.pause();
|
|
1312
|
-
rl.close();
|
|
1305
|
+
cleanup();
|
|
1313
1306
|
reject(new Error("SIGINT"));
|
|
1314
1307
|
return;
|
|
1315
1308
|
}
|
|
1316
1309
|
if (key === "\r" || key === "\n") {
|
|
1317
|
-
|
|
1318
|
-
process5.stdin.removeListener("data", onData);
|
|
1319
|
-
process5.stdin.pause();
|
|
1320
|
-
rl.close();
|
|
1310
|
+
cleanup();
|
|
1321
1311
|
const result = [...selected].map((i) => items[i].name);
|
|
1322
1312
|
resolve2(result);
|
|
1323
1313
|
return;
|