Thanks for contributing to feature-env.
For package installation and usage examples, see README.md.
- Node.js 18+ (recommended)
- npm
- Git
npm install- Build package:
npm run build - Build test output:
npm run build:test - Run tests:
npm test - Full verification (build + tests):
npm run check
Build scripts use npm lifecycle hooks:
prebuildrunscleanbuildcompiles TypeScript todist/postbuildverifies required build outputs existprebuild:testrunsclean:testbuild:testcompiles test TypeScript to.test-dist/postbuild:testverifies required test build outputs exist
src/- package source codetest/- TypeScript tests.test-dist/- compiled test outputexamples/- runnable usage examples
- Create a branch from
main. - Make focused changes.
- Run
npm run check. - Commit with a clear message.
- Open a pull request.
Use concise, descriptive messages. Examples:
feat: add strict unknown env key validationfix: improve enum validator error detaildocs: add strict mode usage exampletest: cover optionalEnv strict unknown keys
- Code is focused and readable
- New behavior includes tests
- Existing tests still pass
- README/docs updated if behavior changed
- Add tests near related behavior in
test/*.test.ts. - Prefer small, explicit test cases for:
- missing keys
- invalid values
- group selection behavior
- strict unknown key handling (if touched)
This project follows SemVer:
- Patch: bug fixes (
1.2.0 -> 1.2.1) - Minor: backward-compatible features (
1.2.0 -> 1.3.0) - Major: breaking changes (
1.x.x -> 2.0.0)
Release flow:
npm run check
npm version <patch|minor|major>
npm publish --access public
git push && git push --tagsWhen opening an issue, include:
- Expected behavior
- Actual behavior
- Minimal reproduction
- Node/npm versions
- Relevant env keys/schema snippet (if applicable)