Development setup
Prerequisites
Section titled “Prerequisites”- Bun — primary package manager and runtime
- Node.js 18+ (used by some sub-tools like Playwright)
- Obsidian — for plugin testing
- Git
Optional for sharing your local dev server with others:
- Tailscale — for tailnet-only sharing
- Cloudflare Tunnel (via
bun x cloudflared) — for public URL sharing
Clone and install
Section titled “Clone and install”That installs the plugin’s dependencies. The docs site has its own separate node_modules in docs/ that gets installed automatically on first use of the orchestrator.
The local dev orchestrator — bun run serve
Section titled “The local dev orchestrator — bun run serve”From the repo root, bun run serve is an interactive menu wrapping every local workflow. It’s the recommended entry point for development — it handles cross-OS node_modules contamination automatically (e.g. rollup native binary mismatches when bouncing between WSL and Windows), auto-installs docs/node_modules on first run, and cleans up all spawned children on Ctrl+C.
Non-interactive shortcuts
Section titled “Non-interactive shortcuts”Windows double-click launchers
Section titled “Windows double-click launchers”Two .bat files at the repo root, for when you’d rather double-click than open a terminal:
| File | Runs | Use |
|---|---|---|
serve.bat | bun run serve | Interactive menu (docs / plugin / both / tunnel / tests) |
serve-docs.bat | bun run serve:docs | Docs dev server only → http://localhost:4321/crosswalker/ |
Both cd to the repo root first, so they work from anywhere, and pause on exit so the window stays open if something errors.
Plugin development workflow
Section titled “Plugin development workflow”Then:
- Open
test-vault/in Obsidian (File → Open vault → selecttest-vault) - Enable Crosswalker in Settings → Community plugins
- Trigger the plugin via command palette: Crosswalker: Import structured data
- Edits to
src/auto-rebuild. Reload the plugin in Obsidian (toggle in settings or Ctrl+R in the dev console) to pick up changes - Install the Hot Reload community plugin in
test-vault/for automatic plugin reloads on rebuild
Docs site development workflow
Section titled “Docs site development workflow”Opens the Astro dev server at http://localhost:4321/crosswalker/. HMR is active — edits to .mdx files hot-reload in the browser (with the exception of inline <style> blocks in MDX files, which sometimes require a full page refresh).
Do not open docs/ as an Obsidian vault — content files are .mdx, not .md. Use VS Code with the MDX extension for rich editing.
Running both in parallel
Section titled “Running both in parallel”Common when working on a feature that touches both plugin code and docs:
Starts the docs dev server and plugin watch build in the same terminal. Single Ctrl+C kills both cleanly.
Build commands (raw)
Section titled “Build commands (raw)”These all work standalone if you prefer not to use the orchestrator:
| Command | Description |
|---|---|
| Plugin | |
bun run dev | Plugin watch mode, outputs to test-vault |
bun run build | Plugin production build (type-check + bundle) |
bun run test | Plugin Jest unit tests |
bun run test:watch | Plugin unit tests in watch mode |
bun run lint | ESLint with obsidian-plugin rules (required for community plugin submission) |
bun run lint:fix | Auto-fix lint issues |
bun run e2e | Plugin E2E tests (WebdriverIO, requires Obsidian) |
| Orchestrator (interactive menu wraps the workflows below) | |
bun run serve | Interactive 8-mode menu — docs dev, plugin watch, parallel both, tunnel sharing, tests, MDX check |
bun run serve:docs | Shortcut: docs Astro dev server (mode 1) |
bun run serve:plugin | Shortcut: plugin watch build (mode 4) |
bun run serve:both | Shortcut: docs dev + plugin watch in parallel (mode 5) |
bun run serve:share | Shortcut: docs dev + Tailscale tunnel (mode 6) |
| Fixtures + spec | |
bun run fixtures | Regenerate Tier 1 test fixtures into test-vault/Frameworks/NIST-mini/ from tools/fixtures/synthetic/nist-mini.csv |
| Docs | |
cd docs && bun run dev | Docs Astro dev server |
cd docs && bun run build | Docs production build → docs/dist |
cd docs && bun run preview | Serve the built dist locally |
cd docs && bun run test:local | Docs Playwright E2E tests |
bun run check:mdx | Lightweight MDX syntax pre-check (catches bare braces, unclosed tags, frontmatter YAML errors) — fast (~1–2s) |
| Release | |
bun run version | Bumps version in manifest.json + versions.json; stages git changes for commit |
See the testing page for details on each test surface.
Project structure
Section titled “Project structure”First-time sanity check
Section titled “First-time sanity check”After cloning and bun install, verify the setup works:
If the plugin build or docs dev server fails with a rollup native-binary error (e.g. Cannot find module @rollup/rollup-<platform>), just re-run bun run serve — the orchestrator auto-detects the contamination and reinstalls docs/node_modules with the correct platform binaries.