@chrom-ar/collector 0.4.0 → 0.5.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 +28 -0
- package/README.md +97 -26
- package/dist/{chunk-YN5N3X7X.js → chunk-42XODVHT.js} +8 -1
- package/dist/collector.esm.js +7 -0
- package/dist/index.cjs +128 -38
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +122 -39
- package/dist/rum.cjs +40 -10
- package/dist/rum.d.cts +10 -4
- package/dist/rum.d.ts +10 -4
- package/dist/rum.esm.js +2 -0
- package/dist/rum.js +34 -11
- package/dist/{types-CTnanJxh.d.cts → types-ml-o_-mr.d.cts} +9 -4
- package/dist/{types-CTnanJxh.d.ts → types-ml-o_-mr.d.ts} +9 -4
- package/package.json +9 -5
|
@@ -31,6 +31,7 @@ interface Breadcrumb {
|
|
|
31
31
|
category?: string;
|
|
32
32
|
message: string;
|
|
33
33
|
}
|
|
34
|
+
|
|
34
35
|
/** One fetch or XHR call, as the RUM plugin sees it. Times are `performance.now()` ms. */
|
|
35
36
|
interface RequestTiming {
|
|
36
37
|
method: string;
|
|
@@ -125,11 +126,14 @@ type TestResult = {
|
|
|
125
126
|
};
|
|
126
127
|
type BreadcrumbKind = "console" | "dom" | "fetch" | "xhr" | "history";
|
|
127
128
|
interface CollectorOptions {
|
|
128
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Your project's DSN, from its setup page in Collector. Without it, nothing is sent.
|
|
131
|
+
* Default: the page's `<meta name="collector-dsn">`.
|
|
132
|
+
*/
|
|
129
133
|
dsn?: string;
|
|
130
|
-
/** e.g. `"production"`, `"staging"`. Issues are counted per environment. */
|
|
134
|
+
/** e.g. `"production"`, `"staging"`. Issues are counted per environment. Default: `<meta name="collector-environment">`. */
|
|
131
135
|
environment?: string;
|
|
132
|
-
/** Your app's version or git sha, e.g. `"web@1.4.2"`. */
|
|
136
|
+
/** Your app's version or git sha, e.g. `"web@1.4.2"`. Default: `<meta name="collector-release">`. */
|
|
133
137
|
release?: string;
|
|
134
138
|
/** Logs what the SDK does to the console, prefixed `[collector]`. Default `false`. */
|
|
135
139
|
debug?: boolean;
|
|
@@ -147,7 +151,8 @@ interface CollectorOptions {
|
|
|
147
151
|
ignoreErrors?: (string | RegExp)[];
|
|
148
152
|
/**
|
|
149
153
|
* Which script URLs are your app's own code. When set, a frame is in-app only
|
|
150
|
-
* if its URL matches. Default: same origin as the page, except vendor chunks
|
|
154
|
+
* if its URL matches. Default: same origin as the page, except vendor chunks
|
|
155
|
+
* and, on pages with an import map, pinned dependencies (see `collector-in-app`).
|
|
151
156
|
*/
|
|
152
157
|
inAppUrls?: (string | RegExp)[];
|
|
153
158
|
/** Remove `?query` and `#hash` from URLs sent to Collector. Default `true`. */
|
|
@@ -31,6 +31,7 @@ interface Breadcrumb {
|
|
|
31
31
|
category?: string;
|
|
32
32
|
message: string;
|
|
33
33
|
}
|
|
34
|
+
|
|
34
35
|
/** One fetch or XHR call, as the RUM plugin sees it. Times are `performance.now()` ms. */
|
|
35
36
|
interface RequestTiming {
|
|
36
37
|
method: string;
|
|
@@ -125,11 +126,14 @@ type TestResult = {
|
|
|
125
126
|
};
|
|
126
127
|
type BreadcrumbKind = "console" | "dom" | "fetch" | "xhr" | "history";
|
|
127
128
|
interface CollectorOptions {
|
|
128
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Your project's DSN, from its setup page in Collector. Without it, nothing is sent.
|
|
131
|
+
* Default: the page's `<meta name="collector-dsn">`.
|
|
132
|
+
*/
|
|
129
133
|
dsn?: string;
|
|
130
|
-
/** e.g. `"production"`, `"staging"`. Issues are counted per environment. */
|
|
134
|
+
/** e.g. `"production"`, `"staging"`. Issues are counted per environment. Default: `<meta name="collector-environment">`. */
|
|
131
135
|
environment?: string;
|
|
132
|
-
/** Your app's version or git sha, e.g. `"web@1.4.2"`. */
|
|
136
|
+
/** Your app's version or git sha, e.g. `"web@1.4.2"`. Default: `<meta name="collector-release">`. */
|
|
133
137
|
release?: string;
|
|
134
138
|
/** Logs what the SDK does to the console, prefixed `[collector]`. Default `false`. */
|
|
135
139
|
debug?: boolean;
|
|
@@ -147,7 +151,8 @@ interface CollectorOptions {
|
|
|
147
151
|
ignoreErrors?: (string | RegExp)[];
|
|
148
152
|
/**
|
|
149
153
|
* Which script URLs are your app's own code. When set, a frame is in-app only
|
|
150
|
-
* if its URL matches. Default: same origin as the page, except vendor chunks
|
|
154
|
+
* if its URL matches. Default: same origin as the page, except vendor chunks
|
|
155
|
+
* and, on pages with an import map, pinned dependencies (see `collector-in-app`).
|
|
151
156
|
*/
|
|
152
157
|
inAppUrls?: (string | RegExp)[];
|
|
153
158
|
/** Remove `?query` and `#hash` from URLs sent to Collector. Default `true`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrom-ar/collector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Reports your browser app's errors to Collector.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-tracking",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"default": "./dist/rum.cjs"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
+
"./collector.esm.js": "./dist/collector.esm.js",
|
|
46
|
+
"./rum.esm.js": "./dist/rum.esm.js",
|
|
45
47
|
"./package.json": "./package.json"
|
|
46
48
|
},
|
|
47
49
|
"files": [
|
|
@@ -52,19 +54,21 @@
|
|
|
52
54
|
"access": "public"
|
|
53
55
|
},
|
|
54
56
|
"scripts": {
|
|
55
|
-
"build": "tsup",
|
|
57
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
|
|
56
58
|
"test": "vitest run --project unit",
|
|
57
59
|
"test:browser": "vitest run --project browser",
|
|
58
60
|
"typecheck": "tsc --noEmit",
|
|
59
61
|
"size": "size-limit",
|
|
60
|
-
"check": "
|
|
62
|
+
"check:standalone": "node scripts/check-standalone.js",
|
|
63
|
+
"check": "npm run typecheck && npm test && npm run build && npm run check:standalone && npm run size",
|
|
61
64
|
"prepublishOnly": "npm run check"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
67
|
"@size-limit/preset-small-lib": "^14.3.0",
|
|
65
68
|
"@vitest/browser-playwright": "^5.1.0",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
69
|
+
"es-module-lexer": "^3.0.5",
|
|
70
|
+
"jsdom": "^31.0.1",
|
|
71
|
+
"playwright": "^1.65.1",
|
|
68
72
|
"size-limit": "^14.3.0",
|
|
69
73
|
"tsup": "^9.0.0",
|
|
70
74
|
"typescript": "^6.0.3",
|