Commit Graph

140 Commits

Author SHA1 Message Date
akhilles 47acfdb62c Suppress 3d export logs to stdout
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 13:07:01 -07:00
akhilles 5a4a36268d Specify default branch
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:53:22 -07:00
akhilles 96833ce729 Bump lock file
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:53:22 -07:00
akhilles 65edff2e71 Fix download race condition
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles e0e9f42350 Reuse dep fetching code from pcb-zen
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles d8ecc6923d Ignore some tests on Windows
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles b86e56102c Sanitize linux tmp dir paths
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles d1a25c62f4 Add pcb vendor snapshot test
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles a365d9ed6c Add bom, release tests
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:09 -07:00
akhilles 6f33fe3c6b Only use local files for workspace root detection
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:08 -07:00
akhilles f84e676d2a Add snapshot testing of stdout/stderr
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:08 -07:00
akhilles bea8fe9453 Add branch support, snapshot_dir
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:08 -07:00
akhilles 2fc6dbd382 Add dir snapshotting
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:08 -07:00
akhilles ec6c37d142 Add sandbox
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 12:31:08 -07:00
Lenny Khazan 9d75b20b24 bump version (#97) v0.2.0-prerelease.5 2025-08-21 15:30:27 -04:00
Akhil Velagapudi 477d0f0e79 Vendor pcb.toml files (#93)
* Mark vendor/ dir as alias root

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Don't consider pcb.toml files irrelevant

Use more LoadSpec helpers.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Track pcb.toml files in path_to_spec

This is enough for `pcb vendor` to pick up these files and copy them to
the vendor/ dir.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use FileProvider::exists

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 15:29:34 -04:00
Lenny Khazan f46a1918db Use vendor/ folder in release (#95)
* Use vendor/ folder in release

* only for release
2025-08-21 15:29:24 -04:00
Akhil Velagapudi ea36c60894 Include drill map pdf in gerbers.zip (#94)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 20:47:16 -07:00
Akhil Velagapudi 1ee83c6e7e Initial implementation of interface subclasses + auto-promotion (#89)
* Add serialize(), deserialize() builtins for debugging

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add field(), __post_init__ to interface()

Also, add better print() behavior.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add interface/net promotion

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove Cargo.toml patch

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix example

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix test workspace

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add interface arg type checking

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update spec.mdx

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Allow `using(Net)`

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 09:27:39 -07:00
Akhil Velagapudi f54aa468cc Add hierarchical package alias resolution (#91)
Deeper directories taking priority.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 08:50:47 -07:00
Akhil Velagapudi 1df8194abf Switch to larger github runners (#90)
* Switch to larger github runners

The "xlarge" in "macos-15-xlarge" doesn't actually mean extra large. The
"x" indicates arm64 as opposed to Intel.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove dep on deprecated actions-rs/toolchain@v1

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-19 18:50:50 -07:00
Akhil Velagapudi 392c9b9395 Better CAD exports (#88)
* Use copied layout files as source for cad export

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Include pads, silkscreen, soldermask in CAD

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Patch text vars in .kicad_pro file

This is used for CAD export for some reason over the .kicad_pcb file.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-19 16:35:12 -07:00
Akhil Velagapudi 8996bef578 Use "odb.zip" for the ODB++ archive (#87)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-19 15:32:33 -07:00
Akhil Velagapudi 55dc9a736e Add ODB++ release artifact (#86)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-19 15:28:11 -07:00
Lenny Khazan d554a4f281 Bump to 0.2.0-prerelease.4 and add --version (#85) v0.2.0-prerelease.4 2025-08-19 16:55:59 -04:00
Lenny Khazan 2bd2a2afb2 Add JSON output mode to pcb release (#84) 2025-08-19 16:53:23 -04:00
Lenny Khazan d8afaba34b Remove LSP autoimport logic (#83) 2025-08-18 23:07:43 -04:00
Lenny Khazan f9a6743428 0.2.0-prerelease.3 (#82)
* bump version

* Bump version: 0.2.0-prerelease.3
2025-08-18 18:32:06 -04:00
Akhil Velagapudi 47190c5821 [DIO-309] Add component_type tag for well-known components (#81)
* Make zen_file path relative to release archive

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add component_type tag for well-known components

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-18 14:54:40 -07:00
Akhil Velagapudi b9d101e129 Fix package resolution in pcb vendor/release (#80)
* Add [packages] to vendor/release test case

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix package resolution in pcb vendor/release

The TrackingLoadResolver middleware couldn't properly resolve packages.
To fix, eliminate the middleware entirely and enhance CoreLoadResolver
to handle all the necessary tracking. This is likely to reduce future
bugs as well.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use public kicad package

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-18 14:32:31 -07:00
Davide Asnaghi 63e02ca70c [FMT] ignore dotfiles (#78)
* ignore hidden files by default

* formatting
2025-08-16 16:16:58 -04:00
Akhil Velagapudi 2059bccbca Substitute PCB_VERSION, PCB_GIT_HASH in release layout files (#77)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 16:30:23 -07:00
Akhil Velagapudi 23442e6577 Only detect workspace root if pcb.toml has [workspace] (#75)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 15:28:37 -07:00
Akhil Velagapudi 52ae02637b Add more release artifacts (#74)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 13:09:52 -07:00
Akhil Velagapudi b97d9f053b [DIO-302] Generate 3d models for release (#73)
* Generate 3d models for release

Release file structure:
/a614869/3d
├── model.step
├── model.svg
└── model.wrl

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Ignore spurious kicad-cli errors

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 12:47:52 -07:00
Akhil Velagapudi 58549fb924 [DIO-301] Add pcb vendor, pcb build --offline (#72)
* Update Cargo.lock

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add pcb vendor

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Copy pcb.toml to release if it exists

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use vendor dir in resolver

Add --offline support to build, layout.
Standardize behavior of find_workspace_root. Most of the callsites would
fallback on parent dir of target .zen file. We should just do that
universally to reduce conditional code paths.

Add an option to the resolve to not use the vendor dir in case that's
useful in some cases.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Drop vendor alias

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Only support pcb vendor in pcb.toml workspaces

Attempting to resolve a common workspace root from multiple zen files in
a dir without pcb.toml just got way too complicated. We can add support
for this in the future if needed.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Canonicalize zen_path

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 12:07:51 -07:00
Lenny Khazan 951f74eb42 Add BOM to WASM API (#71) 2025-08-15 01:32:51 -04:00
Lenny Khazan 9058b71749 Add more context to LSP error diagnostics (#70) 2025-08-15 00:20:01 -04:00
Akhil Velagapudi 1636bc18f7 [DIO-300] Add pcb release command (#69)
* Add pcb release command

Intentially spartan in terms of flags/arguments. All that's needed is
the path to the .zen file.

To test:
cargo run -- release crates/pcb/test-workspace/boards/TestBoard.zen

Implemented:
- Workspace root detection (even without pcb.toml)
- Git-based versioning (e.g. tag > commit hash > dirty commit hash)
- Zen source files copied into release dir (release-dir/src)
- Dependencies are vendored into release dir (release-dir/src/vendor)
- Unmatched bom is generated into release dir (release-dir/bom)
- KiCad layout dir is copied into release dir (release-dir/layout)
- Metadata file is generated into release dir (release-dir/metadata.json)
- Generated artifacts are stored in .pcb/ dir (for now) and not uploaded

TODO:
- Upload the release bundle to API server
- Add a --dry-run to generate release bundle but not upload (similar to
  cargo)
- Use the vendor/ dir for dependency resolution for deterministic builds
- Add pcb vendor subcommand, --offline flag for build/layout
- Add more release artifacts (e.g. gerbers, odb, etc.)

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix windows compat

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add support, test-coverage for workspace-relative loads

Assume that pcb.toml is needed for workspace-relative loads

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use workspace root .pcb dir for staging releases

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-14 18:46:43 -07:00
Akhil Velagapudi f20ac95f64 [DIO-298] [DIO-299] Add pcb bom command to generate unmatched bom (#66)
* Add structured, unmatched BOM export command

Run using `pcb bom <path/to/zen> -o json`

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Test bom command in CI

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump stdlib in examples from v0.2.0 to v0.2.2

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove default_multiplier, use struct for group key

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use PhysicalValue to do less string parsing

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add alternatives to group key

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use DynamicFullWidth for the comfy table

Attempts to fit the table within terminal width.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-14 12:13:20 -07:00
Akhil Velagapudi a41fd301eb Parse unit records as AttributeValue::Physical (#68)
Reduce unnecessary conversions to/from strings.
Use rust_decimal for fixed precision.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-14 10:21:10 -07:00
Lenny Khazan 208d95e023 resolve workspace in wasm (#65) 2025-08-12 02:19:13 -04:00
Lenny Khazan b29b5865e5 pcb upgrade command (#64)
* `pcb upgrade` command

* remove pending snap

* clippy
2025-08-12 01:56:48 -04:00
Davide Asnaghi dbb13bd4aa pin stdlib (#63) 2025-08-08 16:23:01 -04:00
Lenny Khazan d3bef1b0a5 Update net naming strategy (#62)
* Consistent net naming

* cargo fmt

* fix clippy

* uniquify net names
2025-08-08 15:52:15 -04:00
Lenny Khazan 4c135e964e Updates for visualizer (#61)
* Updates for visualizer

* update docstring
2025-08-05 18:20:01 -04:00
Davide Asnaghi 9a96e2e5aa [DOCS] theme (#60)
* add diode theme

* add vscode links

* add vscode features

* advanced install
2025-08-05 16:50:40 -04:00
Davide Asnaghi da1375abbd [FIX] multiple .pcb caches (#59)
* fix .pcb cache instantiation

* fix format
2025-08-05 11:15:11 -04:00
Martin Charles 926864652c add nix flake (#51)
* add nix flake

nix profile install nix profile install github:diodeinc/pcb

kicad isn't packaged here yet but can deal with that later

used crane as there is a bug in nixpkgs rust https://discourse.nixos.org/t/rust-with-git-deps-symbolic-link-error-to-cargo-vendor-dep/28841 and naserk had some issue as well. crane isn't ideal because it doesn't cache properly but now it one click installs so whatever

* allow external buildifier

* fix linux compilation

next up package kicad in a sane way

* fmt

* apply suggestions
2025-08-04 17:33:39 -04:00
Lenny Khazan 834fc645cc [DIO-293] Add dnp/exclude_from_bom support (#58)
* [DIO-293] Add dnp/exclude_from_bom support

* ignore underscored fields
2025-08-04 16:28:07 -04:00