@mihari/logger-browser 0.1.0 → 0.2.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/dist/index.d.mts +17 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +99 -65
- package/dist/index.js.map +1 -1
- package/{src/index.ts → dist/index.mjs} +18 -34
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -7
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MihariClient } from '@mihari/logger-core';
|
|
2
|
+
import { MihariConfig } from '@mihari/logger-types';
|
|
3
|
+
export { MihariConfig } from '@mihari/logger-types';
|
|
4
|
+
|
|
5
|
+
declare class BrowserMihari extends MihariClient {
|
|
6
|
+
private unloadHandlerRegistered;
|
|
7
|
+
constructor(config: MihariConfig);
|
|
8
|
+
protected getDefaultMetadata(): Record<string, unknown>;
|
|
9
|
+
private registerUnloadHandler;
|
|
10
|
+
/**
|
|
11
|
+
* Uses navigator.sendBeacon to reliably send remaining logs
|
|
12
|
+
* when the page is being unloaded.
|
|
13
|
+
*/
|
|
14
|
+
private sendBeaconFlush;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { BrowserMihari };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { MihariClient } from
|
|
2
|
-
import { MihariConfig } from
|
|
3
|
-
export
|
|
1
|
+
import { MihariClient } from '@mihari/logger-core';
|
|
2
|
+
import { MihariConfig } from '@mihari/logger-types';
|
|
3
|
+
export { MihariConfig } from '@mihari/logger-types';
|
|
4
|
+
|
|
5
|
+
declare class BrowserMihari extends MihariClient {
|
|
4
6
|
private unloadHandlerRegistered;
|
|
5
7
|
constructor(config: MihariConfig);
|
|
6
8
|
protected getDefaultMetadata(): Record<string, unknown>;
|
|
@@ -11,5 +13,5 @@ export declare class BrowserMihari extends MihariClient {
|
|
|
11
13
|
*/
|
|
12
14
|
private sendBeaconFlush;
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
export { BrowserMihari };
|
package/dist/index.js
CHANGED
|
@@ -1,73 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 });
|
|
4
11
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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;
|
|
11
19
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
BrowserMihari: () => BrowserMihari,
|
|
34
|
+
MihariConfig: () => import_logger_types.MihariConfig
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
var import_pako = __toESM(require("pako"));
|
|
38
|
+
var import_logger_core = require("@mihari/logger-core");
|
|
39
|
+
var import_logger_types = require("@mihari/logger-types");
|
|
40
|
+
var browserCompressFn = async (data) => {
|
|
41
|
+
return import_pako.default.gzip(data);
|
|
42
|
+
};
|
|
43
|
+
var BrowserMihari = class extends import_logger_core.MihariClient {
|
|
44
|
+
constructor(config) {
|
|
45
|
+
super(config);
|
|
46
|
+
this.unloadHandlerRegistered = false;
|
|
47
|
+
if (config.compression !== false) {
|
|
48
|
+
this.setCompressFn(browserCompressFn);
|
|
49
|
+
}
|
|
50
|
+
this.registerUnloadHandler();
|
|
51
|
+
}
|
|
52
|
+
getDefaultMetadata() {
|
|
53
|
+
const meta = {};
|
|
54
|
+
if (typeof navigator !== "undefined") {
|
|
55
|
+
meta.userAgent = navigator.userAgent;
|
|
56
|
+
}
|
|
57
|
+
if (typeof window !== "undefined" && window.location) {
|
|
58
|
+
meta.url = window.location.href;
|
|
20
59
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (typeof navigator !== "undefined") {
|
|
24
|
-
meta.userAgent = navigator.userAgent;
|
|
25
|
-
}
|
|
26
|
-
if (typeof window !== "undefined" && window.location) {
|
|
27
|
-
meta.url = window.location.href;
|
|
28
|
-
}
|
|
29
|
-
if (typeof document !== "undefined") {
|
|
30
|
-
meta.referrer = document.referrer;
|
|
31
|
-
}
|
|
32
|
-
return meta;
|
|
60
|
+
if (typeof document !== "undefined") {
|
|
61
|
+
meta.referrer = document.referrer;
|
|
33
62
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this.unloadHandlerRegistered = true;
|
|
42
|
-
window.addEventListener("visibilitychange", () => {
|
|
43
|
-
if (document.visibilityState === "hidden") {
|
|
44
|
-
this.sendBeaconFlush();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
window.addEventListener("pagehide", () => {
|
|
48
|
-
this.sendBeaconFlush();
|
|
49
|
-
});
|
|
63
|
+
return meta;
|
|
64
|
+
}
|
|
65
|
+
registerUnloadHandler() {
|
|
66
|
+
if (this.unloadHandlerRegistered) {
|
|
67
|
+
return;
|
|
50
68
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* when the page is being unloaded.
|
|
54
|
-
*/
|
|
55
|
-
sendBeaconFlush() {
|
|
56
|
-
if (typeof navigator === "undefined" || !navigator.sendBeacon) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// Access the batcher's internal queue by triggering a flush
|
|
60
|
-
// We build the beacon payload from whatever is pending
|
|
61
|
-
try {
|
|
62
|
-
const blob = new Blob([JSON.stringify({ _beaconFlush: true })], { type: "application/json" });
|
|
63
|
-
navigator.sendBeacon(this.config.endpoint, blob);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
// Best-effort: swallow errors during page unload
|
|
67
|
-
}
|
|
68
|
-
// Also attempt normal flush
|
|
69
|
-
void this.flush().catch(() => { });
|
|
69
|
+
if (typeof window === "undefined") {
|
|
70
|
+
return;
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
this.unloadHandlerRegistered = true;
|
|
73
|
+
window.addEventListener("visibilitychange", () => {
|
|
74
|
+
if (document.visibilityState === "hidden") {
|
|
75
|
+
this.sendBeaconFlush();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
window.addEventListener("pagehide", () => {
|
|
79
|
+
this.sendBeaconFlush();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Uses navigator.sendBeacon to reliably send remaining logs
|
|
84
|
+
* when the page is being unloaded.
|
|
85
|
+
*/
|
|
86
|
+
sendBeaconFlush() {
|
|
87
|
+
if (typeof navigator === "undefined" || !navigator.sendBeacon) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const blob = new Blob(
|
|
92
|
+
[JSON.stringify({ _beaconFlush: true })],
|
|
93
|
+
{ type: "application/json" }
|
|
94
|
+
);
|
|
95
|
+
navigator.sendBeacon(this.config.endpoint, blob);
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
void this.flush().catch(() => {
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
BrowserMihari,
|
|
105
|
+
MihariConfig
|
|
106
|
+
});
|
|
73
107
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import pako from \"pako\";\nimport { MihariClient } from \"@mihari/logger-core\";\nimport { MihariConfig, CompressFn } from \"@mihari/logger-types\";\n\nconst browserCompressFn: CompressFn = async (data) => {\n return pako.gzip(data);\n};\n\nexport class BrowserMihari extends MihariClient {\n private unloadHandlerRegistered = false;\n\n constructor(config: MihariConfig) {\n super(config);\n\n if (config.compression !== false) {\n this.setCompressFn(browserCompressFn);\n }\n\n this.registerUnloadHandler();\n }\n\n protected override getDefaultMetadata(): Record<string, unknown> {\n const meta: Record<string, unknown> = {};\n\n if (typeof navigator !== \"undefined\") {\n meta.userAgent = navigator.userAgent;\n }\n\n if (typeof window !== \"undefined\" && window.location) {\n meta.url = window.location.href;\n }\n\n if (typeof document !== \"undefined\") {\n meta.referrer = document.referrer;\n }\n\n return meta;\n }\n\n private registerUnloadHandler(): void {\n if (this.unloadHandlerRegistered) {\n return;\n }\n if (typeof window === \"undefined\") {\n return;\n }\n\n this.unloadHandlerRegistered = true;\n\n window.addEventListener(\"visibilitychange\", () => {\n if (document.visibilityState === \"hidden\") {\n this.sendBeaconFlush();\n }\n });\n\n window.addEventListener(\"pagehide\", () => {\n this.sendBeaconFlush();\n });\n }\n\n /**\n * Uses navigator.sendBeacon to reliably send remaining logs\n * when the page is being unloaded.\n */\n private sendBeaconFlush(): void {\n if (typeof navigator === \"undefined\" || !navigator.sendBeacon) {\n return;\n }\n\n // Access the batcher's internal queue by triggering a flush\n // We build the beacon payload from whatever is pending\n try {\n const blob = new Blob(\n [JSON.stringify({ _beaconFlush: true })],\n { type: \"application/json\" }\n );\n navigator.sendBeacon(this.config.endpoint, blob);\n } catch {\n // Best-effort: swallow errors during page unload\n }\n\n // Also attempt normal flush\n void this.flush().catch(() => {});\n }\n}\n\nexport { MihariConfig } from \"@mihari/logger-types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,yBAA6B;AAqF7B,0BAA6B;AAlF7B,IAAM,oBAAgC,OAAO,SAAS;AACpD,SAAO,YAAAA,QAAK,KAAK,IAAI;AACvB;AAEO,IAAM,gBAAN,cAA4B,gCAAa;AAAA,EAG9C,YAAY,QAAsB;AAChC,UAAM,MAAM;AAHd,SAAQ,0BAA0B;AAKhC,QAAI,OAAO,gBAAgB,OAAO;AAChC,WAAK,cAAc,iBAAiB;AAAA,IACtC;AAEA,SAAK,sBAAsB;AAAA,EAC7B;AAAA,EAEmB,qBAA8C;AAC/D,UAAM,OAAgC,CAAC;AAEvC,QAAI,OAAO,cAAc,aAAa;AACpC,WAAK,YAAY,UAAU;AAAA,IAC7B;AAEA,QAAI,OAAO,WAAW,eAAe,OAAO,UAAU;AACpD,WAAK,MAAM,OAAO,SAAS;AAAA,IAC7B;AAEA,QAAI,OAAO,aAAa,aAAa;AACnC,WAAK,WAAW,SAAS;AAAA,IAC3B;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,wBAA8B;AACpC,QAAI,KAAK,yBAAyB;AAChC;AAAA,IACF;AACA,QAAI,OAAO,WAAW,aAAa;AACjC;AAAA,IACF;AAEA,SAAK,0BAA0B;AAE/B,WAAO,iBAAiB,oBAAoB,MAAM;AAChD,UAAI,SAAS,oBAAoB,UAAU;AACzC,aAAK,gBAAgB;AAAA,MACvB;AAAA,IACF,CAAC;AAED,WAAO,iBAAiB,YAAY,MAAM;AACxC,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMQ,kBAAwB;AAC9B,QAAI,OAAO,cAAc,eAAe,CAAC,UAAU,YAAY;AAC7D;AAAA,IACF;AAIA,QAAI;AACF,YAAM,OAAO,IAAI;AAAA,QACf,CAAC,KAAK,UAAU,EAAE,cAAc,KAAK,CAAC,CAAC;AAAA,QACvC,EAAE,MAAM,mBAAmB;AAAA,MAC7B;AACA,gBAAU,WAAW,KAAK,OAAO,UAAU,IAAI;AAAA,IACjD,QAAQ;AAAA,IAER;AAGA,SAAK,KAAK,MAAM,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAAA,EAClC;AACF;","names":["pako"]}
|
|
@@ -1,74 +1,57 @@
|
|
|
1
|
+
// src/index.ts
|
|
1
2
|
import pako from "pako";
|
|
2
3
|
import { MihariClient } from "@mihari/logger-core";
|
|
3
|
-
import { MihariConfig
|
|
4
|
-
|
|
5
|
-
const browserCompressFn: CompressFn = async (data) => {
|
|
4
|
+
import { MihariConfig } from "@mihari/logger-types";
|
|
5
|
+
var browserCompressFn = async (data) => {
|
|
6
6
|
return pako.gzip(data);
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private unloadHandlerRegistered = false;
|
|
11
|
-
|
|
12
|
-
constructor(config: MihariConfig) {
|
|
8
|
+
var BrowserMihari = class extends MihariClient {
|
|
9
|
+
constructor(config) {
|
|
13
10
|
super(config);
|
|
14
|
-
|
|
11
|
+
this.unloadHandlerRegistered = false;
|
|
15
12
|
if (config.compression !== false) {
|
|
16
13
|
this.setCompressFn(browserCompressFn);
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
this.registerUnloadHandler();
|
|
20
16
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const meta: Record<string, unknown> = {};
|
|
24
|
-
|
|
17
|
+
getDefaultMetadata() {
|
|
18
|
+
const meta = {};
|
|
25
19
|
if (typeof navigator !== "undefined") {
|
|
26
20
|
meta.userAgent = navigator.userAgent;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
if (typeof window !== "undefined" && window.location) {
|
|
30
23
|
meta.url = window.location.href;
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
if (typeof document !== "undefined") {
|
|
34
26
|
meta.referrer = document.referrer;
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
return meta;
|
|
38
29
|
}
|
|
39
|
-
|
|
40
|
-
private registerUnloadHandler(): void {
|
|
30
|
+
registerUnloadHandler() {
|
|
41
31
|
if (this.unloadHandlerRegistered) {
|
|
42
32
|
return;
|
|
43
33
|
}
|
|
44
34
|
if (typeof window === "undefined") {
|
|
45
35
|
return;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
37
|
this.unloadHandlerRegistered = true;
|
|
49
|
-
|
|
50
38
|
window.addEventListener("visibilitychange", () => {
|
|
51
39
|
if (document.visibilityState === "hidden") {
|
|
52
40
|
this.sendBeaconFlush();
|
|
53
41
|
}
|
|
54
42
|
});
|
|
55
|
-
|
|
56
43
|
window.addEventListener("pagehide", () => {
|
|
57
44
|
this.sendBeaconFlush();
|
|
58
45
|
});
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
/**
|
|
62
48
|
* Uses navigator.sendBeacon to reliably send remaining logs
|
|
63
49
|
* when the page is being unloaded.
|
|
64
50
|
*/
|
|
65
|
-
|
|
51
|
+
sendBeaconFlush() {
|
|
66
52
|
if (typeof navigator === "undefined" || !navigator.sendBeacon) {
|
|
67
53
|
return;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
|
-
// Access the batcher's internal queue by triggering a flush
|
|
71
|
-
// We build the beacon payload from whatever is pending
|
|
72
55
|
try {
|
|
73
56
|
const blob = new Blob(
|
|
74
57
|
[JSON.stringify({ _beaconFlush: true })],
|
|
@@ -76,12 +59,13 @@ export class BrowserMihari extends MihariClient {
|
|
|
76
59
|
);
|
|
77
60
|
navigator.sendBeacon(this.config.endpoint, blob);
|
|
78
61
|
} catch {
|
|
79
|
-
// Best-effort: swallow errors during page unload
|
|
80
62
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
void this.flush().catch(() => {});
|
|
63
|
+
void this.flush().catch(() => {
|
|
64
|
+
});
|
|
84
65
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
BrowserMihari,
|
|
69
|
+
MihariConfig
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import pako from \"pako\";\nimport { MihariClient } from \"@mihari/logger-core\";\nimport { MihariConfig, CompressFn } from \"@mihari/logger-types\";\n\nconst browserCompressFn: CompressFn = async (data) => {\n return pako.gzip(data);\n};\n\nexport class BrowserMihari extends MihariClient {\n private unloadHandlerRegistered = false;\n\n constructor(config: MihariConfig) {\n super(config);\n\n if (config.compression !== false) {\n this.setCompressFn(browserCompressFn);\n }\n\n this.registerUnloadHandler();\n }\n\n protected override getDefaultMetadata(): Record<string, unknown> {\n const meta: Record<string, unknown> = {};\n\n if (typeof navigator !== \"undefined\") {\n meta.userAgent = navigator.userAgent;\n }\n\n if (typeof window !== \"undefined\" && window.location) {\n meta.url = window.location.href;\n }\n\n if (typeof document !== \"undefined\") {\n meta.referrer = document.referrer;\n }\n\n return meta;\n }\n\n private registerUnloadHandler(): void {\n if (this.unloadHandlerRegistered) {\n return;\n }\n if (typeof window === \"undefined\") {\n return;\n }\n\n this.unloadHandlerRegistered = true;\n\n window.addEventListener(\"visibilitychange\", () => {\n if (document.visibilityState === \"hidden\") {\n this.sendBeaconFlush();\n }\n });\n\n window.addEventListener(\"pagehide\", () => {\n this.sendBeaconFlush();\n });\n }\n\n /**\n * Uses navigator.sendBeacon to reliably send remaining logs\n * when the page is being unloaded.\n */\n private sendBeaconFlush(): void {\n if (typeof navigator === \"undefined\" || !navigator.sendBeacon) {\n return;\n }\n\n // Access the batcher's internal queue by triggering a flush\n // We build the beacon payload from whatever is pending\n try {\n const blob = new Blob(\n [JSON.stringify({ _beaconFlush: true })],\n { type: \"application/json\" }\n );\n navigator.sendBeacon(this.config.endpoint, blob);\n } catch {\n // Best-effort: swallow errors during page unload\n }\n\n // Also attempt normal flush\n void this.flush().catch(() => {});\n }\n}\n\nexport { MihariConfig } from \"@mihari/logger-types\";\n"],"mappings":";AAAA,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAqF7B,SAAS,oBAAoB;AAlF7B,IAAM,oBAAgC,OAAO,SAAS;AACpD,SAAO,KAAK,KAAK,IAAI;AACvB;AAEO,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAG9C,YAAY,QAAsB;AAChC,UAAM,MAAM;AAHd,SAAQ,0BAA0B;AAKhC,QAAI,OAAO,gBAAgB,OAAO;AAChC,WAAK,cAAc,iBAAiB;AAAA,IACtC;AAEA,SAAK,sBAAsB;AAAA,EAC7B;AAAA,EAEmB,qBAA8C;AAC/D,UAAM,OAAgC,CAAC;AAEvC,QAAI,OAAO,cAAc,aAAa;AACpC,WAAK,YAAY,UAAU;AAAA,IAC7B;AAEA,QAAI,OAAO,WAAW,eAAe,OAAO,UAAU;AACpD,WAAK,MAAM,OAAO,SAAS;AAAA,IAC7B;AAEA,QAAI,OAAO,aAAa,aAAa;AACnC,WAAK,WAAW,SAAS;AAAA,IAC3B;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,wBAA8B;AACpC,QAAI,KAAK,yBAAyB;AAChC;AAAA,IACF;AACA,QAAI,OAAO,WAAW,aAAa;AACjC;AAAA,IACF;AAEA,SAAK,0BAA0B;AAE/B,WAAO,iBAAiB,oBAAoB,MAAM;AAChD,UAAI,SAAS,oBAAoB,UAAU;AACzC,aAAK,gBAAgB;AAAA,MACvB;AAAA,IACF,CAAC;AAED,WAAO,iBAAiB,YAAY,MAAM;AACxC,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMQ,kBAAwB;AAC9B,QAAI,OAAO,cAAc,eAAe,CAAC,UAAU,YAAY;AAC7D;AAAA,IACF;AAIA,QAAI;AACF,YAAM,OAAO,IAAI;AAAA,QACf,CAAC,KAAK,UAAU,EAAE,cAAc,KAAK,CAAC,CAAC;AAAA,QACvC,EAAE,MAAM,mBAAmB;AAAA,MAC7B;AACA,gBAAU,WAAW,KAAK,OAAO,UAAU,IAAI;AAAA,IACjD,QAAQ;AAAA,IAER;AAGA,SAAK,KAAK,MAAM,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAAA,EAClC;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,20 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mihari/logger-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Browser client for mihari log collection",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
7
15
|
"files": [
|
|
8
16
|
"dist"
|
|
9
17
|
],
|
|
10
18
|
"scripts": {
|
|
11
|
-
"build": "
|
|
19
|
+
"build": "tsup",
|
|
12
20
|
"clean": "rm -rf dist",
|
|
13
21
|
"test": "cd ../.. && npx vitest run --config vitest.config.ts packages/browser"
|
|
14
22
|
},
|
|
23
|
+
"tsup": {
|
|
24
|
+
"entry": [
|
|
25
|
+
"src/index.ts"
|
|
26
|
+
],
|
|
27
|
+
"format": [
|
|
28
|
+
"cjs",
|
|
29
|
+
"esm"
|
|
30
|
+
],
|
|
31
|
+
"dts": true,
|
|
32
|
+
"splitting": false,
|
|
33
|
+
"sourcemap": true,
|
|
34
|
+
"clean": true,
|
|
35
|
+
"external": [
|
|
36
|
+
"@mihari/logger-core",
|
|
37
|
+
"@mihari/logger-types",
|
|
38
|
+
"pako"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
15
41
|
"dependencies": {
|
|
16
|
-
"@mihari/logger-core": "^0.
|
|
17
|
-
"@mihari/logger-types": "^0.
|
|
42
|
+
"@mihari/logger-core": "^0.2.0",
|
|
43
|
+
"@mihari/logger-types": "^0.2.0",
|
|
18
44
|
"pako": "^2.1.0"
|
|
19
45
|
},
|
|
20
46
|
"devDependencies": {
|
|
@@ -29,5 +55,5 @@
|
|
|
29
55
|
"url": "https://github.com/mihari/mihari-js",
|
|
30
56
|
"directory": "packages/browser"
|
|
31
57
|
},
|
|
32
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "a0a2dd591dafbf0923bb81bd5d8180fa6d6eecea"
|
|
33
59
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAc,MAAM,sBAAsB,CAAC;AAMhE,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,uBAAuB,CAAS;gBAE5B,MAAM,EAAE,YAAY;cAUb,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAkBhE,OAAO,CAAC,qBAAqB;IAqB7B;;;OAGG;IACH,OAAO,CAAC,eAAe;CAoBxB;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|