@xylabs/log 2.10.0 → 2.10.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.
package/package.json CHANGED
@@ -54,14 +54,14 @@
54
54
  "typescript",
55
55
  "esm"
56
56
  ],
57
- "dependencies": {
58
- "rollbar": "^2.26.2",
59
- "tslib": "^2.6.2"
57
+ "optionalDependencies": {
58
+ "rollbar": "^2.26.2"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@xylabs/ts-scripts-yarn3": "^2.19.5",
63
62
  "@xylabs/tsconfig": "^2.19.5",
64
63
  "publint": "^0.2.2",
64
+ "rollbar": "^2.26.2",
65
65
  "tsup": "^7.2.0"
66
66
  },
67
67
  "publishConfig": {
@@ -72,6 +72,6 @@
72
72
  "url": "https://github.com/xylabs/sdk-js.git"
73
73
  },
74
74
  "sideEffects": false,
75
- "version": "2.10.0",
75
+ "version": "2.10.2",
76
76
  "packageManager": "yarn@3.3.1"
77
77
  }
package/tsup.config.ts CHANGED
@@ -5,10 +5,12 @@ export default defineConfig({
5
5
  bundle: true,
6
6
  cjsInterop: true,
7
7
  clean: true,
8
- dts: true,
9
- entry: ['src'],
8
+ dts: {
9
+ entry: ['src/index.ts'],
10
+ },
11
+ entry: ['src/index.ts'],
10
12
  format: ['cjs', 'esm'],
11
13
  sourcemap: true,
12
14
  splitting: false,
13
- tsconfig: 'tsconfig.json',
15
+ tsconfig: 'tsconfig.build.json',
14
16
  })
