@canmi/web 2026.1005.4 → 2026.1005.5

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.
@@ -8,7 +8,10 @@ import { join } from "node:path";
8
8
  const VERSIONED = [
9
9
  "@codemirror/view",
10
10
  "@videojs/core",
11
- "d3-hierarchy"
11
+ "d3-array",
12
+ "d3-hierarchy",
13
+ "d3-scale",
14
+ "d3-shape"
12
15
  ];
13
16
  /** The globals a package used on every page is disclosed as, given its installed version. */
14
17
  const GLOBALS = {
@@ -0,0 +1,10 @@
1
+ import { MiddlewareHandler } from "hono";
2
+ //#region disclose/src/hono.d.ts
3
+ /**
4
+ * `X-Powered-By: Hono` on every answer, which is all Wappalyzer's Hono fingerprint reads -- and on
5
+ * a page's own response alone, so an API answered in a browser is named too. Hono's own
6
+ * `poweredBy` sets the header in place, which throws on an answer passed through from a `fetch`,
7
+ * whose headers are immutable; that one is copied first. See spec/web/disclose.md.
8
+ */
9
+ export declare function poweredBy(): MiddlewareHandler;
10
+ //#endregion
@@ -0,0 +1,25 @@
1
+ //#region disclose/src/hono.ts
2
+ /**
3
+ * `X-Powered-By: Hono` on every answer, which is all Wappalyzer's Hono fingerprint reads -- and on
4
+ * a page's own response alone, so an API answered in a browser is named too. Hono's own
5
+ * `poweredBy` sets the header in place, which throws on an answer passed through from a `fetch`,
6
+ * whose headers are immutable; that one is copied first. See spec/web/disclose.md.
7
+ */
8
+ function poweredBy() {
9
+ return async (c, next) => {
10
+ await next();
11
+ try {
12
+ c.res.headers.set("X-Powered-By", "Hono");
13
+ } catch {
14
+ const headers = new Headers(c.res.headers);
15
+ headers.set("X-Powered-By", "Hono");
16
+ c.res = new Response(c.res.body, {
17
+ status: c.res.status,
18
+ statusText: c.res.statusText,
19
+ headers
20
+ });
21
+ }
22
+ };
23
+ }
24
+ //#endregion
25
+ export { poweredBy };
@@ -19,6 +19,12 @@ export interface Disclosure {
19
19
  * is nothing to say. See spec/web/disclose.md.
20
20
  */
21
21
  export declare function disclosureHead(disclosure: Disclosure | undefined): string;
22
+ /**
23
+ * D3, from the component that draws with it: `d3.version`, which no D3 module sets. The value names
24
+ * the module, which Wappalyzer's version check refuses, so D3 shows without the module's own major
25
+ * read as D3's. Nothing when the app's build found no D3 module. See spec/web/disclose.md.
26
+ */
27
+ export declare function discloseD3(disclosure: Disclosure | undefined): void;
22
28
  /** Sets `globals` on `window`, from an app's root layout; nothing on the server. */
23
29
  export declare function discloseGlobals(disclosure: Disclosure | undefined): void;
24
30
  /**
@@ -14,6 +14,23 @@ function disclosureHead(disclosure) {
14
14
  }
15
15
  return parts.join("");
16
16
  }
17
+ /** The D3 modules an app may draw with, any one of which is D3 to a fingerprint. */
18
+ const D3_MODULES = [
19
+ "d3-hierarchy",
20
+ "d3-scale",
21
+ "d3-shape",
22
+ "d3-array"
23
+ ];
24
+ /**
25
+ * D3, from the component that draws with it: `d3.version`, which no D3 module sets. The value names
26
+ * the module, which Wappalyzer's version check refuses, so D3 shows without the module's own major
27
+ * read as D3's. Nothing when the app's build found no D3 module. See spec/web/disclose.md.
28
+ */
29
+ function discloseD3(disclosure) {
30
+ const versions = disclosure?.versions ?? {};
31
+ const name = D3_MODULES.find((module) => versions[module]);
32
+ if (name) disclose({ "d3.version": `${name}@${versions[name]}` });
33
+ }
17
34
  /** Sets `globals` on `window`, from an app's root layout; nothing on the server. */
18
35
  function discloseGlobals(disclosure) {
19
36
  if (disclosure) disclose(disclosure.globals);
@@ -41,4 +58,4 @@ function disclose(entries) {
41
58
  }
42
59
  }
43
60
  //#endregion
44
- export { disclose, discloseGlobals, disclosureHead };
61
+ export { disclose, discloseD3, discloseGlobals, disclosureHead };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canmi/web",
3
- "version": "2026.1005.4",
3
+ "version": "2026.1005.5",
4
4
  "description": "SvelteKit compat, referer and Sentry.",
5
5
  "keywords": [
6
6
  "browserslist",
@@ -48,6 +48,10 @@
48
48
  "types": "./dist/disclose/src/build.d.ts",
49
49
  "default": "./dist/disclose/src/build.js"
50
50
  },
51
+ "./disclose/hono": {
52
+ "types": "./dist/disclose/src/hono.d.ts",
53
+ "default": "./dist/disclose/src/hono.js"
54
+ },
51
55
  "./disclose": {
52
56
  "types": "./dist/disclose/src/index.d.ts",
53
57
  "default": "./dist/disclose/src/index.js"
@@ -59,11 +63,13 @@
59
63
  },
60
64
  "devDependencies": {
61
65
  "@sentry/sveltekit": "^11.4.0",
62
- "@sveltejs/kit": "^3.0.0"
66
+ "@sveltejs/kit": "^3.0.0",
67
+ "hono": "^4.13.12"
63
68
  },
64
69
  "peerDependencies": {
65
70
  "@sentry/sveltekit": "^11.4.0",
66
- "@sveltejs/kit": "^3.0.0"
71
+ "@sveltejs/kit": "^3.0.0",
72
+ "hono": "^4.13.12"
67
73
  },
68
74
  "peerDependenciesMeta": {
69
75
  "@sentry/sveltekit": {
@@ -71,6 +77,9 @@
71
77
  },
72
78
  "@sveltejs/kit": {
73
79
  "optional": true
80
+ },
81
+ "hono": {
82
+ "optional": true
74
83
  }
75
84
  },
76
85
  "scripts": {