@archie/devtools 0.0.9 → 0.0.10

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  injectInspector
3
- } from "../../chunk-6HHNPJXA.mjs";
3
+ } from "../../chunk-REJDPYAO.mjs";
4
4
  import "../../chunk-D5EA6RR5.mjs";
5
5
 
6
6
  // src/client/inject-inspector/auto.ts
7
- injectInspector();
7
+ injectInspector({ scriptSource: "remote" });
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Default CDN URL for the standalone inspector script.
3
+ * Override via InjectOptions.scriptUrl when you need SRI, a private CDN, or a pinned version.
4
+ * Note: cache-busting with Date.now() is intentional (avoids stale inspectors) but
5
+ * incompatible with Subresource Integrity — pass a fixed scriptUrl + integrity attribute externally if needed.
6
+ */
7
+ declare const REMOTE_INSPECTOR_SCRIPT_URL = "https://pub-bf238c278d9644b39ec34ecaca1d315c.r2.dev/inspector.standalone.js";
1
8
  /** Only configured domains (Archie host origins) and optionally localhost in dev. "*" is never used. */
2
9
  type InjectOptions = {
3
10
  id?: string;
@@ -20,6 +27,18 @@ type InjectOptions = {
20
27
  * When undefined, inferred from document.referrer (localhost or missing = dev).
21
28
  */
22
29
  dev?: boolean;
30
+ /**
31
+ * Where to load the inspector script from.
32
+ * - "remote" (default): load from REMOTE_INSPECTOR_SCRIPT_URL with a dynamic hash to avoid cache.
33
+ * - "local": load from the bundled module (import('./inspector.js')).
34
+ */
35
+ scriptSource?: 'remote' | 'local';
36
+ /**
37
+ * Override the remote script URL (e.g. your own CDN, a pinned version, or a URL with SRI hash).
38
+ * Only used when scriptSource is "remote" (default). Defaults to REMOTE_INSPECTOR_SCRIPT_URL.
39
+ * Example: 'https://my-cdn.com/inspector.standalone.js'
40
+ */
41
+ scriptUrl?: string;
23
42
  };
24
43
  /**
25
44
  * Loads and runs the Archie inspector script (dynamic import).
@@ -35,4 +54,4 @@ type InjectOptions = {
35
54
  */
36
55
  declare function injectInspector(opts?: InjectOptions): Promise<HTMLScriptElement | null> | null;
37
56
 
38
- export { type InjectOptions, injectInspector };
57
+ export { type InjectOptions, REMOTE_INSPECTOR_SCRIPT_URL, injectInspector };
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Default CDN URL for the standalone inspector script.
3
+ * Override via InjectOptions.scriptUrl when you need SRI, a private CDN, or a pinned version.
4
+ * Note: cache-busting with Date.now() is intentional (avoids stale inspectors) but
5
+ * incompatible with Subresource Integrity — pass a fixed scriptUrl + integrity attribute externally if needed.
6
+ */
7
+ declare const REMOTE_INSPECTOR_SCRIPT_URL = "https://pub-bf238c278d9644b39ec34ecaca1d315c.r2.dev/inspector.standalone.js";
1
8
  /** Only configured domains (Archie host origins) and optionally localhost in dev. "*" is never used. */
2
9
  type InjectOptions = {
3
10
  id?: string;
@@ -20,6 +27,18 @@ type InjectOptions = {
20
27
  * When undefined, inferred from document.referrer (localhost or missing = dev).
21
28
  */
22
29
  dev?: boolean;
30
+ /**
31
+ * Where to load the inspector script from.
32
+ * - "remote" (default): load from REMOTE_INSPECTOR_SCRIPT_URL with a dynamic hash to avoid cache.
33
+ * - "local": load from the bundled module (import('./inspector.js')).
34
+ */
35
+ scriptSource?: 'remote' | 'local';
36
+ /**
37
+ * Override the remote script URL (e.g. your own CDN, a pinned version, or a URL with SRI hash).
38
+ * Only used when scriptSource is "remote" (default). Defaults to REMOTE_INSPECTOR_SCRIPT_URL.
39
+ * Example: 'https://my-cdn.com/inspector.standalone.js'
40
+ */
41
+ scriptUrl?: string;
23
42
  };
24
43
  /**
25
44
  * Loads and runs the Archie inspector script (dynamic import).
@@ -35,4 +54,4 @@ type InjectOptions = {
35
54
  */
36
55
  declare function injectInspector(opts?: InjectOptions): Promise<HTMLScriptElement | null> | null;
37
56
 
38
- export { type InjectOptions, injectInspector };
57
+ export { type InjectOptions, REMOTE_INSPECTOR_SCRIPT_URL, injectInspector };