Thanks for your interest in improving this project! This guide outlines a simple, GitHub-friendly workflow to help your contributions land smoothly.
- Fork the repository from the
mainbranch - Create a topic branch off your fork’s
main(use prefixes likefeat/orfix//bug/) - Make changes with tests, keep coverage strong
- Run lint and tests locally
- Open a Pull Request from your fork/branch to this repository’s
main
- Fork this repo on GitHub (ensure the default branch is
main). - Clone your fork locally and set the upstream remote:
- origin → your fork
- upstream → https://github.com/rbonestell/vite-plugin-sri-gen
Follow a git-flow-like convention. Prefixes are encouraged:
- Features:
feat/<short-summary> - Bug fixes:
fix/<short-summary>orbug/<short-summary>
Start your work from the latest main.
- Requires Node.js 18+ (ESM-only project)
- Install dependencies using npm
Helpful scripts:
- Build:
npm run build - Lint:
npm run lint(ornpm run lint:fix) - Test (watch/interactive):
npm test - Test with coverage report:
npm run test:cov(outputs HTML and lcov undercoverage/)
- Write or update tests for every code change you make
- Strive for optimal coverage. Aim not to reduce overall coverage and add tests for new branches, edge cases, and failure modes
- The test runner is Vitest. Coverage is generated via V8; HTML reports live at
coverage/lcov-report/index.html
- TypeScript-first, ESM-only
- Linting is enforced via ESLint
- Tabs for indentation, semicolons required
- Common TypeScript rules (e.g., consistent type imports, no unused vars)
- Please run
npm run lintand address issues (ornpm run lint:fixwhere safe)
Use clear, descriptive commit messages. Multiple small, focused commits are fine. Squash on merge may be used. Conventional Commits are welcome but not required.
- Push your branch to your fork
- Open a PR from
your-fork:your-branch→rbonestell/vite-plugin-sri-gen:main - Fill out the description with:
- What changed and why
- Any related issues or links
- Notes on tests and potential impacts
PR checklist (please verify before submitting):
- Branch created from
mainand targetsmain - Tests added/updated for all changes
-
npm testpasses locally - Coverage is strong (no meaningful regressions);
npm run test:covreviewed -
npm run lintpasses (or is fixed) -
npm run buildcompletes successfully - Docs and types updated where relevant
A maintainer will review your PR and may request changes. Once approved and checks pass, it will be merged.
- File a GitHub Issue for bugs or feature discussions
- For security-sensitive concerns, please consider responsible disclosure via a private channel if applicable
By contributing, you agree that your contributions will be licensed under the MIT License of this repository.