msakowski_obsidian-library-.../CONTRIBUTING.md
Nils Schönwald 6f82523bd9 build: migrate test runner from Jest to Vitest
Replace Jest with Vitest to drop transitive dependencies flagged by Snyk
(@babel/core, ws@8.20.1, inflight); the lockfile shrinks from 745 to 568
packages. The 508-test suite and its wall-clock time are unchanged.

- Remove jest, jest-environment-jsdom, @swc/jest, @swc/core, @types/jest;
  add vitest + jsdom
- Add vitest.config.ts with resolve.alias mirroring the old
  moduleNameMapper; enable globals and the jsdom environment
- Convert all jest.* usages to vi.*; import Mock/Mocked/MockInstance
  types from vitest; @jest-environment -> @vitest-environment pragmas
- BibleTextFetcher curl fallback: lazy require() -> lazy import() so the
  module is mockable under Vitest (behaviour unchanged, desktop-only)
- Point CI, docs, and scripts at pnpm test:vitest
2026-07-02 22:02:21 +02:00

3.3 KiB
Raw Permalink Blame History

Contributing

Thank you for your interest in contributing to this project!

Before getting started, please take a moment to familiarize yourself with our guiding principles and contribution process.

Adding a Language

Want to add support for a new language? Head straight to LOCALIZATION.md for a step-by-step guide on how to do that.

Development Principles

Our development approach is driven by the following core principles:

  • Enhancing the integration between Obsidian and JW Library is our primary focus.
  • We strive to keep the plugin lightweight and free from unnecessary complexity.
  • Our design philosophy is opinionated—favoring a minimalist, keyboard-centric experience—while remaining open to thoughtful enhancements.
  • Writing should be a distraction-free experience.
  • We aim to be compatible with other well-established plugins and avoid interference. Please report issues if found. Known issues
  • We respect copyright laws and do not expose or reveal copyrighted content from JW Library.

Linting & Formatting

This project uses two linters:

  • ESLint (type-checked rules) — TypeScript/JavaScript source under src/
  • remark (remark-preset-lint-recommended + remark-gfm) — Markdown files
Command Purpose
pnpm test:lint Run ESLint and remark
pnpm test:lint-fix Run both with auto-fix
pnpm test:lint-ts ESLint only
pnpm test:lint-md remark only
pnpm test:lint-md-fix remark with --output to rewrite docs

Git hooks

Managed via simple-git-hooks (configured in package.json):

  • pre-commit — runs lint-staged, which lints (and auto-fixes) only staged files
  • pre-push — runs pnpm test:affected (ESLint + remark + tsc + Vitest on tests related to changes since origin/main); a push is aborted if any check fails. Use pnpm test for the full suite.

Install these for inline diagnostics matching CI:

Contribution Process

To ensure a smooth contribution, please follow these steps:

  1. Review Guidelines: Familiarize yourself with our contribution guidelines before starting.
  2. Bug Fixes: Feel free to submit pull requests (PRs) directly for bug fixes.
  3. New Ideas: For feature requests, enhancements, or ideas, please engage in the discussions section first. You can join existing topics or create new ones.
  4. Pre-PR Discussion: We strive to keep the plugin lightweight. Discussing your ideas before coding helps ensure alignment with our vision and saves you time and effort on work that might not be merged.
  5. Submit Your Work: Once theres agreement on the approach, submit your pull request with the proposed changes. Every contribution is valuable!

We appreciate your support in making this project better!