@honeybadger-io/js 4.0.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +13 -64
  2. package/dist/browser/honeybadger.d.ts +6 -6
  3. package/dist/browser/honeybadger.js +1791 -1694
  4. package/dist/browser/honeybadger.js.map +1 -1
  5. package/dist/browser/honeybadger.min.js +1 -1
  6. package/dist/browser/honeybadger.min.js.map +1 -1
  7. package/dist/browser/integrations/breadcrumbs.d.ts +3 -0
  8. package/dist/browser/integrations/event_listeners.d.ts +3 -0
  9. package/dist/browser/integrations/onerror.d.ts +4 -0
  10. package/dist/browser/integrations/onunhandledrejection.d.ts +3 -0
  11. package/dist/browser/integrations/timers.d.ts +3 -0
  12. package/dist/browser/transport.d.ts +8 -0
  13. package/dist/browser/{types/browser/util.d.ts → util.d.ts} +1 -0
  14. package/dist/server/async_store.d.ts +6 -0
  15. package/dist/server/{types/server/aws_lambda.d.ts → aws_lambda.d.ts} +1 -1
  16. package/dist/server/honeybadger.d.ts +8 -8
  17. package/dist/server/honeybadger.js +644 -504
  18. package/dist/server/integrations/uncaught_exception.d.ts +3 -0
  19. package/dist/server/integrations/unhandled_rejection.d.ts +3 -0
  20. package/dist/server/middleware.d.ts +5 -0
  21. package/dist/server/transport.d.ts +10 -0
  22. package/dist/server/{types/server/util.d.ts → util.d.ts} +3 -2
  23. package/honeybadger.d.ts +2 -2
  24. package/package.json +28 -40
  25. package/dist/browser/types/browser/integrations/breadcrumbs.d.ts +0 -2
  26. package/dist/browser/types/browser/integrations/event_listeners.d.ts +0 -2
  27. package/dist/browser/types/browser/integrations/onerror.d.ts +0 -3
  28. package/dist/browser/types/browser/integrations/onunhandledrejection.d.ts +0 -2
  29. package/dist/browser/types/browser/integrations/timers.d.ts +0 -2
  30. package/dist/browser/types/browser/transport.d.ts +0 -7
  31. package/dist/browser/types/browser.d.ts +0 -12
  32. package/dist/browser/types/core/client.d.ts +0 -37
  33. package/dist/browser/types/core/store.d.ts +0 -7
  34. package/dist/browser/types/core/types.d.ts +0 -160
  35. package/dist/browser/types/core/util.d.ts +0 -32
  36. package/dist/browser/types/server/async_store.d.ts +0 -5
  37. package/dist/browser/types/server/aws_lambda.d.ts +0 -10
  38. package/dist/browser/types/server/integrations/uncaught_exception.d.ts +0 -2
  39. package/dist/browser/types/server/integrations/unhandled_rejection.d.ts +0 -2
  40. package/dist/browser/types/server/middleware.d.ts +0 -4
  41. package/dist/browser/types/server/transport.d.ts +0 -9
  42. package/dist/browser/types/server/util.d.ts +0 -9
  43. package/dist/browser/types/server.d.ts +0 -17
  44. package/dist/server/types/browser/integrations/breadcrumbs.d.ts +0 -2
  45. package/dist/server/types/browser/integrations/event_listeners.d.ts +0 -2
  46. package/dist/server/types/browser/integrations/onerror.d.ts +0 -3
  47. package/dist/server/types/browser/integrations/onunhandledrejection.d.ts +0 -2
  48. package/dist/server/types/browser/integrations/timers.d.ts +0 -2
  49. package/dist/server/types/browser/transport.d.ts +0 -7
  50. package/dist/server/types/browser/util.d.ts +0 -18
  51. package/dist/server/types/browser.d.ts +0 -12
  52. package/dist/server/types/core/client.d.ts +0 -37
  53. package/dist/server/types/core/store.d.ts +0 -7
  54. package/dist/server/types/core/types.d.ts +0 -160
  55. package/dist/server/types/core/util.d.ts +0 -32
  56. package/dist/server/types/server/async_store.d.ts +0 -5
  57. package/dist/server/types/server/integrations/uncaught_exception.d.ts +0 -2
  58. package/dist/server/types/server/integrations/unhandled_rejection.d.ts +0 -2
  59. package/dist/server/types/server/middleware.d.ts +0 -4
  60. package/dist/server/types/server/transport.d.ts +0 -9
  61. package/dist/server/types/server.d.ts +0 -17
package/README.md CHANGED
@@ -2,37 +2,17 @@
2
2
 
