Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/guides/running-tscircuit/platform-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ await circuitRunner.renderUntilSettled()
const circuitJson = await circuitRunner.getCircuitJson()
```

## External Vendor Integrations

You can provide them through a custom platform configuration instead.

For a concrete example, see
[Using ti-parts-engine](./using-ti-parts-engine). That guide shows:

- how to provide a custom TI-backed `partsEngine`
- how to enable explicit `footprint="ti:..."` strings when needed
- how to keep partner-token usage in local tooling instead of browser clients

Comment on lines +92 to +102
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure we should call out TI specifically in the general platform configuration guide

:::info
Interested in running the entire tscircuit platform privately inside your company?
We're happy to help! Reach out to **enterprise@tscircuit.com**
Expand Down
109 changes: 109 additions & 0 deletions docs/guides/running-tscircuit/using-ti-parts-engine.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Using ti-parts-engine
description: Configure TI-backed part lookup and explicit `ti:` footprints through a custom platform config
sidebar_position: 5
---

`@tscircuit/ti-parts-engine` helps you provide TI-backed behavior through a
custom platform configuration in local development workflows.

This guide assumes `@tscircuit/ti-parts-engine` is available in your local
development environment.

## Use TI as a Custom Parts Engine

If your local tooling loads a JS/TS platform config module, you can keep the TI
parts engine in a `tscircuit.config.ts`-style file:

```ts
import { createTiPartsEngine } from "@tscircuit/ti-parts-engine"

export default {
platformConfig: {
partsEngine: createTiPartsEngine({
// local CLI/dev usage only
partnerToken: process.env.PARTNER_TOKEN!,
}),
},
}
```

This wires TI-backed automatic part lookup through `platform.partsEngine`.

:::info
Keep `PARTNER_TOKEN` in local development tooling only. Do not expose it to
browser clients or commit it to your repository.
:::

## Use Explicit `ti:` Footprint Strings

If you want to use explicit footprint strings such as
`footprint="ti:MSP430"`, you also need a TI footprint library mapping. The
easiest way to wire both pieces together is `createTiPlatformConfig(...)`:

```ts
import { createTiPlatformConfig } from "@tscircuit/ti-parts-engine"

export default {
platformConfig: createTiPlatformConfig({
partnerToken: process.env.PARTNER_TOKEN!,
}),
}
```

This configures:

- `partsEngine` for TI-backed part lookup
- `footprintLibraryMap.ti` for explicit `ti:` footprint strings

If you only provide `createTiPartsEngine(...)`, automatic TI part lookup works,
but the `ti:` footprint prefix is not added by itself.

## Example User Project Files

If your local tooling supports a JS/TS platform config module, a minimal TI
footprint project can look like this:

`index.circuit.tsx`

```tsx
export default () => (
<board width="20mm" height="20mm">
<chip name="U1" footprint="ti:MSP430" />
</board>
)
```

`tscircuit.config.ts`

```ts
import { createTiPlatformConfig } from "@tscircuit/ti-parts-engine"

export default {
platformConfig: createTiPlatformConfig({
// local CLI/dev usage only
partnerToken: process.env.PARTNER_TOKEN!,
}),
}
```

This is a local CLI/dev style workflow. Do not expose a real `PARTNER_TOKEN`
to browser clients.

## Programmatic Usage

You can also pass the same `createTiPlatformConfig(...)` result directly when
creating a runner or root circuit:

```ts
import { RootCircuit } from "@tscircuit/core"

