component-lib@0.3.2 selects the same source for every build until the manifest
changes.
Repository structure
A board repository has a rootpcb.toml with [workspace] and [board]
metadata, a board .zen entrypoint, and generated KiCad files under layout/.
Create one with pcb new board <NAME> <REPO_URL>.
A registry repository has a root [workspace] but no [board]. Both repository
types can own reusable packages under components/ and modules/. Each package
has its own pcb.toml and .zen entrypoints; component packages also carry
their symbols and footprints. vendor/ holds vendored dependencies.
Version policy
PCB packages use semantic versions with hardware-specific compatibility rules:
Compatibility families are minor-version lanes before
1.0 (0.3.x, 0.4.x)
and major-version lanes afterward (1.x, 2.x). Do not publish breaking changes
within a family.
pcb sync records the selected dependency graph in pcb.toml, resolving branches
and commits to immutable pseudo-versions. Builds reuse this hydrated state rather
than selecting newly published versions.
Workspace package discovery
Starting at the workspace root,pcb searches at most eight directory levels
and treats each descendant directory containing pcb.toml as a package.
[workspace].exclude controls discovery:
pcb does not search inside an excluded directory. It also skips generated and
cache directories such as
.git, .pcb, vendor, target, node_modules, and fork.
Coexisting versions
A build can contain incompatible families of one package, such ascomponent-lib@0.3.x and component-lib@1.x. The resolver keeps separate copies
for their dependents. Their values have distinct types and cannot cross the
compatibility boundary.
Minimal Version Selection
Minimal Version Selection (MVS), based on Go modules, selects the highest explicit minimum required within each package family:component-lib >= 0.3.0, while regulator requires
component-lib >= 0.3.2. MVS therefore selects 0.3.2, even if 0.3.9 exists.
Require a newer version explicitly when the project is ready to test it:
Import paths as identity
Import paths serve as globally unique package identifiers:pcb.toml so imports remain stable across upgrades:
Hydrated manifests
Workspaces store resolved dependency state inpcb.toml. pcb sync updates:
[dependencies]: direct dependencies the package imports or explicitly owns.[dependencies.indirect]: the tool-managed MVS closure needed to build it.
@1 suffix is a compatibility lane. It allows multiple
incompatible versions of the same package path to coexist while keeping the
selected version exact.
Do not edit [dependencies.indirect] by hand. Commit hydrated pcb.toml files.
Vendoring ([workspace].vendor)
Vendoring policy is controlled by the root workspace manifest:
pcb publishuses[workspace].vendorpatterns when staging release sources.pcb syncvendors packages matched by[workspace].vendor.pcb vendorwithout--alluses[workspace].vendor.pcb vendor --allvendors everything.- Read commands such as
pcb build,pcb layout,pcb test,pcb open, andpcb bomdo not changevendor/or rewrite dependency manifests.
Workspace name ([workspace].name)
Workspace manifests can override the Diode workspace name used for board
release uploads:
name is omitted, pcb publish derives the workspace name from the first
path segment of [workspace].repository. For example,
anything.com/XYZ/boards/MyBoard uses XYZ.
Endpoint ([workspace].endpoint)
Workspace manifests can override the Diode host suffix used by CLI commands
that access Diode services:
endpoint = "diode.computer"resolves application and API URLs underapp.diode.computerandapi.diode.computer.- The setting applies to workspace-aware commands such as
pcb auth,pcb bom,pcb publish, and routing commands. - Authentication is scoped to the resolved endpoint. Authentication for one endpoint does not overwrite tokens for another.
BOM matching ([workspace.bom])
pcb bom availability queries use strict BOM matching by default, requiring
exact MPN matches. Workspace manifests can opt out to use fuzzy matching:
Registry search scope
Registry-backedpcb search searches the public Diode registry and the
registries configured by [workspace].repository.
pcb search --registry code.diode.computer/diode/registry ...overrides the default scope for that invocation.- Repeat
--registryto search more than one registry.
Pseudo-versions
Pseudo-versions identify unreleased commits while preserving version ordering. The format isv<base>-0.<timestamp>-<commit>.
pcb sync writes the resolved pseudo-version back to the package manifest with
the full 40-character commit hash.
The base version (0.3.15) is the next patch version after the most recent tag
reachable from that commit. This places the pseudo-version after its base tag and
before the next release.
If the package has never been tagged, pseudo-versions start in the 0.1.1
family (for example 0.1.1-0.<timestamp>-<commit>), one patch above the
initial unpublished release version 0.1.0.
Pseudo-versions participate fully in MVS. If one package requires component-lib@0.3.14
and another requires the pseudo-version above, MVS selects the pseudo-version
(it is higher). This permits testing an unreleased change without retaining a
mutable branch reference in the hydrated graph.
Use a tagged release for production dependencies when one is available.
Commands
pcb migrate
Runs project migrations using the latest stable pcbc toolchain, regardless of
the workspace’s current pcb-version lane. After all migrations succeed, the
command updates [workspace].pcb-version in pcb.toml to the target toolchain
lane.
pcb sync
Reconciles imports and hydrates package manifests. Run this after adding or
removing imports or changing dependency versions.
[workspace].vendor.
pcb sync --check always verifies the whole workspace, regardless of the
current directory, and writes neither pcb.toml nor vendor/. It detects
missing or stale vendored package versions; it does not verify the contents of
vendored versions that are already present.
pcb add
Adds or upgrades a direct dependency for the package in the current directory.
pcb add rewrites the direct dependency entry and rehydrates the package’s
dependency closure.
pcb build
Builds a board or workspace package.
pcb build checks that the hydrated state is sufficient and does not rewrite
pcb.toml or vendor/. Use pcb sync or pcb vendor to update dependency
state.
pcb list
Lists read-only package dependency information.
pcb list -m -u must be run from a package directory. It reports direct remote
dependencies only, showing the latest stable version in the same compatibility
lane and the latest newer breaking lane when available. It does not update manifests.
pcb update
pcb update is disabled. Use pcb add -u instead.
pcb publish
Publishes changed packages with annotated Git tags.
- No version tag exists.
- Its content hash differs from the published tag.
- Its
pcb.tomlhash differs from the published tag.
- Unpublished: Start at
0.1.0. - Published packages: Apply the requested semantic-version bump:
patch,minor, ormajor. --bump=infer: Infer each bump from conventional commits since the last tag, then raise dependent bumps to at least the highest bump among published internal dependencies.-y/--yes: Skip the final confirmation prompt.