typeCAD 0.3 Release

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/typecad

Both 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:

CommandDescription
typecad createCreate a new typeCAD project
typecad add componentAdd a component to the current project
typecad add packageCreate a reusable component package
typecad buildBuild KiCad output from typeCAD source
typecad searchSearch KiCad schematic symbols
typecad importConvert a KiCad PCB file to typeCAD code
typecad diffCompare two KiCad PCB files visually
typecad docGenerate PCB documentation from Markdown
typecad doctorCheck your environment for common issues
typecad validateValidate project source without a full build
typecad drcRun Design Rule Check on a KiCad PCB file
typecad ercRun 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-docgen and @typecad/typecad-gitdiff are no longer published separately. Use the typecad doc and typecad diff commands, or import from @typecad/typecad/docgen and @typecad/typecad/diff.
  • The IComponent type alias is deprecated in favor of ComponentInit.
  • The CLI entry points from previous separate packages have been replaced by the typecad binary.