-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add key as optional parameter for trace props (#50)
* add key as optional parameter for trace props * add key to common component props * fix type issue by adding to zod prop * formatbot: Automatically format code * switch to bun lockfiles * update lockfile * switch typehceck to bun * update formatcheck --------- Co-authored-by: tscircuitbot <tscircuitbot@users.noreply.github.com>
- Loading branch information
1 parent
44af085
commit b0a8305
Showing
9 changed files
with
53 additions
and
6,719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
# Created using @tscircuit/plop (npm install -g @tscircuit/plop) | ||
name: Format Check | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
jobs: | ||
format-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '22' | ||
- name: Setup bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Run format check | ||
run: npm run format:check | ||
- name: Run format check | ||
run: bun run format:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
dist | ||
.vscode | ||
.aider* | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { z } from "zod" | ||
import { distance, route_hint_point } from "@tscircuit/soup" | ||
import { point } from "../common/point" | ||
|
||
export const portRef = z.union([ | ||
z.string(), | ||
z.custom<{ getPortSelector: () => string }>((v) => | ||
Boolean(v.getPortSelector), | ||
), | ||
]) | ||
|
||
const baseTraceProps = z.object({ | ||
key: z.string().optional(), | ||
path: z.array(portRef), | ||
thickness: distance.optional(), | ||
schematicRouteHints: z.array(point).optional(), | ||
pcbRouteHints: z.array(route_hint_point).optional(), | ||
}) | ||
|
||
export const traceProps = z.union([ | ||
baseTraceProps.extend({ | ||
path: z.array(portRef), | ||
}), | ||
baseTraceProps.extend({ | ||
from: portRef, | ||
to: portRef, | ||
}), | ||
]) | ||
|
||
export type TraceProps = z.input<typeof traceProps> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.