@tscircuit/cli 0.1.93 → 0.1.95
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 +1 -0
- package/dist/main.js +75 -487
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ Commands:
|
|
|
49
49
|
config Manage tscircuit CLI configuration
|
|
50
50
|
export [options] <file> Export tscircuit code to various formats
|
|
51
51
|
add <component> Add a component from tscircuit.com
|
|
52
|
+
upgrade Upgrade CLI to the latest version
|
|
52
53
|
help [command] display help for command
|
|
53
54
|
```
|
|
54
55
|
<!-- END_HELP_OUTPUT -->
|
package/dist/main.js
CHANGED
|
@@ -433425,7 +433425,7 @@ import readline from "node:readline";
|
|
|
433425
433425
|
import { execSync as execSync2 } from "node:child_process";
|
|
433426
433426
|
var import_semver = __toESM2(require_semver2(), 1);
|
|
433427
433427
|
// package.json
|
|
433428
|
-
var version = "0.1.
|
|
433428
|
+
var version = "0.1.94";
|
|
433429
433429
|
var package_default = {
|
|
433430
433430
|
name: "@tscircuit/cli",
|
|
433431
433431
|
version,
|
|
@@ -433436,7 +433436,7 @@ var package_default = {
|
|
|
433436
433436
|
"@tscircuit/core": "^0.0.353",
|
|
433437
433437
|
"@tscircuit/eval": "^0.0.152",
|
|
433438
433438
|
"@tscircuit/fake-snippets": "^0.0.23",
|
|
433439
|
-
"@tscircuit/file-server": "^0.0.
|
|
433439
|
+
"@tscircuit/file-server": "^0.0.19",
|
|
433440
433440
|
"@tscircuit/runframe": "^0.0.341",
|
|
433441
433441
|
"@types/bun": "^1.2.2",
|
|
433442
433442
|
"@types/configstore": "^6.0.2",
|
|
@@ -434299,6 +434299,7 @@ init_lib();
|
|
|
434299
434299
|
init_lib();
|
|
434300
434300
|
init_lib();
|
|
434301
434301
|
init_lib();
|
|
434302
|
+
init_lib();
|
|
434302
434303
|
var fileSchema = z.object({
|
|
434303
434304
|
file_id: z.string(),
|
|
434304
434305
|
file_path: z.string(),
|
|
@@ -434533,7 +434534,7 @@ var get_default = withRouteSpec({
|
|
|
434533
434534
|
<p><span class="label">Created At:</span> ${file.created_at}</p>
|
|
434534
434535
|
</div>
|
|
434535
434536
|
<h2>Content:</h2>
|
|
434536
|
-
<pre>${file.text_content}</pre>
|
|
434537
|
+
<pre>${file.text_content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
434537
434538
|
</div>
|
|
434538
434539
|
</body>
|
|
434539
434540
|
</html>`, {
|
|
@@ -434760,6 +434761,70 @@ var health_default = withRouteSpec({
|
|
|
434760
434761
|
})((req, ctx) => {
|
|
434761
434762
|
return ctx.json({ ok: true });
|
|
434762
434763
|
});
|
|
434764
|
+
var PROXY_HEADERS = [
|
|
434765
|
+
"X-Target-Url",
|
|
434766
|
+
"X-Sender-Origin",
|
|
434767
|
+
"X-Sender-Host",
|
|
434768
|
+
"X-Sender-Referer",
|
|
434769
|
+
"X-Sender-User-Agent",
|
|
434770
|
+
"X-Sender-Cookie"
|
|
434771
|
+
];
|
|
434772
|
+
var proxy_default = withRouteSpec({
|
|
434773
|
+
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"],
|
|
434774
|
+
jsonResponse: z.any()
|
|
434775
|
+
})(async (req, ctx) => {
|
|
434776
|
+
const targetUrl = req.headers.get("X-Target-Url");
|
|
434777
|
+
if (!targetUrl) {
|
|
434778
|
+
return ctx.json({ error: "X-Target-Url header is required" }, { status: 400 });
|
|
434779
|
+
}
|
|
434780
|
+
let body = undefined;
|
|
434781
|
+
if (["POST", "PUT", "PATCH"].includes(req.method)) {
|
|
434782
|
+
body = await req.clone().text();
|
|
434783
|
+
}
|
|
434784
|
+
const headers = new Headers(req.headers);
|
|
434785
|
+
const senderOrigin = req.headers.get("X-Sender-Origin");
|
|
434786
|
+
if (senderOrigin) {
|
|
434787
|
+
headers.set("Origin", senderOrigin);
|
|
434788
|
+
}
|
|
434789
|
+
const senderHost = req.headers.get("X-Sender-Host");
|
|
434790
|
+
if (senderHost) {
|
|
434791
|
+
headers.set("Host", senderHost);
|
|
434792
|
+
}
|
|
434793
|
+
const senderReferer = req.headers.get("X-Sender-Referer");
|
|
434794
|
+
if (senderReferer) {
|
|
434795
|
+
headers.set("Referer", senderReferer);
|
|
434796
|
+
}
|
|
434797
|
+
const senderUserAgent = req.headers.get("X-Sender-User-Agent");
|
|
434798
|
+
if (senderUserAgent) {
|
|
434799
|
+
headers.set("User-Agent", senderUserAgent);
|
|
434800
|
+
}
|
|
434801
|
+
const senderCookie = req.headers.get("X-Sender-Cookie");
|
|
434802
|
+
if (senderCookie) {
|
|
434803
|
+
headers.set("Cookie", senderCookie);
|
|
434804
|
+
}
|
|
434805
|
+
for (const header of PROXY_HEADERS) {
|
|
434806
|
+
headers.delete(header);
|
|
434807
|
+
}
|
|
434808
|
+
headers.delete("content-encoding");
|
|
434809
|
+
headers.delete("accept-encoding");
|
|
434810
|
+
try {
|
|
434811
|
+
const response = await fetch(targetUrl, {
|
|
434812
|
+
method: req.method,
|
|
434813
|
+
headers,
|
|
434814
|
+
body: ["GET", "HEAD"].includes(req.method) ? undefined : body
|
|
434815
|
+
});
|
|
434816
|
+
const responseHeaders = new Headers(response.headers);
|
|
434817
|
+
responseHeaders.delete("content-encoding");
|
|
434818
|
+
return new Response(response.body, {
|
|
434819
|
+
status: response.status,
|
|
434820
|
+
statusText: response.statusText,
|
|
434821
|
+
headers: responseHeaders
|
|
434822
|
+
});
|
|
434823
|
+
} catch (error) {
|
|
434824
|
+
console.error("Proxy error:", error);
|
|
434825
|
+
return ctx.json({ error: { message: "Failed to proxy request" } }, { status: 502 });
|
|
434826
|
+
}
|
|
434827
|
+
});
|
|
434763
434828
|
var routes_default = withRouteSpec({
|
|
434764
434829
|
methods: ["GET"],
|
|
434765
434830
|
jsonResponse: z.any()
|
|
@@ -434807,6 +434872,7 @@ var routeMapWithHandlers = {
|
|
|
434807
434872
|
"/files/list": list_default4,
|
|
434808
434873
|
"/files/upsert": upsert_default,
|
|
434809
434874
|
"/health": health_default,
|
|
434875
|
+
"/proxy": proxy_default,
|
|
434810
434876
|
"/": routes_default
|
|
434811
434877
|
};
|
|
434812
434878
|
var winterSpec = {
|
|
@@ -439171,6 +439237,11 @@ Ready to use!`);
|
|
|
439171
439237
|
// cli/auth/logout/register.ts
|
|
439172
439238
|
var registerAuthLogout = (program3) => {
|
|
439173
439239
|
const logoutAction = () => {
|
|
439240
|
+
const session = getSessionToken();
|
|
439241
|
+
if (!session) {
|
|
439242
|
+
console.log("You are not logged in!");
|
|
439243
|
+
return;
|
|
439244
|
+
}
|
|
439174
439245
|
clearSession();
|
|
439175
439246
|
console.log("You have been logged out!");
|
|
439176
439247
|
};
|
|
@@ -464292,495 +464363,12 @@ var registerAdd = (program3) => {
|
|
|
464292
464363
|
});
|
|
464293
464364
|
};
|
|
464294
464365
|
|
|
464295
|
-
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
464296
|
-
var ANSI_BACKGROUND_OFFSET = 10;
|
|
464297
|
-
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
464298
|
-
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
464299
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
464300
|
-
var styles = {
|
|
464301
|
-
modifier: {
|
|
464302
|
-
reset: [0, 0],
|
|
464303
|
-
bold: [1, 22],
|
|
464304
|
-
dim: [2, 22],
|
|
464305
|
-
italic: [3, 23],
|
|
464306
|
-
underline: [4, 24],
|
|
464307
|
-
overline: [53, 55],
|
|
464308
|
-
inverse: [7, 27],
|
|
464309
|
-
hidden: [8, 28],
|
|
464310
|
-
strikethrough: [9, 29]
|
|
464311
|
-
},
|
|
464312
|
-
color: {
|
|
464313
|
-
black: [30, 39],
|
|
464314
|
-
red: [31, 39],
|
|
464315
|
-
green: [32, 39],
|
|
464316
|
-
yellow: [33, 39],
|
|
464317
|
-
blue: [34, 39],
|
|
464318
|
-
magenta: [35, 39],
|
|
464319
|
-
cyan: [36, 39],
|
|
464320
|
-
white: [37, 39],
|
|
464321
|
-
blackBright: [90, 39],
|
|
464322
|
-
gray: [90, 39],
|
|
464323
|
-
grey: [90, 39],
|
|
464324
|
-
redBright: [91, 39],
|
|
464325
|
-
greenBright: [92, 39],
|
|
464326
|
-
yellowBright: [93, 39],
|
|
464327
|
-
blueBright: [94, 39],
|
|
464328
|
-
magentaBright: [95, 39],
|
|
464329
|
-
cyanBright: [96, 39],
|
|
464330
|
-
whiteBright: [97, 39]
|
|
464331
|
-
},
|
|
464332
|
-
bgColor: {
|
|
464333
|
-
bgBlack: [40, 49],
|
|
464334
|
-
bgRed: [41, 49],
|
|
464335
|
-
bgGreen: [42, 49],
|
|
464336
|
-
bgYellow: [43, 49],
|
|
464337
|
-
bgBlue: [44, 49],
|
|
464338
|
-
bgMagenta: [45, 49],
|
|
464339
|
-
bgCyan: [46, 49],
|
|
464340
|
-
bgWhite: [47, 49],
|
|
464341
|
-
bgBlackBright: [100, 49],
|
|
464342
|
-
bgGray: [100, 49],
|
|
464343
|
-
bgGrey: [100, 49],
|
|
464344
|
-
bgRedBright: [101, 49],
|
|
464345
|
-
bgGreenBright: [102, 49],
|
|
464346
|
-
bgYellowBright: [103, 49],
|
|
464347
|
-
bgBlueBright: [104, 49],
|
|
464348
|
-
bgMagentaBright: [105, 49],
|
|
464349
|
-
bgCyanBright: [106, 49],
|
|
464350
|
-
bgWhiteBright: [107, 49]
|
|
464351
|
-
}
|
|
464352
|
-
};
|
|
464353
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
464354
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
464355
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
464356
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
464357
|
-
function assembleStyles() {
|
|
464358
|
-
const codes = new Map;
|
|
464359
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
464360
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
464361
|
-
styles[styleName] = {
|
|
464362
|
-
open: `\x1B[${style[0]}m`,
|
|
464363
|
-
close: `\x1B[${style[1]}m`
|
|
464364
|
-
};
|
|
464365
|
-
group[styleName] = styles[styleName];
|
|
464366
|
-
codes.set(style[0], style[1]);
|
|
464367
|
-
}
|
|
464368
|
-
Object.defineProperty(styles, groupName, {
|
|
464369
|
-
value: group,
|
|
464370
|
-
enumerable: false
|
|
464371
|
-
});
|
|
464372
|
-
}
|
|
464373
|
-
Object.defineProperty(styles, "codes", {
|
|
464374
|
-
value: codes,
|
|
464375
|
-
enumerable: false
|
|
464376
|
-
});
|
|
464377
|
-
styles.color.close = "\x1B[39m";
|
|
464378
|
-
styles.bgColor.close = "\x1B[49m";
|
|
464379
|
-
styles.color.ansi = wrapAnsi16();
|
|
464380
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
464381
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
464382
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
464383
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
464384
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
464385
|
-
Object.defineProperties(styles, {
|
|
464386
|
-
rgbToAnsi256: {
|
|
464387
|
-
value(red, green, blue) {
|
|
464388
|
-
if (red === green && green === blue) {
|
|
464389
|
-
if (red < 8) {
|
|
464390
|
-
return 16;
|
|
464391
|
-
}
|
|
464392
|
-
if (red > 248) {
|
|
464393
|
-
return 231;
|
|
464394
|
-
}
|
|
464395
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
464396
|
-
}
|
|
464397
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
464398
|
-
},
|
|
464399
|
-
enumerable: false
|
|
464400
|
-
},
|
|
464401
|
-
hexToRgb: {
|
|
464402
|
-
value(hex) {
|
|
464403
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
464404
|
-
if (!matches) {
|
|
464405
|
-
return [0, 0, 0];
|
|
464406
|
-
}
|
|
464407
|
-
let [colorString] = matches;
|
|
464408
|
-
if (colorString.length === 3) {
|
|
464409
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
464410
|
-
}
|
|
464411
|
-
const integer = Number.parseInt(colorString, 16);
|
|
464412
|
-
return [
|
|
464413
|
-
integer >> 16 & 255,
|
|
464414
|
-
integer >> 8 & 255,
|
|
464415
|
-
integer & 255
|
|
464416
|
-
];
|
|
464417
|
-
},
|
|
464418
|
-
enumerable: false
|
|
464419
|
-
},
|
|
464420
|
-
hexToAnsi256: {
|
|
464421
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
464422
|
-
enumerable: false
|
|
464423
|
-
},
|
|
464424
|
-
ansi256ToAnsi: {
|
|
464425
|
-
value(code) {
|
|
464426
|
-
if (code < 8) {
|
|
464427
|
-
return 30 + code;
|
|
464428
|
-
}
|
|
464429
|
-
if (code < 16) {
|
|
464430
|
-
return 90 + (code - 8);
|
|
464431
|
-
}
|
|
464432
|
-
let red;
|
|
464433
|
-
let green;
|
|
464434
|
-
let blue;
|
|
464435
|
-
if (code >= 232) {
|
|
464436
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
464437
|
-
green = red;
|
|
464438
|
-
blue = red;
|
|
464439
|
-
} else {
|
|
464440
|
-
code -= 16;
|
|
464441
|
-
const remainder = code % 36;
|
|
464442
|
-
red = Math.floor(code / 36) / 5;
|
|
464443
|
-
green = Math.floor(remainder / 6) / 5;
|
|
464444
|
-
blue = remainder % 6 / 5;
|
|
464445
|
-
}
|
|
464446
|
-
const value2 = Math.max(red, green, blue) * 2;
|
|
464447
|
-
if (value2 === 0) {
|
|
464448
|
-
return 30;
|
|
464449
|
-
}
|
|
464450
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
464451
|
-
if (value2 === 2) {
|
|
464452
|
-
result += 60;
|
|
464453
|
-
}
|
|
464454
|
-
return result;
|
|
464455
|
-
},
|
|
464456
|
-
enumerable: false
|
|
464457
|
-
},
|
|
464458
|
-
rgbToAnsi: {
|
|
464459
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
464460
|
-
enumerable: false
|
|
464461
|
-
},
|
|
464462
|
-
hexToAnsi: {
|
|
464463
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
464464
|
-
enumerable: false
|
|
464465
|
-
}
|
|
464466
|
-
});
|
|
464467
|
-
return styles;
|
|
464468
|
-
}
|
|
464469
|
-
var ansiStyles = assembleStyles();
|
|
464470
|
-
var ansi_styles_default = ansiStyles;
|
|
464471
|
-
|
|
464472
|
-
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
464473
|
-
import process10 from "node:process";
|
|
464474
|
-
import os3 from "node:os";
|
|
464475
|
-
import tty from "node:tty";
|
|
464476
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process10.argv) {
|
|
464477
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
464478
|
-
const position2 = argv.indexOf(prefix + flag);
|
|
464479
|
-
const terminatorPosition = argv.indexOf("--");
|
|
464480
|
-
return position2 !== -1 && (terminatorPosition === -1 || position2 < terminatorPosition);
|
|
464481
|
-
}
|
|
464482
|
-
var { env: env2 } = process10;
|
|
464483
|
-
var flagForceColor;
|
|
464484
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
464485
|
-
flagForceColor = 0;
|
|
464486
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
464487
|
-
flagForceColor = 1;
|
|
464488
|
-
}
|
|
464489
|
-
function envForceColor() {
|
|
464490
|
-
if ("FORCE_COLOR" in env2) {
|
|
464491
|
-
if (env2.FORCE_COLOR === "true") {
|
|
464492
|
-
return 1;
|
|
464493
|
-
}
|
|
464494
|
-
if (env2.FORCE_COLOR === "false") {
|
|
464495
|
-
return 0;
|
|
464496
|
-
}
|
|
464497
|
-
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
464498
|
-
}
|
|
464499
|
-
}
|
|
464500
|
-
function translateLevel(level) {
|
|
464501
|
-
if (level === 0) {
|
|
464502
|
-
return false;
|
|
464503
|
-
}
|
|
464504
|
-
return {
|
|
464505
|
-
level,
|
|
464506
|
-
hasBasic: true,
|
|
464507
|
-
has256: level >= 2,
|
|
464508
|
-
has16m: level >= 3
|
|
464509
|
-
};
|
|
464510
|
-
}
|
|
464511
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
464512
|
-
const noFlagForceColor = envForceColor();
|
|
464513
|
-
if (noFlagForceColor !== undefined) {
|
|
464514
|
-
flagForceColor = noFlagForceColor;
|
|
464515
|
-
}
|
|
464516
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
464517
|
-
if (forceColor === 0) {
|
|
464518
|
-
return 0;
|
|
464519
|
-
}
|
|
464520
|
-
if (sniffFlags) {
|
|
464521
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
464522
|
-
return 3;
|
|
464523
|
-
}
|
|
464524
|
-
if (hasFlag("color=256")) {
|
|
464525
|
-
return 2;
|
|
464526
|
-
}
|
|
464527
|
-
}
|
|
464528
|
-
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
464529
|
-
return 1;
|
|
464530
|
-
}
|
|
464531
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
464532
|
-
return 0;
|
|
464533
|
-
}
|
|
464534
|
-
const min = forceColor || 0;
|
|
464535
|
-
if (env2.TERM === "dumb") {
|
|
464536
|
-
return min;
|
|
464537
|
-
}
|
|
464538
|
-
if (process10.platform === "win32") {
|
|
464539
|
-
const osRelease = os3.release().split(".");
|
|
464540
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
464541
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
464542
|
-
}
|
|
464543
|
-
return 1;
|
|
464544
|
-
}
|
|
464545
|
-
if ("CI" in env2) {
|
|
464546
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env2))) {
|
|
464547
|
-
return 3;
|
|
464548
|
-
}
|
|
464549
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
|
|
464550
|
-
return 1;
|
|
464551
|
-
}
|
|
464552
|
-
return min;
|
|
464553
|
-
}
|
|
464554
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
464555
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
464556
|
-
}
|
|
464557
|
-
if (env2.COLORTERM === "truecolor") {
|
|
464558
|
-
return 3;
|
|
464559
|
-
}
|
|
464560
|
-
if (env2.TERM === "xterm-kitty") {
|
|
464561
|
-
return 3;
|
|
464562
|
-
}
|
|
464563
|
-
if ("TERM_PROGRAM" in env2) {
|
|
464564
|
-
const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
464565
|
-
switch (env2.TERM_PROGRAM) {
|
|
464566
|
-
case "iTerm.app": {
|
|
464567
|
-
return version2 >= 3 ? 3 : 2;
|
|
464568
|
-
}
|
|
464569
|
-
case "Apple_Terminal": {
|
|
464570
|
-
return 2;
|
|
464571
|
-
}
|
|
464572
|
-
}
|
|
464573
|
-
}
|
|
464574
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
464575
|
-
return 2;
|
|
464576
|
-
}
|
|
464577
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
464578
|
-
return 1;
|
|
464579
|
-
}
|
|
464580
|
-
if ("COLORTERM" in env2) {
|
|
464581
|
-
return 1;
|
|
464582
|
-
}
|
|
464583
|
-
return min;
|
|
464584
|
-
}
|
|
464585
|
-
function createSupportsColor(stream, options = {}) {
|
|
464586
|
-
const level = _supportsColor(stream, {
|
|
464587
|
-
streamIsTTY: stream && stream.isTTY,
|
|
464588
|
-
...options
|
|
464589
|
-
});
|
|
464590
|
-
return translateLevel(level);
|
|
464591
|
-
}
|
|
464592
|
-
var supportsColor = {
|
|
464593
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
464594
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
464595
|
-
};
|
|
464596
|
-
var supports_color_default = supportsColor;
|
|
464597
|
-
|
|
464598
|
-
// node_modules/chalk/source/utilities.js
|
|
464599
|
-
function stringReplaceAll(string2, substring, replacer) {
|
|
464600
|
-
let index = string2.indexOf(substring);
|
|
464601
|
-
if (index === -1) {
|
|
464602
|
-
return string2;
|
|
464603
|
-
}
|
|
464604
|
-
const substringLength = substring.length;
|
|
464605
|
-
let endIndex = 0;
|
|
464606
|
-
let returnValue = "";
|
|
464607
|
-
do {
|
|
464608
|
-
returnValue += string2.slice(endIndex, index) + substring + replacer;
|
|
464609
|
-
endIndex = index + substringLength;
|
|
464610
|
-
index = string2.indexOf(substring, endIndex);
|
|
464611
|
-
} while (index !== -1);
|
|
464612
|
-
returnValue += string2.slice(endIndex);
|
|
464613
|
-
return returnValue;
|
|
464614
|
-
}
|
|
464615
|
-
function stringEncaseCRLFWithFirstIndex(string2, prefix, postfix, index) {
|
|
464616
|
-
let endIndex = 0;
|
|
464617
|
-
let returnValue = "";
|
|
464618
|
-
do {
|
|
464619
|
-
const gotCR = string2[index - 1] === "\r";
|
|
464620
|
-
returnValue += string2.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
464621
|
-
` : `
|
|
464622
|
-
`) + postfix;
|
|
464623
|
-
endIndex = index + 1;
|
|
464624
|
-
index = string2.indexOf(`
|
|
464625
|
-
`, endIndex);
|
|
464626
|
-
} while (index !== -1);
|
|
464627
|
-
returnValue += string2.slice(endIndex);
|
|
464628
|
-
return returnValue;
|
|
464629
|
-
}
|
|
464630
|
-
|
|
464631
|
-
// node_modules/chalk/source/index.js
|
|
464632
|
-
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
464633
|
-
var GENERATOR = Symbol("GENERATOR");
|
|
464634
|
-
var STYLER = Symbol("STYLER");
|
|
464635
|
-
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
464636
|
-
var levelMapping = [
|
|
464637
|
-
"ansi",
|
|
464638
|
-
"ansi",
|
|
464639
|
-
"ansi256",
|
|
464640
|
-
"ansi16m"
|
|
464641
|
-
];
|
|
464642
|
-
var styles2 = Object.create(null);
|
|
464643
|
-
var applyOptions = (object, options = {}) => {
|
|
464644
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
464645
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
464646
|
-
}
|
|
464647
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
464648
|
-
object.level = options.level === undefined ? colorLevel : options.level;
|
|
464649
|
-
};
|
|
464650
|
-
var chalkFactory = (options) => {
|
|
464651
|
-
const chalk = (...strings) => strings.join(" ");
|
|
464652
|
-
applyOptions(chalk, options);
|
|
464653
|
-
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
464654
|
-
return chalk;
|
|
464655
|
-
};
|
|
464656
|
-
function createChalk(options) {
|
|
464657
|
-
return chalkFactory(options);
|
|
464658
|
-
}
|
|
464659
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
464660
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
464661
|
-
styles2[styleName] = {
|
|
464662
|
-
get() {
|
|
464663
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
464664
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
464665
|
-
return builder;
|
|
464666
|
-
}
|
|
464667
|
-
};
|
|
464668
|
-
}
|
|
464669
|
-
styles2.visible = {
|
|
464670
|
-
get() {
|
|
464671
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
464672
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
464673
|
-
return builder;
|
|
464674
|
-
}
|
|
464675
|
-
};
|
|
464676
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
464677
|
-
if (model === "rgb") {
|
|
464678
|
-
if (level === "ansi16m") {
|
|
464679
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
464680
|
-
}
|
|
464681
|
-
if (level === "ansi256") {
|
|
464682
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
464683
|
-
}
|
|
464684
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
464685
|
-
}
|
|
464686
|
-
if (model === "hex") {
|
|
464687
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
464688
|
-
}
|
|
464689
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
464690
|
-
};
|
|
464691
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
464692
|
-
for (const model of usedModels) {
|
|
464693
|
-
styles2[model] = {
|
|
464694
|
-
get() {
|
|
464695
|
-
const { level } = this;
|
|
464696
|
-
return function(...arguments_) {
|
|
464697
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
464698
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
464699
|
-
};
|
|
464700
|
-
}
|
|
464701
|
-
};
|
|
464702
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
464703
|
-
styles2[bgModel] = {
|
|
464704
|
-
get() {
|
|
464705
|
-
const { level } = this;
|
|
464706
|
-
return function(...arguments_) {
|
|
464707
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
464708
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
464709
|
-
};
|
|
464710
|
-
}
|
|
464711
|
-
};
|
|
464712
|
-
}
|
|
464713
|
-
var proto = Object.defineProperties(() => {}, {
|
|
464714
|
-
...styles2,
|
|
464715
|
-
level: {
|
|
464716
|
-
enumerable: true,
|
|
464717
|
-
get() {
|
|
464718
|
-
return this[GENERATOR].level;
|
|
464719
|
-
},
|
|
464720
|
-
set(level) {
|
|
464721
|
-
this[GENERATOR].level = level;
|
|
464722
|
-
}
|
|
464723
|
-
}
|
|
464724
|
-
});
|
|
464725
|
-
var createStyler = (open2, close, parent) => {
|
|
464726
|
-
let openAll;
|
|
464727
|
-
let closeAll;
|
|
464728
|
-
if (parent === undefined) {
|
|
464729
|
-
openAll = open2;
|
|
464730
|
-
closeAll = close;
|
|
464731
|
-
} else {
|
|
464732
|
-
openAll = parent.openAll + open2;
|
|
464733
|
-
closeAll = close + parent.closeAll;
|
|
464734
|
-
}
|
|
464735
|
-
return {
|
|
464736
|
-
open: open2,
|
|
464737
|
-
close,
|
|
464738
|
-
openAll,
|
|
464739
|
-
closeAll,
|
|
464740
|
-
parent
|
|
464741
|
-
};
|
|
464742
|
-
};
|
|
464743
|
-
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
464744
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
464745
|
-
Object.setPrototypeOf(builder, proto);
|
|
464746
|
-
builder[GENERATOR] = self2;
|
|
464747
|
-
builder[STYLER] = _styler;
|
|
464748
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
464749
|
-
return builder;
|
|
464750
|
-
};
|
|
464751
|
-
var applyStyle = (self2, string2) => {
|
|
464752
|
-
if (self2.level <= 0 || !string2) {
|
|
464753
|
-
return self2[IS_EMPTY] ? "" : string2;
|
|
464754
|
-
}
|
|
464755
|
-
let styler = self2[STYLER];
|
|
464756
|
-
if (styler === undefined) {
|
|
464757
|
-
return string2;
|
|
464758
|
-
}
|
|
464759
|
-
const { openAll, closeAll } = styler;
|
|
464760
|
-
if (string2.includes("\x1B")) {
|
|
464761
|
-
while (styler !== undefined) {
|
|
464762
|
-
string2 = stringReplaceAll(string2, styler.close, styler.open);
|
|
464763
|
-
styler = styler.parent;
|
|
464764
|
-
}
|
|
464765
|
-
}
|
|
464766
|
-
const lfIndex = string2.indexOf(`
|
|
464767
|
-
`);
|
|
464768
|
-
if (lfIndex !== -1) {
|
|
464769
|
-
string2 = stringEncaseCRLFWithFirstIndex(string2, closeAll, openAll, lfIndex);
|
|
464770
|
-
}
|
|
464771
|
-
return openAll + string2 + closeAll;
|
|
464772
|
-
};
|
|
464773
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
464774
|
-
var chalk = createChalk();
|
|
464775
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
464776
|
-
var source_default = chalk;
|
|
464777
|
-
|
|
464778
464366
|
// cli/upgrade/register.ts
|
|
464779
464367
|
function registerUpgradeCommand(program3) {
|
|
464780
464368
|
program3.command("upgrade").description("Upgrade CLI to the latest version").action(async () => {
|
|
464781
464369
|
const isUpdated = await checkForTsciUpdates();
|
|
464782
464370
|
if (!isUpdated) {
|
|
464783
|
-
console.log(
|
|
464371
|
+
console.log(kleur_default.green("You are already using the latest version of tsci."));
|
|
464784
464372
|
}
|
|
464785
464373
|
});
|
|
464786
464374
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.95",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@babel/standalone": "^7.26.9",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@tscircuit/core": "^0.0.353",
|
|
9
9
|
"@tscircuit/eval": "^0.0.152",
|
|
10
10
|
"@tscircuit/fake-snippets": "^0.0.23",
|
|
11
|
-
"@tscircuit/file-server": "^0.0.
|
|
11
|
+
"@tscircuit/file-server": "^0.0.19",
|
|
12
12
|
"@tscircuit/runframe": "^0.0.341",
|
|
13
13
|
"@types/bun": "^1.2.2",
|
|
14
14
|
"@types/configstore": "^6.0.2",
|