package-version-bisect
v0.1.0
Published
A CLI tool for pinpointing which package version introduced a bug or regression in your project.
Downloads
5
Maintainers
Readme
Package Version Bisect
Package Version Bisect is a tool inspired by git bisect that helps you identify which version of a package introduced a bug or regression in your project.
Usage
Package Version Bisect works by following a process similar to git bisect. Here’s how you can use it:
npx package-version-bisect --package <package-name> --good <good-version> --bad <bad-version>From there you will be prompted to test different versions of the package and mark them as good or bad based on whether they exhibit the issue.
It will use your preferred package manager to install the versions, given you run it in the same directory as your lockfile. If needed, you can provide a custom command through the --install parameter.
Reference
| Parameter | Description | Required | Example |
|--------------|--------------------------------------------------------------------------------------------------------|----------|-------------------------|
| --package | The name of the package | Yes | --package my-package |
| --good | A known good version of the package | Yes | --good 1.0.0 |
| --bad | A known bad version of the package | Yes | --bad 1.2.0 |
| --install | Command to run instead of npm install (useful when using another package manager or devDependencies) | No | --install "yarn add -D" |
Future improvements
- Improve algorithm by prioritizing testing major versions
- Support for custom test commands for automated testing
- Support recognizing the package manager (npm, yarn, etc.) even if not run at top level (same directory as lockfile)
- Automatically preserve the dependency type (ex. devDependencies) upon installation
- Support for private packages
- Add option to include pre-release versions like
3.0.2-rc.1(currently only includes stable versions)
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License.
