Skip to content

emergence-engineering/pcbjam-shared

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@pcbjam/shared

The contract between the PCBJam wasm-frontend (the GPL standalone KiCad editor) and any backend that serves projects to it.

This package is deliberately tiny and MIT-licensed so that anyone can implement a conforming backend. It defines:

  • The KiCad tool domainTOOLS, toolSchema, TOOL_LABELS, EXTENSION_TOOL, FILELESS_TOOLS.
  • The minimum read/load API a backend must expose for the editor to work — a ts-rest contract with listProjects, getProject, and listFiles.
  • The shared DTOsProject, ProjectFile, ProjectWithFiles, errorBody, and projectSlugSchema.

It does not define management/write operations (create, delete, upload), ownership, or auth — those belong to the application layer that builds on top of this contract.

Required binary route

The file-byte download is streamed binary and is intentionally not a ts-rest endpoint. A conforming backend must still expose:

GET /api/projects/:project/files/*   →   raw file bytes

The editor fetches it directly.

Usage

import { contract, type Tool, EXTENSION_TOOL } from "@pcbjam/shared";
import { initClient } from "@ts-rest/core";

const client = initClient(contract, { baseUrl: "http://localhost:3050" });
const res = await client.getProject({ params: { project: "demo" } });

License

MIT — see LICENSE.

About

Shared ts libs for the pcbjam web/frontend.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors