Skip to content

Latest commit

 

History

History
59 lines (36 loc) · 1.99 KB

CONTRIBUTING.md

File metadata and controls

59 lines (36 loc) · 1.99 KB

Contributing

First of all, thanks for helping out! 🎉

I am happy to accept PRs that:

  • fix a bug, fix spelling, or bring in a new enhancement
  • have a well described PR description
  • include tests (though you can wait until an initial review before writing tests)
  • do not add dependencies if reasonably avoidable
  • do not break backward compatibility (unless there's a good reason)

If you are thinking of adding a new option to bibtex-tidy, please first open an issue to discuss the idea and consider the tradeoffs. With each new option comes new potential edge cases and additional complexity to the UI/CLI.

Making changes

What should I change?

Most of the time you'll just be wanting to edit files in the src/ directory.

Do not edit autogenerated files; these will be overwritten when bibtex-tidy is built. Autogenerated files are indicated with a comment at the top of the file.

Building

npm run build

This compiles the Typescript code, passes it through swc to ensure compatibility with older browsers and node versions, and outputs bibtex-tidy in three places:

  • CLI: bin/bibtex-tidy
  • web app: docs/
  • JS library: bibtex-tidy.js

Testing

npm test

Please add tests to test/. You may prefer to wait until your PR is reviewed before writing tests.

We use a bespoke test runner. This runs each test in the CLI, web app, and JS API. It also repeats each test multiple times to ensure the output is stable.

You can also view a coverage report by running npm run cover.

Adding dependencies

This project aims to use minimal 3rd party dependencies to minimise risks of introducing vulnerabilities. As of v1.8.5, there is only one direct dependency (Codemirror); all others are used for building bibtex-tidy.

The general advice is to avoid using a dependency unless it saves adding significant complexity to bibtex-tidy.

Cleaning up

Before you create a PR, please ensure you have run the biome linter and prettier on your code:

npm run check -- --write