-
Create a normal feature branch from
main. -
Create the workspace with the repository generator:
pnpm create:prototype -- --name example --title "Example" --description "What the prototype explores." -
If a specification exists, pass
--spec path/to/SPEC.mdand read the copiedSPEC.mdbefore coding. -
Work inside
prototypes/<prototype>/. Useroamjs-componentsandrunExtensiondirectly. -
Run
pnpm test,pnpm build, andpnpm prepare:artifacts. -
Open a pull request and use its preview URL for testing in Roam.
Prototype directory names must be lowercase kebab-case.
The generator options are:
--dry-runreports the files and URLs without writing.--skip-installavoids runningpnpm install --ignore-scripts.--adopt-existingfills a placeholder that contains onlyREADME.mdand optionalSPEC.md, preserving those documents.--spec <markdown-file>copies a specification asSPEC.md.
Do not hand-copy packages/extension-base/template. The generator is the supported way to create a workspace and keeps dependency/catalog references consistent.
The starter's runExtension wrapper handles extension lifecycle registration. In production, it also reports load failures through SamePage and may include the graph name and extension settings. Do not put credentials or sensitive data in settings.
An installable prototype must produce:
prototypes/<prototype>/
├── README.md
└── dist/
└── extension.js
dist/extension.css and either CHANGELOG.md or dist/CHANGELOG.md are optional. A dist/README.md may override the repository README in the published artifact.
Only these public files are deployed:
extension.jsREADME.mdextension.cssCHANGELOG.md
Source maps, package metadata, tests, fixtures, and source files are never deployed by the shared publisher. Any unexpected build output fails artifact preparation.
CI builds without secrets. After it succeeds, the trusted publishing workflow uploads the packaged output to:
https://discoursegraphs.com/releases/prototypes/previews/<branch-slug>/<prototype>/
The publishing workflow creates a Roam prototype previews comment on the pull request with the exact URL to paste into Roam. Later commits on the same branch overwrite the preview and update that comment instead of adding another one.
Merging to main publishes the stable URL.