Contributing
Quick start
Section titled “Quick start”Clone the repository and install dependencies:
git clone https://github.com/nandan-varma/purgeit.gitcd purgeitnpm installVerify everything
Section titled “Verify everything”Before opening a pull request, run the full verification:
npm run typechecknpm run lintnpm testnpm run buildRunning tests
Section titled “Running tests”Run the full suite:
npm testRun a single test file:
npx vitest run src/rules/merge.test.tsRun a specific test by name:
npx vitest run -t "test name substring"Working on the code
Section titled “Working on the code”- Keep
src/ui/as the only directory that imports React or Ink. The CI enforces this with a grep check. - TypeScript options are strict:
exactOptionalPropertyTypesandnoUncheckedIndexedAccessare enabled. - Vitest is configured with
fileParallelism: falsebecause tests spawn realduchild processes; parallel file execution can exhaustposix_spawnon macOS. - Do not add a
rootDirto tsconfig;test/fixtures/build-tmp-tree.tslives outsidesrc/. - Never add
#!/usr/bin/env nodeto source files; tsup’sbanner.jsadds the shebang during bundling.
Publishing
Section titled “Publishing”- Make sure the full verification passes.
- Use
npm versionto bump the version. - Push tags;
npm publishwill be handled by the CI workflow.
Documentation
Section titled “Documentation”Docs live in the docs/ directory and are built with Astro Starlight. To edit or preview them:
cd docsnpm installnpm run devWhen adding new CLI flags, config options, or exported APIs, please update the relevant docs page.