Skip to content

Development

Prerequisites

  • Node.js 24+
  • uv (for building and previewing Zensical documentation)
  • pre-commit (for local git commit hooks)

Common Commands

# Install dependencies
npm install

# Watch mode for active plugin development
npm run dev

# Run Biome lint & format checks
npm run check

# Auto-fix formatting and safe lint issues
npm run check:fix

# Lint and format Markdown files with rumdl
npm run lint:md
npm run format:md

# Run strict TypeScript type validation
npm run typecheck

# Run tests with 100% coverage enforcement
npm run test:coverage

# Build production main.js and verify moment.js is not bundled
npm run build

Documentation with Zensical

User documentation lives in docs/ and is configured via zensical.toml.

# Local live preview
npm run docs:serve

# Production static site build (outputs to site/)
npm run docs:build

Code Quality Standards

  • TypeScript: Strict compiler flags including strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, and verbatimModuleSyntax.
  • Biome: Enforces formatting, import organization, strict lint rules, and cognitive complexity limits.
  • rumdl: Enforces Markdown linting and formatting across README.md and docs/ (configured in .rumdl.toml with the mkdocs flavor).
  • 100% Test Coverage: Vitest enforces 100% statements, branches, functions, and lines across src/.
  • External Moment.js: esbuild.config.mjs keeps obsidian and moment external, and scripts/verify-bundle.mjs fails the build if moment.js is ever bundled into main.js.

Pre-Commit Hooks

Install the configured pre-commit checks:

pre-commit install
pre-commit run --all-files

Releasing a New Version

Obsidian and BRAT match GitHub Release tag names against manifest.json's version using exact string equality, so release tags use bare SemVer without a v prefix (e.g. 0.1.0, 0.2.0-beta.1). The repository's .npmrc sets tag-version-prefix="" so npm version creates bare tags automatically.

Cutting a Pre-release (BRAT)

Keep manifest.json on main at the latest stable version so Obsidian's stable updater is never disrupted. Tag the commit you want to test and push the tag:

git tag 0.2.0-beta.1
git push origin 0.2.0-beta.1

The Release Plugin workflow detects the - pre-release suffix, runs all quality gates and 100% coverage tests, stamps "version": "0.2.0-beta.1" into the packaged release manifest.json (without modifying main), and publishes a GitHub Pre-release with main.js, manifest.json, styles.css, and chrono-sort-0.2.0-beta.1.zip.

Cutting a Stable Release

  1. Bump the version in package.json, manifest.json, and versions.json (and create the bare SemVer tag):

    npm version 0.2.0
    
  2. Push the commit and tag:

    git push origin main --follow-tags
    

The Release Plugin workflow verifies that the stable tag exactly matches manifest.json, runs all quality gates and 100% coverage tests, builds main.js, and publishes a regular GitHub Release with main.js, manifest.json, styles.css, and chrono-sort-0.2.0.zip.