Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
aed95bf
Research: SolidCraft designs (.sc) – container, links, properties, BO…
Nov 21, 2026
8097aba
SolidCraft designs: preview image from the embedded thumbnail (#364)
Nov 21, 2026
8e5fdc9
SolidCraft assemblies: linked designs as file references (#365)
Nov 21, 2026
798fa14
Desktop: show SolidCraft designs that are open in SolidCraft (#370)
Nov 21, 2026
d1bbba6
Desktop: STEP export of SolidCraft designs via solidcraft-cli on ever…
Nov 21, 2026
63f614e
Desktop: module order (rustfmt)
Nov 21, 2026
808bb2a
Desktop: module order (rustfmt)
Nov 21, 2026
fbf255a
Desktop: write item number and revision into SolidCraft designs (#369)
Nov 21, 2026
007a956
TeamCraft plugin for SolidCraft (plugins/solidcraft)
Nov 21, 2026
c753ad5
SolidCraft plugin: type alias for the design properties (clippy)
Nov 22, 2026
cfe7d80
Merge main (#384 = #363, already contained)
Nov 22, 2026
8d6e9ba
Merge H385 state (already merged into main)
Nov 22, 2026
71bf8db
Merge main (contains the squashed base PRs)
Nov 22, 2026
3cc4c08
Merge H386 state (already merged into main)
Nov 22, 2026
9486be6
Merge main (contains the squashed base PRs)
Nov 22, 2026
e6bbeac
Merge H387 state (already merged into main)
Nov 22, 2026
907a055
Merge main (contains the squashed base PRs)
Nov 22, 2026
aeac502
Merge H389 state (already merged into main)
Nov 22, 2026
21d530a
Merge main (contains the squashed base PRs)
Nov 22, 2026
1e321b6
Merge H390 state (already merged into main)
Nov 22, 2026
7e2b9bd
Merge main (contains the squashed base PRs)
Nov 22, 2026
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
60 changes: 60 additions & 0 deletions .github/workflows/solidcraft-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# The TeamCraft plugin for SolidCraft (plugins/solidcraft): formatting,
# lints and tests on Linux, then the WebAssembly component, checked to import
# nothing but SolidCraft's plugin interface, kept as an artifact. Its own
# Cargo project – never part of the server or desktop build.
name: SolidCraft plugin

on:
push:
branches: [main]
paths: ["plugins/solidcraft/**", ".github/workflows/solidcraft-plugin.yml"]
pull_request:
paths: ["plugins/solidcraft/**", ".github/workflows/solidcraft-plugin.yml"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: solidcraft-plugin-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
plugin:
name: SolidCraft plugin
runs-on: ubuntu-24.04
timeout-minutes: 20
defaults:
run:
working-directory: plugins/solidcraft
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: plugins/solidcraft
- uses: taiki-e/install-action@v2
with:
tool: wasm-tools
- name: Formatting
run: cargo fmt --check
- name: Clippy (tests on this computer)
run: cargo clippy --all-targets -- -D warnings
- name: Tests
run: cargo test
- name: Clippy (the component)
run: cargo clippy --release --target wasm32-unknown-unknown -- -D warnings
- name: Build the package
run: ./build.sh
- uses: actions/upload-artifact@v4
with:
name: teamcraft-solidcraft-plugin
path: plugins/solidcraft/target/package/teamcraft
if-no-files-found: error
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ see the notices in the README.
SolidCraft design's properties (and TeamCraft's ids and server under
`teamcraft.pdm`) through `solidcraft-cli`; refused while the design is
read-only or open in SolidCraft.
- **TeamCraft plugin for SolidCraft** (`plugins/solidcraft`). A WebAssembly
component for SolidCraft's plugin runtime: *TeamCraft status*, *Check for
TeamCraft* (part numbers, BOM rows, linked designs), *Link to TeamCraft
item* and *Unlink*; works offline on the open design. Built and tested by
the new workflow *SolidCraft plugin*.

## [0.2.11] - 2026-11-21

Expand Down
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ desktop/ TeamCraft Desktop (Tauri 2, own Cargo project – never part
new-files.js + desktop/src/newfiles.rs = new items from local files, worklist *New on this computer* (#359);
desktop/src/localserver.rs = *Try TeamCraft on this computer* (starts the bundled teamcraft-server local);
tauri.local-server.conf.json = the *with local server* installers (externalBin teamcraft-server + postgresql/)
plugins/solidcraft TeamCraft plugin for SolidCraft: WebAssembly component (craft:plugin@0.2.0, wit/plugin.wit = SolidCraft's
interface, MIT), own Cargo project; src/logic.rs = status, check, link, unlink over SolidCraft's commands
(fake host in tests); build.sh → target/package/teamcraft; workflow solidcraft-plugin.yml
```

## Conventions
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ end-to-end tests against a real PostgreSQL.
- **SolidCraft and FieldCraft** – [SolidCraft](https://github.com/tangency-labs/solidcraft)
designs (`.sc`, checked by content) and
[FieldCraft](https://github.com/tangency-labs/fieldcraft) models (`.fieldcraft`) are recognised, SolidCraft's embedded picture is the preview image, linked designs are
file references with quantities, the desktop app exports designs to STEP with `solidcraft-cli`, and their STEP and 3MF
file references with quantities, the desktop app exports designs to STEP with `solidcraft-cli`, a TeamCraft plugin for SolidCraft shows and checks the design's TeamCraft item inside SolidCraft, and their STEP and 3MF
exports previewed –
design, export and analysis in one revision ([more](https://warr-ev.github.io/TeamCraft/reference/interop.html)).

Expand Down Expand Up @@ -556,6 +556,7 @@ Third-party components (complete list with versions in `Cargo.lock` and
| futures-core | desktop app: cancellable streamed uploads | MIT / Apache-2.0 |
| Montserrat, Oswald | fonts | SIL OFL 1.1 |
| libfuzzer-sys (libFuzzer) | fuzz targets in `fuzz/` only, never shipped | MIT / Apache-2.0 (libFuzzer: Apache-2.0 with LLVM exception) |
| wit-bindgen; SolidCraft's plugin interface (`plugins/solidcraft/wit/plugin.wit`, unchanged) | the TeamCraft plugin for SolidCraft in `plugins/solidcraft` only, never in the server or desktop app | Apache-2.0 WITH LLVM-exception / MIT / Apache-2.0; WIT file: MIT |

SolidWorks, NX, Creo, CATIA, Inventor, Fusion,
Revit and the other product names are trademarks of their respective
Expand Down
2 changes: 2 additions & 0 deletions docs/OPEN_WORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,8 @@ real files and belong to section 3 once such files are at hand.
- [x] Desktop: item number and revision written into the design properties (#369); left: automatically at check-out (a setting), link paths after a rename
- [x] Desktop: designs open in SolidCraft (lock file) shown, warning at check-in (#370)
- [ ] (research first) 3D preview from the `.sc` file alone (#371)
- [x] TeamCraft plugin for SolidCraft (`plugins/solidcraft`): status, check before check-in, link/unlink; left: tested
in a real SolidCraft, a release package, a *Check in* hand-over to the desktop app

### 5. Feature demand (backlog)

Expand Down
27 changes: 26 additions & 1 deletion docs/src/reference/interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,32 @@ references it.

The three projects share their approach – one Rust build, a desktop app and
a command line, open formats – but not code: TeamCraft is licensed under the
MPL-2.0 and does not include SolidCraft or FieldCraft code.
MPL-2.0 and does not include SolidCraft or FieldCraft code (the plugin for SolidCraft below contains SolidCraft's interface definition, MIT).

What TeamCraft reads from a `.sc` design, and the sources of those findings, are
recorded in the research page [SolidCraft designs](../research/solidcraft-design.md).

## TeamCraft plugin for SolidCraft

`plugins/solidcraft` is a plugin for SolidCraft's plugin runtime (a
WebAssembly component, `craft:plugin@0.2.0`, built by the workflow
*SolidCraft plugin*, see its [README](https://github.com/WARR-eV/TeamCraft/tree/main/plugins/solidcraft)).
SolidCraft's plugins have no network access, so it works on the open design
only – with the TeamCraft object the desktop app's *Item data* writes
(`teamcraft.pdm`):

* **TeamCraft status** – the item and revision of the design, the link to the
revision page, whether part number and revision still match;
* **Check for TeamCraft** – missing part numbers, a part number or revision
that differs from the linked item, BOM rows without a part number, one part
number with two descriptions, quantities SolidCraft cannot add up, linked
designs with an absolute path or the same file name twice;
* **Link to TeamCraft item** / **Unlink from TeamCraft** – write or remove the
item data from inside SolidCraft, for designs edited without the desktop
app.

Install: copy the package folder `teamcraft` into SolidCraft's plugins folder
(*Preferences › Plugins › Show in folder*) and enable it. The plugin is
TeamCraft's own code (MPL-2.0); it contains SolidCraft's interface definition
`plugin.wit` unchanged under SolidCraft's MIT licence, which a component for
SolidCraft's runtime needs.
6 changes: 5 additions & 1 deletion docs/src/research/solidcraft-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ All findings come from SolidCraft's public documentation and its source
code, licensed MIT OR Apache-2.0, as of SolidCraft 0.46.1 (commit
`18c9760e3`, <https://github.com/tangency-labs/solidcraft>). They were read as
a specification; TeamCraft's readers are its own code and no SolidCraft code
is copied or vendored (see [FieldCraft and SolidCraft](../reference/interop.md)).
is copied or vendored (see [FieldCraft and SolidCraft](../reference/interop.md)). The
TeamCraft plugin for SolidCraft (`plugins/solidcraft`) is the one exception:
it contains SolidCraft's plugin interface definition `plugin.wit`, unchanged
and under its MIT licence, because a component for SolidCraft's runtime is
built against it.

| Topic | Source |
|-------------------------------------------|------------------------------------------------------------|
Expand Down
28 changes: 28 additions & 0 deletions plugins/solidcraft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The TeamCraft plugin for SolidCraft – a WebAssembly component, built on its
# own (never part of the server or desktop build). See README.md.
[package]
name = "teamcraft-solidcraft-plugin"
version = "0.1.0"
edition = "2021"
license = "MPL-2.0"
description = "TeamCraft plugin for SolidCraft: TeamCraft item status, check before check-in, link a design to an item"
publish = false

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
serde_json = "1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wit-bindgen = "0.41"

[profile.release]
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"

# Not a member of another workspace.
[workspace]
58 changes: 58 additions & 0 deletions plugins/solidcraft/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# TeamCraft plugin for SolidCraft

A plugin for [SolidCraft](https://github.com/tangency-labs/solidcraft)
(open-source parametric CAD) that shows and checks a design's TeamCraft
data inside SolidCraft. It is a WebAssembly component for SolidCraft's
experimental plugin runtime (`craft:plugin@0.2.0`, capability
`commands@0.2`).

SolidCraft's plugins have no network access, so the plugin never talks to a
TeamCraft server. It works with what is in the open design: its properties,
the TeamCraft object the desktop app writes (*Item data*, key
`teamcraft.pdm`: item number, revision, item and revision ids, server), the
bill of materials and the linked designs. Check-out, check-in and the
working folder stay in the TeamCraft desktop app.

## Entries

All four are on the *TeamCraft* ribbon group (Plugins tab) and in the
Plugins menu.

| Entry | Effect | What it does |
|-------|--------|--------------|
| **status** – *TeamCraft status* | read | The TeamCraft item and revision the design belongs to, the page of the revision on the server, and whether the design's part number and revision still say the same. |
| **check** – *Check for TeamCraft* | read | What keeps the design from going into TeamCraft cleanly: no part number, a part number or revision that differs from the linked item, BOM rows without a part number, one part number with two descriptions, quantities SolidCraft cannot add up, linked designs with an absolute path or two linked designs with the same file name. `ready` is true when only notes are left. |
| **link** – *Link to TeamCraft item* | edit | Writes item number, revision and (optional) name into the design properties (*Part number*, *Revision*, *Description*) and TeamCraft's object – for designs edited without the desktop app. Ids written by the desktop app are kept while the item stays the same. One undo step; save the design afterwards. |
| **unlink** – *Unlink from TeamCraft* | edit | Removes TeamCraft's object; part number and revision stay. |

SolidCraft commands it calls (declared in `plugin.json`, none of them reads
or writes files): `document.metadata`, `document.metadata.set`,
`document.metadata.remove`, `assembly.bom`, `component.links`.

## Build

```sh
rustup target add wasm32-unknown-unknown
cargo install wasm-tools
./build.sh # → target/package/teamcraft/ (plugin.json, plugin.wasm, SHA256SUMS)
cargo test # the entries against a fake design, on this computer
```

`build.sh` checks that the component imports nothing but `craft:plugin@0.2.0`
(no WASI). The GitHub workflow *SolidCraft plugin* builds and tests it and
keeps the package as an artifact.

## Install

Copy the folder `teamcraft` (the package; the folder name must be the plugin
id) into SolidCraft's plugins folder – *Preferences › Plugins › Show in
folder* – enable it there and review the approval SolidCraft shows. Installing
or enabling never runs plugin code; SolidCraft asks before the first run.

## Licence and sources

The plugin is TeamCraft's own code under the MPL-2.0. `wit/plugin.wit` is
SolidCraft's interface definition (`crates/craft-plugin/wit/plugin.wit` at
SolidCraft commit `94096b84f`), unchanged, under SolidCraft's MIT licence
(`wit/LICENSE-MIT`); it is needed to build a component for SolidCraft's
plugin runtime. Background: `docs/src/research/solidcraft-design.md`.
28 changes: 28 additions & 0 deletions plugins/solidcraft/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Builds the TeamCraft plugin for SolidCraft: the package folder
# target/package/teamcraft/ with plugin.json and plugin.wasm (a WebAssembly component).
# Needs the wasm32-unknown-unknown target (rustup target add
# wasm32-unknown-unknown) and wasm-tools (cargo install wasm-tools).
set -euo pipefail
cd "$(dirname "$0")"

cargo build --release --target wasm32-unknown-unknown
core=target/wasm32-unknown-unknown/release/teamcraft_solidcraft_plugin.wasm
out=target/package/teamcraft
rm -rf "$out"
mkdir -p "$out"
# the core module + the component type wit-bindgen embedded → a component
wasm-tools component new "$core" -o "$out/plugin.wasm"
wasm-tools validate "$out/plugin.wasm"
# SolidCraft refuses WASI and anything outside craft:plugin@0.2.0
imports=$(wasm-tools component wit "$out/plugin.wasm" | grep -E '^\s*import ' || true)
echo "Imports:"
echo "$imports"
if grep -vqE 'craft:plugin/[a-z-]+@0\.2\.0' <<<"$imports"; then
echo "error: the component imports something other than craft:plugin@0.2.0" >&2
exit 1
fi
cp plugin.json README.md "$out/"
cp ../../LICENSE "$out/LICENSE"
(cd "$out" && sha256sum plugin.json plugin.wasm > SHA256SUMS)
echo "Package: $out"
53 changes: 53 additions & 0 deletions plugins/solidcraft/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"id": "teamcraft",
"name": "TeamCraft",
"version": "0.1.0",
"description": "TeamCraft item of the design, a check before checking it in to TeamCraft, and linking a design to a TeamCraft item. Works offline on the open design.",
"capabilities": ["commands@0.2"],
"runtime": {
"module": "plugin.wasm",
"entries": [
{
"name": "status",
"effect": "read",
"input_schema": {"type": "object", "properties": {}},
"slots": [{"kind": "ribbon", "name": "TeamCraft"}]
},
{
"name": "check",
"effect": "read",
"input_schema": {"type": "object", "properties": {}},
"slots": [{"kind": "ribbon", "name": "TeamCraft"}]
},
{
"name": "link",
"effect": "edit",
"input_schema": {
"type": "object",
"required": ["item_number", "revision"],
"properties": {
"item_number": {"type": "string", "title": "Item number", "maxLength": 256},
"revision": {"type": "string", "title": "Revision", "maxLength": 256},
"name": {"type": "string", "title": "Item name", "maxLength": 256},
"server": {"type": "string", "title": "TeamCraft server (https://…)", "maxLength": 256}
}
},
"slots": [{"kind": "ribbon", "name": "TeamCraft"}]
},
{
"name": "unlink",
"effect": "edit",
"input_schema": {"type": "object", "properties": {}},
"slots": [{"kind": "ribbon", "name": "TeamCraft"}]
}
],
"commands": [
"document.metadata",
"document.metadata.set",
"document.metadata.remove",
"assembly.bom",
"component.links"
],
"limits": {"fuel": 50000000, "memory_mib": 64, "deadline_ms": 10000}
}
}
Loading
Loading