mirror of
https://github.com/tim-hub/obsidian-bible-reference.git
synced 2026-07-22 06:00:26 +00:00
- Switch package manager/runtime/test-runner from pnpm+jest to Bun.
Remove pnpm-workspace.yaml + pnpm-lock.yaml; root package.json is now a
bun workspace ("workspaces": ["packages/*"]); add bun.lock.
- Move the Obsidian plugin source into packages/obsidian-bible-reference/
(src, scripts, tsconfig, eslint, prettier). The repo root remains the
installable plugin folder: manifest.json, versions.json, styles.css and
the built main.js stay at root.
- esbuild + version-bump resolve repo-root paths so the build emits main.js
to root and version-bump edits root manifest/versions from the package.
- Migrate plugin tests from jest to `bun test`. Only the provider test used
jest mocking; convert to bun:test (mock/spyOn). Mock the types-only
`obsidian` module via a bun test preload (bunfig.toml) since mock.module
is not hoisted like jest.mock.
- Root build builds packages in dependency order then the plugin; CI builds
before test because the plugin/tests import bible-reference-toolkit's dist.
- Update CI + release workflows to oven-sh/setup-bun; husky pre-commit,
dev-setup/release docs and VS Code tasks to bun.
- Pin plugin prettier to 3.8.3 (3.9.x reformats unrelated union types).
- Add @types/node to bible-reference-toolkit (was hoisted under pnpm).
Claude-Session: https://claude.ai/code/session_013pCNGDmUyfJia4tE4aWoYM
1.5 KiB
1.5 KiB
Dev Setup & Tooling
Stack
- Language: TypeScript → bundled
main.js(entry:packages/obsidian-bible-reference/src/main.ts) - Repo layout: Bun workspace monorepo. The repo root is the installable Obsidian plugin folder (
manifest.json,versions.json,styles.css, builtmain.js); all source lives underpackages/. - Package manager / runtime / test runner: Bun (required,
>=1.1) - Bundler: esbuild (
packages/obsidian-bible-reference/scripts/esbuild.config.mjs) - Types:
obsidiantype definitions - Packages:
obsidian-bible-reference(plugin),bible-reference-toolkit,bible-book-names-intl
Commands (run from the repo root)
bun install # install all workspace dependencies
bun run dev # watch mode (incremental build of the plugin)
bun run build # production build (type-check + bundle -> main.js at repo root)
bun test # run all package tests (bun test)
bun run lint # eslint the plugin package
bun run prettier # check formatting
Per-package scripts (e.g. lint:fix, prettier:fix, version) live in each package and can be run with:
bun run --filter obsidian-bible-reference lint:fix
bun run --filter obsidian-bible-reference prettier:fix
Release artifacts
main.js, manifest.json, and styles.css must be at the repo root (the plugin folder). The production build emits main.js there; CI attaches these files to the GitHub release on tag push.