@robinpath/cli 2.4.0 → 2.5.0
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.mjs +22 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -18598,7 +18598,7 @@ function getNativeModules() {
|
|
|
18598
18598
|
import { join as join3, basename as basename2 } from "node:path";
|
|
18599
18599
|
import { homedir as homedir2, platform as platform2 } from "node:os";
|
|
18600
18600
|
import { existsSync as existsSync2 } from "node:fs";
|
|
18601
|
-
var CLI_VERSION = true ? "2.
|
|
18601
|
+
var CLI_VERSION = true ? "2.5.0" : "2.5.0";
|
|
18602
18602
|
var FLAG_QUIET = false;
|
|
18603
18603
|
var FLAG_VERBOSE = false;
|
|
18604
18604
|
var FLAG_AUTO_ACCEPT = false;
|
|
@@ -24324,7 +24324,7 @@ function InputArea({ onSubmit, placeholder, statusText }) {
|
|
|
24324
24324
|
setValue(matchingCommands[0][0]);
|
|
24325
24325
|
return;
|
|
24326
24326
|
}
|
|
24327
|
-
if (showFiles.length
|
|
24327
|
+
if (showFiles.length > 0) {
|
|
24328
24328
|
const atMatch = value.match(/@(\S*)$/);
|
|
24329
24329
|
if (atMatch) {
|
|
24330
24330
|
const before = value.slice(0, value.length - atMatch[0].length);
|
|
@@ -24346,6 +24346,25 @@ function InputArea({ onSubmit, placeholder, statusText }) {
|
|
|
24346
24346
|
const lines = value.split("\n");
|
|
24347
24347
|
const empty = value === "";
|
|
24348
24348
|
const w = Math.min(process.stdout.columns - 4 || 76, 76);
|
|
24349
|
+
function renderLineWithFileRefs(line) {
|
|
24350
|
+
const parts = [];
|
|
24351
|
+
const refRegex = /@([\w.\-]+)/g;
|
|
24352
|
+
let lastIdx = 0;
|
|
24353
|
+
let m;
|
|
24354
|
+
let k2 = 0;
|
|
24355
|
+
while ((m = refRegex.exec(line)) !== null) {
|
|
24356
|
+
if (m.index > lastIdx) parts.push(/* @__PURE__ */ jsx2(Text2, { children: line.slice(lastIdx, m.index) }, k2++));
|
|
24357
|
+
const fileName = m[1];
|
|
24358
|
+
const fileExists = existsSync11(join12(process.cwd(), fileName));
|
|
24359
|
+
parts.push(/* @__PURE__ */ jsxs2(Text2, { color: fileExists ? "cyan" : void 0, bold: fileExists, children: [
|
|
24360
|
+
"@",
|
|
24361
|
+
fileName
|
|
24362
|
+
] }, k2++));
|
|
24363
|
+
lastIdx = m.index + m[0].length;
|
|
24364
|
+
}
|
|
24365
|
+
if (lastIdx < line.length) parts.push(/* @__PURE__ */ jsx2(Text2, { children: line.slice(lastIdx) }, k2++));
|
|
24366
|
+
return parts.length > 0 ? parts : [/* @__PURE__ */ jsx2(Text2, { children: line }, 0)];
|
|
24367
|
+
}
|
|
24349
24368
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
24350
24369
|
showHints && /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", marginX: 2, marginBottom: 1, children: matchingCommands.slice(0, 8).map(([cmd, desc]) => /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
24351
24370
|
/* @__PURE__ */ jsx2(Text2, { color: "cyan", children: cmd.padEnd(14) }),
|
|
@@ -24358,7 +24377,7 @@ function InputArea({ onSubmit, placeholder, statusText }) {
|
|
|
24358
24377
|
placeholder
|
|
24359
24378
|
] }) : lines.map((line, i) => /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
24360
24379
|
i === 0 ? /* @__PURE__ */ jsx2(Text2, { color: "cyan", children: "> " }) : /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: " " }),
|
|
24361
|
-
line,
|
|
24380
|
+
renderLineWithFileRefs(line),
|
|
24362
24381
|
i === lines.length - 1 ? /* @__PURE__ */ jsx2(Text2, { color: "cyan", children: "\u258E" }) : null
|
|
24363
24382
|
] }, i)) }),
|
|
24364
24383
|
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "\u2500".repeat(Math.max(process.stdout.columns || 80, 40)) })
|