@canmi/web 2026.1005.0 → 2026.1005.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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region disclose/src/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* What the page is built with, said where a profiler reads it: each dotted path set on `window`,
|
|
4
|
+
* the objects on the way made as needed, and nothing already there replaced. A patch for
|
|
5
|
+
* Wappalyzer, whose fingerprints read globals -- and read a version only from some. See
|
|
6
|
+
* spec/web/disclose.md.
|
|
7
|
+
*/
|
|
8
|
+
export declare function disclose(entries: Readonly<Record<string, unknown>>): void;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region disclose/src/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* What the page is built with, said where a profiler reads it: each dotted path set on `window`,
|
|
4
|
+
* the objects on the way made as needed, and nothing already there replaced. A patch for
|
|
5
|
+
* Wappalyzer, whose fingerprints read globals -- and read a version only from some. See
|
|
6
|
+
* spec/web/disclose.md.
|
|
7
|
+
*/
|
|
8
|
+
function disclose(entries) {
|
|
9
|
+
if (typeof window === "undefined") return;
|
|
10
|
+
for (const [path, value] of Object.entries(entries)) {
|
|
11
|
+
const keys = path.split(".");
|
|
12
|
+
const last = keys.pop();
|
|
13
|
+
if (!last) continue;
|
|
14
|
+
let target = window;
|
|
15
|
+
for (const key of keys) {
|
|
16
|
+
const next = target[key];
|
|
17
|
+
if (next === null || typeof next !== "object" && typeof next !== "function") target[key] = {};
|
|
18
|
+
target = target[key];
|
|
19
|
+
}
|
|
20
|
+
if (target[last] === void 0) target[last] = value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { disclose };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { disclose } from "../../disclose/src/index.js";
|
|
1
2
|
import { initOptions } from "./options.js";
|
|
2
|
-
import { init } from "@sentry/sveltekit";
|
|
3
|
+
import { SDK_VERSION, init } from "@sentry/sveltekit";
|
|
3
4
|
//#region sentry/src/client.ts
|
|
4
5
|
/** Initialize the browser SDK, or do nothing when the app has no DSN. */
|
|
5
6
|
function initClient({ dsn, dev }) {
|
|
6
7
|
if (!dsn) return;
|
|
7
8
|
init(initOptions(dsn, dev));
|
|
9
|
+
disclose({ "Sentry.SDK_VERSION": SDK_VERSION });
|
|
8
10
|
}
|
|
9
11
|
//#endregion
|
|
10
12
|
export { initClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canmi/web",
|
|
3
|
-
"version": "2026.1005.
|
|
3
|
+
"version": "2026.1005.1",
|
|
4
4
|
"description": "SvelteKit compat, referer and Sentry.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browserslist",
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"types": "./dist/sentry/src/server.d.ts",
|
|
45
45
|
"default": "./dist/sentry/src/server.js"
|
|
46
46
|
},
|
|
47
|
+
"./disclose": {
|
|
48
|
+
"types": "./dist/disclose/src/index.d.ts",
|
|
49
|
+
"default": "./dist/disclose/src/index.js"
|
|
50
|
+
},
|
|
47
51
|
"./package.json": "./package.json"
|
|
48
52
|
},
|
|
49
53
|
"dependencies": {
|