@honeybadger-io/react 2.0.0 → 2.0.1

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.
package/README.md CHANGED
@@ -54,7 +54,7 @@ REACT_APP_HONEYBADGER_API_KEY=b425b636 npm run start
54
54
 
55
55
  This will serve the demo app with hot reload at localhost:3000
56
56
 
57
- For a detailed explanation on how hot reloading works, check out the [guide](http://reactjs-templates.github.io/webpack/) and [docs for react-loader](http://reactjs.github.io/react-loader).
57
+ For a detailed explanation on how hot reloading works, check out the [documentation](https://webpack.js.org/concepts/hot-module-replacement/).
58
58
 
59
59
  ## Changelog
60
60
 
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.cjs.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":[null,null],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;;;;;;;;;;;;;MAQqB,qBAAsB,SAAQA,eAAyC;IAO1F,MAAM;QACJ,QACEC,uCAAK,SAAS,EAAC,OAAO,iBACpBC,gEAEM,EACNA,kCACG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,WACtC,EACNA,kCACG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,WAC5D,aACF,EACP;KACF;;AAnBM,+BAAS,GAAG;IACjB,KAAK,EAAEC,6BAAS,CAAC,MAAM;IACvB,IAAI,EAAEA,6BAAS,CAAC,MAAM;CACvB;;MCCkB,wBAAyB,SAAQH,eAAuE;IAQ3H,YAAY,KAAoC;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,aAAa,EAAE,KAAK;SACrB,CAAA;KACF;IAEM,OAAO,wBAAwB,CAAC,KAAY;QACjD,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;KACvD;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;QACxD,IAAI,CAAC,QAAQ,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAA;QACnE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,SAAgB,EAAC,CAAC,CAAA;KAClE;IAEO,iBAAiB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc;cAC5BI,yBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAqB,EAAE,IAAI,CAAC,KAAK,CAAC;cACjEF,eAAC,qBAAqB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;KAC9C;IAED,MAAM;QACJ,QACEA,gDACG,IAAI,CAAC,KAAK,CAAC,aAAa;kBACrB,IAAI,CAAC,iBAAiB,EAAE;kBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;KACF;;AAvCM,kCAAS,GAAG;IACjB,WAAW,EAAEC,6BAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;IAC3B,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-react.cjs.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;;;;;;;;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AAK,CAAC;cACjEF,eAAC,qBAAqB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;KAC9C;IAED,MAAM;QACJ,QACEA,gDACG,IAAI,CAAC,KAAK,CAAC,aAAa;kBACrB,IAAI,CAAC,iBAAiB,EAAE;kBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;KACF;;AAvCM,kCAAS,GAAG;IACjB,WAAW,EAAEC,6BAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;IAC3B,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.esm.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":[null,null],"names":["_jsxs","_jsx"],"mappings":";;;;;MAQqB,qBAAsB,SAAQ,SAAyC;IAO1F,MAAM;QACJ,QACEA,4BAAK,SAAS,EAAC,OAAO,iBACpBC,qDAEM,EACNA,uBACG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,WACtC,EACNA,uBACG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,WAC5D,aACF,EACP;KACF;;AAnBM,+BAAS,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,IAAI,EAAE,SAAS,CAAC,MAAM;CACvB;;MCCkB,wBAAyB,SAAQ,SAAuE;IAQ3H,YAAY,KAAoC;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,aAAa,EAAE,KAAK;SACrB,CAAA;KACF;IAEM,OAAO,wBAAwB,CAAC,KAAY;QACjD,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;KACvD;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;QACxD,IAAI,CAAC,QAAQ,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAA;QACnE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,SAAgB,EAAC,CAAC,CAAA;KAClE;IAEO,iBAAiB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc;cAC5B,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAqB,EAAE,IAAI,CAAC,KAAK,CAAC;cACjEA,IAAC,qBAAqB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;KAC9C;IAED,MAAM;QACJ,QACEA,0BACG,IAAI,CAAC,KAAK,CAAC,aAAa;kBACrB,IAAI,CAAC,iBAAiB,EAAE;kBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;KACF;;AAvCM,kCAAS,GAAG;IACjB,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,OAAO;IAC3B,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;"}
1
+ {"version":3,"file":"honeybadger-react.esm.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;MAQqB,qBAAsB,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qB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;KAC9C;IAED,MAAM;QACJ,QACEA,0BACG,IAAI,CAAC,KAAK,CAAC,aAAa;kBACrB,IAAI,CAAC,iBAAiB,EAAE;kBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;KACF;;AAvCM,kCAAS,GAAG;IACjB,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,OAAO;IAC3B,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":[null,null],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;;;;;;;UAQqB,qBAAsB,SAAQA,eAAyC;QAO1F,MAAM;YACJ,QACEC,uCAAK,SAAS,EAAC,OAAO,iBACpBC,gEAEM,EACNA,kCACG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,WACtC,EACNA,kCACG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,WAC5D,aACF,EACP;SACF;;IAnBM,+BAAS,GAAG;QACjB,KAAK,EAAEC,6BAAS,CAAC,MAAM;QACvB,IAAI,EAAEA,6BAAS,CAAC,MAAM;KACvB;;UCCkB,wBAAyB,SAAQH,eAAuE;QAQ3H,YAAY,KAAoC;YAC9C,KAAK,CAAC,KAAK,CAAC,CAAA;YACZ,IAAI,CAAC,KAAK,GAAG;gBACX,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;gBACV,aAAa,EAAE,KAAK;aACrB,CAAA;SACF;QAEM,OAAO,wBAAwB,CAAC,KAAY;YACjD,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;SACvD;QAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;YACxD,IAAI,CAAC,QAAQ,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAA;YACnE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,SAAgB,EAAC,CAAC,CAAA;SAClE;QAEO,iBAAiB;YACvB,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc;kBAC5BI,yBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAqB,EAAE,IAAI,CAAC,KAAK,CAAC;kBACjEF,eAAC,qBAAqB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;SAC9C;QAED,MAAM;YACJ,QACEA,gDACG,IAAI,CAAC,KAAK,CAAC,aAAa;sBACrB,IAAI,CAAC,iBAAiB,EAAE;sBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;SACF;;IAvCM,kCAAS,GAAG;QACjB,WAAW,EAAEC,6BAAS,CAAC,MAAM,CAAC,UAAU;QACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;QAC3B,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;KACzE;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-react.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;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AAC,KAAK,CAAC;kBACjEF,eAAC,qBAAqB,oBAAK,IAAI,CAAC,KAAK,UAAI,CAAA;SAC9C;QAED,MAAM;YACJ,QACEA,gDACG,IAAI,CAAC,KAAK,CAAC,aAAa;sBACrB,IAAI,CAAC,iBAAiB,EAAE;sBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,WAEtB,EACJ;SACF;;IAvCM,kCAAS,GAAG;QACjB,WAAW,EAAEC,6BAAS,CAAC,MAAM,CAAC,UAAU;QACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;QAC3B,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;KACzE;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/react",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "React.js integration for honeybadger",
5
5
  "author": "Jason Truesdell <jason@yuzuten.com> (https://github.com/JasonTrue)",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "preversion": "npm test",
29
29
  "version": "scripts/update-versions.sh",
30
30
  "postversion": "git push && git push --tags",
31
- "prepublishOnly": "npm build && npm test"
31
+ "prepublishOnly": "npm run build && npm test"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "prop-types": "^15.5.4",
@@ -36,25 +36,25 @@
36
36
  "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@rollup/plugin-commonjs": "^20.0.0",
40
- "@rollup/plugin-typescript": "^8.2.5",
41
- "@types/jest": "^27.0.1",
42
- "@types/react": "^17.0.20",
39
+ "@rollup/plugin-commonjs": "^21.0.2",
40
+ "@rollup/plugin-typescript": "^8.3.1",
41
+ "@types/jest": "^27.4.1",
42
+ "@types/react": "^17.0.40",
43
43
  "@types/react-test-renderer": "^17.0.1",
44
- "@types/sinon": "^10.0.2",
44
+ "@types/sinon": "^10.0.11",
45
45
  "cross-env": "^7.0.0",
46
46
  "gh-pages": "^3.2.3",
47
47
  "react": "^17.0.2",
48
48
  "react-scripts": "^4.0.3",
49
49
  "react-test-renderer": "^17.0.2",
50
- "rollup": "^2.56.3",
51
- "sinon": "^11.1.2",
52
- "typescript": "^4.4.3"
50
+ "rollup": "^2.70.1",
51
+ "sinon": "^13.0.1",
52
+ "typescript": "^4.6.2"
53
53
  },
54
54
  "files": [
55
55
  "dist"
56
56
  ],
57
57
  "dependencies": {
58
- "@honeybadger-io/js": "^3.2.4"
58
+ "@honeybadger-io/js": "^3.2.8"
59
59
  }
60
60
  }
