@spotlightjs/overlay 1.8.3 → 2.0.0-alpha.2

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,5 +1,5 @@
1
- import { EventProcessor, Hub, Integration } from '@sentry/types';
2
- type SpotlightBrowserIntegationOptions = {
1
+ import { Client, Event } from '@sentry/types';
2
+ type SpotlightBrowserIntegrationOptions = {
3
3
  /**
4
4
  * The URL of the Sidecar instance to connect and forward events to.
5
5
  * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.
@@ -8,16 +8,30 @@ type SpotlightBrowserIntegationOptions = {
8
8
  */
9
9
  sidecarUrl?: string;
10
10
  };
11
- export declare class Spotlight implements Integration {
11
+ /**
12
+ * A Sentry integration for Spotlight integration that the Overlay will inject automatically.
13
+ * This integration does a couple of things:
14
+ *
15
+ * - Try to enrich stack traces by querying a potentially existing context lines integration
16
+ * on the server side (@see packages/astro/src/vite/source-context.ts)
17
+ * - Drop transactions created from interactions with the Spotlight UI
18
+ * - Forward Sentry events sent from the browser SDK to the Sidecar instance running on
19
+ * either on http://localhost:8969/stream or on the supplied `sidecarUrl` option.
20
+ *
21
+ * @param options - Configuration options for the integration ({@link SpotlightBrowserIntegrationOptions})
22
+ *
23
+ * @returns Sentry integration for Spotlight.
24
+ */
25
+ export declare const spotlightIntegration: (options?: SpotlightBrowserIntegrationOptions) => {
12
26
  name: string;
13
- private _sidecarUrl;
14
- constructor(options?: SpotlightBrowserIntegationOptions);
15
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
16
- }
27
+ setupOnce: () => void;
28
+ setup: () => void;
29
+ processEvent: (event: Event) => Promise<Event | null>;
30
+ afterAllSetup: (client: Client) => void;
31
+ };
17
32
  type FetchImpl = typeof fetch;
18
33
  /**
19
34
  * We want to get an unpatched fetch implementation to avoid capturing our own calls.
20
- * TODO: We might need to expose this as a utitly function so people can make requests without the SDK picking it put
21
35
  */
22
36
  export declare function getNativeFetchImplementation(): FetchImpl;
23
37
  export {};
@@ -1,3 +1,4 @@
1
1
  export declare function activateLogger(): void;
2
2
  export declare function deactivateLogger(): void;
3
3
  export declare function log(...args: unknown[]): void;
4
+ export declare function warn(...args: unknown[]): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotlightjs/overlay",
3
3
  "description": "The overlay of Spotlight to add debug interface to your web app.",
4
- "version": "1.8.3",
4
+ "version": "2.0.0-alpha.2",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [
@@ -18,7 +18,8 @@
18
18
  },
19
19
  "dependencies": {},
20
20
  "devDependencies": {
21
- "@sentry/types": "^7.77.0",
21
+ "@sentry/types": "^8.0.0-alpha.7",
22
+ "@sentry/utils": "^8.0.0-alpha.7",
22
23
  "@types/react": "^18.2.37",
23
24
  "@types/react-dom": "^18.2.15",
24
25
  "@typescript-eslint/eslint-plugin": "^6.0.0",
@@ -34,7 +35,6 @@
34
35
  "vite-plugin-svgr": "^3.2.0",
35
36
  "vitest": "^0.34.6",
36
37
  "@fontsource/raleway": "^5.0.8",
37
- "@sentry/utils": "^7.77.0",
38
38
  "autoprefixer": "^10.4.15",
39
39
  "dayjs": "^1.11.9",
40
40
  "platformicons": "^5.8.3",