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”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 |
|---|---|
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 |
bun run lint:fix | Auto-fix lint issues |
bun run e2e | Plugin E2E tests (WebdriverIO, requires Obsidian) |
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 |
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.