@apolitical/error-reporting 0.0.2 → 0.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.0] - 2022-01-31
9
+ ### Fixed
10
+ - Node.js version
11
+ ### Removed
12
+ - Buffer dependency
13
+
8
14
  ## [0.0.2] - 2022-01-14
9
15
  ### Updated
10
16
  - Dependencies
package/README.md CHANGED
@@ -6,7 +6,7 @@ Browser (and Node.js) library to report errors to GCP
6
6
 
7
7
  Requires the following to run:
8
8
 
9
- - [node.js][node] 12.20.1+
9
+ - [node.js][node] 16.13.0+
10
10
  - [yarn][yarn]
11
11
 
12
12
  [node]: https://nodejs.org/en/download/
package/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("stackdriver-errors-js")):"function"==typeof define&&define.amd?define(["stackdriver-errors-js"],r):"object"==typeof exports?exports.ApoliticalErrorReporting=r(require("stackdriver-errors-js")):e.ApoliticalErrorReporting=r(e["stackdriver-errors-js"])}(this,(function(e){return function(){"use strict";var r={542:function(r){r.exports=e}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(e,r){for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){o.r(n),o.d(n,{reportError:function(){return u},setContext:function(){return s}});var e=o(542),r=o.n(e);const{APOLITICAL:{WEBSITES:t},GCP:{ENVIRONMENTS:i,PROJECT_ID:c}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"}},GCP:{ENVIRONMENTS:{BETA:"beta",BETA_2:"beta-2",RC:"rc",LIVE:"live"},PROJECT_ID:"hazel-tea-194609"}};let a={key:null,environment:null,projectId:c};const s=({accessToken:e,environment:r,origin:o=null,projectId:n,serviceName:s,isEncodedToken:u=!0})=>{var l;a.key=u?(l=e)&&Buffer.from(l,"base64").toString("ascii"):e,a.environment=r||(e=>{let r=null,o=null;switch(o="undefined"!=typeof window?window.origin||window.location.origin:e,o){case t.BETA:r=i.BETA;break;case t.BETA_2:r=i.BETA_2;break;case t.LIVE:r=i.LIVE;break;case t.RC:r=i.RC;break;default:r=i.BETA}return r})(o),a.projectId=n||c,s&&(a.service=`${s}:${a.environment}`)},u=async(e,t)=>{try{const o=new(r());o.start(a),t&&o.setUser(t),await o.report(e)}catch(e){console.warn(`Cannot report error: ${e.message}`)}}}(),n}()}));
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("stackdriver-errors-js")):"function"==typeof define&&define.amd?define(["stackdriver-errors-js"],r):"object"==typeof exports?exports.ApoliticalErrorReporting=r(require("stackdriver-errors-js")):e.ApoliticalErrorReporting=r(e["stackdriver-errors-js"])}(this,(function(e){return function(){"use strict";var r={542:function(r){r.exports=e}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(e,r){for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){o.r(n),o.d(n,{reportError:function(){return u},setContext:function(){return s}});var e=o(542),r=o.n(e);const{APOLITICAL:{WEBSITES:t},GCP:{ENVIRONMENTS:i,PROJECT_ID:c}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"}},GCP:{ENVIRONMENTS:{BETA:"beta",BETA_2:"beta-2",RC:"rc",LIVE:"live"},PROJECT_ID:"hazel-tea-194609"}};let a={key:null,environment:null,projectId:c};const s=({apiKey:e,environment:r,origin:o=null,projectId:n,serviceName:s})=>{a.key=e,a.environment=r||(e=>{let r=null,o=null;switch(o="undefined"!=typeof window?window.origin||window.location.origin:e,o){case t.BETA:r=i.BETA;break;case t.BETA_2:r=i.BETA_2;break;case t.LIVE:r=i.LIVE;break;case t.RC:r=i.RC;break;default:r=i.BETA}return r})(o),a.projectId=n||c,s&&(a.service=`${s}:${a.environment}`)},u=async(e,t)=>{try{const o=new(r());o.start(a),t&&o.setUser(t),await o.report(e)}catch(e){console.warn(`Cannot report error: ${e.message}`)}}}(),n}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/error-reporting",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Browser library to report errors to GCP",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -30,34 +30,26 @@
30
30
  "stackdriver-errors-js": "0.12.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@apolitical/eslint-config": "0.0.1",
34
- "@babel/core": "7.16.7",
35
- "babel-eslint": "10.1.0",
36
- "babel-loader": "8.2.3",
37
- "babel-preset-react-app": "10.0.1",
33
+ "@apolitical/eslint-config": "1.0.2",
34
+ "@babel/core": "7.16.12",
35
+ "@babel/eslint-parser": "7.16.5",
36
+ "@babel/plugin-transform-runtime": "7.16.10",
37
+ "@babel/preset-env": "7.16.11",
38
38
  "husky": "7.0.4",
39
39
  "jest": "27.4.7",
40
40
  "jest-junit": "13.0.0",
41
- "lint-staged": "12.1.7",
42
- "webpack": "5.66.0",
43
- "webpack-cli": "4.9.1"
41
+ "lint-staged": "12.3.2",
42
+ "webpack": "5.67.0",
43
+ "webpack-cli": "4.9.2"
44
44
  },
45
45
  "eslintConfig": {
46
46
  "extends": [
47
- "eslint:recommended",
48
- "plugin:prettier/recommended",
49
- "plugin:jest/recommended"
47
+ "@apolitical/eslint-config/base.config"
50
48
  ],
51
49
  "env": {
52
- "browser": true,
53
- "node": true,
54
- "es6": true,
55
- "jest": true
50
+ "browser": true
56
51
  },
57
- "plugins": [
58
- "jest"
59
- ],
60
- "parser": "babel-eslint"
52
+ "parser": "@babel/eslint-parser"
61
53
  },
62
54
  "prettier": "@apolitical/eslint-config/prettier.config",
63
55
  "browserslist": {
@@ -89,11 +81,18 @@
89
81
  },
90
82
  "babel": {
91
83
  "presets": [
92
- "react-app"
93
- ]
84
+ "@babel/preset-env"
85
+ ],
86
+ "env": {
87
+ "test": {
88
+ "plugins": [
89
+ "@babel/plugin-transform-runtime"
90
+ ]
91
+ }
92
+ }
94
93
  },
95
94
  "engines": {
96
- "node": ">=12.20.1"
95
+ "node": ">=16.13.0"
97
96
  },
98
97
  "lint-staged": {
99
98
  "*.js": "eslint --cache --fix --ignore-path .gitignore",