typeCAD 0.3
Version 0.3 is a breaking change release that consolidates the typeCAD ecosystem into a single package and introduces a unified command-line tool.
One package, one install
@typecad/typecad-docgen and @typecad/typecad-gitdiff have been merged into the main @typecad/typecad package. What previously required three separate installs now takes one:
npm install @typecad/typecadBoth tools remain available programmatically via subpath exports:
import { generateDocumentation } from '@typecad/typecad/docgen';
import { generateDiffs } from '@typecad/typecad/diff';The typecad binary
A new unified CLI replaces the previous collection of separate commands. Running npx typecad or the installed typecad binary gives access to:
| Command | Description |
|---|---|
typecad create | Create a new typeCAD project |
typecad add component | Add a component to the current project |
typecad add package | Create a reusable component package |
typecad build | Build KiCad output from typeCAD source |
typecad search | Search KiCad schematic symbols |
typecad import | Convert a KiCad PCB file to typeCAD code |
typecad diff | Compare two KiCad PCB files visually |
typecad doc | Generate PCB documentation from Markdown |
typecad doctor | Check your environment for common issues |
typecad validate | Validate project source without a full build |
typecad drc | Run Design Rule Check on a KiCad PCB file |
typecad erc | Run Electrical Rules Check on a KiCad schematic |
The diff and doc commands are the same tools that were previously separate packages, now accessible without an additional install.
Text, value, silkscreen, and fab positioning
Components now accept layout properties that control where and how text appears on the board. Three layout properties are available:
referenceLayout– Controls the reference designator text position (defaults to F.SilkS)valueLayout– Controls the value text position (defaults to F.Fab)fabLayout– Controls fabrication layer text (defaults to F.Fab)
Each accepts position, rotation, layer, font size, thickness, and justification:
let r1 = new Component({
footprint: 'Resistor_SMD:R_0603_1608Metric',
reference: 'R1',
referenceLayout: { x: 0, y: -1.5, rotation: 90, width: 0.8, height: 0.8 },
valueLayout: { x: 0, y: 1.5, width: 0.6, height: 0.6 },
fabLayout: { x: 0, y: 0, text: 'R1' },
});Arbitrary text entries can also be added to any component via the text property, which accepts an array of positioned and styled text objects.
Simplified component API
The Component constructor now accepts a single ComponentInit object with all properties optional. The previous IComponent type is deprecated. Components can be created with minimal configuration:
let R1 = new Component({ value: '1kohm' });The Package base class was also rewritten. Components assigned to this inside a build() method are collected automatically, so there is no need to push them into an array manually. Helper methods for net(), via(), track(), and add() are provided on the base class.
Breaking changes
@typecad/typecad-docgenand@typecad/typecad-gitdiffare no longer published separately. Use thetypecad docandtypecad diffcommands, or import from@typecad/typecad/docgenand@typecad/typecad/diff.- The
IComponenttype alias is deprecated in favor ofComponentInit. - The CLI entry points from previous separate packages have been replaced by the
typecadbinary.