From 4e21352a9827298cca792b975f3bc8c48a2c0a99 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Sun, 3 May 2026 11:19:24 +0800 Subject: [PATCH 01/24] fix: allow tsci push without entrypoint when circuit.json exists When no tsx/ts entrypoint files are found, getEntrypoint() now falls back to checking for circuit.json files. This mirrors the behavior of `tsci dev` which already supports circuit.json files as valid build targets. Fixes #2797 --- lib/shared/get-entrypoint.ts | 22 ++++++++++++++++++ tests/get-entrypoint.test.ts | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/lib/shared/get-entrypoint.ts b/lib/shared/get-entrypoint.ts index c2858b38d..770cce979 100644 --- a/lib/shared/get-entrypoint.ts +++ b/lib/shared/get-entrypoint.ts @@ -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" @@ -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 '", diff --git a/tests/get-entrypoint.test.ts b/tests/get-entrypoint.test.ts index 28ee40c54..9475dd7da 100644 --- a/tests/get-entrypoint.test.ts +++ b/tests/get-entrypoint.test.ts @@ -519,3 +519,47 @@ 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 () => ', + ) + + 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")) +}) From 59f0559316b1ee2e83c1536f0f7ec5590b3d51e7 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sat, 9 May 2026 00:00:07 +0800 Subject: [PATCH 02/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index a7894f2a2..d29ef02ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,3 +80,4 @@ 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 From c5e71498c4bce93f2be831e7ff3a287cf9f85785 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sat, 9 May 2026 12:00:07 +0800 Subject: [PATCH 03/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index d29ef02ad..355311750 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,3 +81,4 @@ Test fixture provides: 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 From fc590079e95dc0425faf746525e266e7f323bb9f Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sun, 10 May 2026 00:00:07 +0800 Subject: [PATCH 04/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 355311750..15efbfb64 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -82,3 +82,4 @@ Test fixture provides: 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 From 406319e8b5f30dbadf2c3976ada97c2df78bcb14 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sun, 10 May 2026 12:00:07 +0800 Subject: [PATCH 05/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 15efbfb64..9703ad25b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,3 +83,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778256007 # bump 1778299207 # bump 1778342407 +# bump 1778385607 From da8aa05ba0b6898237873ba486e6b676cb819241 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Sun, 10 May 2026 20:33:18 +0800 Subject: [PATCH 06/24] fix: format --- tests/get-entrypoint.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/get-entrypoint.test.ts b/tests/get-entrypoint.test.ts index 9475dd7da..ff30ef7de 100644 --- a/tests/get-entrypoint.test.ts +++ b/tests/get-entrypoint.test.ts @@ -539,7 +539,9 @@ test("getEntrypoint returns circuit.json as implicit entrypoint when no tsx/ts f expect(entrypoint).not.toBeNull() expect(entrypoint).toBe(path.join(tmpDir, "prebuilt.circuit.json")) - expect(onSuccessMessage).toContain("Using circuit.json as implicit entrypoint") + expect(onSuccessMessage).toContain( + "Using circuit.json as implicit entrypoint", + ) }) test("getEntrypoint prefers tsx entrypoint over circuit.json", async () => { From f214b0019b505eb40bcc39463f4361d0477b5522 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Sun, 10 May 2026 20:49:21 +0800 Subject: [PATCH 07/24] fix: skip transpilation when includeBoardFiles configured and no library entrypoint found --- cli/build/register.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build/register.ts b/cli/build/register.ts index ffc7b8397..5322f0d02 100644 --- a/cli/build/register.ts +++ b/cli/build/register.ts @@ -732,7 +732,7 @@ export const registerBuild = (program: Command) => { const entryFile = fileArgIsDirectFile ? resolvedFileArgPath : transpileEntrypoint - if (!entryFile) { + if (!entryFile || (hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested)) { if ( hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested From 84426494faec8c0eb79f9735f2f4a1d761cc04ef Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 22:00:22 +0800 Subject: [PATCH 08/24] fix: format --- cli/build/register.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/build/register.ts b/cli/build/register.ts index 5322f0d02..89e9ea9b7 100644 --- a/cli/build/register.ts +++ b/cli/build/register.ts @@ -732,7 +732,10 @@ export const registerBuild = (program: Command) => { const entryFile = fileArgIsDirectFile ? resolvedFileArgPath : transpileEntrypoint - if (!entryFile || (hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested)) { + if ( + !entryFile || + (hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested) + ) { if ( hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested From 43136f2932ad12a03f4d7a6085bb743b2b55cfb6 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 22:19:51 +0800 Subject: [PATCH 09/24] fix: transpile when real .ts/.tsx entrypoint exists alongside includeBoardFiles Previously, transpilation was skipped whenever `includeBoardFiles` was configured and `--transpile` wasn't explicitly passed, even when a valid TypeScript library entrypoint (e.g. `index.circuit.tsx`) was present. Now the skip only applies when the resolved entrypoint is not a real `.ts`/`.tsx` file (e.g. a `.circuit.json` fallback or absent). Co-Authored-By: Claude Sonnet 4.6 --- cli/build/register.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/build/register.ts b/cli/build/register.ts index 89e9ea9b7..436abbf44 100644 --- a/cli/build/register.ts +++ b/cli/build/register.ts @@ -732,9 +732,15 @@ export const registerBuild = (program: Command) => { const entryFile = fileArgIsDirectFile ? resolvedFileArgPath : transpileEntrypoint + const isRealTsEntrypoint = Boolean( + entryFile && + (entryFile.endsWith(".ts") || entryFile.endsWith(".tsx")), + ) if ( !entryFile || - (hasConfiguredIncludeBoardFiles && !transpileExplicitlyRequested) + (hasConfiguredIncludeBoardFiles && + !transpileExplicitlyRequested && + !isRealTsEntrypoint) ) { if ( hasConfiguredIncludeBoardFiles && From e734d5c6153217766cf0d59112b193d9579dd354 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 22:39:11 +0800 Subject: [PATCH 10/24] chore: re-trigger CI From 4c23cb83d262d1c643587357772e15c88f029721 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 22:45:59 +0800 Subject: [PATCH 11/24] chore: re-trigger CI From 2167216441af9a14461432a1d07b658a16aa6058 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 22:47:01 +0800 Subject: [PATCH 12/24] chore: re-trigger CI From bb1db4b8de5b03054786d2f67a0154ead0cd8396 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 23:00:19 +0800 Subject: [PATCH 13/24] chore: re-trigger CI From 6da68fd6048559ee8ad01002ccc74d80e39b0cc8 Mon Sep 17 00:00:00 2001 From: 64JohnLee <64lamei@gmail.com> Date: Mon, 11 May 2026 23:09:02 +0800 Subject: [PATCH 14/24] chore: re-trigger CI From 9cea80eaa7e3b5b268a4733a47135d0fc1f51226 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Tue, 12 May 2026 00:00:08 +0800 Subject: [PATCH 15/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 9703ad25b..50b98582c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -84,3 +84,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778299207 # bump 1778342407 # bump 1778385607 +# bump 1778515208 From c5c693af05b9a1c2b8ba17fcc1cd0af115954f28 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Tue, 12 May 2026 12:00:07 +0800 Subject: [PATCH 16/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 50b98582c..956f777f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,3 +85,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778342407 # bump 1778385607 # bump 1778515208 +# bump 1778558407 From 660aabaa40778ea046c34be868c34151408ed3f6 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Wed, 13 May 2026 00:00:08 +0800 Subject: [PATCH 17/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 956f777f3..353ec26f4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -86,3 +86,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778385607 # bump 1778515208 # bump 1778558407 +# bump 1778601608 From 1b2a423dd9be3da1b19278c6f55701e4a3ac4873 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Wed, 13 May 2026 12:00:07 +0800 Subject: [PATCH 18/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 353ec26f4..2c53e16aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,3 +87,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778515208 # bump 1778558407 # bump 1778601608 +# bump 1778644807 From 18ef6f0be850f97fe29b070e14b579dba1c31140 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Thu, 14 May 2026 00:00:08 +0800 Subject: [PATCH 19/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 2c53e16aa..2fd72b1b9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -88,3 +88,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778558407 # bump 1778601608 # bump 1778644807 +# bump 1778688008 From 6b7f0c627f0ad44669aac76c8f5ae7a0698a05b1 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Thu, 14 May 2026 12:00:07 +0800 Subject: [PATCH 20/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 2fd72b1b9..23f670c1b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,3 +89,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778601608 # bump 1778644807 # bump 1778688008 +# bump 1778731207 From 61357dd912f7287b0fc497f8f1f9c432de6d38b0 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Fri, 15 May 2026 00:00:09 +0800 Subject: [PATCH 21/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 23f670c1b..f195c6e74 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,3 +90,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778644807 # bump 1778688008 # bump 1778731207 +# bump 1778774409 From 569494c78851da5697d5c74946563d5a65a4005b Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Fri, 15 May 2026 12:00:08 +0800 Subject: [PATCH 22/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index f195c6e74..254979823 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -91,3 +91,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778688008 # bump 1778731207 # bump 1778774409 +# bump 1778817608 From 73313dbd1dc7bbded6a131d107034069fd0eec89 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sat, 16 May 2026 00:00:08 +0800 Subject: [PATCH 23/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 254979823..5e853a8bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -92,3 +92,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778731207 # bump 1778774409 # bump 1778817608 +# bump 1778860808 From 670ddec897686de0f329131a8b95c1eeb68581c5 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Sat, 16 May 2026 12:00:06 +0800 Subject: [PATCH 24/24] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 5e853a8bd..0a77fce14 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -93,3 +93,4 @@ The CLI entrypoint (`cli/entrypoint.js`) selects between Bun and tsx as the Type # bump 1778774409 # bump 1778817608 # bump 1778860808 +# bump 1778904006