Short rules for working in this repo.
- This is a Go CLI project to inject environment variables into bundled javascript files.
- All changes must be clean and testable.
- See
magefile.gofor all available scripts
# setup
mage -v bootstrap# build single debug binary (current platform), outputs to root directory
mage -v build:debug# build all release binaries (cross platform), outputs to bin/
mage -v build:release# bundles all binaries into zips, ready for release/distribution
mage -v releasebin/output directory for binariescommand/package containing all CLI commandsnpm/npm release directoriesreactenv/core package for logictools/package for build tools. ensures tool dependencies are kept in syncui/package for terminal UI logicversion/package just for the version
- Add brief code comments for tricky or non-obvious logic.
- Tests are written in
Vitest - Everything should be tested, and be testable
- New behavior requires tests (unit or e2e).
A few tips to write better tests:
Russ Cox - Go Testing By Example
- Make it easy to add new tests.
- Use test coverage to find untested code.
- Coverage is no substitute for thought.
- Write exhaustive tests.
- Separate test cases from test logic (i.e use test case tables, separate from logic).
- Look for special cases.
- If you didn't add a test, you didn't fix the bug.
- Test cases can be in testdata files.
- Compare against other implementations.
- Make test failures readable.
- If the answers can change, wtite coed to update them.
- Code quality is limited by test quality.
- Scripts make good test cases.
- Improve your tests over time.
- Follow
CONTRIBUTING.mdprefix rules and lowercase messages.
- When answering questions, respond with high-confidence answers only: verify in code; do not guess.