package/CHANGELOG.md DELETED
@@ -1,60 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased]
8
-
9
- ## [2.0.0] - 2021-09-24
10
- ### Changed
11
- - Transform to a typescript project
12
- - [Breaking change] Export core `Honeybadger` from `@honeybadger-io/js` to simplify integration. Read more at [PR](https://github.com/honeybadger-io/honeybadger-react/pull/275).
13
-
14
- ## [1.0.2] - 2021-09-14
15
- ### Fixed
16
- - Fix typescript definitions (#272)
17
-
18
- ## [1.0.1] - 2021-02-18
19
- ### Fixed
20
- - Bump peerDependencies version for React 17
21
-
22
- ## [1.0.0] - 2021-01-19
23
- ### Changed
24
- - Migrate honeybadger-js dependency to @honeybadger-io/js 3.0.0
25
- See https://docs.honeybadger.io/lib/javascript/support/upgrading-to-v3.html
26
-
27
- ## [0.0.8] - 2020-09-24
28
- ### Fixed
29
- - Update honeybadger-js to 2.3.0
30
-
31
- ## [0.0.7] - 2020-04-24
32
- ### Fixed
33
- - Update honeybadger-js to 2.2.1 (security release, see
34
- [here](https://github.com/honeybadger-io/honeybadger-js/blob/master/CHANGELOG.md#220---2020-03-16))
35
-
36
- ## [0.0.6] - 2020-01-08
37
- ### Fixed
38
- - Fix TypeScript type definitions
39
-
40
- ## [0.0.5] - 2019-12-18
41
- ### Fixed
42
- - Deps & security updates
43
- - Proptypes bug (#39) (#40)
44
-
45
- ## [0.0.4] - 2019-07-01
46
- ### Fixed
47
- - Fix PropType mismatch #38 @andrewsouthard
48
-
49
- ## [0.0.3] - 2019-04-16
50
- ### Changed
51
- - Update honeybadger-js to v1.0. See
52
- https://github.com/honeybadger-io/honeybadger-js/blob/master/CHANGELOG.md
53
-
54
- ## [0.0.2] - 2019-01-21
55
- ### Added
56
- - Add TypeScript definition
57
-
58
- ## [0.0.1] - 2018-11-30
59
- ### Added
60
- - Initial release