Shipping nine packages from one repository
One private monorepo is the source; nine public repositories get exactly what Obsidian's directory needs, built in the open and signed by GitHub.
One source, nine public repositories
All of Tahoe lives in one repository: the theme, the eight plugins, a shared build, and the tests. Each package that's public has its own repository as well (obsidian-tahoe-run, -math, -code and so on), because Obsidian's community directory installs from one repository per package.
publish/sync.sh copies a package across. For a plugin built from src/ it mirrors the sources with rsync --delete, takes the package's own tests along, copies manifest.json, and records the release in versions.json, which maps each version to the oldest Obsidian it supports. The public repository never gets edited by hand, so the two can't drift.
Some code is only for my own vault. It's marked in the source with // @private on a line, or between @private-start and @private-end for a block, in JavaScript and CSS alike. The sync strips those markers' contents, then searches the public copy for the feature's name and fails if any trace is left. A leak would need the marker and that final check to both go wrong.
Releases anyone can verify
Every public repository has the same release workflow. Pushing a tag:
- checks that the tag matches
versioninmanifest.json, and stops if it doesn't; - installs with
npm ciand buildsmain.json GitHub's runner; - attests
main.js,manifest.jsonandstyles.csswithactions/attest, so anyone can rungh attestation verify main.js --repo krishnanefx/obsidian-tahoe-mathand confirm the file was built by that workflow from that commit; - creates a draft release whose notes are the annotated tag's message.
Nothing is published straight from CI. Before a draft goes live, the release script checks that every file has an attestation and that the main.js GitHub built is byte-for-byte the same as a local build of the same commit. If either check fails, the release stays a draft.
Tahoe Run's Python on iPhone and iPad downloads Pyodide at first use. The SHA-256 of each of Pyodide's core files is pinned in the plugin (CORE_SHA256 in src/pyodide.js). Packages are checked against the hashes in Pyodide's lock file. A download that doesn't match isn't kept.
A release queue with gates
Finished work doesn't go out in one push. Commits wait on a local queue branch in each public repository, and publish/queue/queue.tsv lists them in order with the date each is due and the tag, if it's a release. A scheduled task runs push-next.sh each morning, which for each due commit:
- replays it onto
main; - builds it and runs the package's tests, and stops if anything fails;
- pushes it, and for a tagged line pushes the tag, waits for the release workflow, runs the checks above and publishes the release;
- moves the line to
pushed.tsv.
If any step fails, nothing is pushed and the line stays where it is for the next run. Each release reaches users on its own, with its own notes, and a broken commit can't slip out behind a good one.
Tests
tests/run.sh runs every suite, and exits non-zero if any fails. On the last run, 305 tests passed:
| Suite | Tests |
|---|---|
| Plugins' logic (Code's lexer and quick fixes, Math, arXiv and DOI links, the semantic index) | 20 |
| Tahoe Run: unit and rich output | 167 |
| Tahoe Run: real programs in each installed language | 39 (11 more skip when a language isn't installed) |
| Tahoe Run: the Python kernel | 79 |
The unit suites run in plain Node, with stand-ins for Obsidian and CodeMirror. With --obsidian, the script also drives a hidden copy of Obsidian over the Chrome DevTools Protocol. The copy has its own settings folder and a fresh vault, and it never takes focus. The scenarios check that the plugins load cleanly, that Python runs, that suggestions and quick fixes appear, that the debugger and variables view work, and that export to Jupyter works. perf.py uses the same copy to measure idle CPU, time per keystroke and scrolling frame times, with each plugin turned off in turn, so a slowdown can be traced to one package.
Before a release, each public repository is also linted with eslint-plugin-obsidianmd, the checks Obsidian's automated review runs.
More write-ups: A notebook inside a note · Refraction in CSS and SVG · AI that stays on the Mac