package/dist/Log.d.mts DELETED
@@ -1,18 +0,0 @@
1
- interface LogConfig {
2
- commitHash?: string;
3
- devMode?: boolean;
4
- payload?: Record<string, unknown>;
5
- rollbarToken?: string;
6
- }
7
- declare class Log {
8
- private devMode?;
9
- private rollbar?;
10
- constructor(config: LogConfig);
11
- debug(...params: any[]): void;
12
- error(...params: any[]): void;
13
- info(...params: any[]): void;
14
- log(...params: any[]): void;
15
- warn(...params: any[]): void;
16
- }
17
-
18
- export { Log, LogConfig };
package/dist/Log.d.ts DELETED
@@ -1,18 +0,0 @@
1
- interface LogConfig {
2
- commitHash?: string;
3
- devMode?: boolean;
4
- payload?: Record<string, unknown>;
5
- rollbarToken?: string;
6
- }
7
- declare class Log {
8
- private devMode?;
9
- private rollbar?;
10
- constructor(config: LogConfig);
11
- debug(...params: any[]): void;
12
- error(...params: any[]): void;
13
- info(...params: any[]): void;
14
- log(...params: any[]): void;
15
- warn(...params: any[]): void;
16
- }
17
-
18
- export { Log, LogConfig };
package/dist/Log.js DELETED
@@ -1,103 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/Log.ts
31
- var Log_exports = {};
32
- __export(Log_exports, {
33
- Log: () => Log
34
- });
35
- module.exports = __toCommonJS(Log_exports);
36
- var import_rollbar = __toESM(require("rollbar"));
37
- var Log = class {
38
- devMode;
39
- rollbar;
40
- constructor(config) {
41
- this.devMode = config.devMode ?? false;
42
- if (config.rollbarToken) {
43
- this.rollbar = new import_rollbar.default({
44
- accessToken: config.rollbarToken,
45
- captureUncaught: true,
46
- captureUnhandledRejections: true,
47
- codeVersion: config.commitHash,
48
- code_version: config.commitHash,
49
- payload: {
50
- client: {
51
- javascript: {
52
- code_version: config.commitHash,
53
- guess_uncaught_frames: true,
54
- source_map_enabled: true
55
- }
56
- },
57
- codeVersion: config.commitHash,
58
- code_version: config.commitHash,
59
- environment: this.devMode ? "development" : "production",
60
- ...config.payload
61
- },
62
- sendConfig: true
63
- });
64
- }
65
- }
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- debug(...params) {
68
- if (this.devMode) {
69
- console.debug(params);
70
- }
71
- }
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
- error(...params) {
74
- console.error(params);
75
- if (!this.devMode) {
76
- this.rollbar?.error(params);
77
- }
78
- }
79
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
80
- info(...params) {
81
- if (this.devMode) {
82
- console.info(params);
83
- }
84
- }
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- log(...params) {
87
- if (this.devMode) {
88
- console.log(params);
89
- }
90
- }
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- warn(...params) {
93
- console.warn(params);
94
- if (!this.devMode) {
95
- this.rollbar?.warn(params);
96
- }
97
- }
98
- };
99
- // Annotate the CommonJS export names for ESM import in node:
100
- 0 && (module.exports = {
101
- Log
102
- });
103
- //# sourceMappingURL=Log.js.map
package/dist/Log.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Log.ts"],"sourcesContent":["import Rollbar from 'rollbar'\n\nexport interface LogConfig {\n commitHash?: string\n devMode?: boolean\n payload?: Record<string, unknown>\n rollbarToken?: string\n}\n\nexport class Log {\n private devMode?: boolean\n private rollbar?: Rollbar\n\n constructor(config: LogConfig) {\n this.devMode = config.devMode ?? false\n\n if (config.rollbarToken) {\n this.rollbar = new Rollbar({\n accessToken: config.rollbarToken,\n captureUncaught: true,\n captureUnhandledRejections: true,\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n payload: {\n client: {\n javascript: {\n code_version: config.commitHash,\n guess_uncaught_frames: true,\n source_map_enabled: true,\n },\n },\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n environment: this.devMode ? 'development' : 'production',\n ...config.payload,\n },\n sendConfig: true,\n })\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debug(...params: any[]) {\n if (this.devMode) {\n console.debug(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public error(...params: any[]) {\n console.error(params)\n if (!this.devMode) {\n this.rollbar?.error(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public info(...params: any[]) {\n if (this.devMode) {\n console.info(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public log(...params: any[]) {\n if (this.devMode) {\n console.log(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public warn(...params: any[]) {\n console.warn(params)\n if (!this.devMode) {\n this.rollbar?.warn(params)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AASb,IAAM,MAAN,MAAU;AAAA,EACP;AAAA,EACA;AAAA,EAER,YAAY,QAAmB;AAC7B,SAAK,UAAU,OAAO,WAAW;AAEjC,QAAI,OAAO,cAAc;AACvB,WAAK,UAAU,IAAI,eAAAA,QAAQ;AAAA,QACzB,aAAa,OAAO;AAAA,QACpB,iBAAiB;AAAA,QACjB,4BAA4B;AAAA,QAC5B,aAAa,OAAO;AAAA,QACpB,cAAc,OAAO;AAAA,QACrB,SAAS;AAAA,UACP,QAAQ;AAAA,YACN,YAAY;AAAA,cACV,cAAc,OAAO;AAAA,cACrB,uBAAuB;AAAA,cACvB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,UACA,aAAa,OAAO;AAAA,UACpB,cAAc,OAAO;AAAA,UACrB,aAAa,KAAK,UAAU,gBAAgB;AAAA,UAC5C,GAAG,OAAO;AAAA,QACZ;AAAA,QACA,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA,EAGO,SAAS,QAAe;AAC7B,QAAI,KAAK,SAAS;AAChB,cAAQ,MAAM,MAAM;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAGO,SAAS,QAAe;AAC7B,YAAQ,MAAM,MAAM;AACpB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAGO,QAAQ,QAAe;AAC5B,QAAI,KAAK,SAAS;AAChB,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AAAA;AAAA,EAGO,OAAO,QAAe;AAC3B,QAAI,KAAK,SAAS;AAChB,cAAQ,IAAI,MAAM;AAAA,IACpB;AAAA,EACF;AAAA;AAAA,EAGO,QAAQ,QAAe;AAC5B,YAAQ,KAAK,MAAM;AACnB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,KAAK,MAAM;AAAA,IAC3B;AAAA,EACF;AACF;","names":["Rollbar"]}
package/dist/Log.mjs DELETED
@@ -1,68 +0,0 @@
1
- // src/Log.ts
2
- import Rollbar from "rollbar";
3
- var Log = class {
4
- devMode;
5
- rollbar;
6
- constructor(config) {
7
- this.devMode = config.devMode ?? false;
8
- if (config.rollbarToken) {
9
- this.rollbar = new Rollbar({
10
- accessToken: config.rollbarToken,
11
- captureUncaught: true,
12
- captureUnhandledRejections: true,
13
- codeVersion: config.commitHash,
14
- code_version: config.commitHash,
15
- payload: {
16
- client: {
17
- javascript: {
18
- code_version: config.commitHash,
19
- guess_uncaught_frames: true,
20
- source_map_enabled: true
21
- }
22
- },
23
- codeVersion: config.commitHash,
24
- code_version: config.commitHash,
25
- environment: this.devMode ? "development" : "production",
26
- ...config.payload
27
- },
28
- sendConfig: true
29
- });
30
- }
31
- }
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- debug(...params) {
34
- if (this.devMode) {
35
- console.debug(params);
36
- }
37
- }
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
- error(...params) {
40
- console.error(params);
41
- if (!this.devMode) {
42
- this.rollbar?.error(params);
43
- }
44
- }
45
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
- info(...params) {
47
- if (this.devMode) {
48
- console.info(params);
49
- }
50
- }
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
- log(...params) {
53
- if (this.devMode) {
54
- console.log(params);
55
- }
56
- }
57
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
- warn(...params) {
59
- console.warn(params);
60
- if (!this.devMode) {
61
- this.rollbar?.warn(params);
62
- }
63
- }
64
- };
65
- export {
66
- Log
67
- };
68
- //# sourceMappingURL=Log.mjs.map
package/dist/Log.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Log.ts"],"sourcesContent":["import Rollbar from 'rollbar'\n\nexport interface LogConfig {\n commitHash?: string\n devMode?: boolean\n payload?: Record<string, unknown>\n rollbarToken?: string\n}\n\nexport class Log {\n private devMode?: boolean\n private rollbar?: Rollbar\n\n constructor(config: LogConfig) {\n this.devMode = config.devMode ?? false\n\n if (config.rollbarToken) {\n this.rollbar = new Rollbar({\n accessToken: config.rollbarToken,\n captureUncaught: true,\n captureUnhandledRejections: true,\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n payload: {\n client: {\n javascript: {\n code_version: config.commitHash,\n guess_uncaught_frames: true,\n source_map_enabled: true,\n },\n },\n codeVersion: config.commitHash,\n code_version: config.commitHash,\n environment: this.devMode ? 'development' : 'production',\n ...config.payload,\n },\n sendConfig: true,\n })\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public debug(...params: any[]) {\n if (this.devMode) {\n console.debug(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public error(...params: any[]) {\n console.error(params)\n if (!this.devMode) {\n this.rollbar?.error(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public info(...params: any[]) {\n if (this.devMode) {\n console.info(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public log(...params: any[]) {\n if (this.devMode) {\n console.log(params)\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public warn(...params: any[]) {\n console.warn(params)\n if (!this.devMode) {\n this.rollbar?.warn(params)\n }\n }\n}\n"],"mappings":";AAAA,OAAO,aAAa;AASb,IAAM,MAAN,MAAU;AAAA,EACP;AAAA,EACA;AAAA,EAER,YAAY,QAAmB;AAC7B,SAAK,UAAU,OAAO,WAAW;AAEjC,QAAI,OAAO,cAAc;AACvB,WAAK,UAAU,IAAI,QAAQ;AAAA,QACzB,aAAa,OAAO;AAAA,QACpB,iBAAiB;AAAA,QACjB,4BAA4B;AAAA,QAC5B,aAAa,OAAO;AAAA,QACpB,cAAc,OAAO;AAAA,QACrB,SAAS;AAAA,UACP,QAAQ;AAAA,YACN,YAAY;AAAA,cACV,cAAc,OAAO;AAAA,cACrB,uBAAuB;AAAA,cACvB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,UACA,aAAa,OAAO;AAAA,UACpB,cAAc,OAAO;AAAA,UACrB,aAAa,KAAK,UAAU,gBAAgB;AAAA,UAC5C,GAAG,OAAO;AAAA,QACZ;AAAA,QACA,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA,EAGO,SAAS,QAAe;AAC7B,QAAI,KAAK,SAAS;AAChB,cAAQ,MAAM,MAAM;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAGO,SAAS,QAAe;AAC7B,YAAQ,MAAM,MAAM;AACpB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAGO,QAAQ,QAAe;AAC5B,QAAI,KAAK,SAAS;AAChB,cAAQ,KAAK,MAAM;AAAA,IACrB;AAAA,EACF;AAAA;AAAA,EAGO,OAAO,QAAe;AAC3B,QAAI,KAAK,SAAS;AAChB,cAAQ,IAAI,MAAM;AAAA,IACpB;AAAA,EACF;AAAA;AAAA,EAGO,QAAQ,QAAe;AAC5B,YAAQ,KAAK,MAAM;AACnB,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,SAAS,KAAK,MAAM;AAAA,IAC3B;AAAA,EACF;AACF;","names":[]}