pi-zentui 0.1.5 → 0.1.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.
- package/README.md +2 -2
- package/extensions/zentui/config.ts +60 -0
- package/extensions/zentui/index.ts +8 -2
- package/extensions/zentui/runtime.ts +62 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Zentui brings two popular aesthetics to Pi:
|
|
|
20
20
|
- ` dirname` — current directory with icon
|
|
21
21
|
- `on branch` — git branch with icon
|
|
22
22
|
- `[!?↑]` — git status indicators (modified, untracked, ahead/behind, stashed, etc.)
|
|
23
|
-
- `via v5.5.0` — runtime detection with version and
|
|
23
|
+
- `via v5.5.0` — runtime detection with version and Starship terminal styles for Nerd Font runtime/language modules
|
|
24
24
|
- Right side shows context usage, token counts, and cost
|
|
25
25
|
|
|
26
26
|
### Editor (Opencode-inspired)
|
|
@@ -46,7 +46,7 @@ Zentui brings two popular aesthetics to Pi:
|
|
|
46
46
|
|
|
47
47
|
### Runtime Detection
|
|
48
48
|
|
|
49
|
-
Detects Starship Nerd Font runtime/language modules, uses the Starship Nerd Font symbols, and
|
|
49
|
+
Detects Starship Nerd Font runtime/language modules, uses the Starship Nerd Font symbols, and styles each runtime with Starship's terminal style strings (for example, Node.js uses `bold green`, so your terminal colorscheme supplies the actual green):
|
|
50
50
|
|
|
51
51
|
| Runtime/language | Detection examples |
|
|
52
52
|
| ---------------- | ------------------------------------------------------------ |
|
|
@@ -129,6 +129,46 @@ function hexToAnsi(hex: string, isBackground = false): string {
|
|
|
129
129
|
return `\x1b[${isBackground ? 48 : 38};2;${r};${g};${b}m`;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
const terminalColorCodes = new Map([
|
|
133
|
+
["black", 30],
|
|
134
|
+
["red", 31],
|
|
135
|
+
["green", 32],
|
|
136
|
+
["yellow", 33],
|
|
137
|
+
["blue", 34],
|
|
138
|
+
["purple", 35],
|
|
139
|
+
["cyan", 36],
|
|
140
|
+
["white", 37],
|
|
141
|
+
["bright-black", 90],
|
|
142
|
+
["bright-red", 91],
|
|
143
|
+
["bright-green", 92],
|
|
144
|
+
["bright-yellow", 93],
|
|
145
|
+
["bright-blue", 94],
|
|
146
|
+
["bright-purple", 95],
|
|
147
|
+
["bright-cyan", 96],
|
|
148
|
+
["bright-white", 97],
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
const terminalStyleModifiers = new Map([
|
|
152
|
+
["bold", 1],
|
|
153
|
+
["dim", 2],
|
|
154
|
+
["dimmed", 2],
|
|
155
|
+
["italic", 3],
|
|
156
|
+
["underline", 4],
|
|
157
|
+
]);
|
|
158
|
+
|
|
159
|
+
function terminalColorToAnsi(color: string): string | undefined {
|
|
160
|
+
const normalized = color.toLowerCase();
|
|
161
|
+
const colorCode = terminalColorCodes.get(normalized);
|
|
162
|
+
if (colorCode !== undefined) return `${colorCode}`;
|
|
163
|
+
|
|
164
|
+
if (/^(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(normalized)) {
|
|
165
|
+
return `38;5;${normalized}`;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (isHexColor(normalized)) return hexToAnsi(normalized).slice(2, -1);
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
132
172
|
type ThemeLike = {
|
|
133
173
|
fg(color: string, text: string): string;
|
|
134
174
|
};
|
|
@@ -161,6 +201,26 @@ export function colorize(theme: ThemeLike, color: ColorSpec, text: string): stri
|
|
|
161
201
|
return theme.fg("text", text);
|
|
162
202
|
}
|
|
163
203
|
|
|
204
|
+
export function renderTerminalStyle(style: string, text: string): string {
|
|
205
|
+
const codes: string[] = [];
|
|
206
|
+
for (const token of style.trim().split(/\s+/)) {
|
|
207
|
+
if (!token) continue;
|
|
208
|
+
|
|
209
|
+
const normalized = token.toLowerCase();
|
|
210
|
+
const modifier = terminalStyleModifiers.get(normalized);
|
|
211
|
+
if (modifier !== undefined) {
|
|
212
|
+
codes.push(`${modifier}`);
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const foreground = normalized.startsWith("fg:") ? normalized.slice(3) : normalized;
|
|
217
|
+
const color = terminalColorToAnsi(foreground);
|
|
218
|
+
if (color) codes.push(color);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return codes.length ? `\x1b[${codes.join(";")}m${text}\x1b[0m` : text;
|
|
222
|
+
}
|
|
223
|
+
|
|
164
224
|
export function ensureConfigExists(): void {
|
|
165
225
|
try {
|
|
166
226
|
if (!existsSync(configPath)) {
|
|
@@ -6,7 +6,13 @@ import type {
|
|
|
6
6
|
Theme,
|
|
7
7
|
} from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { type EditorTheme, type TUI, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
type PolishedTuiConfig,
|
|
11
|
+
colorize,
|
|
12
|
+
ensureConfigExists,
|
|
13
|
+
loadConfig,
|
|
14
|
+
renderTerminalStyle,
|
|
15
|
+
} from "./config";
|
|
10
16
|
import { type GitStatusSummary, emptyGitStatus, readGitStatus } from "./git";
|
|
11
17
|
import { type StopProjectRefreshInterval, startProjectRefreshInterval } from "./project-refresh";
|
|
12
18
|
import { type RuntimeInfo, readRuntimeInfo } from "./runtime";
|
|
@@ -92,7 +98,7 @@ function formatRuntimeSegment(
|
|
|
92
98
|
): string {
|
|
93
99
|
if (!runtime) return "";
|
|
94
100
|
const label = runtime.version ? `${runtime.symbol} ${runtime.version}` : runtime.symbol;
|
|
95
|
-
return `${colorize(theme, mutedColor, "via")} ${
|
|
101
|
+
return `${colorize(theme, mutedColor, "via")} ${renderTerminalStyle(runtime.style, label)}`;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
function formatCwdLabel(cwd: string, cwdIcon: string): string {
|
|
@@ -8,10 +8,10 @@ const VERSION_TIMEOUT_MS = 2500;
|
|
|
8
8
|
export type RuntimeMetadata = {
|
|
9
9
|
name: string;
|
|
10
10
|
symbol: string;
|
|
11
|
-
|
|
11
|
+
style: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export type RuntimeInfo = Pick<RuntimeMetadata, "name" | "symbol" | "
|
|
14
|
+
export type RuntimeInfo = Pick<RuntimeMetadata, "name" | "symbol" | "style"> & {
|
|
15
15
|
version?: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -149,7 +149,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
149
149
|
{
|
|
150
150
|
name: "buf",
|
|
151
151
|
symbol: "",
|
|
152
|
-
|
|
152
|
+
style: "bold blue",
|
|
153
153
|
},
|
|
154
154
|
{ files: ["buf.yaml", "buf.gen.yaml", "buf.work.yaml"] },
|
|
155
155
|
versionFromCommands([{ command: "buf", args: ["--version"] }]),
|
|
@@ -158,7 +158,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
158
158
|
{
|
|
159
159
|
name: "bun",
|
|
160
160
|
symbol: "",
|
|
161
|
-
|
|
161
|
+
style: "bold red",
|
|
162
162
|
},
|
|
163
163
|
{ files: ["bun.lock", "bun.lockb"] },
|
|
164
164
|
async () => prefixVersion(await runVersion("bun", ["--version"])),
|
|
@@ -167,7 +167,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
167
167
|
{
|
|
168
168
|
name: "deno",
|
|
169
169
|
symbol: "",
|
|
170
|
-
|
|
170
|
+
style: "green bold",
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
files: ["deno.json", "deno.jsonc", "deno.lock"],
|
|
@@ -178,7 +178,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
178
178
|
{
|
|
179
179
|
name: "cmake",
|
|
180
180
|
symbol: "",
|
|
181
|
-
|
|
181
|
+
style: "bold blue",
|
|
182
182
|
},
|
|
183
183
|
{ files: ["CMakeLists.txt", "CMakeCache.txt"] },
|
|
184
184
|
versionFromCommands([{ command: "cmake", args: ["--version"] }]),
|
|
@@ -187,7 +187,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
187
187
|
{
|
|
188
188
|
name: "cpp",
|
|
189
189
|
symbol: "",
|
|
190
|
-
|
|
190
|
+
style: "bold 149",
|
|
191
191
|
},
|
|
192
192
|
{ extensions: ["cpp", "cc", "cxx", "c++", "hpp", "hh", "hxx", "h++", "tcc"] },
|
|
193
193
|
versionFromCommands([
|
|
@@ -200,7 +200,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
200
200
|
{
|
|
201
201
|
name: "c",
|
|
202
202
|
symbol: "",
|
|
203
|
-
|
|
203
|
+
style: "bold 149",
|
|
204
204
|
},
|
|
205
205
|
{ extensions: ["c", "h"] },
|
|
206
206
|
versionFromCommands([
|
|
@@ -213,7 +213,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
213
213
|
{
|
|
214
214
|
name: "cobol",
|
|
215
215
|
symbol: "",
|
|
216
|
-
|
|
216
|
+
style: "bold blue",
|
|
217
217
|
},
|
|
218
218
|
{ extensions: ["cbl", "cob", "CBL", "COB"] },
|
|
219
219
|
versionFromCommands([{ command: "cobc", args: ["--version"] }]),
|
|
@@ -222,7 +222,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
222
222
|
{
|
|
223
223
|
name: "conda",
|
|
224
224
|
symbol: "",
|
|
225
|
-
|
|
225
|
+
style: "bold green",
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
env: (env) => Boolean(env.CONDA_DEFAULT_ENV?.trim()) && !env.PIXI_ENVIRONMENT_NAME,
|
|
@@ -232,7 +232,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
232
232
|
{
|
|
233
233
|
name: "crystal",
|
|
234
234
|
symbol: "",
|
|
235
|
-
|
|
235
|
+
style: "bold red",
|
|
236
236
|
},
|
|
237
237
|
{ extensions: ["cr"], files: ["shard.yml"] },
|
|
238
238
|
versionFromCommands([{ command: "crystal", args: ["--version"] }]),
|
|
@@ -241,7 +241,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
241
241
|
{
|
|
242
242
|
name: "dart",
|
|
243
243
|
symbol: "",
|
|
244
|
-
|
|
244
|
+
style: "bold blue",
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
extensions: ["dart"],
|
|
@@ -254,7 +254,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
254
254
|
{
|
|
255
255
|
name: "dotnet",
|
|
256
256
|
symbol: "",
|
|
257
|
-
|
|
257
|
+
style: "bold blue",
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
extensions: ["csproj", "fsproj", "xproj"],
|
|
@@ -272,7 +272,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
272
272
|
{
|
|
273
273
|
name: "elixir",
|
|
274
274
|
symbol: "",
|
|
275
|
-
|
|
275
|
+
style: "bold purple",
|
|
276
276
|
},
|
|
277
277
|
{ files: ["mix.exs"] },
|
|
278
278
|
versionFromCommands([
|
|
@@ -283,7 +283,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
283
283
|
{
|
|
284
284
|
name: "elm",
|
|
285
285
|
symbol: "",
|
|
286
|
-
|
|
286
|
+
style: "cyan bold",
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
289
|
extensions: ["elm"],
|
|
@@ -296,7 +296,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
296
296
|
{
|
|
297
297
|
name: "erlang",
|
|
298
298
|
symbol: "",
|
|
299
|
-
|
|
299
|
+
style: "bold red",
|
|
300
300
|
},
|
|
301
301
|
{ files: ["rebar.config", "erlang.mk"] },
|
|
302
302
|
versionFromCommands([{ command: "erl", args: ["-version"] }]),
|
|
@@ -305,7 +305,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
305
305
|
{
|
|
306
306
|
name: "fennel",
|
|
307
307
|
symbol: "",
|
|
308
|
-
|
|
308
|
+
style: "bold green",
|
|
309
309
|
},
|
|
310
310
|
{ extensions: ["fnl"] },
|
|
311
311
|
versionFromCommands([{ command: "fennel", args: ["--version"] }]),
|
|
@@ -314,7 +314,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
314
314
|
{
|
|
315
315
|
name: "fortran",
|
|
316
316
|
symbol: "",
|
|
317
|
-
|
|
317
|
+
style: "bold purple",
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
extensions: [
|
|
@@ -349,7 +349,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
349
349
|
{
|
|
350
350
|
name: "gleam",
|
|
351
351
|
symbol: "",
|
|
352
|
-
|
|
352
|
+
style: "bold #FFAFF3",
|
|
353
353
|
},
|
|
354
354
|
{ extensions: ["gleam"], files: ["gleam.toml"] },
|
|
355
355
|
versionFromCommands([{ command: "gleam", args: ["--version"] }]),
|
|
@@ -358,7 +358,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
358
358
|
{
|
|
359
359
|
name: "golang",
|
|
360
360
|
symbol: "",
|
|
361
|
-
|
|
361
|
+
style: "bold cyan",
|
|
362
362
|
},
|
|
363
363
|
{ files: ["go.mod"] },
|
|
364
364
|
async () => extractVersion(await runVersion("go", ["version"]), /go version go([0-9][^\s]*)/i),
|
|
@@ -367,7 +367,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
367
367
|
{
|
|
368
368
|
name: "gradle",
|
|
369
369
|
symbol: "",
|
|
370
|
-
|
|
370
|
+
style: "bold bright-cyan",
|
|
371
371
|
},
|
|
372
372
|
{ files: ["build.gradle", "build.gradle.kts"], folders: ["gradle"] },
|
|
373
373
|
versionFromCommands([
|
|
@@ -378,7 +378,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
378
378
|
{
|
|
379
379
|
name: "guix_shell",
|
|
380
380
|
symbol: "",
|
|
381
|
-
|
|
381
|
+
style: "yellow bold",
|
|
382
382
|
},
|
|
383
383
|
{ env: (env) => Boolean(env.GUIX_ENVIRONMENT?.trim()) },
|
|
384
384
|
),
|
|
@@ -386,7 +386,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
386
386
|
{
|
|
387
387
|
name: "haskell",
|
|
388
388
|
symbol: "",
|
|
389
|
-
|
|
389
|
+
style: "bold purple",
|
|
390
390
|
},
|
|
391
391
|
{ extensions: ["hs", "cabal", "hs-boot"], files: ["stack.yaml", "cabal.project"] },
|
|
392
392
|
versionFromCommands([{ command: "ghc", args: ["--numeric-version"] }]),
|
|
@@ -395,7 +395,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
395
395
|
{
|
|
396
396
|
name: "haxe",
|
|
397
397
|
symbol: "",
|
|
398
|
-
|
|
398
|
+
style: "bold fg:202",
|
|
399
399
|
},
|
|
400
400
|
{
|
|
401
401
|
extensions: ["hx", "hxml"],
|
|
@@ -408,7 +408,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
408
408
|
{
|
|
409
409
|
name: "helm",
|
|
410
410
|
symbol: "",
|
|
411
|
-
|
|
411
|
+
style: "bold white",
|
|
412
412
|
},
|
|
413
413
|
{ files: ["helmfile.yaml", "Chart.yaml"] },
|
|
414
414
|
versionFromCommands([{ command: "helm", args: ["version", "--short"] }]),
|
|
@@ -417,7 +417,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
417
417
|
{
|
|
418
418
|
name: "java",
|
|
419
419
|
symbol: "",
|
|
420
|
-
|
|
420
|
+
style: "red dimmed",
|
|
421
421
|
},
|
|
422
422
|
{ files: [".java-version"] },
|
|
423
423
|
async () => {
|
|
@@ -432,7 +432,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
432
432
|
{
|
|
433
433
|
name: "julia",
|
|
434
434
|
symbol: "",
|
|
435
|
-
|
|
435
|
+
style: "bold purple",
|
|
436
436
|
},
|
|
437
437
|
{ extensions: ["jl"], files: ["Project.toml", "Manifest.toml"] },
|
|
438
438
|
versionFromCommands([{ command: "julia", args: ["--version"] }]),
|
|
@@ -441,7 +441,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
441
441
|
{
|
|
442
442
|
name: "kotlin",
|
|
443
443
|
symbol: "",
|
|
444
|
-
|
|
444
|
+
style: "bold blue",
|
|
445
445
|
},
|
|
446
446
|
{ extensions: ["kt", "kts"] },
|
|
447
447
|
versionFromCommands([{ command: "kotlin", args: ["-version"] }]),
|
|
@@ -450,7 +450,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
450
450
|
{
|
|
451
451
|
name: "lua",
|
|
452
452
|
symbol: "",
|
|
453
|
-
|
|
453
|
+
style: "bold blue",
|
|
454
454
|
},
|
|
455
455
|
{
|
|
456
456
|
extensions: ["lua"],
|
|
@@ -478,7 +478,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
478
478
|
{
|
|
479
479
|
name: "maven",
|
|
480
480
|
symbol: "",
|
|
481
|
-
|
|
481
|
+
style: "bold bright-cyan",
|
|
482
482
|
},
|
|
483
483
|
{ files: ["pom.xml"] },
|
|
484
484
|
versionFromCommands([
|
|
@@ -489,7 +489,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
489
489
|
{
|
|
490
490
|
name: "meson",
|
|
491
491
|
symbol: "",
|
|
492
|
-
|
|
492
|
+
style: "blue bold",
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
env: (env) => env.MESON_DEVENV === "1" && Boolean(env.MESON_PROJECT_NAME?.trim()),
|
|
@@ -499,7 +499,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
499
499
|
{
|
|
500
500
|
name: "mojo",
|
|
501
501
|
symbol: "",
|
|
502
|
-
|
|
502
|
+
style: "bold 208",
|
|
503
503
|
},
|
|
504
504
|
{ extensions: ["mojo", "🔥"] },
|
|
505
505
|
versionFromCommands([{ command: "mojo", args: ["--version"] }]),
|
|
@@ -508,7 +508,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
508
508
|
{
|
|
509
509
|
name: "nim",
|
|
510
510
|
symbol: "",
|
|
511
|
-
|
|
511
|
+
style: "bold yellow",
|
|
512
512
|
},
|
|
513
513
|
{ extensions: ["nim", "nims", "nimble"], files: ["nim.cfg"] },
|
|
514
514
|
versionFromCommands([{ command: "nim", args: ["--version"] }]),
|
|
@@ -517,7 +517,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
517
517
|
{
|
|
518
518
|
name: "nix_shell",
|
|
519
519
|
symbol: "",
|
|
520
|
-
|
|
520
|
+
style: "bold blue",
|
|
521
521
|
},
|
|
522
522
|
{ env: (env) => env.IN_NIX_SHELL === "pure" || env.IN_NIX_SHELL === "impure" },
|
|
523
523
|
),
|
|
@@ -525,7 +525,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
525
525
|
{
|
|
526
526
|
name: "nodejs",
|
|
527
527
|
symbol: "",
|
|
528
|
-
|
|
528
|
+
style: "bold green",
|
|
529
529
|
},
|
|
530
530
|
{
|
|
531
531
|
files: ["package.json", ".node-version", ".nvmrc"],
|
|
@@ -537,7 +537,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
537
537
|
{
|
|
538
538
|
name: "python",
|
|
539
539
|
symbol: "",
|
|
540
|
-
|
|
540
|
+
style: "yellow bold",
|
|
541
541
|
},
|
|
542
542
|
{
|
|
543
543
|
files: [
|
|
@@ -562,7 +562,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
562
562
|
{
|
|
563
563
|
name: "rust",
|
|
564
564
|
symbol: "",
|
|
565
|
-
|
|
565
|
+
style: "bold red",
|
|
566
566
|
},
|
|
567
567
|
{ files: ["Cargo.toml"] },
|
|
568
568
|
async () => extractVersion(await runVersion("rustc", ["--version"]), /rustc\s+([0-9][^\s]*)/i),
|
|
@@ -571,7 +571,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
571
571
|
{
|
|
572
572
|
name: "ruby",
|
|
573
573
|
symbol: "",
|
|
574
|
-
|
|
574
|
+
style: "bold red",
|
|
575
575
|
},
|
|
576
576
|
{ files: ["Gemfile", ".ruby-version"] },
|
|
577
577
|
async () => extractVersion(await runVersion("ruby", ["--version"]), /ruby\s+([0-9][^\s]*)/i),
|
|
@@ -580,7 +580,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
580
580
|
{
|
|
581
581
|
name: "php",
|
|
582
582
|
symbol: "",
|
|
583
|
-
|
|
583
|
+
style: "147 bold",
|
|
584
584
|
},
|
|
585
585
|
{ files: ["composer.json"] },
|
|
586
586
|
async () => extractVersion(await runVersion("php", ["--version"]), /PHP\s+([0-9][^\s]*)/i),
|
|
@@ -589,7 +589,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
589
589
|
{
|
|
590
590
|
name: "ocaml",
|
|
591
591
|
symbol: "",
|
|
592
|
-
|
|
592
|
+
style: "bold yellow",
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
595
|
extensions: ["opam", "ml", "mli", "re", "rei"],
|
|
@@ -602,7 +602,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
602
602
|
{
|
|
603
603
|
name: "odin",
|
|
604
604
|
symbol: "",
|
|
605
|
-
|
|
605
|
+
style: "bold bright-blue",
|
|
606
606
|
},
|
|
607
607
|
{ extensions: ["odin"] },
|
|
608
608
|
versionFromCommands([{ command: "odin", args: ["version"] }]),
|
|
@@ -611,7 +611,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
611
611
|
{
|
|
612
612
|
name: "opa",
|
|
613
613
|
symbol: "",
|
|
614
|
-
|
|
614
|
+
style: "bold blue",
|
|
615
615
|
},
|
|
616
616
|
{ extensions: ["rego"] },
|
|
617
617
|
versionFromCommands([{ command: "opa", args: ["version"] }]),
|
|
@@ -620,7 +620,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
620
620
|
{
|
|
621
621
|
name: "perl",
|
|
622
622
|
symbol: "",
|
|
623
|
-
|
|
623
|
+
style: "bold 149",
|
|
624
624
|
},
|
|
625
625
|
{
|
|
626
626
|
extensions: ["pl", "pm", "pod"],
|
|
@@ -640,7 +640,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
640
640
|
{
|
|
641
641
|
name: "pixi",
|
|
642
642
|
symbol: "",
|
|
643
|
-
|
|
643
|
+
style: "yellow bold",
|
|
644
644
|
},
|
|
645
645
|
{
|
|
646
646
|
files: ["pixi.toml", "pixi.lock"],
|
|
@@ -652,7 +652,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
652
652
|
{
|
|
653
653
|
name: "pulumi",
|
|
654
654
|
symbol: "",
|
|
655
|
-
|
|
655
|
+
style: "bold 5",
|
|
656
656
|
},
|
|
657
657
|
{ files: ["Pulumi.yaml", "Pulumi.yml"] },
|
|
658
658
|
versionFromCommands([{ command: "pulumi", args: ["version"] }]),
|
|
@@ -661,7 +661,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
661
661
|
{
|
|
662
662
|
name: "purescript",
|
|
663
663
|
symbol: "",
|
|
664
|
-
|
|
664
|
+
style: "bold white",
|
|
665
665
|
},
|
|
666
666
|
{ extensions: ["purs"], files: ["spago.dhall", "spago.yaml", "spago.lock"] },
|
|
667
667
|
versionFromCommands([{ command: "purs", args: ["--version"] }]),
|
|
@@ -670,7 +670,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
670
670
|
{
|
|
671
671
|
name: "raku",
|
|
672
672
|
symbol: "",
|
|
673
|
-
|
|
673
|
+
style: "bold 149",
|
|
674
674
|
},
|
|
675
675
|
{ extensions: ["p6", "pm6", "pod6", "raku", "rakumod"], files: ["META6.json"] },
|
|
676
676
|
versionFromCommands([{ command: "raku", args: ["--version"] }]),
|
|
@@ -679,7 +679,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
679
679
|
{
|
|
680
680
|
name: "red",
|
|
681
681
|
symbol: "",
|
|
682
|
-
|
|
682
|
+
style: "red bold",
|
|
683
683
|
},
|
|
684
684
|
{ extensions: ["red", "reds"] },
|
|
685
685
|
versionFromCommands([{ command: "red", args: ["--version"] }]),
|
|
@@ -688,7 +688,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
688
688
|
{
|
|
689
689
|
name: "rlang",
|
|
690
690
|
symbol: "",
|
|
691
|
-
|
|
691
|
+
style: "blue bold",
|
|
692
692
|
},
|
|
693
693
|
{
|
|
694
694
|
extensions: ["R", "Rd", "Rmd", "Rproj", "Rsx"],
|
|
@@ -701,7 +701,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
701
701
|
{
|
|
702
702
|
name: "scala",
|
|
703
703
|
symbol: "",
|
|
704
|
-
|
|
704
|
+
style: "red dimmed",
|
|
705
705
|
},
|
|
706
706
|
{
|
|
707
707
|
extensions: ["sbt", "scala"],
|
|
@@ -714,7 +714,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
714
714
|
{
|
|
715
715
|
name: "solidity",
|
|
716
716
|
symbol: "",
|
|
717
|
-
|
|
717
|
+
style: "bold blue",
|
|
718
718
|
},
|
|
719
719
|
{ extensions: ["sol"] },
|
|
720
720
|
versionFromCommands([{ command: "solc", args: ["--version"] }]),
|
|
@@ -723,7 +723,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
723
723
|
{
|
|
724
724
|
name: "spack",
|
|
725
725
|
symbol: "",
|
|
726
|
-
|
|
726
|
+
style: "bold blue",
|
|
727
727
|
},
|
|
728
728
|
{ env: (env) => Boolean(env.SPACK_ENV?.trim()) },
|
|
729
729
|
),
|
|
@@ -731,7 +731,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
731
731
|
{
|
|
732
732
|
name: "swift",
|
|
733
733
|
symbol: "",
|
|
734
|
-
|
|
734
|
+
style: "bold 202",
|
|
735
735
|
},
|
|
736
736
|
{ extensions: ["swift"], files: ["Package.swift"] },
|
|
737
737
|
versionFromCommands([
|
|
@@ -742,7 +742,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
742
742
|
{
|
|
743
743
|
name: "terraform",
|
|
744
744
|
symbol: "",
|
|
745
|
-
|
|
745
|
+
style: "bold 105",
|
|
746
746
|
},
|
|
747
747
|
{ extensions: ["tf", "tfplan", "tfstate"], folders: [".terraform"] },
|
|
748
748
|
versionFromCommands([
|
|
@@ -754,7 +754,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
754
754
|
{
|
|
755
755
|
name: "typst",
|
|
756
756
|
symbol: "",
|
|
757
|
-
|
|
757
|
+
style: "bold #0093A7",
|
|
758
758
|
},
|
|
759
759
|
{ extensions: ["typ"], files: ["template.typ"] },
|
|
760
760
|
versionFromCommands([{ command: "typst", args: ["--version"] }]),
|
|
@@ -763,7 +763,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
763
763
|
{
|
|
764
764
|
name: "vagrant",
|
|
765
765
|
symbol: "",
|
|
766
|
-
|
|
766
|
+
style: "cyan bold",
|
|
767
767
|
},
|
|
768
768
|
{ files: ["Vagrantfile"] },
|
|
769
769
|
versionFromCommands([{ command: "vagrant", args: ["--version"] }]),
|
|
@@ -772,7 +772,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
772
772
|
{
|
|
773
773
|
name: "vlang",
|
|
774
774
|
symbol: "",
|
|
775
|
-
|
|
775
|
+
style: "blue bold",
|
|
776
776
|
},
|
|
777
777
|
{ extensions: ["v"], files: ["v.mod", "vpkg.json", ".vpkg-lock.json"] },
|
|
778
778
|
versionFromCommands([{ command: "v", args: ["version"] }]),
|
|
@@ -781,7 +781,7 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
781
781
|
{
|
|
782
782
|
name: "xmake",
|
|
783
783
|
symbol: "",
|
|
784
|
-
|
|
784
|
+
style: "bold green",
|
|
785
785
|
},
|
|
786
786
|
{ files: ["xmake.lua"] },
|
|
787
787
|
versionFromCommands([{ command: "xmake", args: ["--version"] }]),
|
|
@@ -790,17 +790,17 @@ const runtimes: RuntimeCandidate[] = [
|
|
|
790
790
|
{
|
|
791
791
|
name: "zig",
|
|
792
792
|
symbol: "",
|
|
793
|
-
|
|
793
|
+
style: "bold yellow",
|
|
794
794
|
},
|
|
795
795
|
{ extensions: ["zig"], files: ["build.zig"] },
|
|
796
796
|
versionFromCommands([{ command: "zig", args: ["version"] }]),
|
|
797
797
|
),
|
|
798
798
|
];
|
|
799
799
|
|
|
800
|
-
export const runtimeMetadata: RuntimeMetadata[] = runtimes.map(({ name, symbol,
|
|
800
|
+
export const runtimeMetadata: RuntimeMetadata[] = runtimes.map(({ name, symbol, style }) => ({
|
|
801
801
|
name,
|
|
802
802
|
symbol,
|
|
803
|
-
|
|
803
|
+
style,
|
|
804
804
|
}));
|
|
805
805
|
|
|
806
806
|
const priorityRuntimeOrder = ["xmake", "maven", "gradle"] as const;
|
|
@@ -854,7 +854,7 @@ export async function readRuntimeInfo(cwd: string): Promise<RuntimeInfo | undefi
|
|
|
854
854
|
return {
|
|
855
855
|
name: runtime.name,
|
|
856
856
|
symbol: runtime.symbol,
|
|
857
|
-
|
|
857
|
+
style: runtime.style,
|
|
858
858
|
version: await runtime.version(cwd),
|
|
859
859
|
};
|
|
860
860
|
}
|