@apolitical/error-reporting 0.0.3-beta.2 → 0.2.0-rc.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/CHANGELOG.md CHANGED
@@ -5,10 +5,15 @@ 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.0.3] - 2022-01-31
8
+ ## [0.2.0] - 2022-05-10
9
+ ### Changed
10
+ - The `environment` is now defined externally
11
+
12
+ ## [0.1.0] - 2022-01-31
9
13
  ### Fixed
10
- - Buffer dependency
11
14
  - Node.js version
15
+ ### Removed
16
+ - Buffer dependency
12
17
 
13
18
  ## [0.0.2] - 2022-01-14
14
19
  ### Updated
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"),require("buffer")):"function"==typeof define&&define.amd?define(["stackdriver-errors-js","buffer"],r):"object"==typeof exports?exports.ApoliticalErrorReporting=r(require("stackdriver-errors-js"),require("buffer")):e.ApoliticalErrorReporting=r(e["stackdriver-errors-js"],e.buffer)}(this,(function(e,r){return function(){"use strict";var t={408:function(e){e.exports=r},542:function(r){r.exports=e}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,{a:r}),r},n.d=function(e,r){for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){n.r(i),n.d(i,{reportError:function(){return f},setContext:function(){return u}});var e=n(542),r=n.n(e),t=n(408);const{APOLITICAL:{WEBSITES:o},GCP:{ENVIRONMENTS:c,PROJECT_ID:a}}={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 s={key:null,environment:null,projectId:a};const u=({accessToken:e,environment:r,origin:n=null,projectId:i,serviceName:u,isEncodedToken:f=!0})=>{var l;s.key=f?(l=e)&&t.Buffer.from(l,"base64").toString("ascii"):e,s.environment=r||(e=>{let r=null,t=null;switch(t="undefined"!=typeof window?window.origin||window.location.origin:e,t){case o.BETA:r=c.BETA;break;case o.BETA_2:r=c.BETA_2;break;case o.LIVE:r=c.LIVE;break;case o.RC:r=c.RC;break;default:r=c.BETA}return r})(n),s.projectId=i||a,u&&(s.service=`${u}:${s.environment}`)},f=async(e,t)=>{try{const o=new(r());o.start(s),t&&o.setUser(t),await o.report(e)}catch(e){console.warn(`Cannot report error: ${e.message}`)}}}(),i}()}));
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 s},setContext:function(){return c}});var e=o(542),r=o.n(e);const{GCP:{PROJECT_ID:t}}={GCP:{PROJECT_ID:"hazel-tea-194609"}};let i={key:null,environment:null,projectId:t};const c=({apiKey:e,environment:r,projectId:o,serviceName:n})=>{i.key=e,i.environment=r,i.projectId=o||t,n&&(i.service=`${n}:${i.environment}`)},s=async(e,t)=>{try{const o=new(r());o.start(i),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.3-beta.2",
3
+ "version": "0.2.0-rc.1",
4
4
  "description": "Browser library to report errors to GCP",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -16,7 +16,8 @@
16
16
  "lint": "eslint --ext .js ./lib",
17
17
  "format": "prettier --write 'lib/**/*.+(js|json)'",
18
18
  "lint-format": "lint-staged",
19
- "prepare": "husky install"
19
+ "prepare": "husky install",
20
+ "prepack": "yarn build"
20
21
  },
21
22
  "keywords": [
22
23
  "JavaScript",
@@ -24,24 +25,23 @@
24
25
  "Error Reporting"
25
26
  ],
26
27
  "dependencies": {
27
- "buffer": "6.0.3",
28
28
  "stackdriver-errors-js": "0.12.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "buffer": "6.0.3",
32
31
  "stackdriver-errors-js": "0.12.0"
33
32
  },
34
33
  "devDependencies": {
35
- "@apolitical/eslint-config": "1.0.2-beta.1",
36
- "@babel/core": "7.16.12",
37
- "@babel/eslint-parser": "7.16.5",
38
- "@babel/plugin-transform-runtime": "7.16.10",
39
- "@babel/preset-env": "7.16.11",
40
- "husky": "7.0.4",
41
- "jest": "27.4.7",
42
- "jest-junit": "13.0.0",
43
- "lint-staged": "12.3.2",
44
- "webpack": "5.67.0",
34
+ "@apolitical/eslint-config": "2.0.1",
35
+ "@babel/core": "7.17.10",
36
+ "@babel/eslint-parser": "7.17.0",
37
+ "@babel/plugin-transform-runtime": "7.17.10",
38
+ "@babel/preset-env": "7.17.10",
39
+ "eslint-config-prettier": "8.5.0",
40
+ "husky": "8.0.1",
41
+ "jest": "28.1.0",
42
+ "jest-junit": "13.2.0",
43
+ "lint-staged": "12.4.1",
44
+ "webpack": "5.72.1",
45
45
  "webpack-cli": "4.9.2"
46
46
  },
47
47
  "eslintConfig": {