@tscircuit/cli 0.0.207 → 0.0.208
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/.github/workflows/formatbot.yml +6 -6
- package/.github/workflows/test.yml +1 -1
- package/bun.lockb +0 -0
- package/cli/lib/cmd-fns/dev/derive-selector-from-pcb-component-id.ts +2 -2
- package/cli/lib/soupify/get-tmp-entrpoint-filepath.ts +3 -1
- package/cli/lib/soupify/soupify-with-core.ts +6 -1
- package/cli/lib/soupify/soupify.ts +1 -1
- package/dist/cli.js +68 -62
- package/example-project/src/MyCircuit.tsx +1 -7
- package/example-project/src/manual-edits.ts +1 -82
- package/frontend/views/HeaderMenu.tsx +2 -2
- package/package.json +7 -6
|
@@ -25,25 +25,25 @@ jobs:
|
|
|
25
25
|
with:
|
|
26
26
|
token: ${{ steps.check_fork.outputs.is_fork == 'true' && secrets.GITHUB_TOKEN || secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
27
27
|
|
|
28
|
-
- name: Setup
|
|
29
|
-
uses:
|
|
28
|
+
- name: Setup bun
|
|
29
|
+
uses: oven-sh/setup-bun@v1
|
|
30
30
|
with:
|
|
31
|
-
|
|
31
|
+
bun-version: latest
|
|
32
32
|
|
|
33
33
|
- name: Get @biomejs/biome version
|
|
34
34
|
id: get-biome-version
|
|
35
35
|
run: echo "BIOME_VERSION=$(node -p "require('./package.json').devDependencies['@biomejs/biome']")" >> $GITHUB_OUTPUT
|
|
36
36
|
|
|
37
37
|
- name: Install @biomejs/biome
|
|
38
|
-
run:
|
|
38
|
+
run: bun install
|
|
39
39
|
|
|
40
40
|
- name: Run Formatter and autofix
|
|
41
41
|
if: steps.check_fork.outputs.is_fork == 'false'
|
|
42
|
-
run:
|
|
42
|
+
run: bunx biome format . --write
|
|
43
43
|
|
|
44
44
|
- name: Format Check (cannot autofix against forks)
|
|
45
45
|
if: steps.check_fork.outputs.is_fork == 'true'
|
|
46
|
-
run:
|
|
46
|
+
run: bunx biome format .
|
|
47
47
|
|
|
48
48
|
- name: Restore lock files
|
|
49
49
|
if: steps.check_fork.outputs.is_fork == 'false'
|
package/bun.lockb
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnySoupElement } from "@tscircuit/
|
|
1
|
+
import type { AnySoupElement } from "@tscircuit/soup"
|
|
2
2
|
import { su } from "@tscircuit/soup-util"
|
|
3
3
|
|
|
4
4
|
export const deriveSelectorFromPcbComponentId = ({
|
|
@@ -8,7 +8,7 @@ export const deriveSelectorFromPcbComponentId = ({
|
|
|
8
8
|
soup: AnySoupElement[]
|
|
9
9
|
pcb_component_id: string
|
|
10
10
|
}) => {
|
|
11
|
-
const source_component = su(soup).source_component.getUsing({
|
|
11
|
+
const source_component = su(soup as any).source_component.getUsing({
|
|
12
12
|
pcb_component_id,
|
|
13
13
|
})
|
|
14
14
|
if (!source_component) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Path from "node:path"
|
|
2
|
+
import fs from "fs/promises"
|
|
2
3
|
|
|
3
|
-
export const getTmpEntrypointFilePath = (filePath: string) => {
|
|
4
|
+
export const getTmpEntrypointFilePath = async (filePath: string) => {
|
|
4
5
|
const tmpEntrypointPath = Path.resolve(
|
|
5
6
|
Path.dirname(filePath),
|
|
6
7
|
Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_entrypoint.tsx",
|
|
@@ -9,5 +10,6 @@ export const getTmpEntrypointFilePath = (filePath: string) => {
|
|
|
9
10
|
Path.dirname(filePath),
|
|
10
11
|
Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_output.json",
|
|
11
12
|
)
|
|
13
|
+
|
|
12
14
|
return { tmpEntrypointPath, tmpOutputPath }
|
|
13
15
|
}
|
|
@@ -10,6 +10,7 @@ import Debug from "debug"
|
|
|
10
10
|
import { getExportNameFromFile } from "./get-export-name-from-file"
|
|
11
11
|
import { getTmpEntrypointFilePath } from "./get-tmp-entrpoint-filepath"
|
|
12
12
|
import { runEntrypointFile } from "./run-entrypoint-file"
|
|
13
|
+
import fs from "node:fs/promises"
|
|
13
14
|
|
|
14
15
|
const debug = Debug("tscircuit:soupify")
|
|
15
16
|
|
|
@@ -25,7 +26,11 @@ export const soupifyWithCore = async (
|
|
|
25
26
|
exportName ??= await getExportNameFromFile(filePath)
|
|
26
27
|
|
|
27
28
|
const { tmpEntrypointPath, tmpOutputPath } =
|
|
28
|
-
getTmpEntrypointFilePath(filePath)
|
|
29
|
+
await getTmpEntrypointFilePath(filePath)
|
|
30
|
+
|
|
31
|
+
// Remove existing entrypoint or tmp output files
|
|
32
|
+
await fs.unlink(tmpEntrypointPath).catch(() => {})
|
|
33
|
+
await fs.unlink(tmpOutputPath).catch(() => {})
|
|
29
34
|
|
|
30
35
|
debug(`writing to ${tmpEntrypointPath}`)
|
|
31
36
|
writeFileSync(
|
|
@@ -32,7 +32,7 @@ export const soupifyWithBuilder = async (
|
|
|
32
32
|
exportName ??= await getExportNameFromFile(filePath)
|
|
33
33
|
|
|
34
34
|
const { tmpEntrypointPath, tmpOutputPath } =
|
|
35
|
-
getTmpEntrypointFilePath(filePath)
|
|
35
|
+
await getTmpEntrypointFilePath(filePath)
|
|
36
36
|
|
|
37
37
|
debug(`writing to ${tmpEntrypointPath}`)
|
|
38
38
|
writeFileSync(
|