@tscircuit/cli 0.1.213 → 0.1.215
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/main.js +33 -15
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -63215,7 +63215,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
63215
63215
|
import { execSync as execSync2 } from "node:child_process";
|
|
63216
63216
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
63217
63217
|
// package.json
|
|
63218
|
-
var version = "0.1.
|
|
63218
|
+
var version = "0.1.214";
|
|
63219
63219
|
var package_default = {
|
|
63220
63220
|
name: "@tscircuit/cli",
|
|
63221
63221
|
version,
|
|
@@ -63225,7 +63225,7 @@ var package_default = {
|
|
|
63225
63225
|
"@biomejs/biome": "^1.9.4",
|
|
63226
63226
|
"@tscircuit/circuit-json-util": "0.0.67",
|
|
63227
63227
|
"@tscircuit/fake-snippets": "^0.0.87",
|
|
63228
|
-
"@tscircuit/file-server": "^0.0.
|
|
63228
|
+
"@tscircuit/file-server": "^0.0.28",
|
|
63229
63229
|
"@tscircuit/math-utils": "0.0.21",
|
|
63230
63230
|
"@tscircuit/props": "^0.0.315",
|
|
63231
63231
|
"@tscircuit/runframe": "^0.0.931",
|
|
@@ -64542,6 +64542,11 @@ var get_default = withRouteSpec({
|
|
|
64542
64542
|
<p><span class="label">File Path:</span> ${file.file_path}</p>
|
|
64543
64543
|
<p><span class="label">Created At:</span> ${file.created_at}</p>
|
|
64544
64544
|
</div>
|
|
64545
|
+
<h2>Links:</h2>
|
|
64546
|
+
<ul>
|
|
64547
|
+
<li><a href="../../files/download?file_path=/${file.file_path}">Download File</a></li>
|
|
64548
|
+
<li><a href="../../files/static/${file.file_path}">Static Route</a></li>
|
|
64549
|
+
</ul>
|
|
64545
64550
|
<h2>Content:</h2>
|
|
64546
64551
|
<pre>${(file.text_content ?? "[binary content]").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
64547
64552
|
</div>
|
|
@@ -64835,11 +64840,12 @@ var getMimeType = (filePath) => {
|
|
|
64835
64840
|
var file_path_default2 = withRouteSpec({
|
|
64836
64841
|
methods: ["GET"],
|
|
64837
64842
|
pathParams: z16.object({
|
|
64838
|
-
file_path: z16.string()
|
|
64843
|
+
file_path: z16.union([z16.string(), z16.array(z16.string())])
|
|
64839
64844
|
})
|
|
64840
64845
|
})((req, ctx) => {
|
|
64841
64846
|
const { file_path } = req.routeParams;
|
|
64842
|
-
const
|
|
64847
|
+
const joinedFilePath = Array.isArray(file_path) ? file_path.join("/") : file_path;
|
|
64848
|
+
const file = ctx.db.getFile({ file_path: `/${joinedFilePath}` });
|
|
64843
64849
|
if (!file) {
|
|
64844
64850
|
return new Response("File not found", { status: 404 });
|
|
64845
64851
|
}
|
|
@@ -64996,7 +65002,7 @@ var routeMapWithHandlers = {
|
|
|
64996
65002
|
"/files/get": get_default2,
|
|
64997
65003
|
"/files/list": list_default4,
|
|
64998
65004
|
"/files/rename": rename_default,
|
|
64999
|
-
"/files/static/[[file_path]]": file_path_default2,
|
|
65005
|
+
"/files/static/[[...file_path]]": file_path_default2,
|
|
65000
65006
|
"/files/upsert": upsert_default,
|
|
65001
65007
|
"/health": health_default,
|
|
65002
65008
|
"/proxy": proxy_default,
|
|
@@ -67976,6 +67982,13 @@ var getVersion = () => {
|
|
|
67976
67982
|
};
|
|
67977
67983
|
|
|
67978
67984
|
// cli/dev/register.ts
|
|
67985
|
+
var findSelectableTsxFiles = (projectDir) => {
|
|
67986
|
+
const files = globbySync(["**/*.tsx", "**/*.ts"], {
|
|
67987
|
+
cwd: projectDir,
|
|
67988
|
+
ignore: DEFAULT_IGNORED_PATTERNS
|
|
67989
|
+
});
|
|
67990
|
+
return files.map((file) => path19.resolve(projectDir, file)).filter((file) => fs19.existsSync(file)).sort();
|
|
67991
|
+
};
|
|
67979
67992
|
var registerDev = (program3) => {
|
|
67980
67993
|
program3.command("dev").description("Start development server for a package").argument("[file]", "Path to the package file").option("-p, --port <number>", "Port to run server on", "3020").action(async (file, options) => {
|
|
67981
67994
|
let port = parseInt(options.port);
|
|
@@ -67997,7 +68010,7 @@ var registerDev = (program3) => {
|
|
|
67997
68010
|
let absolutePath;
|
|
67998
68011
|
if (file) {
|
|
67999
68012
|
absolutePath = path19.resolve(file);
|
|
68000
|
-
if (!absolutePath.endsWith(".tsx")) {
|
|
68013
|
+
if (!absolutePath.endsWith(".tsx") && !absolutePath.endsWith(".ts")) {
|
|
68001
68014
|
console.error("Error: Only .tsx files are supported");
|
|
68002
68015
|
return;
|
|
68003
68016
|
}
|
|
@@ -68009,8 +68022,13 @@ var registerDev = (program3) => {
|
|
|
68009
68022
|
absolutePath = entrypointPath;
|
|
68010
68023
|
console.log("Found entrypoint at:", entrypointPath);
|
|
68011
68024
|
} else {
|
|
68012
|
-
|
|
68013
|
-
|
|
68025
|
+
const availableFiles = findSelectableTsxFiles(process.cwd());
|
|
68026
|
+
if (availableFiles.length === 0) {
|
|
68027
|
+
console.log("No .tsx or .ts files found in the project. Run 'tsci init' to bootstrap a basic project.");
|
|
68028
|
+
return;
|
|
68029
|
+
}
|
|
68030
|
+
absolutePath = availableFiles[0];
|
|
68031
|
+
console.log("Selected file:", path19.relative(process.cwd(), absolutePath));
|
|
68014
68032
|
}
|
|
68015
68033
|
}
|
|
68016
68034
|
try {
|
|
@@ -71311,7 +71329,7 @@ var debug10 = Debug10("dsn-converter:parse-dsn-to-dsn-json");
|
|
|
71311
71329
|
// lib/shared/generate-circuit-json.tsx
|
|
71312
71330
|
var import_make_vfs2 = __toESM2(require_dist8(), 1);
|
|
71313
71331
|
import path21 from "node:path/posix";
|
|
71314
|
-
import { relative as
|
|
71332
|
+
import { relative as relative8 } from "node:path";
|
|
71315
71333
|
import fs21 from "node:fs";
|
|
71316
71334
|
import Debug11 from "debug";
|
|
71317
71335
|
|
|
@@ -71373,7 +71391,7 @@ async function generateCircuitJson({
|
|
|
71373
71391
|
});
|
|
71374
71392
|
const projectDir = path21.dirname(filePath);
|
|
71375
71393
|
const resolvedOutputDir = outputDir || projectDir;
|
|
71376
|
-
const relativeComponentPath =
|
|
71394
|
+
const relativeComponentPath = relative8(projectDir, filePath);
|
|
71377
71395
|
const baseFileName = outputFileName || path21.basename(filePath).replace(/\.[^.]+$/, "");
|
|
71378
71396
|
const outputPath = path21.join(resolvedOutputDir, `${baseFileName}.circuit.json`);
|
|
71379
71397
|
debug11(`Project directory: ${projectDir}`);
|
|
@@ -119152,10 +119170,10 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
119152
119170
|
function uniqueSort(nodes) {
|
|
119153
119171
|
nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
|
|
119154
119172
|
nodes.sort((a, b3) => {
|
|
119155
|
-
const
|
|
119156
|
-
if (
|
|
119173
|
+
const relative9 = compareDocumentPosition(a, b3);
|
|
119174
|
+
if (relative9 & DocumentPosition.PRECEDING) {
|
|
119157
119175
|
return -1;
|
|
119158
|
-
} else if (
|
|
119176
|
+
} else if (relative9 & DocumentPosition.FOLLOWING) {
|
|
119159
119177
|
return 1;
|
|
119160
119178
|
}
|
|
119161
119179
|
return 0;
|
|
@@ -172905,8 +172923,8 @@ var registerBuild = (program3) => {
|
|
|
172905
172923
|
fs27.mkdirSync(distDir, { recursive: true });
|
|
172906
172924
|
let hasErrors = false;
|
|
172907
172925
|
for (const filePath of circuitFiles) {
|
|
172908
|
-
const
|
|
172909
|
-
const outputDirName =
|
|
172926
|
+
const relative9 = path26.relative(projectDir, filePath);
|
|
172927
|
+
const outputDirName = relative9.replace(/(\.board|\.circuit)?\.tsx$/, "");
|
|
172910
172928
|
const outputPath = path26.join(distDir, outputDirName, "circuit.json");
|
|
172911
172929
|
const ok = await buildFile(filePath, outputPath, projectDir, options);
|
|
172912
172930
|
if (!ok)
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.215",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@babel/standalone": "^7.26.9",
|
|
7
7
|
"@biomejs/biome": "^1.9.4",
|
|
8
8
|
"@tscircuit/circuit-json-util": "0.0.67",
|
|
9
9
|
"@tscircuit/fake-snippets": "^0.0.87",
|
|
10
|
-
"@tscircuit/file-server": "^0.0.
|
|
10
|
+
"@tscircuit/file-server": "^0.0.28",
|
|
11
11
|
"@tscircuit/math-utils": "0.0.21",
|
|
12
12
|
"@tscircuit/props": "^0.0.315",
|
|
13
13
|
"@tscircuit/runframe": "^0.0.931",
|