Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
a2a2078
chore: update packages @tscircuit/runframe (#2832)
tscircuitbot Apr 28, 2026
d178682
v0.1.1297 (#2833)
tscircuitbot Apr 28, 2026
1b04505
chore: update packages @tscircuit/runframe (#2835)
tscircuitbot Apr 28, 2026
1df6b5c
v0.1.1298 (#2836)
tscircuitbot Apr 28, 2026
dca332d
update schematic analysis dep (#2837)
seveibar Apr 28, 2026
2d8bc2a
v0.1.1299 (#2839)
tscircuitbot Apr 28, 2026
f6f960d
chore: Update CLI usage in README (#2838)
tscircuitbot Apr 28, 2026
f9abc18
v0.1.1300 (#2841)
tscircuitbot Apr 28, 2026
a3d1c07
chore: update packages @tscircuit/runframe (#2849)
tscircuitbot Apr 28, 2026
8978d0f
chore: update packages @tscircuit/runframe (#2852)
tscircuitbot Apr 28, 2026
e1129ae
v0.1.1302 (#2853)
tscircuitbot Apr 28, 2026
646689b
chore: update packages @tscircuit/runframe (#2854)
tscircuitbot Apr 28, 2026
de243ca
v0.1.1303 (#2855)
tscircuitbot Apr 28, 2026
c41c882
chore: update packages @tscircuit/runframe (#2856)
tscircuitbot Apr 28, 2026
f23abae
v0.1.1304 (#2857)
tscircuitbot Apr 28, 2026
27bf662
chore: update packages @tscircuit/runframe (#2858)
tscircuitbot Apr 29, 2026
2eb6129
v0.1.1305 (#2859)
tscircuitbot Apr 29, 2026
511d4a9
chore: update packages @tscircuit/runframe (#2860)
tscircuitbot Apr 29, 2026
a18998d
v0.1.1306 (#2861)
tscircuitbot Apr 29, 2026
03f7e9d
chore: update packages @tscircuit/runframe (#2862)
tscircuitbot Apr 29, 2026
7bd464c
v0.1.1307 (#2863)
tscircuitbot Apr 29, 2026
c06b4dc
chore: update packages @tscircuit/runframe (#2864)
tscircuitbot Apr 29, 2026
fe24648
v0.1.1308 (#2865)
tscircuitbot Apr 29, 2026
663b0ac
chore: update packages @tscircuit/runframe (#2866)
tscircuitbot Apr 29, 2026
29d7de9
v0.1.1309 (#2867)
tscircuitbot Apr 29, 2026
52e56ee
Fix push entrypoint requirement (#2868)
seveibar Apr 29, 2026
e5355a7
v0.1.1310 (#2869)
tscircuitbot Apr 29, 2026
1f56351
chore: update packages @tscircuit/runframe (#2870)
tscircuitbot Apr 29, 2026
8eb04f1
v0.1.1311 (#2871)
tscircuitbot Apr 29, 2026
1be894a
chore: update packages @tscircuit/runframe (#2872)
tscircuitbot Apr 29, 2026
0ff35b1
v0.1.1312 (#2873)
tscircuitbot Apr 29, 2026
3876c1c
chore: update packages @tscircuit/runframe (#2874)
tscircuitbot Apr 29, 2026
1b79980
v0.1.1313 (#2875)
tscircuitbot Apr 29, 2026
8a50e83
chore: update packages @tscircuit/runframe (#2876)
tscircuitbot Apr 29, 2026
ec1857f
v0.1.1314 (#2877)
tscircuitbot Apr 29, 2026
ddfdb9d
chore: update packages @tscircuit/runframe (#2878)
tscircuitbot Apr 29, 2026
901b447
v0.1.1315 (#2879)
tscircuitbot Apr 29, 2026
ef52c5e
chore: update packages @tscircuit/runframe (#2880)
tscircuitbot Apr 29, 2026
970b1f9
v0.1.1316 (#2881)
tscircuitbot Apr 29, 2026
b238bea
chore: update packages @tscircuit/runframe (#2883)
tscircuitbot Apr 30, 2026
aeeaf0a
v0.1.1317 (#2884)
tscircuitbot Apr 30, 2026
cf6114e
chore: update packages @tscircuit/runframe (#2887)
tscircuitbot Apr 30, 2026
76d2543
v0.1.1318 (#2888)
tscircuitbot Apr 30, 2026
36a8afc
chore: update packages @tscircuit/runframe (#2889)
tscircuitbot Apr 30, 2026
37f4a36
v0.1.1319 (#2890)
tscircuitbot Apr 30, 2026
6dfef16
update circuit-json-schematic-placement-analysis to commit add7fd89b1…
Sang-it Apr 30, 2026
72a8c8f
v0.1.1320 (#2892)
tscircuitbot Apr 30, 2026
5eab14b
update @tscircuit/circuit-json-schematic-placement-analysis to a8b1e6…
Sang-it May 1, 2026
aa84326
chore: Update CLI usage in README (#2894)
tscircuitbot May 1, 2026
84afb8f
v0.1.1321 (#2896)
tscircuitbot May 1, 2026
0fde5ba
update bun.lock (#2895)
Sang-it May 1, 2026
bab5eaa
v0.1.1322 (#2897)
tscircuitbot May 1, 2026
0bb4efd
chore: update circuit-json-to-kicad dep (#2898)
MustafaMulla29 May 1, 2026
f42c5d9
chore: update packages @tscircuit/runframe (#2901)
tscircuitbot May 1, 2026
c0c1495
v0.1.1324 (#2902)
tscircuitbot May 1, 2026
3afc624
chore: update packages @tscircuit/runframe (#2903)
tscircuitbot May 1, 2026
8f77f0b
v0.1.1325 (#2904)
tscircuitbot May 1, 2026
ab40713
chore: update packages @tscircuit/runframe (#2906)
tscircuitbot May 1, 2026
9609986
v0.1.1326 (#2907)
tscircuitbot May 1, 2026
591a3e3
chore: bump circuit-json-to-gerber to 0.0.51 (#2908)
imrishabh18 May 1, 2026
bfeb1ac
chore: Update CLI usage in README (#2909)
tscircuitbot May 1, 2026
57d7363
v0.1.1327 (#2910)
tscircuitbot May 1, 2026
2f0819c
chore: update packages @tscircuit/runframe (#2911)
tscircuitbot May 2, 2026
b733eb3
v0.1.1328 (#2912)
tscircuitbot May 2, 2026
e13615f
chore: update packages @tscircuit/runframe (#2917)
tscircuitbot May 3, 2026
5fcada2
v0.1.1329 (#2918)
tscircuitbot May 3, 2026
3cf048f
chore: update packages @tscircuit/runframe (#2919)
tscircuitbot May 3, 2026
daae7d0
v0.1.1330 (#2920)
tscircuitbot May 3, 2026
618ceef
chore: update packages @tscircuit/runframe (#2922)
tscircuitbot May 3, 2026
cbe7da8
v0.1.1331 (#2923)
tscircuitbot May 3, 2026
b57ead9
chore: update packages @tscircuit/runframe (#2925)
tscircuitbot May 4, 2026
c4ddd00
v0.1.1332 (#2926)
tscircuitbot May 4, 2026
cbd4501
chore: update packages @tscircuit/runframe (#2927)
tscircuitbot May 4, 2026
629b4a8
chore: update packages @tscircuit/runframe (#2928)
tscircuitbot May 4, 2026
5bafe7a
v0.1.1333 (#2929)
tscircuitbot May 4, 2026
173b787
chore: update packages @tscircuit/runframe (#2930)
tscircuitbot May 4, 2026
0277b85
v0.1.1334 (#2931)
tscircuitbot May 4, 2026
205062e
chore: update @tscircuit/circuit-json-schematic-placement-analysis to…
MustafaMulla29 May 5, 2026
e8d92ee
v0.1.1335 (#2933)
tscircuitbot May 5, 2026
d33f640
chore: update packages @tscircuit/runframe (#2934)
tscircuitbot May 5, 2026
cd6ef56
v0.1.1336 (#2935)
tscircuitbot May 5, 2026
e4fc442
chore: update packages @tscircuit/runframe (#2936)
tscircuitbot May 5, 2026
d5d819a
v0.1.1337 (#2937)
tscircuitbot May 5, 2026
0b53fd0
Remove unused routing command from the codebase which confused the ag…
MustafaMulla29 May 5, 2026
1422075
v0.1.1338 (#2939)
tscircuitbot May 5, 2026
5cdc414
chore: update packages @tscircuit/runframe (#2940)
tscircuitbot May 5, 2026
cc1bd8c
v0.1.1339 (#2941)
tscircuitbot May 5, 2026
4469b9e
chore: update packages @tscircuit/runframe (#2942)
tscircuitbot May 5, 2026
d5fb76c
v0.1.1340 (#2943)
tscircuitbot May 5, 2026
51bdb5f
chore: update packages @tscircuit/runframe (#2944)
tscircuitbot May 5, 2026
329f515
v0.1.1341 (#2945)
tscircuitbot May 5, 2026
cf9b9a3
chore: update packages @tscircuit/runframe (#2946)
tscircuitbot May 5, 2026
68475a3
v0.1.1342 (#2947)
tscircuitbot May 5, 2026
70ddfe6
chore: update packages @tscircuit/runframe (#2948)
tscircuitbot May 5, 2026
8b81218
v0.1.1343 (#2949)
tscircuitbot May 5, 2026
1da5db2
chore: update packages @tscircuit/runframe (#2950)
tscircuitbot May 5, 2026
e8aaa97
v0.1.1344 (#2951)
tscircuitbot May 5, 2026
3df0453
chore: update packages @tscircuit/runframe (#2954)
tscircuitbot May 6, 2026
e858c54
v0.1.1345 (#2955)
tscircuitbot May 6, 2026
8789550
chore: update packages @tscircuit/runframe (#2956)
tscircuitbot May 6, 2026
76fb169
v0.1.1346 (#2957)
tscircuitbot May 6, 2026
152d702
chore: update packages @tscircuit/runframe (#2958)
tscircuitbot May 6, 2026
56d6d1f
chore: update packages @tscircuit/runframe (#2960)
tscircuitbot May 6, 2026
8babde8
v0.1.1348 (#2961)
tscircuitbot May 6, 2026
22b955a
chore: update packages @tscircuit/runframe (#2962)
tscircuitbot May 6, 2026
dfb879d
v0.1.1349 (#2963)
tscircuitbot May 6, 2026
c8b99ff
chore: update packages @tscircuit/runframe (#2964)
tscircuitbot May 6, 2026
2faf60e
v0.1.1350 (#2965)
tscircuitbot May 6, 2026
0504608
chore: update packages @tscircuit/runframe (#2966)
tscircuitbot May 6, 2026
da9e57d
v0.1.1351 (#2967)
tscircuitbot May 6, 2026
5b6010d
chore: update packages @tscircuit/runframe (#2968)
tscircuitbot May 6, 2026
94278bf
v0.1.1352 (#2969)
tscircuitbot May 6, 2026
022221c
chore: update packages @tscircuit/runframe (#2970)
tscircuitbot May 6, 2026
19f64b9
v0.1.1353 (#2971)
tscircuitbot May 6, 2026
589e490
chore: update packages @tscircuit/runframe (#2972)
tscircuitbot May 6, 2026
95373ba
v0.1.1354 (#2973)
tscircuitbot May 6, 2026
df24c7c
chore: update packages @tscircuit/runframe (#2974)
tscircuitbot May 6, 2026
f70e16d
v0.1.1355 (#2975)
tscircuitbot May 6, 2026
f5102d1
chore: update packages @tscircuit/runframe (#2978)
tscircuitbot May 7, 2026
fd935ae
v0.1.1356 (#2979)
tscircuitbot May 7, 2026
4160981
chore: update packages @tscircuit/runframe (#2980)
tscircuitbot May 7, 2026
83c14ee
v0.1.1357 (#2981)
tscircuitbot May 7, 2026
4e21352
fix: allow tsci push without entrypoint when circuit.json exists
64johnlee May 3, 2026
59f0559
chore: bump PR
64johnlee May 8, 2026
c5e7149
chore: bump PR
64johnlee May 9, 2026
fc59007
chore: bump PR
64johnlee May 9, 2026
406319e
chore: bump PR
64johnlee May 10, 2026
da8aa05
fix: format
64johnlee May 10, 2026
f214b00
fix: skip transpilation when includeBoardFiles configured and no libr…
64johnlee May 10, 2026
8442649
fix: format
64johnlee May 11, 2026
43136f2
fix: transpile when real .ts/.tsx entrypoint exists alongside include…
64johnlee May 11, 2026
e734d5c
chore: re-trigger CI
64johnlee May 11, 2026
4c23cb8
chore: re-trigger CI
64johnlee May 11, 2026
2167216
chore: re-trigger CI
64johnlee May 11, 2026
bb1db4b
chore: re-trigger CI
64johnlee May 11, 2026
6da68fd
chore: re-trigger CI
64johnlee May 11, 2026
9cea80e
chore: bump PR
64johnlee May 11, 2026
c5c693a
chore: bump PR
64johnlee May 12, 2026
660aaba
chore: bump PR
64johnlee May 12, 2026
1b2a423
chore: bump PR
64johnlee May 13, 2026
18ef6f0
chore: bump PR
64johnlee May 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@ Test fixture provides:
## Runtime

The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the TypeScript runner, preferring Bun when available. This allows hot-reload during development while maintaining Node.js compatibility.
# bump 1778256007
# bump 1778299207
# bump 1778342407
# bump 1778385607
# bump 1778515208
# bump 1778558407
# bump 1778601608
# bump 1778644807
# bump 1778688008
18 changes: 9 additions & 9 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion cli/build/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,16 @@ export const registerBuild = (program: Command) => {
const entryFile = fileArgIsDirectFile
? resolvedFileArgPath
: transpileEntrypoint
if (!entryFile) {
const isRealTsEntrypoint = Boolean(
entryFile &&
(entryFile.endsWith(".ts") || entryFile.endsWith(".tsx")),
)
if (
!entryFile ||
(hasConfiguredIncludeBoardFiles &&
!transpileExplicitlyRequested &&
!isRealTsEntrypoint)
) {
if (
hasConfiguredIncludeBoardFiles &&
!transpileExplicitlyRequested
Expand Down
11 changes: 0 additions & 11 deletions cli/check/routing/register.ts

This file was deleted.

2 changes: 0 additions & 2 deletions cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { registerCheckPinSpecification } from "./check/pin-specification/registe
import { registerCheckPlacement } from "./check/placement/register"
import { registerCheck } from "./check/register"
import { registerCheckRoutingDifficulty } from "./check/routing-difficulty/register"
import { registerCheckRouting } from "./check/routing/register"
import { registerCheckSchematicPlacement } from "./check/schematic-placement/register"
import { registerCheckTraceLength } from "./check/trace-length/register"
import { registerClone } from "./clone/register"
Expand Down Expand Up @@ -85,7 +84,6 @@ registerCheckNetlist(program)
registerCheckPinSpecification(program)
registerCheckPlacement(program)
registerCheckRoutingDifficulty(program)
registerCheckRouting(program)
registerCheckSchematicPlacement(program)
registerCheckTraceLength(program)

Expand Down
22 changes: 22 additions & 0 deletions lib/shared/get-entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from "node:fs"
import * as path from "node:path"
import { globbySync } from "globby"
import { loadProjectConfig } from "lib/project-config"
import kleur from "kleur"

Expand Down Expand Up @@ -202,6 +203,27 @@ export const getEntrypoint = async ({
}
}

// No entrypoint found - check for circuit.json files as implicit entrypoints
// This allows `tsci push` to work the same as `tsci dev` which supports circuit.json files
const circuitJsonFiles = globbySync(
["**/*.circuit.json", "**/circuit.json"],
{
cwd: validatedProjectDir,
ignore: ["**/node_modules/**", "**/dist/**"],
},
)
.map((f) => path.resolve(validatedProjectDir, f))
.filter(
(f) => fs.existsSync(f) && isValidDirectory(f, validatedProjectDir),
)
.sort()

if (circuitJsonFiles.length > 0) {
const chosenFile = path.relative(validatedProjectDir, circuitJsonFiles[0])
onSuccess(`Using circuit.json as implicit entrypoint: '${chosenFile}'`)
return circuitJsonFiles[0]
}

onError(
kleur.red(
"No entrypoint found. Run 'tsci init' to bootstrap a basic project or specify a file with 'tsci push <file>'",
Expand Down
65 changes: 53 additions & 12 deletions lib/shared/push-snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,55 @@ type PushOptions = {

const debug = Debug("tsci:push-snippet")

const findPushProject = async ({
filePath,
onError,
}: {
filePath?: string
onError: (message: string) => void
}): Promise<{
snippetFilePath?: string
packageJsonPath?: string
projectDir: string
} | null> => {
if (filePath) {
const snippetFilePath = await getEntrypoint({
filePath,
onSuccess: () => {},
onError,
})

if (!snippetFilePath) {
return null
}

const packageJsonPath = [
path.resolve(path.join(path.dirname(snippetFilePath), "package.json")),
path.resolve(path.join(process.cwd(), "package.json")),
].find((candidatePath) => fs.existsSync(candidatePath))
const projectDir = packageJsonPath
? path.dirname(packageJsonPath)
: path.dirname(snippetFilePath)

return { snippetFilePath, packageJsonPath, projectDir }
}

const projectDir = process.cwd()
const packageJsonPath = path.resolve(path.join(projectDir, "package.json"))
if (!fs.existsSync(packageJsonPath)) {
return { projectDir }
}

const snippetFilePath =
(await getEntrypoint({
projectDir,
onSuccess: () => {},
onError: () => {},
})) ?? undefined

return { snippetFilePath, packageJsonPath, projectDir }
}

const getArchivePayload = async (
filePaths: string[],
projectDir: string,
Expand Down Expand Up @@ -74,24 +123,16 @@ export const pushSnippet = async ({
return onExit(1)
}

// Detect the entrypoint file
const snippetFilePath = await getEntrypoint({
const pushProject = await findPushProject({
filePath,
onSuccess: () => {},
onError,
})

if (!snippetFilePath) {
if (!pushProject) {
return onExit(1)
}

const packageJsonPath = [
path.resolve(path.join(path.dirname(snippetFilePath), "package.json")),
path.resolve(path.join(process.cwd(), "package.json")),
].find((path) => fs.existsSync(path))
const projectDir = packageJsonPath
? path.dirname(packageJsonPath)
: path.dirname(snippetFilePath)
const { snippetFilePath, packageJsonPath, projectDir } = pushProject

if (!packageJsonPath) {
onError(
Expand All @@ -110,7 +151,7 @@ export const pushSnippet = async ({
}
}

if (!fs.existsSync(snippetFilePath)) {
if (snippetFilePath && !fs.existsSync(snippetFilePath)) {
onError(`File not found: ${snippetFilePath}`)
return onExit(1)
}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tscircuit/cli",
"version": "0.1.1296",
"version": "0.1.1357",
"main": "dist/cli/main.js",
"exports": {
".": "./dist/cli/main.js",
Expand All @@ -11,13 +11,13 @@
"@biomejs/biome": "^1.9.4",
"@tscircuit/circuit-json-placement-analysis": "^0.0.6",
"@tscircuit/circuit-json-routing-analysis": "^0.0.1",
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#d09c8d74f3085b29744bb0f1c9864c1154c69436",
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#8e3b4dc434d342f6b9833777107fc66515d1480b",
"@tscircuit/fake-snippets": "^0.0.182",
"@tscircuit/file-server": "^0.0.32",
"@tscircuit/image-utils": "^0.0.3",
"@tscircuit/math-utils": "0.0.36",
"@tscircuit/props": "^0.0.496",
"@tscircuit/runframe": "^0.0.1882",
"@tscircuit/runframe": "^0.0.1938",
"@tscircuit/schematic-match-adapt": "^0.0.22",
"@types/bun": "^1.2.2",
"@types/configstore": "^6.0.2",
Expand All @@ -31,8 +31,8 @@
"chokidar": "4.0.1",
"circuit-json": "^0.0.403",
"circuit-json-to-bom-csv": "^0.0.7",
"circuit-json-to-gerber": "^0.0.49",
"circuit-json-to-kicad": "^0.0.114",
"circuit-json-to-gerber": "^0.0.51",
"circuit-json-to-kicad": "^0.0.125",
"circuit-json-to-pnp-csv": "^0.0.7",
"circuit-json-to-readable-netlist": "^0.0.15",
"circuit-json-to-spice": "^0.0.10",
Expand Down
51 changes: 38 additions & 13 deletions tests/cli/push/push1-no-entrypoint.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
import { test, expect } from "bun:test"
import { getCliTestFixture } from "../../fixtures/get-cli-test-fixture"
import * as fs from "node:fs"
import * as path from "node:path"

test("should fail if no entrypoint file is found", async () => {
const { runCommand } = await getCliTestFixture()
try {
await runCommand("tsci push")
} catch (e) {
if (e instanceof Error) {
expect(e.message).toContain(
"No entrypoint found. Run 'tsci init' to bootstrap a basic project.",
)
} else {
throw e
}
}
test("should fail if no package.json is found", async () => {
const { runCommand } = await getCliTestFixture({ loggedIn: true })
const { stderr, exitCode } = await runCommand("tsci push")

expect(exitCode).toBe(1)
expect(stderr).toBe(
"No package.json found, try running 'tsci init' to bootstrap the project\n",
)
})

test("should push a package without an entrypoint", async () => {
const { tmpDir, runCommand } = await getCliTestFixture({
loggedIn: true,
})

fs.writeFileSync(
path.resolve(tmpDir, "package.json"),
JSON.stringify({ name: "@tsci/test-user.test-package", version: "1.0.0" }),
)
fs.writeFileSync(
path.resolve(tmpDir, "tscircuit.config.json"),
JSON.stringify({ includeBoardFiles: ["**/*.circuit.json"] }),
)
fs.writeFileSync(
path.resolve(tmpDir, "prebuilt.circuit.json"),
JSON.stringify([{ type: "source_component", name: "U1" }]),
)

const { stdout, stderr, exitCode } = await runCommand("tsci push")

expect(exitCode).toBe(0)
expect(stderr).toBe("")
expect(stdout).toContain("⬆︎ package.json")
expect(stdout).toContain("⬆︎ prebuilt.circuit.json")
expect(stdout).toContain("⬆︎ tscircuit.config.json")
expect(stdout).toContain('"@tsci/test-user.test-package@1.0.0" published!')
}, 30_000)
46 changes: 46 additions & 0 deletions tests/get-entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,3 +519,49 @@ test("getEntrypoint warns when multiple common locations exist", async () => {
expect(warnings[0]).toContain("Choosing 'index.tsx'")
expect(warnings[0]).toContain("'src/index.tsx'")
})

test("getEntrypoint returns circuit.json as implicit entrypoint when no tsx/ts files exist", async () => {
const { tmpDir } = await getCliTestFixture()

// Create only a circuit.json file, no tsx/ts entrypoints
await fs.writeFile(
path.join(tmpDir, "prebuilt.circuit.json"),
JSON.stringify([{ type: "source_component", name: "U1" }]),
)

let onSuccessMessage = ""
const entrypoint = await getEntrypoint({
projectDir: tmpDir,
onSuccess: (msg) => {
onSuccessMessage = msg
},
})

expect(entrypoint).not.toBeNull()
expect(entrypoint).toBe(path.join(tmpDir, "prebuilt.circuit.json"))
expect(onSuccessMessage).toContain(
"Using circuit.json as implicit entrypoint",
)
})

test("getEntrypoint prefers tsx entrypoint over circuit.json", async () => {
const { tmpDir } = await getCliTestFixture()

// Create both a circuit.json and an index.tsx
await fs.writeFile(
path.join(tmpDir, "prebuilt.circuit.json"),
JSON.stringify([{ type: "source_component", name: "U1" }]),
)
await fs.writeFile(
path.join(tmpDir, "index.tsx"),
'export default () => <board width="10mm" height="10mm"></board>',
)

const entrypoint = await getEntrypoint({
projectDir: tmpDir,
})

// Should prefer the tsx file since it comes first in ALLOWED_ENTRYPOINT_NAMES
expect(entrypoint).not.toBeNull()
expect(entrypoint).toBe(path.join(tmpDir, "index.tsx"))
})