3
3
  ![Node CI](https://github.com/honeybadger-io/honeybadger-js/workflows/Node%20CI/badge.svg)
4
4
  [![npm version](https://badge.fury.io/js/%40honeybadger-io%2Fjs.svg)](https://badge.fury.io/js/%40honeybadger-io%2Fjs)
5
- [![deploy](https://img.shields.io/badge/deploy-🛳%20Ship.js-blue?style=flat)](https://github.com/algolia/shipjs)
5
+ [![npm dm](https://img.shields.io/npm/dm/@honeybadger-io/js)](https://www.npmjs.com/package/@honeybadger-io/js)
6
+ [![npm dt](https://img.shields.io/npm/dt/@honeybadger-io/js)](https://www.npmjs.com/package/@honeybadger-io/js)
6
7
 
7
8
  Universal JavaScript library for integrating apps with the :zap: [Honeybadger Error Notifier](http://honeybadger.io).
8
9
 
9
- ❗*Note: The NPM package has been moved to [**@honeybadger-io/js**](https://www.npmjs.com/package/@honeybadger-io/js) starting with v3.0.0. See the [v2-stable](https://github.com/honeybadger-io/honeybadger-js/tree/v2-stable) branch for the [**honeybadger-js**](https://www.npmjs.com/package/honeybadger-js) 2.x package. [Upgrade instructions](https://docs.honeybadger.io/lib/javascript/support/upgrading-to-v3.html)*
10
-
11
10
  ## Documentation and Support
12
11
 
13
12
  For comprehensive documentation and support, [check out our documentation site](http://docs.honeybadger.io/lib/javascript/index.html).
14
13
 
15
- ## Changelog
16
-
17
- [Conventional Commits](https://www.conventionalcommits.org/) are enforced with a git hook ([husky](https://typicode.github.io/husky) + [commitlint](https://commitlint.js.org/)) in order to automate changelog generation.
18
- [CHANGELOG.md](CHANGELOG.md) is updated when a new version is released (npm run release) with [shipjs](https://community.algolia.com/shipjs/reference/all-config.html#updatechangelog).
19
-
20
- ## Contributing
21
-
22
- 1. Fork it.
23
- 2. Create a topic branch `git checkout -b my_branch`
24
- 3. Commit your changes `git commit -am "Boom"`
25
- 4. Push to your branch `git push origin my_branch`
26
- 5. Send a [pull request](https://github.com/honeybadger-io/honeybadger-js/pulls)
27
-
28
14
  ## Development
29
15
 
30
- 1. Run `npm install`.
31
- 2. To run unit tests for both browser and server builds: `npm test`. Or separately: `npm run test:browser`, `npm run test:server`.
32
- 3. To run integration tests across all supported platforms, set up a [BrowserStack](https://www.browserstack.com/)
33
- account and use `BROWSERSTACK_USERNAME=your_username BROWSERSTACK_ACCESS_KEY=your-access-key npm run test:integration`.
34
- 4. To test the TypeScript type definitions: `npm run tsd`.
35
-
36
16
  ### Bundling and types
37
17
  This project is _isomorphic_, meaning it's a single library which contains both browser and server builds. It's written in TypeScript, and transpiled and bundled with Rollup. Our Rollup config generates three main files:
38
18
  1. The server build, which transpiles `src/server.ts` and its dependencies into `dist/server/honeybadger.js`.
@@ -43,11 +23,17 @@ In addition, the TypeScript type declaration for each build is generated into it
43
23
 
44
24
  However, since the package is isomorphic, TypeScript users will likely be writing `import * as Honeybadger from '@honeybadger-io/js'` or `import Honeybadger = require('@honeybadger-io/js')` in their IDE. Our `package.json` has ` main` and `browser` fields that determine which build they get, but [there can only be a single type declaration file](https://github.com/Microsoft/TypeScript/issues/29128). So we use an extra file in the project root, `honeybadger.d.ts`, that combines the types from both builds.
45
25
 
26
+ ### Tests
27
+ 1. To run unit tests for both browser and server builds: `npm test`. Or separately: `npm run test:browser`, `npm run test:server`.
28
+ 2. To run integration tests across all supported platforms, set up a [BrowserStack](https://www.browserstack.com/)
29
+ account and use `BROWSERSTACK_USERNAME=your_username BROWSERSTACK_ACCESS_KEY=your-access-key npm run test:integration`.
30
+ 3. To test the TypeScript type definitions: `npm run tsd`.
31
+
46
32
  ## Releasing
47
33
 
48
- Releasing is done with two commands: `npm version` and `npm publish`. **Both
49
- commands should be used with care.** The `npm publish` command publishes to NPM
50
- **and** to our *js.honeybadger.io* CDN (hosted on AWS via S3/CloudFront).
34
+ This package comes with a `postpublish` script (`scripts/release-cdn.sh`)
35
+ which is executed every time a new version is released to NPM.
36
+ The script publishes to our *js.honeybadger.io* CDN (hosted on AWS via S3/CloudFront).
51
37
 
52
38
  For the CDN release, make sure you have the following environment variable
53
39
  available in your shell:
@@ -59,47 +45,10 @@ export HONEYBADGER_DISTRIBUTION_ID=cloudfront-id
59
45
 
60
46
  AWS credentials are read from *~/.aws/credentials*, using the default profile.
61
47
 
62
- To perform a full release:
63
-
64
- 1. With a clean working tree, use `npm version [new version]` to bump the version, commit the
65
- changes, tag the release, and push to GitHub. See `npm help version` for
66
- documentation.
67
-
68
- 2. To publish the release, use `npm publish`. See `npm help publish` for
69
- documentation.
70
-
71
48
  If the CDN release fails for some reason (bad AWS credentials, for instance),
72
- re-run the release manually with `npm run release-cdn`.
73
-
74
- ### Release Automation
75
-
76
- We use [Ship.js](https://github.com/algolia/shipjs) to automate releasing. Our [custom Ship.js config](https://github.com/honeybadger-io/honeybadger-js/blob/master/ship.config.js) determines the next release version based on the unreleased section of our [changelog](https://github.com/honeybadger-io/honeybadger-js/blob/master/CHANGELOG.md) ([Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format).
77
-
78
- Ship.js creates a PR once per week when unreleased changes are present. You can also trigger a release PR by saying "@shipjs prepare" in any issue or pull request comment on GitHub.
79
-
80
- #### Available Commands
81
-
82
- - `npm run release` - Calculates the next version and creates a PR via `shipjs prepare`. This can run locally or in CI
83
- - `npx shipjs trigger` - Publish to NPM (usually happens in CI, but can also run locally)
84
-
85
- #### GitHub Workflows
86
-
87
- - [shipjs-manual-prepare](https://github.com/honeybadger-io/honeybadger-js/blob/master/.github/workflows/shipjs-manual-prepare.yml)
88
- - [shipjs-schedule-prepare](https://github.com/honeybadger-io/honeybadger-js/blob/master/.github/workflows/shipjs-schedule-prepare.yml)
89
- - [shipjs-trigger](https://github.com/honeybadger-io/honeybadger-js/blob/master/.github/workflows/shipjs-trigger.yml)
90
-
91
- #### Related Links
92
-
93
- - [Our Ship.js config file](https://github.com/honeybadger-io/honeybadger-js/blob/master/ship.config.js)
94
- - [Our Changelog file](https://github.com/honeybadger-io/honeybadger-js/blob/master/CHANGELOG.md)
95
- - [Ship.js on GitHub](https://github.com/algolia/shipjs)
96
- - [Ship.js docs](https://community.algolia.com/shipjs/guide/)
97
- - [More about our unique setup](https://www.joshuawood.net/notes/release-automation-with-ship-js-and-keep-a-changelog)
98
-
99
- ## License
49
+ re-run the release manually with by executing the script `npm run postpublish`.
100
50
 
101
- The Honeybadger gem is MIT licensed. See the [MIT-LICENSE](https://raw.github.com/honeybadger-io/honeybadger-js/master/MIT-LICENSE) file in this repository for details.
102
51
 
103
52
  ---
104
- <p><a href="https://www.browserstack.com/"><img src="/browserstack-logo.png" width="150"></a><br>
53
+ <p><a href="https://www.browserstack.com/"><img src="./browserstack-logo.png" width="150"></a><br>
105
54
  <small>We use <a href="https://www.browserstack.com/">BrowserStack</a> to run our automated integration tests on multiple platforms in CI.</small></p>
@@ -1,12 +1,12 @@
1
- import Client from './types/core/client';
2
- import { BrowserConfig } from './types/core/types';
1
+ import { Types, Client } from '@honeybadger-io/core';
3
2
  declare class Honeybadger extends Client {
4
- config: BrowserConfig;
5
- constructor(opts?: Partial<BrowserConfig>);
6
- configure(opts?: Partial<BrowserConfig>): this;
3
+ config: Types.BrowserConfig;
4
+ constructor(opts?: Partial<Types.BrowserConfig>);
5
+ configure(opts?: Partial<Types.BrowserConfig>): this;
7
6
  resetMaxErrors(): number;
8
- factory(opts?: Partial<BrowserConfig>): this;
7
+ factory(opts?: Partial<Types.BrowserConfig>): this;
9
8
  checkIn(_id: string): Promise<void>;
10
9
  }
11
10
  declare const _default: Honeybadger;
12
11
  export default _default;
12
+ //# sourceMappingURL=browser.d.ts.map