diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..5706fae79 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +## Making changes + +1. Fork the repository. +2. Make changes. +3. Add tests in `test/`. +4. Run tests with `pnpm test`. + +## Release changes + +1. Merge PRs into dev branch. +2. Merge dev branch into main branch with `git checkout main && git merge dev` +3. Push main branch to remote with `git push` +4. GitHub action will create a release and publish it to npm. + +Feel free to improve this process by creating an issue or PR. diff --git a/src/lib/report-size.ts b/src/lib/report-size.ts index efd841e2f..75e91ab97 100644 --- a/src/lib/report-size.ts +++ b/src/lib/report-size.ts @@ -2,7 +2,7 @@ import * as colors from 'picocolors' import type { Logger } from '../log' const prettyBytes = (bytes: number) => { - if (bytes === 0) return '0 B' + if (bytes < 1024) return `${bytes} B` const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] const exp = Math.floor(Math.log(bytes) / Math.log(1024)) return `${(bytes / 1024 ** exp).toFixed(2)} ${unit[exp]}`