From 1ef289a6ebfd14f23b9bb3156ab735fd11b17ea4 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Tue, 28 Apr 2026 11:40:54 +0800 Subject: [PATCH 01/13] fix: tsci push should find fallback file when no entrypoint --- lib/shared/push-snippet.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/shared/push-snippet.ts b/lib/shared/push-snippet.ts index 75bc61dea..871446950 100644 --- a/lib/shared/push-snippet.ts +++ b/lib/shared/push-snippet.ts @@ -75,12 +75,27 @@ export const pushSnippet = async ({ } // Detect the entrypoint file - const snippetFilePath = await getEntrypoint({ + let snippetFilePath = await getEntrypoint({ filePath, onSuccess: () => {}, onError, }) + // If no entrypoint found, try to find any valid circuit file (like tsci dev does) + if (!snippetFilePath) { + const { globbySync } = await import("globby") + const projectDir = process.cwd() + const validFiles = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], { + cwd: projectDir, + ignore: ["node_modules/**", "**/.*"] + }).filter(f => fs.existsSync(f)) + + if (validFiles.length > 0) { + snippetFilePath = path.resolve(projectDir, validFiles[0]) + onSuccess(`Using fallback file: '${validFiles[0]}'`) + } + } + if (!snippetFilePath) { return onExit(1) } From ddc2700f780c15b81c5381de08aba95ea043edfd Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Tue, 28 Apr 2026 12:49:02 +0800 Subject: [PATCH 02/13] fix: use static import for globbySync instead of dynamic import --- lib/shared/push-snippet.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/shared/push-snippet.ts b/lib/shared/push-snippet.ts index 871446950..84e7ff7cc 100644 --- a/lib/shared/push-snippet.ts +++ b/lib/shared/push-snippet.ts @@ -6,6 +6,7 @@ import semver from "semver" import Debug from "debug" import kleur from "kleur" import { getEntrypoint } from "./get-entrypoint" +import { globbySync } from "globby" import prompts from "lib/utils/prompts" import { getUnscopedPackageName } from "lib/utils/get-unscoped-package-name" import { getPackageAuthor } from "lib/utils/get-package-author" @@ -83,12 +84,12 @@ export const pushSnippet = async ({ // If no entrypoint found, try to find any valid circuit file (like tsci dev does) if (!snippetFilePath) { - const { globbySync } = await import("globby") + const projectDir = process.cwd() const validFiles = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], { cwd: projectDir, ignore: ["node_modules/**", "**/.*"] - }).filter(f => fs.existsSync(f)) + }).filter((relativePath) => fs.existsSync(path.join(projectDir, relativePath))) if (validFiles.length > 0) { snippetFilePath = path.resolve(projectDir, validFiles[0]) From a58a7675138dbb301f17b5f9149727703aef3fad Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Tue, 28 Apr 2026 22:19:03 +0800 Subject: [PATCH 03/13] feat: add pnp-csv as standalone export format Add pnp-csv export format to ALLOWED_EXPORT_FORMATS, using the already-imported convertCircuitJsonToPickAndPlaceCsv function. Usage: tsci export MyCircuit.tsx -f pnp-csv Outputs: MyCircuit-pnp.csv Closes #2806 --- lib/shared/export-snippet.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/shared/export-snippet.ts b/lib/shared/export-snippet.ts index d7459d0df..4e5e0d04d 100644 --- a/lib/shared/export-snippet.ts +++ b/lib/shared/export-snippet.ts @@ -55,6 +55,7 @@ export const ALLOWED_EXPORT_FORMATS = [ "srj", "step", "assembly-svg", + "pnp-csv", ] as const export type ExportFormat = (typeof ALLOWED_EXPORT_FORMATS)[number] @@ -76,6 +77,7 @@ const OUTPUT_EXTENSIONS: Record = { "kicad-library": "", srj: ".simple-route.json", step: ".step", + "pnp-csv": "-pnp.csv", } const isRecord = (value: unknown): value is Record => @@ -345,6 +347,9 @@ export const exportSnippet = async ({ case "assembly-svg": outputContent = convertCircuitJsonToAssemblySvg(circuitJson) break + case "pnp-csv": + outputContent = await convertCircuitJsonToPickAndPlaceCsv(circuitJson) + break default: outputContent = JSON.stringify(circuitJson, null, 2) } From 0f51e0055ad793feb722217ae120a351b5e22356 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Thu, 30 Apr 2026 23:24:56 +0800 Subject: [PATCH 04/13] style: run biome format --- lib/shared/push-snippet.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/shared/push-snippet.ts b/lib/shared/push-snippet.ts index 84e7ff7cc..21b1173e3 100644 --- a/lib/shared/push-snippet.ts +++ b/lib/shared/push-snippet.ts @@ -84,12 +84,16 @@ export const pushSnippet = async ({ // If no entrypoint found, try to find any valid circuit file (like tsci dev does) if (!snippetFilePath) { - const projectDir = process.cwd() - const validFiles = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], { - cwd: projectDir, - ignore: ["node_modules/**", "**/.*"] - }).filter((relativePath) => fs.existsSync(path.join(projectDir, relativePath))) + const validFiles = globbySync( + ["**/*.tsx", "**/*.ts", "**/*.circuit.json"], + { + cwd: projectDir, + ignore: ["node_modules/**", "**/.*"], + }, + ).filter((relativePath) => + fs.existsSync(path.join(projectDir, relativePath)), + ) if (validFiles.length > 0) { snippetFilePath = path.resolve(projectDir, validFiles[0]) From 2af982c412162ad6919ad729aaa2f94f6f7999e1 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Mon, 4 May 2026 11:33:59 +0800 Subject: [PATCH 05/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index a7894f2a2..6af229514 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 1777865639 From 090e138f6d5f54f6932a40ff20e3f111ce28ad44 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Mon, 4 May 2026 11:35:26 +0800 Subject: [PATCH 06/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 6af229514..d56cde0a5 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 1777865639 +# bump 1777865726 From a4a67233d62d367b40db29ae3e65c640ec2d4383 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Mon, 4 May 2026 12:00:09 +0800 Subject: [PATCH 07/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index d56cde0a5..24460a96c 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 1777865639 # bump 1777865726 +# bump 1777867209 From 87cf40848fb74fc371121db005e7cd0baea38213 Mon Sep 17 00:00:00 2001 From: 64johnlee <64lamei@gmail.com> Date: Tue, 5 May 2026 00:00:11 +0800 Subject: [PATCH 08/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 24460a96c..b019dcf02 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 1777865639 # bump 1777865726 # bump 1777867209 +# bump 1777910411 From ff00b1cecd80b2c869a38aa4548c2f1149cd1c1e Mon Sep 17 00:00:00 2001 From: John Lee Date: Tue, 5 May 2026 12:00:07 +0800 Subject: [PATCH 09/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index b019dcf02..134a7a09f 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 1777865726 # bump 1777867209 # bump 1777910411 +# bump 1777953607 From 688c65ce9914c29ee9d4b9c05ab79e5b24997621 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Wed, 6 May 2026 00:00:07 +0800 Subject: [PATCH 10/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 134a7a09f..85971141c 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 1777867209 # bump 1777910411 # bump 1777953607 +# bump 1777996807 From d86ba2895bcf3dbc86d4cc8400687d72bdcd401c Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Wed, 6 May 2026 12:00:13 +0800 Subject: [PATCH 11/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 85971141c..94fe83648 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 1777910411 # bump 1777953607 # bump 1777996807 +# bump 1778040013 From 2d9827e383be7fad872ea90c37516440cd5c8f40 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Thu, 7 May 2026 00:00:16 +0800 Subject: [PATCH 12/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 94fe83648..9b9c27a3d 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 1777953607 # bump 1777996807 # bump 1778040013 +# bump 1778083216 From 1fcbe5000a8398ea0014a8c9ec5faf4b6f4b1271 Mon Sep 17 00:00:00 2001 From: John Lee <64lamei@gmail.com> Date: Thu, 7 May 2026 12:00:13 +0800 Subject: [PATCH 13/13] chore: bump PR --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 9b9c27a3d..e679b996c 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 1777996807 # bump 1778040013 # bump 1778083216 +# bump 1778126413