lcclaude 1.0.4 → 1.0.6
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.
|
@@ -20,12 +20,16 @@ import { EVENT_HANDLER_PROPS } from "./events/event-handlers.js";
|
|
|
20
20
|
import { getFocusManager, getRootNode } from "./focus.js";
|
|
21
21
|
import { LayoutDisplay } from "./layout/node.js";
|
|
22
22
|
import applyStyles from "./styles.js";
|
|
23
|
-
|
|
23
|
+
function shouldEnableInkDevtools() {
|
|
24
|
+
const runtimeEnv = globalThis.process?.env;
|
|
25
|
+
return isEnvTruthy(runtimeEnv?.LCCLAUDE_REACT_DEVTOOLS);
|
|
26
|
+
}
|
|
27
|
+
if (shouldEnableInkDevtools()) {
|
|
24
28
|
import("./devtools.js").catch((error) => {
|
|
25
29
|
const moduleError = error;
|
|
26
30
|
if (moduleError.code === "ERR_MODULE_NOT_FOUND") {
|
|
27
31
|
console.warn(`
|
|
28
|
-
The environment variable
|
|
32
|
+
The environment variable LCCLAUDE_REACT_DEVTOOLS is set, so Ink tried to import \`react-devtools-core\`,
|
|
29
33
|
but this failed as it was not installed. Debugging with React Devtools requires it.
|
|
30
34
|
|
|
31
35
|
To install use this command:
|
|
@@ -1,7 +1,88 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import cliBoxes from "cli-boxes";
|
|
3
2
|
import { applyColor } from "./colorize.js";
|
|
4
3
|
import { stringWidth } from "./stringWidth.js";
|
|
4
|
+
const BUILTIN_BORDER_STYLES = {
|
|
5
|
+
single: {
|
|
6
|
+
topLeft: "┌",
|
|
7
|
+
top: "─",
|
|
8
|
+
topRight: "┐",
|
|
9
|
+
right: "│",
|
|
10
|
+
bottomRight: "┘",
|
|
11
|
+
bottom: "─",
|
|
12
|
+
bottomLeft: "└",
|
|
13
|
+
left: "│"
|
|
14
|
+
},
|
|
15
|
+
double: {
|
|
16
|
+
topLeft: "╔",
|
|
17
|
+
top: "═",
|
|
18
|
+
topRight: "╗",
|
|
19
|
+
right: "║",
|
|
20
|
+
bottomRight: "╝",
|
|
21
|
+
bottom: "═",
|
|
22
|
+
bottomLeft: "╚",
|
|
23
|
+
left: "║"
|
|
24
|
+
},
|
|
25
|
+
round: {
|
|
26
|
+
topLeft: "╭",
|
|
27
|
+
top: "─",
|
|
28
|
+
topRight: "╮",
|
|
29
|
+
right: "│",
|
|
30
|
+
bottomRight: "╯",
|
|
31
|
+
bottom: "─",
|
|
32
|
+
bottomLeft: "╰",
|
|
33
|
+
left: "│"
|
|
34
|
+
},
|
|
35
|
+
bold: {
|
|
36
|
+
topLeft: "┏",
|
|
37
|
+
top: "━",
|
|
38
|
+
topRight: "┓",
|
|
39
|
+
right: "┃",
|
|
40
|
+
bottomRight: "┛",
|
|
41
|
+
bottom: "━",
|
|
42
|
+
bottomLeft: "┗",
|
|
43
|
+
left: "┃"
|
|
44
|
+
},
|
|
45
|
+
singleDouble: {
|
|
46
|
+
topLeft: "╓",
|
|
47
|
+
top: "─",
|
|
48
|
+
topRight: "╖",
|
|
49
|
+
right: "║",
|
|
50
|
+
bottomRight: "╜",
|
|
51
|
+
bottom: "─",
|
|
52
|
+
bottomLeft: "╙",
|
|
53
|
+
left: "║"
|
|
54
|
+
},
|
|
55
|
+
doubleSingle: {
|
|
56
|
+
topLeft: "╒",
|
|
57
|
+
top: "═",
|
|
58
|
+
topRight: "╕",
|
|
59
|
+
right: "│",
|
|
60
|
+
bottomRight: "╛",
|
|
61
|
+
bottom: "═",
|
|
62
|
+
bottomLeft: "╘",
|
|
63
|
+
left: "│"
|
|
64
|
+
},
|
|
65
|
+
classic: {
|
|
66
|
+
topLeft: "+",
|
|
67
|
+
top: "-",
|
|
68
|
+
topRight: "+",
|
|
69
|
+
right: "|",
|
|
70
|
+
bottomRight: "+",
|
|
71
|
+
bottom: "-",
|
|
72
|
+
bottomLeft: "+",
|
|
73
|
+
left: "|"
|
|
74
|
+
},
|
|
75
|
+
arrow: {
|
|
76
|
+
topLeft: "↘",
|
|
77
|
+
top: "↓",
|
|
78
|
+
topRight: "↙",
|
|
79
|
+
right: "←",
|
|
80
|
+
bottomRight: "↖",
|
|
81
|
+
bottom: "↑",
|
|
82
|
+
bottomLeft: "↗",
|
|
83
|
+
left: "→"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
5
86
|
export const CUSTOM_BORDER_STYLES = {
|
|
6
87
|
dashed: {
|
|
7
88
|
top: "╌",
|
|
@@ -44,7 +125,7 @@ const renderBorder = (x, y, node, output) => {
|
|
|
44
125
|
if (node.style.borderStyle) {
|
|
45
126
|
const width = Math.floor(node.yogaNode.getComputedWidth());
|
|
46
127
|
const height = Math.floor(node.yogaNode.getComputedHeight());
|
|
47
|
-
const box = typeof node.style.borderStyle === "string" ? CUSTOM_BORDER_STYLES[node.style.borderStyle] ??
|
|
128
|
+
const box = typeof node.style.borderStyle === "string" ? CUSTOM_BORDER_STYLES[node.style.borderStyle] ?? BUILTIN_BORDER_STYLES[node.style.borderStyle] : node.style.borderStyle;
|
|
48
129
|
const topBorderColor = node.style.borderTopColor ?? node.style.borderColor;
|
|
49
130
|
const bottomBorderColor = node.style.borderBottomColor ?? node.style.borderColor;
|
|
50
131
|
const leftBorderColor = node.style.borderLeftColor ?? node.style.borderColor;
|
package/dist/src/utils/semver.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
_npmSemver = require("semver");
|
|
5
|
-
}
|
|
6
|
-
return _npmSemver;
|
|
1
|
+
import * as npmSemver from "semver";
|
|
2
|
+
function getBunSemver() {
|
|
3
|
+
return globalThis.Bun?.semver;
|
|
7
4
|
}
|
|
8
5
|
export function gt(a, b) {
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const bunSemver = getBunSemver();
|
|
7
|
+
if (bunSemver) {
|
|
8
|
+
return bunSemver.order(a, b) === 1;
|
|
11
9
|
}
|
|
12
|
-
return
|
|
10
|
+
return npmSemver.gt(a, b, { loose: true });
|
|
13
11
|
}
|
|
14
12
|
export function gte(a, b) {
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const bunSemver = getBunSemver();
|
|
14
|
+
if (bunSemver) {
|
|
15
|
+
return bunSemver.order(a, b) >= 0;
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return npmSemver.gte(a, b, { loose: true });
|
|
19
18
|
}
|
|
20
19
|
export function lt(a, b) {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const bunSemver = getBunSemver();
|
|
21
|
+
if (bunSemver) {
|
|
22
|
+
return bunSemver.order(a, b) === -1;
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return npmSemver.lt(a, b, { loose: true });
|
|
25
25
|
}
|
|
26
26
|
export function lte(a, b) {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const bunSemver = getBunSemver();
|
|
28
|
+
if (bunSemver) {
|
|
29
|
+
return bunSemver.order(a, b) <= 0;
|
|
29
30
|
}
|
|
30
|
-
return
|
|
31
|
+
return npmSemver.lte(a, b, { loose: true });
|
|
31
32
|
}
|
|
32
33
|
export function satisfies(version, range) {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
const bunSemver = getBunSemver();
|
|
35
|
+
if (bunSemver) {
|
|
36
|
+
return bunSemver.satisfies(version, range);
|
|
35
37
|
}
|
|
36
|
-
return
|
|
38
|
+
return npmSemver.satisfies(version, range, { loose: true });
|
|
37
39
|
}
|
|
38
40
|
export function order(a, b) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const bunSemver = getBunSemver();
|
|
42
|
+
if (bunSemver) {
|
|
43
|
+
return bunSemver.order(a, b);
|
|
41
44
|
}
|
|
42
|
-
return
|
|
45
|
+
return npmSemver.compare(a, b, { loose: true });
|
|
43
46
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lcclaude",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"bidi-js": "^1.0.3",
|
|
49
49
|
"chalk": "^5.6.2",
|
|
50
50
|
"chokidar": "^4.0.3",
|
|
51
|
-
"cli-boxes": "^4.0.1",
|
|
52
51
|
"code-excerpt": "^4.0.0",
|
|
53
52
|
"diff": "^8.0.4",
|
|
54
53
|
"emoji-regex": "^10.6.0",
|
|
@@ -89,5 +88,9 @@
|
|
|
89
88
|
"xss": "^1.0.15",
|
|
90
89
|
"yaml": "^2.8.3",
|
|
91
90
|
"zod": "^4.3.6"
|
|
91
|
+
},
|
|
92
|
+
"overrides": {
|
|
93
|
+
"@aws-sdk/types": "3.965.0",
|
|
94
|
+
"@aws-sdk/util-locate-window": "3.965.0"
|
|
92
95
|
}
|
|
93
96
|
}
|