const circuit = new RootCircuit({
platform: createTiPlatformConfig({
partnerToken: process.env.PARTNER_TOKEN!,
}),
})
```

For more background on platform customization, see
[Platform Configuration](./platform-configuration).
51 changes: 20 additions & 31 deletions docs/guides/tscircuit-essentials/tscircuit-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,29 @@ The `tscircuit.config.json` file is a project-level configuration file that allo
```json
{
"mainEntrypoint": "lib/circuits/main-board.tsx",
"ignoredFiles": [
"dist",
"build",
"coverage",
"*.log",
".DS_Store",
"temp"
]
"ignoredFiles": ["dist", "build", "coverage", "*.log", ".DS_Store", "temp"]
}
```

## Configuration Options

| Property | Description |
| --- | --- |
| `$schema` | [Optional JSON schema reference for editor tooling.](#schema) |
| `mainEntrypoint` | [Primary entry file for builds and dev workflows.](#mainentrypoint) |
| `previewComponentPath` | [Overrides which component is used for preview images/GLTF.](#previewcomponentpath) |
| `siteDefaultComponentPath` | [Default component shown in generated static sites.](#sitedefaultcomponentpath) |
| `ignoredFiles` | [Extra file and directory ignore patterns for CLI workflows.](#ignoredfiles) |
| `includeBoardFiles` | [Glob list for which board files are built or snapshotted.](#includeboardfiles) |
| `snapshotsDir` | [Centralized directory for snapshot outputs.](#snapshotsdir) |
| `prebuildCommand` | [Command to run before builds.](#prebuildcommand) |
| `buildCommand` | [Override command used for cloud builds.](#buildcommand) |
| `kicadProjectEntrypointPath` | [Entry file for KiCad project generation.](#kicadprojectentrypointpath) |
| `kicadLibraryEntrypointPath` | [Entry file for KiCad footprint library generation.](#kicadlibraryentrypointpath) |
| `kicadLibraryName` | [Name for the generated KiCad library.](#kicadlibraryname) |
| Property | Description |
| --------------------------------- | ----------------------------------------------------------------------------------- |
| `$schema` | [Optional JSON schema reference for editor tooling.](#schema) |
| `mainEntrypoint` | [Primary entry file for builds and dev workflows.](#mainentrypoint) |
| `previewComponentPath` | [Overrides which component is used for preview images/GLTF.](#previewcomponentpath) |
| `siteDefaultComponentPath` | [Default component shown in generated static sites.](#sitedefaultcomponentpath) |
| `ignoredFiles` | [Extra file and directory ignore patterns for CLI workflows.](#ignoredfiles) |
| `includeBoardFiles` | [Glob list for which board files are built or snapshotted.](#includeboardfiles) |
| `snapshotsDir` | [Centralized directory for snapshot outputs.](#snapshotsdir) |
| `prebuildCommand` | [Command to run before builds.](#prebuildcommand) |
| `buildCommand` | [Override command used for cloud builds.](#buildcommand) |
| `kicadProjectEntrypointPath` | [Entry file for KiCad project generation.](#kicadprojectentrypointpath) |
| `kicadLibraryEntrypointPath` | [Entry file for KiCad footprint library generation.](#kicadlibraryentrypointpath) |
| `kicadLibraryName` | [Name for the generated KiCad library.](#kicadlibraryname) |
| `alwaysUseLatestTscircuitOnCloud` | [Force latest tscircuit version in cloud builds.](#alwaysuselatesttscircuitoncloud) |
| `build` | [Build output toggles for CLI builds.](#build) |
| `pcbSnapshotSettings` | [Rendering options for PCB snapshots and preview images.](#pcbsnapshotsettings) |
| `build` | [Build output toggles for CLI builds.](#build) |
| `pcbSnapshotSettings` | [Rendering options for PCB snapshots and preview images.](#pcbsnapshotsettings) |

### $schema

Expand Down Expand Up @@ -136,13 +129,7 @@ Specifies paths or directory names that should be ignored when the dev server sy

```json
{
"ignoredFiles": [
"dist",
"build",
".git",
"*.log",
"temp"
]
"ignoredFiles": ["dist", "build", ".git", "*.log", "temp"]
}
```

Expand Down Expand Up @@ -353,6 +340,7 @@ Toggle build outputs for `tsci build`.
```

**Options:**

- `circuitJson` (`boolean`): Enable circuit JSON output in build.
- `kicadProject` (`boolean`): Enable KiCad project output (`.kicad_pro`, `.kicad_sch`, `.kicad_pcb`) in build.
- `kicadLibrary` (`boolean`): Enable KiCad library output in build.
Expand Down Expand Up @@ -381,6 +369,7 @@ Controls rendering options for PCB images generated by `tsci snapshot` and `tsci
```

**Options:**

- `showCourtyards` (`boolean`): Render courtyard outlines around components. Courtyards define the keepout boundary for a footprint. Defaults to `false`.
- `showPcbNotes` (`boolean`): Render PCB notes layer in the output image. Defaults to `false`.
- `showFabricationNotes` (`boolean`): Render fabrication notes layer in the output image. Defaults to `false`.
Expand Down
Loading