@sentry/server-utils 10.58.0 → 10.60.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/build/cjs/integrations/tracing-channel/mysql.js +137 -0
- package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -0
- package/build/cjs/orchestrion/bundler/vite.js +34 -0
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -0
- package/build/cjs/orchestrion/channels.js +8 -0
- package/build/cjs/orchestrion/channels.js.map +1 -0
- package/build/cjs/orchestrion/config.js +38 -0
- package/build/cjs/orchestrion/config.js.map +1 -0
- package/build/cjs/orchestrion/detect.js +20 -0
- package/build/cjs/orchestrion/detect.js.map +1 -0
- package/build/cjs/orchestrion/index.js +10 -0
- package/build/cjs/orchestrion/index.js.map +1 -0
- package/build/cjs/orchestrion/runtime/register.js +50 -0
- package/build/cjs/orchestrion/runtime/register.js.map +1 -0
- package/build/cjs/redis/redis-dc-subscriber.js +12 -16
- package/build/cjs/redis/redis-dc-subscriber.js.map +1 -1
- package/build/esm/integrations/tracing-channel/mysql.js +135 -0
- package/build/esm/integrations/tracing-channel/mysql.js.map +1 -0
- package/build/esm/orchestrion/bundler/vite.js +32 -0
- package/build/esm/orchestrion/bundler/vite.js.map +1 -0
- package/build/esm/orchestrion/channels.js +6 -0
- package/build/esm/orchestrion/channels.js.map +1 -0
- package/build/esm/orchestrion/config.js +34 -0
- package/build/esm/orchestrion/config.js.map +1 -0
- package/build/esm/orchestrion/detect.js +18 -0
- package/build/esm/orchestrion/detect.js.map +1 -0
- package/build/esm/orchestrion/index.js +3 -0
- package/build/esm/orchestrion/index.js.map +1 -0
- package/build/esm/orchestrion/runtime/register.js +48 -0
- package/build/esm/orchestrion/runtime/register.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/redis/redis-dc-subscriber.js +12 -16
- package/build/esm/redis/redis-dc-subscriber.js.map +1 -1
- package/build/orchestrion/import-hook.mjs +19 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts +10 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/vite.d.ts +31 -0
- package/build/types/orchestrion/bundler/vite.d.ts.map +1 -0
- package/build/types/orchestrion/channels.d.ts +18 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -0
- package/build/types/orchestrion/config.d.ts +35 -0
- package/build/types/orchestrion/config.d.ts.map +1 -0
- package/build/types/orchestrion/detect.d.ts +23 -0
- package/build/types/orchestrion/detect.d.ts.map +1 -0
- package/build/types/orchestrion/index.d.ts +3 -0
- package/build/types/orchestrion/index.d.ts.map +1 -0
- package/build/types/orchestrion/runtime/register.d.ts +23 -0
- package/build/types/orchestrion/runtime/register.d.ts.map +1 -0
- package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -1
- package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +10 -0
- package/build/types-ts3.8/orchestrion/bundler/vite.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/channels.d.ts +18 -0
- package/build/types-ts3.8/orchestrion/config.d.ts +35 -0
- package/build/types-ts3.8/orchestrion/detect.d.ts +23 -0
- package/build/types-ts3.8/orchestrion/index.d.ts +3 -0
- package/build/types-ts3.8/orchestrion/runtime/register.d.ts +23 -0
- package/package.json +76 -11
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fully-qualified `diagnostics_channel` names that orchestrion publishes to.
|
|
3
|
+
*
|
|
4
|
+
* Orchestrion's transform always prefixes the configured `channelName` with
|
|
5
|
+
* `orchestrion:${module.name}:`. So a config of
|
|
6
|
+
* `{ channelName: 'query', module: { name: 'mysql' } }`
|
|
7
|
+
* publishes to `orchestrion:mysql:query`.
|
|
8
|
+
*
|
|
9
|
+
* Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full
|
|
10
|
+
* prefixed string from this map; the config files set only the unprefixed
|
|
11
|
+
* suffix in `channelName`. Keeping both pieces in one file is what guarantees
|
|
12
|
+
* they don't drift apart and silently stop firing.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CHANNELS: {
|
|
15
|
+
readonly MYSQL_QUERY: "orchestrion:mysql:query";
|
|
16
|
+
};
|
|
17
|
+
export type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];
|
|
18
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../../src/orchestrion/channels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ;;CAEX,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';
|
|
2
|
+
/**
|
|
3
|
+
* The central list of channel injections orchestrion should perform.
|
|
4
|
+
*
|
|
5
|
+
* This module has NO side effects — it's the only thing both the runtime hook
|
|
6
|
+
* (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)
|
|
7
|
+
* import from. Adding a new instrumented method is one entry here plus one
|
|
8
|
+
* subscriber in `integrations/<lib>/tracing-channel.ts`.
|
|
9
|
+
*
|
|
10
|
+
* `channelName` here is the unprefixed suffix; the actual diagnostics_channel
|
|
11
|
+
* name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[];
|
|
14
|
+
/**
|
|
15
|
+
* The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`
|
|
16
|
+
* (e.g. `['mysql']`).
|
|
17
|
+
*
|
|
18
|
+
* Bundler plugins MUST ensure these are actually bundled rather than
|
|
19
|
+
* externalized: an externalized dependency is resolved from `node_modules` at
|
|
20
|
+
* runtime and never passes through the code transform's `onLoad`, so its
|
|
21
|
+
* diagnostics_channel calls are silently never injected.
|
|
22
|
+
*/
|
|
23
|
+
export declare const INSTRUMENTED_MODULE_NAMES: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Returns `external` with any instrumented packages removed, so a bundler that
|
|
26
|
+
* uses an "external" denylist (esbuild, Bun, Rollup) still bundles — and thus
|
|
27
|
+
* transforms — them. Matches an exact package name (`'mysql'`) or a subpath
|
|
28
|
+
* (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`
|
|
29
|
+
* is returned unchanged.
|
|
30
|
+
*
|
|
31
|
+
* (Vite uses an `ssr.noExternal` allowlist instead, so it consumes
|
|
32
|
+
* `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)
|
|
33
|
+
*/
|
|
34
|
+
export declare function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined;
|
|
35
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/orchestrion/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,qBAAqB,EAqB1D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,EAAyE,CAAC;AAExH;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAO1G"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __SENTRY_ORCHESTRION__: {
|
|
3
|
+
runtime?: boolean;
|
|
4
|
+
bundler?: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Verifies that the diagnostics channels have been injected either by the
|
|
9
|
+
* runtime `--import` hook (or init-time registration), a bundler plugin, or
|
|
10
|
+
* both, and warns if not.
|
|
11
|
+
*
|
|
12
|
+
* Both injectors being active at once is fine: they operate on disjoint module
|
|
13
|
+
* sets (a module is either loaded through Node's loader and transformed by the
|
|
14
|
+
* runtime hook, or inlined by the bundler and transformed by the plugin), so
|
|
15
|
+
* a single module can't be double-wrapped. A hybrid setup, with some deps
|
|
16
|
+
* external and runtime-instrumented, others bundled and plugin-instrumented,
|
|
17
|
+
* is fine.
|
|
18
|
+
*
|
|
19
|
+
* Note: intentionally does NOT warn in production, only in debug builds,
|
|
20
|
+
* because production warnings are reserved for truly critical issues.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectOrchestrionSetup(): void;
|
|
23
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/orchestrion/detect.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,sBAAsB,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CAClF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAiB7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __SENTRY_ORCHESTRION__: {
|
|
3
|
+
runtime?: boolean;
|
|
4
|
+
bundler?: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Synchronously register the diagnostics-channel injection module hooks.
|
|
9
|
+
*
|
|
10
|
+
* This is the single source of truth for the registration logic. It is used by:
|
|
11
|
+
* - `Sentry.init()` (the Node SDK calls it directly — that's why this module
|
|
12
|
+
* must be CJS-compatible / dual-built, so it can be `require()`d synchronously
|
|
13
|
+
* before the app's `import`s resolve), and
|
|
14
|
+
* - `import-hook.mjs`, the side-effecting `--import` entry, which just calls it.
|
|
15
|
+
*
|
|
16
|
+
* Libraries imported *after* this call publish the `tracingChannel` events that
|
|
17
|
+
* the channel-based integrations subscribe to.
|
|
18
|
+
*
|
|
19
|
+
* Idempotent via `globalThis.__SENTRY_ORCHESTRION__` — a no-op if the runtime
|
|
20
|
+
* `--import` hook or a bundler plugin already injected the channels.
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerDiagnosticsChannelInjection(): void;
|
|
23
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/orchestrion/runtime/register.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,sBAAsB,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CAClF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mCAAmC,IAAI,IAAI,CA4F1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-dc-subscriber.d.ts","sourceRoot":"","sources":["../../../src/redis/redis-dc-subscriber.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redis-dc-subscriber.d.ts","sourceRoot":"","sources":["../../../src/redis/redis-dc-subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAczC,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,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AI,KAC9B,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAK5B;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,0BAA0B,EAC1C,YAAY,CAAC,EAAE,kCAAkC,GAChD,IAAI,CAwBN;AA0ID,qDAAqD;AACrD,wBAAgB,uCAAuC,IAAI,IAAI,CAG9D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXPERIMENTAL — orchestrion-driven mysql integration.
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to the `orchestrion:mysql:query` diagnostics_channel that the
|
|
5
|
+
* orchestrion code transform injects into `mysql/lib/Connection.js`'s
|
|
6
|
+
* `Connection.prototype.query`. Requires the orchestrion runtime hook or
|
|
7
|
+
* bundler plugin to be active — wire that up via `_experimentalSetupOrchestrion`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const mysqlChannelIntegration: () => import("@sentry/core").Integration;
|
|
10
|
+
//# sourceMappingURL=mysql.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type UnknownPlugin = any;
|
|
2
|
+
/**
|
|
3
|
+
* Vite plugin that runs the orchestrion code transform on the bundled output.
|
|
4
|
+
*
|
|
5
|
+
* Use when bundling a Node app with Vite (e.g. Vite SSR builds, Nuxt's Nitro
|
|
6
|
+
* pipeline, SvelteKit). For unbundled Node processes use the runtime hook
|
|
7
|
+
* instead (`node --import @sentry/node/orchestrion app.js`).
|
|
8
|
+
*
|
|
9
|
+
* Returns two plugins:
|
|
10
|
+
* 1. `sentry-orchestrion-marker` — a `renderChunk` hook that prepends a
|
|
11
|
+
* single-line banner to entry chunks. The banner sets
|
|
12
|
+
* `globalThis.__SENTRY_ORCHESTRION__.bundler = true` at app boot, so the
|
|
13
|
+
* `_experimentalSetupOrchestrion()` detector can confirm the bundler path
|
|
14
|
+
* ran (rather than relying on a build-time flag that wouldn't be visible
|
|
15
|
+
* to the runtime).
|
|
16
|
+
* Also injects every instrumented package name into `ssr.noExternal` via
|
|
17
|
+
* the `config` hook, since externalized deps are `require()`d at runtime
|
|
18
|
+
* from `node_modules` and never pass through the transform.
|
|
19
|
+
* 2. The upstream `@apm-js-collab/code-transformer-bundler-plugins/vite`
|
|
20
|
+
* plugin, fed our central `SENTRY_INSTRUMENTATIONS` config.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* // vite.config.ts
|
|
25
|
+
* import { sentryOrchestrionPlugin } from '@sentry/node/orchestrion/vite';
|
|
26
|
+
* export default { plugins: [sentryOrchestrionPlugin()] };
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function sentryOrchestrionPlugin(): UnknownPlugin[];
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=vite.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fully-qualified `diagnostics_channel` names that orchestrion publishes to.
|
|
3
|
+
*
|
|
4
|
+
* Orchestrion's transform always prefixes the configured `channelName` with
|
|
5
|
+
* `orchestrion:${module.name}:`. So a config of
|
|
6
|
+
* `{ channelName: 'query', module: { name: 'mysql' } }`
|
|
7
|
+
* publishes to `orchestrion:mysql:query`.
|
|
8
|
+
*
|
|
9
|
+
* Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full
|
|
10
|
+
* prefixed string from this map; the config files set only the unprefixed
|
|
11
|
+
* suffix in `channelName`. Keeping both pieces in one file is what guarantees
|
|
12
|
+
* they don't drift apart and silently stop firing.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CHANNELS: {
|
|
15
|
+
readonly MYSQL_QUERY: "orchestrion:mysql:query";
|
|
16
|
+
};
|
|
17
|
+
export type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];
|
|
18
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InstrumentationConfig } from '@apm-js-collab/code-transformer';
|
|
2
|
+
/**
|
|
3
|
+
* The central list of channel injections orchestrion should perform.
|
|
4
|
+
*
|
|
5
|
+
* This module has NO side effects — it's the only thing both the runtime hook
|
|
6
|
+
* (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)
|
|
7
|
+
* import from. Adding a new instrumented method is one entry here plus one
|
|
8
|
+
* subscriber in `integrations/<lib>/tracing-channel.ts`.
|
|
9
|
+
*
|
|
10
|
+
* `channelName` here is the unprefixed suffix; the actual diagnostics_channel
|
|
11
|
+
* name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[];
|
|
14
|
+
/**
|
|
15
|
+
* The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`
|
|
16
|
+
* (e.g. `['mysql']`).
|
|
17
|
+
*
|
|
18
|
+
* Bundler plugins MUST ensure these are actually bundled rather than
|
|
19
|
+
* externalized: an externalized dependency is resolved from `node_modules` at
|
|
20
|
+
* runtime and never passes through the code transform's `onLoad`, so its
|
|
21
|
+
* diagnostics_channel calls are silently never injected.
|
|
22
|
+
*/
|
|
23
|
+
export declare const INSTRUMENTED_MODULE_NAMES: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Returns `external` with any instrumented packages removed, so a bundler that
|
|
26
|
+
* uses an "external" denylist (esbuild, Bun, Rollup) still bundles — and thus
|
|
27
|
+
* transforms — them. Matches an exact package name (`'mysql'`) or a subpath
|
|
28
|
+
* (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`
|
|
29
|
+
* is returned unchanged.
|
|
30
|
+
*
|
|
31
|
+
* (Vite uses an `ssr.noExternal` allowlist instead, so it consumes
|
|
32
|
+
* `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)
|
|
33
|
+
*/
|
|
34
|
+
export declare function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined;
|
|
35
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __SENTRY_ORCHESTRION__: {
|
|
3
|
+
runtime?: boolean;
|
|
4
|
+
bundler?: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Verifies that the diagnostics channels have been injected either by the
|
|
9
|
+
* runtime `--import` hook (or init-time registration), a bundler plugin, or
|
|
10
|
+
* both, and warns if not.
|
|
11
|
+
*
|
|
12
|
+
* Both injectors being active at once is fine: they operate on disjoint module
|
|
13
|
+
* sets (a module is either loaded through Node's loader and transformed by the
|
|
14
|
+
* runtime hook, or inlined by the bundler and transformed by the plugin), so
|
|
15
|
+
* a single module can't be double-wrapped. A hybrid setup, with some deps
|
|
16
|
+
* external and runtime-instrumented, others bundled and plugin-instrumented,
|
|
17
|
+
* is fine.
|
|
18
|
+
*
|
|
19
|
+
* Note: intentionally does NOT warn in production, only in debug builds,
|
|
20
|
+
* because production warnings are reserved for truly critical issues.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectOrchestrionSetup(): void;
|
|
23
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __SENTRY_ORCHESTRION__: {
|
|
3
|
+
runtime?: boolean;
|
|
4
|
+
bundler?: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Synchronously register the diagnostics-channel injection module hooks.
|
|
9
|
+
*
|
|
10
|
+
* This is the single source of truth for the registration logic. It is used by:
|
|
11
|
+
* - `Sentry.init()` (the Node SDK calls it directly — that's why this module
|
|
12
|
+
* must be CJS-compatible / dual-built, so it can be `require()`d synchronously
|
|
13
|
+
* before the app's `import`s resolve), and
|
|
14
|
+
* - `import-hook.mjs`, the side-effecting `--import` entry, which just calls it.
|
|
15
|
+
*
|
|
16
|
+
* Libraries imported *after* this call publish the `tracingChannel` events that
|
|
17
|
+
* the channel-based integrations subscribe to.
|
|
18
|
+
*
|
|
19
|
+
* Idempotent via `globalThis.__SENTRY_ORCHESTRION__` — a no-op if the runtime
|
|
20
|
+
* `--import` hook or a bundler plugin already injected the channels.
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerDiagnosticsChannelInjection(): void;
|
|
23
|
+
//# sourceMappingURL=register.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/server-utils",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.60.0",
|
|
4
4
|
"description": "Server Utilities for all Sentry JavaScript SDKs",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/server-utils",
|
|
@@ -18,20 +18,63 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
"./package.json": "./package.json",
|
|
20
20
|
".": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
"types": "./build/types/index.d.ts",
|
|
22
|
+
"import": "./build/esm/index.js",
|
|
23
|
+
"require": "./build/cjs/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./orchestrion": {
|
|
26
|
+
"types": "./build/types/orchestrion/index.d.ts",
|
|
27
|
+
"import": "./build/esm/orchestrion/index.js",
|
|
28
|
+
"require": "./build/cjs/orchestrion/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./orchestrion/config": {
|
|
31
|
+
"types": "./build/types/orchestrion/config.d.ts",
|
|
32
|
+
"import": "./build/esm/orchestrion/config.js",
|
|
33
|
+
"require": "./build/cjs/orchestrion/config.js"
|
|
34
|
+
},
|
|
35
|
+
"./orchestrion/register": {
|
|
36
|
+
"types": "./build/types/orchestrion/runtime/register.d.ts",
|
|
37
|
+
"import": "./build/esm/orchestrion/runtime/register.js",
|
|
38
|
+
"require": "./build/cjs/orchestrion/runtime/register.js"
|
|
39
|
+
},
|
|
40
|
+
"./orchestrion/vite": {
|
|
41
|
+
"types": "./build/types/orchestrion/bundler/vite.d.ts",
|
|
42
|
+
"import": "./build/esm/orchestrion/bundler/vite.js"
|
|
43
|
+
},
|
|
44
|
+
"./orchestrion/import-hook": {
|
|
45
|
+
"import": "./build/orchestrion/import-hook.mjs"
|
|
29
46
|
}
|
|
30
47
|
},
|
|
31
48
|
"typesVersions": {
|
|
32
49
|
"<5.0": {
|
|
33
50
|
"build/types/index.d.ts": [
|
|
34
51
|
"build/types-ts3.8/index.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"orchestrion": [
|
|
54
|
+
"build/types-ts3.8/orchestrion/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"orchestrion/config": [
|
|
57
|
+
"build/types-ts3.8/orchestrion/config.d.ts"
|
|
58
|
+
],
|
|
59
|
+
"orchestrion/register": [
|
|
60
|
+
"build/types-ts3.8/orchestrion/runtime/register.d.ts"
|
|
61
|
+
],
|
|
62
|
+
"orchestrion/vite": [
|
|
63
|
+
"build/types-ts3.8/orchestrion/bundler/vite.d.ts"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"*": {
|
|
67
|
+
"orchestrion": [
|
|
68
|
+
"build/types/orchestrion/index.d.ts"
|
|
69
|
+
],
|
|
70
|
+
"orchestrion/config": [
|
|
71
|
+
"build/types/orchestrion/config.d.ts"
|
|
72
|
+
],
|
|
73
|
+
"orchestrion/register": [
|
|
74
|
+
"build/types/orchestrion/runtime/register.d.ts"
|
|
75
|
+
],
|
|
76
|
+
"orchestrion/vite": [
|
|
77
|
+
"build/types/orchestrion/bundler/vite.d.ts"
|
|
35
78
|
]
|
|
36
79
|
}
|
|
37
80
|
},
|
|
@@ -39,7 +82,16 @@
|
|
|
39
82
|
"access": "public"
|
|
40
83
|
},
|
|
41
84
|
"dependencies": {
|
|
42
|
-
"@
|
|
85
|
+
"@apm-js-collab/code-transformer-bundler-plugins": "^0.5.0",
|
|
86
|
+
"@apm-js-collab/code-transformer": "^0.15.0",
|
|
87
|
+
"@apm-js-collab/tracing-hooks": "^0.10.0",
|
|
88
|
+
"@sentry/conventions": "^0.12.0",
|
|
89
|
+
"@sentry/core": "10.60.0",
|
|
90
|
+
"magic-string": "~0.30.0"
|
|
91
|
+
},
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"@types/node": "^18.19.1",
|
|
94
|
+
"vite": "^6.4.3"
|
|
43
95
|
},
|
|
44
96
|
"scripts": {
|
|
45
97
|
"build": "run-p build:transpile build:types",
|
|
@@ -64,5 +116,18 @@
|
|
|
64
116
|
"volta": {
|
|
65
117
|
"extends": "../../package.json"
|
|
66
118
|
},
|
|
67
|
-
"sideEffects": false
|
|
119
|
+
"sideEffects": false,
|
|
120
|
+
"nx": {
|
|
121
|
+
"targets": {
|
|
122
|
+
"build:transpile": {
|
|
123
|
+
"outputs": [
|
|
124
|
+
"{projectRoot}/build/esm",
|
|
125
|
+
"{projectRoot}/build/cjs",
|
|
126
|
+
"{projectRoot}/build/npm/esm",
|
|
127
|
+
"{projectRoot}/build/npm/cjs",
|
|
128
|
+
"{projectRoot}/build/orchestrion"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
68
133
|
}
|