honeybadger-js
honeybadger-js copied to clipboard
Universal JavaScript library for reporting errors to Honeybadger.io :zap:
Honeybadger for JavaScript
Welcome! This is the monorepo which holds all Honeybadger packages for JavaScript.
Documentation and Support
For comprehensive documentation and support, check out our documentation site.
Changelog
-
CHANGELOG.md is updated when a new version is released (
npm run release). The rootCHANGELOG.mdhas a collective changelog from changes in all the packages of the monorepo. Each package also has its ownCHANGELOG.mdwith changes related only to itself. -
Conventional Commits are enforced with a Git hook (via husky + commitlint) in order to automate changelog generation.
Contributing
- Fork the repo.
- Create a topic branch
git checkout -b my_branch - Commit your changes
git commit -am "chore: boom" - Push to your branch
git push origin my_branch - Send a pull request
Development
We use Lerna to manage the monorepo. It helps us:
- link between packages,
- generate changelogs and bump versions (based on conventional commits) and
- publish to NPM
- Run
npm installfrom the monorepo root. - Run
npm testfrom the monorepo root to run unit tests for all packages.
Lerna Tips
- Always install from the root, i.e.
npm installonly from the root folder, otherwise you may get unexpected issues with the linked packages. - Use
lerna add my-pkg --scope="@honeybadger-io/js"to addmy-pkgin the@honeybadger-io/jsproject. Or you can manually add to the target project'spackage.jsonfile. You still need to runnpm installfrom the root. - Use
lerna runto execute commands for all projects. If the command is not found it will not be executed. You can filter the packages using--scope. For example,lerna run testwill executenpm run testto all packages that have this script available.
For more info, you can read the docs.
Troubleshooting TypeScript
- Not seeing changes when working in
.tsfiles? Make sure that you rebuild every time you make a change. Or enable "compile on save" with your IDE - WebStorm(Jetbrains) / VS Code. - If you are getting errors with Typescript, make sure that you do
npm run build. It's a prerequisite for Typescript Project References.
Releasing
All packages in the monorepo are released in fixed mode, meaning that releasing a new version of one package also creates a release in that version for the other packages.
Releasing is done using npm run release. This command calls lerna publish, which does the following:
- generates changelog based on the commit messages (see Changelog above)
npm versionnpm publish
Note: some packages may have a postpublish script, for example @honeybadger-io/js (found in packages/js) has a script to also publish to our js.honeybadger.io CDN (hosted on AWS via S3/CloudFront).
Release Automation
For the moment, there are no automated releases. You can manually trigger a new release using the Publish New Release (lerna-publish.yml) workflow.
Note: only users with write permissions can trigger this workflow (i.e. Collaborators).
Available Commands
npm run release- Calculates the next version, commits and publishes to NPM (and to our CDN). This command is executed from the Publish New Release workflow.
License
The Honeybadger gem is MIT licensed. See the MIT-LICENSE file in this repository for details.