@caperjs/plugin-rollbar 0.1.0 → 0.1.2

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.
@@ -1,7 +1,7 @@
1
1
  import { Logger as e, Plugin as t, isDev as n } from "@caperjs/core";
2
2
  import r from "rollbar";
3
3
  //#region src/version.ts
4
- var i = "0.1.0", a = "2.26.4", o = {
4
+ var i = "0.1.2", a = "2.26.4", o = {
5
5
  isDev: !1,
6
6
  enabled: !0,
7
7
  captureUncaught: !0,
@@ -1 +1 @@
1
- {"version":3,"file":"caper-plugin-rollbar.mjs","names":[],"sources":["../src/version.ts","../src/RollbarPlugin.ts","../src/index.ts"],"sourcesContent":["export const version = '0.1.0';\nexport const rollbarVersion = '2.26.4';","import { IApplication, IPlugin, isDev, Logger, Plugin } from '@caperjs/core';\nimport Rollbar from 'rollbar';\nimport { rollbarVersion, version } from './version';\n\nexport interface RollbarPluginOptions extends Rollbar.Configuration {\n isDev?: boolean;\n debug?: boolean;\n}\n\nexport interface IRollbarPlugin extends IPlugin<RollbarPluginOptions> {\n readonly rollbar: Rollbar;\n}\n\nconst defaultOptions = {\n isDev: false,\n enabled: true,\n captureUncaught: true,\n captureUnhandledRejections: true,\n debug: isDev,\n};\n\nexport class RollbarPlugin extends Plugin<RollbarPluginOptions> implements IRollbarPlugin {\n protected _options: RollbarPluginOptions;\n private _rollbar: Rollbar;\n\n get rollbar() {\n return this._rollbar;\n }\n\n private hello() {\n const hello = `%c Caper Rollbar Plugin v${version} | %cRollbar v${rollbarVersion}`;\n console.log(\n hello,\n 'background: rgba(31, 41, 55, 1);color: #74b64c',\n 'background: rgba(31, 41, 55, 1);color: #e91e63',\n 'background: rgba(31, 41, 55, 1);color: #74b64c',\n );\n\n if (this._options.debug) {\n Logger.log(this._options);\n }\n }\n\n async initialize(options: Partial<RollbarPluginOptions>, _app: IApplication) {\n this._options = {\n accessToken: _app.env.VITE_ROLLBAR_ACCESS_TOKEN || _app.env.ROLLBAR_ACCESS_TOKEN,\n ...defaultOptions,\n ...options,\n };\n\n // check if accessToken is set\n if (!this._options.accessToken) {\n throw new Error('Rollbar accessToken is required');\n }\n // TODO: should we even instantiate Rollbar here if isDev is true?\n this._rollbar = new Rollbar(this._options);\n this.hello();\n\n if (this._options.isDev) {\n Logger.warn('Rollbar is disabled in development mode');\n this._rollbar.configure({ enabled: false });\n } else {\n Logger.log('Rollbar is enabled');\n }\n }\n}\n","import { RollbarPlugin } from './RollbarPlugin';\n\nexport type { IRollbarPlugin, RollbarPluginOptions } from './RollbarPlugin';\n\nexport default RollbarPlugin;\n"],"mappings":";;;AAAA,IAAa,IAAU,SACV,IAAiB,UCYxB,IAAiB;CACrB,OAAO;CACP,SAAS;CACT,iBAAiB;CACjB,4BAA4B;CAC5B,OAAO;CACR,ECfD,IDiBA,cAAmC,EAAuD;CAIxF,IAAI,UAAU;AACZ,SAAO,KAAK;;CAGd,QAAgB;EACd,IAAM,IAAQ,4BAA4B,EAAQ,gBAAgB;AAQlE,EAPA,QAAQ,IACN,GACA,kDACA,kDACA,iDACD,EAEG,KAAK,SAAS,SAChB,EAAO,IAAI,KAAK,SAAS;;CAI7B,MAAM,WAAW,GAAwC,GAAoB;AAQ3E,MAPA,KAAK,WAAW;GACd,aAAa,EAAK,IAAI,6BAA6B,EAAK,IAAI;GAC5D,GAAG;GACH,GAAG;GACJ,EAGG,CAAC,KAAK,SAAS,YACjB,OAAU,MAAM,kCAAkC;AAMpD,EAHA,KAAK,WAAW,IAAI,EAAQ,KAAK,SAAS,EAC1C,KAAK,OAAO,EAER,KAAK,SAAS,SAChB,EAAO,KAAK,0CAA0C,EACtD,KAAK,SAAS,UAAU,EAAE,SAAS,IAAO,CAAC,IAE3C,EAAO,IAAI,qBAAqB"}
1
+ {"version":3,"file":"caper-plugin-rollbar.mjs","names":[],"sources":["../src/version.ts","../src/RollbarPlugin.ts","../src/index.ts"],"sourcesContent":["export const version = '0.1.2';\nexport const rollbarVersion = '2.26.4';","import { IApplication, IPlugin, isDev, Logger, Plugin } from '@caperjs/core';\nimport Rollbar from 'rollbar';\nimport { rollbarVersion, version } from './version';\n\nexport interface RollbarPluginOptions extends Rollbar.Configuration {\n isDev?: boolean;\n debug?: boolean;\n}\n\nexport interface IRollbarPlugin extends IPlugin<RollbarPluginOptions> {\n readonly rollbar: Rollbar;\n}\n\nconst defaultOptions = {\n isDev: false,\n enabled: true,\n captureUncaught: true,\n captureUnhandledRejections: true,\n debug: isDev,\n};\n\nexport class RollbarPlugin extends Plugin<RollbarPluginOptions> implements IRollbarPlugin {\n protected _options: RollbarPluginOptions;\n private _rollbar: Rollbar;\n\n get rollbar() {\n return this._rollbar;\n }\n\n private hello() {\n const hello = `%c Caper Rollbar Plugin v${version} | %cRollbar v${rollbarVersion}`;\n console.log(\n hello,\n 'background: rgba(31, 41, 55, 1);color: #74b64c',\n 'background: rgba(31, 41, 55, 1);color: #e91e63',\n 'background: rgba(31, 41, 55, 1);color: #74b64c',\n );\n\n if (this._options.debug) {\n Logger.log(this._options);\n }\n }\n\n async initialize(options: Partial<RollbarPluginOptions>, _app: IApplication) {\n this._options = {\n accessToken: _app.env.VITE_ROLLBAR_ACCESS_TOKEN || _app.env.ROLLBAR_ACCESS_TOKEN,\n ...defaultOptions,\n ...options,\n };\n\n // check if accessToken is set\n if (!this._options.accessToken) {\n throw new Error('Rollbar accessToken is required');\n }\n // TODO: should we even instantiate Rollbar here if isDev is true?\n this._rollbar = new Rollbar(this._options);\n this.hello();\n\n if (this._options.isDev) {\n Logger.warn('Rollbar is disabled in development mode');\n this._rollbar.configure({ enabled: false });\n } else {\n Logger.log('Rollbar is enabled');\n }\n }\n}\n","import { RollbarPlugin } from './RollbarPlugin';\n\nexport type { IRollbarPlugin, RollbarPluginOptions } from './RollbarPlugin';\n\nexport default RollbarPlugin;\n"],"mappings":";;;AAAA,IAAa,IAAU,SACV,IAAiB,UCYxB,IAAiB;CACrB,OAAO;CACP,SAAS;CACT,iBAAiB;CACjB,4BAA4B;CAC5B,OAAO;CACR,ECfD,IDiBA,cAAmC,EAAuD;CAIxF,IAAI,UAAU;AACZ,SAAO,KAAK;;CAGd,QAAgB;EACd,IAAM,IAAQ,4BAA4B,EAAQ,gBAAgB;AAQlE,EAPA,QAAQ,IACN,GACA,kDACA,kDACA,iDACD,EAEG,KAAK,SAAS,SAChB,EAAO,IAAI,KAAK,SAAS;;CAI7B,MAAM,WAAW,GAAwC,GAAoB;AAQ3E,MAPA,KAAK,WAAW;GACd,aAAa,EAAK,IAAI,6BAA6B,EAAK,IAAI;GAC5D,GAAG;GACH,GAAG;GACJ,EAGG,CAAC,KAAK,SAAS,YACjB,OAAU,MAAM,kCAAkC;AAMpD,EAHA,KAAK,WAAW,IAAI,EAAQ,KAAK,SAAS,EAC1C,KAAK,OAAO,EAER,KAAK,SAAS,SAChB,EAAO,KAAK,0CAA0C,EACtD,KAAK,SAAS,UAAU,EAAE,SAAS,IAAO,CAAC,IAE3C,EAAO,IAAI,qBAAqB"}
package/lib/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const version = "0.1.0";
1
+ export declare const version = "0.1.2";
2
2
  export declare const rollbarVersion = "2.26.4";
3
3
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caperjs/plugin-rollbar",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Rollbar",
5
5
  "files": [
6
6
  "lib",
@@ -15,6 +15,11 @@
15
15
  }
16
16
  },
17
17
  "sideEffects": false,
18
+ "scripts": {
19
+ "build": "pnpm run generate-version && vite build",
20
+ "test": "echo \"Error: no test specified\" && exit 1",
21
+ "generate-version": "node generateVersion.mjs"
22
+ },
18
23
  "keywords": [
19
24
  "rollbar",
20
25
  "rollbar.js",
@@ -24,19 +29,14 @@
24
29
  "author": "",
25
30
  "license": "MIT",
26
31
  "devDependencies": {
32
+ "@caperjs/core": "0.1.2",
27
33
  "vite": "^8.0.7",
28
- "vite-plugin-dts": "^4.5.3",
29
- "@caperjs/core": "0.1.0"
34
+ "vite-plugin-dts": "^4.5.3"
30
35
  },
31
36
  "peerDependencies": {
32
- "@caperjs/core": "0.1.0"
37
+ "@caperjs/core": "0.1.2"
33
38
  },
34
39
  "dependencies": {
35
40
  "rollbar": "^2.26.4"
36
- },
37
- "scripts": {
38
- "build": "pnpm run generate-version && vite build",
39
- "test": "echo \"Error: no test specified\" && exit 1",
40
- "generate-version": "node generateVersion.mjs"
41
41
  }
42
- }
42
+ }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '0.1.0';
1
+ export const version = '0.1.2';
2
2
  export const rollbarVersion = '2.26.4';
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Relish Interactive
4
- Copyright (c) 2026 Anthony Sapp
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.