@tscircuit/cli 0.0.189 → 0.0.191

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.
@@ -11,34 +11,53 @@ jobs:
11
11
  if: github.event.pull_request.draft == false
12
12
 
13
13
  steps:
14
+ - name: Determine if fork
15
+ id: check_fork
16
+ run: |
17
+ if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
18
+ echo "is_fork=false" >> $GITHUB_OUTPUT
19
+ else
20
+ echo "is_fork=true" >> $GITHUB_OUTPUT
21
+ fi
22
+
14
23
  - name: Checkout code
15
24
  uses: actions/checkout@v3
16
25
  with:
17
- token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
26
+ token: ${{ steps.check_fork.outputs.is_fork == 'true' && secrets.GITHUB_TOKEN || secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
18
27
 
19
- - name: Setup Bun
20
- uses: oven-sh/setup-bun@v1
28
+ - name: Setup Node.js
29
+ uses: actions/setup-node@v3
21
30
  with:
22
- bun-version: latest
23
-
24
- - name: Install dependencies
25
- run: bun install --frozen-lockfile
31
+ node-version: '20'
26
32
 
27
33
  - name: Get @biomejs/biome version
28
34
  id: get-biome-version
29
- run: echo "BIOME_VERSION=$(bunx jq -r '.devDependencies["@biomejs/biome"]' package.json)" >> $GITHUB_OUTPUT
35
+ run: echo "BIOME_VERSION=$(node -p "require('./package.json').devDependencies['@biomejs/biome']")" >> $GITHUB_OUTPUT
30
36
 
31
37
  - name: Install @biomejs/biome
32
- run: bun add -d @biomejs/biome@${{ steps.get-biome-version.outputs.BIOME_VERSION }}
38
+ run: npm install @biomejs/biome@${{ steps.get-biome-version.outputs.BIOME_VERSION }}
39
+
40
+ - name: Run Formatter and autofix
41
+ if: steps.check_fork.outputs.is_fork == 'false'
42
+ run: npx @biomejs/biome format . --write
43
+
44
+ - name: Format Check (cannot autofix against forks)
45
+ if: steps.check_fork.outputs.is_fork == 'true'
46
+ run: npx @biomejs/biome format .
33
47
 
34
- - name: Run formatter
35
- run: bunx @biomejs/biome format . --write
48
+ - name: Restore lock files
49
+ if: steps.check_fork.outputs.is_fork == 'false'
50
+ run: |
51
+ git checkout -- *lock.json || true
52
+ git checkout -- *.lock || true
53
+ git checkout -- *.lockb || true
36
54
 
37
55
  - name: Commit changes
56
+ if: steps.check_fork.outputs.is_fork == 'false'
38
57
  uses: stefanzweifel/git-auto-commit-action@v4
39
58
  with:
40
59
  commit_message: "formatbot: Automatically format code"
41
60
  branch: ${{ github.head_ref }}
42
61
  commit_user_name: tscircuitbot
43
62
  commit_user_email: tscircuitbot@users.noreply.github.com
44
- commit_author: tscircuitbot <tscircuitbot@users.noreply.github.com>
63
+ commit_author: tscircuitbot <tscircuitbot@users.noreply.github.com>
package/bun.lockb CHANGED
Binary file
@@ -11,6 +11,9 @@ import { deriveSelectorFromPcbComponentId } from "./derive-selector-from-pcb-com
11
11
  import type { EditEvent } from "@tscircuit/manual-edit-events"
12
12
  import { getManualTraceHintFromEvent, ManualTraceHint } from "@tscircuit/layout"
13
13
  import JSON5 from "json5"
14
+ import Debug from "debug"
15
+
16
+ const debug = Debug("tscircuit:cli:edit-event-watcher")
14
17
 
15
18
  export const startEditEventWatcher = async (
16
19
  {
@@ -46,14 +49,12 @@ export const startEditEventWatcher = async (
46
49
  `Edit event detected for dev_package_example ${dev_package_example.dev_package_example_id}`,
47
50
  ),
48
51
  )
49
- console.log(
50
- kleur.gray(` file_path: ${dev_package_example.file_path}`),
51
- )
52
+ debug(`file_path: ${dev_package_example.file_path}`)
52
53
 
53
54
  last_edit_event_update_time[dev_package_example_id] =
54
55
  dev_package_example.edit_events_last_updated_at! // TODO last_edit_event_updated_at
55
56
 
56
- console.log(kleur.gray(` getting new edit events...`))
57
+ debug(` getting new edit events...`)
57
58
 
58
59
  const dev_package_example_full = await devServerAxios
59
60
  .post("/api/dev_package_examples/get", {
@@ -99,9 +100,7 @@ export const startEditEventWatcher = async (
99
100
  "utf-8",
100
101
  )
101
102
 
102
- console.log(
103
- kleur.gray(` found manual edit file: ${manual_edit_file}`),
104
- )
103
+ debug(` found manual edit file: ${manual_edit_file}`)
105
104
 
106
105
  // 2. Convert the edit events into ManualPcbPosition[] and append,
107
106
  // removing any old placements/positions for the same selector.
@@ -211,6 +210,10 @@ export const startEditEventWatcher = async (
211
210
  if (handled_edit_events.has(incoming_edit_event.edit_event_id))
212
211
  continue
213
212
 
213
+ debug(
214
+ `incoming_edit_event: ${JSON.stringify(incoming_edit_event)}`,
215
+ )
216
+
214
217
  if (
215
218
  incoming_edit_event.pcb_edit_event_type ===
216
219
  "edit_component_location"
@@ -224,6 +227,10 @@ export const startEditEventWatcher = async (
224
227
  })
225
228
  }
226
229
 
230
+ debug(
231
+ `edit event pcb_component_selector: "${pcb_component_selector}"`,
232
+ )
233
+
227
234
  // TODO we'll need to work past this for edit_event_type=edit_trace
228
235
  if (!pcb_component_selector) continue
229
236