Welcome! This monorepo contains all Honeybadger packages for JavaScript. Refer to each package's README for more information and setup instructions:
- @honeybadger-io/core
The core package that integrates with the Honeybadger API - @honeybadger-io/js
SDK for browsers, Node.js, and AWS Lambda - @honeybadger-io/webpack
Webpack plugin for uploading source maps to Honeybadger - @honeybadger-io/vue
SDK for Vue.js integration - @honeybadger-io/react
SDK for React integration - @honeybadger-io/nextjs
SDK for Next.js integration - @honeybadger-io/gatsby-plugin-honeybadger
Gatsby plugin - @honeybadger-io/react-native
SDK for React Native integration - @honeybadger-io/rollup-plugin
Rollup/Vite plugin for uploading source maps to Honeybadger - @honeybadger-io/esbuild-plugin
esbuild plugin for uploading source maps to Honeybadger - @honeybadger-io/plugin-core
Utility functions shared by the Rollup, Webpack, and esbuild plugins
For comprehensive documentation and support, see our docs: https://docs.honeybadger.io/lib/javascript/index.html
-
Each package's
CHANGELOG.mdis updated when a new version is released (npm run release). -
Conventional Commits are enforced with a Git hook (via husky + commitlint) in order to automate changelog generation.
- 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
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.
- 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.
Tip
For more info, you can read the docs.
- 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 run
npm run build. It's a prerequisite for TypeScript Project References.
Packages in the monorepo are released in independent mode, meaning that Lerna will decide which packages to release and what version bump to apply based on the commits since the last release.
Releases are performed via GitHub Actions, which run npm run release. That command calls lerna publish, which:
- generates the changelog based on commit messages (see Changelog above)
- runs
npm version - runs
npm 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).
The repository automatically releases new packages when a PR is merged on master using the Publish New Release workflow (lerna-publish.yml).
Important
NPM releases are authorized through NPM Trusted Publishing. Only one workflow can be configured as a Trusted Publisher at a time. Keep the scheduled workflow configured by default. If you need to manually trigger a different workflow, temporarily switch NPM Trusted Publishing to that workflow, and revert back to the scheduled workflow afterward.
Warning
Only users with write permissions can trigger this workflow (i.e. Collaborators).
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.
This Honeybadger repository and published packages are MIT licensed. See the MIT-LICENSE file in this repository for details.