@sentry/bundler-plugins 11.9.0 → 11.10.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/README.md +5 -1
- package/build/cjs/bun/index.js +126 -0
- package/build/cjs/bun/index.js.map +1 -0
- package/build/cjs/core/component-annotation-oxc.js +1 -1
- package/build/cjs/core/debug-id-upload.js +1 -1
- package/build/cjs/core/sentry/transports.js +3 -3
- package/build/cjs/core/sentry/transports.js.map +1 -1
- package/build/cjs/core/utils.js +1 -1
- package/build/cjs/core/version.js +1 -1
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/rollup/index.js +1 -1
- package/build/esm/bun/index.js +109 -0
- package/build/esm/bun/index.js.map +1 -0
- package/build/esm/core/version.js +1 -1
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/bun/index.d.ts +25 -0
- package/build/types/bun/index.d.ts.map +1 -0
- package/build/types/core/version.d.ts +1 -1
- package/build/types/core/version.d.ts.map +1 -1
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
-
<
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-white.png" media="(prefers-color-scheme: dark)" />
|
|
5
|
+
<source srcset="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
|
|
6
|
+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280">
|
|
7
|
+
</picture>
|
|
4
8
|
</a>
|
|
5
9
|
</p>
|
|
6
10
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
|
|
3
|
+
const index = require('../core/index.js');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const buildPluginManager = require('../core/build-plugin-manager.js');
|
|
6
|
+
const utils = require('../core/utils.js');
|
|
7
|
+
const debugIdUpload = require('../core/debug-id-upload.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
n[k] = e[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
22
|
+
|
|
23
|
+
const pluginName = "sentry-bun-plugin";
|
|
24
|
+
const DEBUG_ID_PLACEHOLDER = "sentry-bun-debug-id-placeholder-0000";
|
|
25
|
+
const BUN_DEBUG_ID_REGEX = /^\/\/# debugId=([0-9a-fA-F]{32})$(?![\s\S]*^\/\/# debugId=)/m;
|
|
26
|
+
function bunDebugIdToUuid(bunDebugId) {
|
|
27
|
+
const hex = bunDebugId.toLowerCase();
|
|
28
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
29
|
+
}
|
|
30
|
+
function sentryBunPlugin(userOptions = {}) {
|
|
31
|
+
const sentryBuildPluginManager = buildPluginManager.createSentryBuildPluginManager(userOptions, {
|
|
32
|
+
loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,
|
|
33
|
+
buildTool: "bun",
|
|
34
|
+
buildToolMajorVersion: process.versions["bun"]?.split(".")[0]
|
|
35
|
+
});
|
|
36
|
+
const {
|
|
37
|
+
logger,
|
|
38
|
+
normalizedOptions: options,
|
|
39
|
+
bundleSizeOptimizationReplacementValues: replacementValues,
|
|
40
|
+
bundleMetadata,
|
|
41
|
+
createDependencyOnBuildArtifacts
|
|
42
|
+
} = sentryBuildPluginManager;
|
|
43
|
+
if (options.disable) {
|
|
44
|
+
return { name: "sentry-bun-noop-plugin", setup: () => void 0 };
|
|
45
|
+
}
|
|
46
|
+
const staticInjectionCode = new utils.CodeInjection();
|
|
47
|
+
if (!options.release.inject) {
|
|
48
|
+
logger.debug("Release injection disabled via `release.inject` option. Will not inject release.");
|
|
49
|
+
} else if (!options.release.name) {
|
|
50
|
+
logger.debug(
|
|
51
|
+
"No release name provided. Will not inject release. Please set the `release.name` option to identify your release."
|
|
52
|
+
);
|
|
53
|
+
} else {
|
|
54
|
+
staticInjectionCode.append(
|
|
55
|
+
utils.generateReleaseInjectorCode({
|
|
56
|
+
release: options.release.name,
|
|
57
|
+
injectBuildInformation: options._experiments.injectBuildInformation || false
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
if (Object.keys(bundleMetadata).length > 0) {
|
|
62
|
+
staticInjectionCode.append(utils.generateModuleMetadataInjectorCode(bundleMetadata));
|
|
63
|
+
}
|
|
64
|
+
void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {
|
|
65
|
+
});
|
|
66
|
+
async function replaceDebugIdPlaceholder(bundlePath) {
|
|
67
|
+
const source = await fs__namespace.promises.readFile(bundlePath, "utf8");
|
|
68
|
+
const bunDebugId = source.match(BUN_DEBUG_ID_REGEX)?.[1];
|
|
69
|
+
if (!bunDebugId) {
|
|
70
|
+
logger.debug(`Bun wrote no debug ID into the bundle. File will not be source mapped: ${bundlePath}`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
await fs__namespace.promises.writeFile(
|
|
74
|
+
bundlePath,
|
|
75
|
+
source.split(DEBUG_ID_PLACEHOLDER).join(bunDebugIdToUuid(bunDebugId)),
|
|
76
|
+
"utf8"
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
name: pluginName,
|
|
81
|
+
setup(build) {
|
|
82
|
+
const config = build.config;
|
|
83
|
+
if (!config) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const injectDebugIds = options.sourcemaps?.disable !== true && !!config.outdir && !!config.sourcemap && config.sourcemap !== "none";
|
|
87
|
+
const injectionCode = new utils.CodeInjection();
|
|
88
|
+
injectionCode.append(staticInjectionCode);
|
|
89
|
+
if (injectDebugIds) {
|
|
90
|
+
injectionCode.append(index.getDebugIdSnippet(DEBUG_ID_PLACEHOLDER));
|
|
91
|
+
}
|
|
92
|
+
if (!injectionCode.isEmpty()) {
|
|
93
|
+
config.banner = config.banner ? `${config.banner}
|
|
94
|
+
${injectionCode.code()}` : injectionCode.code();
|
|
95
|
+
}
|
|
96
|
+
if (Object.keys(replacementValues).length > 0) {
|
|
97
|
+
const replacementStringValues = {};
|
|
98
|
+
Object.entries(replacementValues).forEach(([key, value]) => {
|
|
99
|
+
replacementStringValues[key] = JSON.stringify(value);
|
|
100
|
+
});
|
|
101
|
+
config.define = { ...config.define, ...replacementStringValues };
|
|
102
|
+
}
|
|
103
|
+
const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();
|
|
104
|
+
const upload = debugIdUpload.createDebugIdUploadFunction({ sentryBuildPluginManager });
|
|
105
|
+
build.onEnd(async (result) => {
|
|
106
|
+
try {
|
|
107
|
+
await sentryBuildPluginManager.createRelease();
|
|
108
|
+
if (injectDebugIds) {
|
|
109
|
+
const bundlePaths = result.outputs.filter((output) => output.kind === "entry-point" || output.kind === "chunk").map((output) => output.path);
|
|
110
|
+
await Promise.all(bundlePaths.map(replaceDebugIdPlaceholder));
|
|
111
|
+
if (options.sourcemaps?.disable !== "disable-upload") {
|
|
112
|
+
await upload(bundlePaths);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
} finally {
|
|
116
|
+
freeGlobalDependencyOnBuildArtifacts();
|
|
117
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
exports.default = sentryBunPlugin;
|
|
125
|
+
exports.sentryBunPlugin = sentryBunPlugin;
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/bun/index.ts"],"sourcesContent":["import type { Options } from '../core';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n CodeInjection,\n} from '../core';\nimport * as fs from 'node:fs';\n\ninterface BunBuildArtifact {\n path: string;\n kind: string;\n}\n\ninterface BunBuildConfig {\n banner?: string;\n sourcemap?: 'none' | 'linked' | 'inline' | 'external' | boolean;\n outdir?: string;\n define?: Record<string, string>;\n}\n\ninterface BunPluginBuilder {\n // Bun passes no `config` when the plugin runs as a runtime plugin (`Bun.plugin()`)\n config?: BunBuildConfig;\n onEnd: (callback: (result: { outputs: BunBuildArtifact[] }) => void | Promise<void>) => void;\n}\n\ninterface BunPlugin {\n name: string;\n setup: (build: BunPluginBuilder) => void;\n}\n\nconst pluginName = 'sentry-bun-plugin';\n\n// Bun computes the debug ID of an output after it adds the banner, so the\n// banner holds this placeholder. It has the length of a debug ID, so the\n// swap does not move any code that the source map points to.\nconst DEBUG_ID_PLACEHOLDER = 'sentry-bun-debug-id-placeholder-0000';\n// Bun writes `//# sourceMappingURL=` after this comment for linked and\n// inline source maps, so match the last debug ID line, not the file end.\nconst BUN_DEBUG_ID_REGEX = /^\\/\\/# debugId=([0-9a-fA-F]{32})$(?![\\s\\S]*^\\/\\/# debugId=)/m;\n\nfunction bunDebugIdToUuid(bunDebugId: string): string {\n const hex = bunDebugId.toLowerCase();\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\nexport function sentryBunPlugin(userOptions: Options = {}): BunPlugin {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,\n buildTool: 'bun',\n buildToolMajorVersion: process.versions['bun']?.split('.')[0],\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return { name: 'sentry-bun-noop-plugin', setup: () => undefined };\n }\n\n const staticInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n staticInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n staticInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n async function replaceDebugIdPlaceholder(bundlePath: string): Promise<void> {\n const source = await fs.promises.readFile(bundlePath, 'utf8');\n const bunDebugId = source.match(BUN_DEBUG_ID_REGEX)?.[1];\n if (!bunDebugId) {\n logger.debug(`Bun wrote no debug ID into the bundle. File will not be source mapped: ${bundlePath}`);\n return;\n }\n\n await fs.promises.writeFile(\n bundlePath,\n source.split(DEBUG_ID_PLACEHOLDER).join(bunDebugIdToUuid(bunDebugId)),\n 'utf8',\n );\n }\n\n return {\n name: pluginName,\n setup(build: BunPluginBuilder): void {\n const config = build.config;\n if (!config) {\n return;\n }\n\n // Without `outdir`, Bun writes no files that the placeholder can be\n // replaced in.\n const injectDebugIds =\n options.sourcemaps?.disable !== true && !!config.outdir && !!config.sourcemap && config.sourcemap !== 'none';\n\n const injectionCode = new CodeInjection();\n injectionCode.append(staticInjectionCode);\n if (injectDebugIds) {\n injectionCode.append(getDebugIdSnippet(DEBUG_ID_PLACEHOLDER));\n }\n\n if (!injectionCode.isEmpty()) {\n config.banner = config.banner ? `${config.banner}\\n${injectionCode.code()}` : injectionCode.code();\n }\n\n if (Object.keys(replacementValues).length > 0) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n config.define = { ...config.define, ...replacementStringValues };\n }\n\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n build.onEnd(async result => {\n try {\n await sentryBuildPluginManager.createRelease();\n\n if (injectDebugIds) {\n const bundlePaths = result.outputs\n .filter(output => output.kind === 'entry-point' || output.kind === 'chunk')\n .map(output => output.path);\n\n await Promise.all(bundlePaths.map(replaceDebugIdPlaceholder));\n\n if (options.sourcemaps?.disable !== 'disable-upload') {\n await upload(bundlePaths);\n }\n }\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n });\n },\n };\n}\n\nexport default sentryBunPlugin;\nexport type { Options as SentryBunPluginOptions } from '../core';\n"],"names":["createSentryBuildPluginManager","CodeInjection","generateReleaseInjectorCode","generateModuleMetadataInjectorCode","fs","getDebugIdSnippet","createDebugIdUploadFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,UAAA,GAAa,mBAAA;AAKnB,MAAM,oBAAA,GAAuB,sCAAA;AAG7B,MAAM,kBAAA,GAAqB,8DAAA;AAE3B,SAAS,iBAAiB,UAAA,EAA4B;AACpD,EAAA,MAAM,GAAA,GAAM,WAAW,WAAA,EAAY;AACnC,EAAA,OAAO,CAAA,EAAG,GAAA,CAAI,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC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AA,MAAM,WAAA,GAAc,MAAA,CAAO,OAAA,CACxB,MAAA,CAAO,YAAU,MAAA,CAAO,IAAA,KAAS,aAAA,IAAiB,MAAA,CAAO,SAAS,OAAO,CAAA,CACzE,GAAA,CAAI,CAAA,MAAA,KAAU,OAAO,IAAI,CAAA;AAE5B,YAAA,MAAM,OAAA,CAAQ,GAAA,CAAI,WAAA,CAAY,GAAA,CAAI,yBAAyB,CAAC,CAAA;AAE5D,YAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,OAAA,KAAY,gBAAA,EAAkB;AACpD,cAAA,MAAM,OAAO,WAAW,CAAA;AAAA,YAC1B;AAAA,UACF;AAAA,QACF,CAAA,SAAE;AACA,UAAA,oCAAA,EAAqC;AACrC,UAAA,MAAM,yBAAyB,eAAA,EAAgB;AAAA,QACjD;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;;;;;"}
|
|
@@ -7,7 +7,7 @@ const utils = require('./utils.js');
|
|
|
7
7
|
const componentAnnotationOxcAst = require('./component-annotation-oxc-ast.js');
|
|
8
8
|
const componentAnnotationOxcWalk = require('./component-annotation-oxc-walk.js');
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e.default : e; }
|
|
11
11
|
|
|
12
12
|
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
13
13
|
const MagicString__default = /*#__PURE__*/_interopDefault(MagicString);
|
|
@@ -6,7 +6,7 @@ const url = require('url');
|
|
|
6
6
|
const util = require('util');
|
|
7
7
|
const utils = require('./utils.js');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e.default : e; }
|
|
10
10
|
|
|
11
11
|
function _interopNamespace(e) {
|
|
12
12
|
if (e && e.__esModule) return e;
|
|
@@ -5,7 +5,7 @@ const node_stream = require('node:stream');
|
|
|
5
5
|
const node_zlib = require('node:zlib');
|
|
6
6
|
const core = require('@sentry/core');
|
|
7
7
|
const path = require('node:path');
|
|
8
|
-
const
|
|
8
|
+
const fs = require('node:fs');
|
|
9
9
|
|
|
10
10
|
function _interopNamespace(e) {
|
|
11
11
|
if (e && e.__esModule) return e;
|
|
@@ -90,9 +90,9 @@ function makeOptionallyEnabledNodeTransport(shouldSendTelemetry) {
|
|
|
90
90
|
if (await shouldSendTelemetry) {
|
|
91
91
|
if (process.env["SENTRY_TEST_OUT_DIR"]) {
|
|
92
92
|
const outDir = process.env["SENTRY_TEST_OUT_DIR"];
|
|
93
|
-
|
|
93
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
94
94
|
const path$1 = path.join(outDir, "sentry-telemetry.json");
|
|
95
|
-
|
|
95
|
+
fs.appendFileSync(path$1, `${JSON.stringify(request)},
|
|
96
96
|
`);
|
|
97
97
|
return { statusCode: 200 };
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.js","sources":["../../../../src/core/sentry/transports.ts"],"sourcesContent":["/**\n * This is a simplified version of the Sentry Node SDK's HTTP transport.\n */\nimport * as https from 'node:https';\nimport { Readable } from 'node:stream';\nimport { createGzip } from 'node:zlib';\nimport { createTransport, suppressTracing } from '@sentry/core';\nimport type {\n BaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequest,\n TransportRequestExecutor,\n} from '@sentry/core';\nimport { join } from 'node:path';\nimport { appendFileSync, mkdirSync } from 'node:fs';\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n return new Readable({\n read() {\n this.push(body);\n this.push(null);\n },\n });\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(options: BaseTransportOptions): TransportRequestExecutor {\n const { hostname, pathname, port, protocol, search } = new URL(options.url);\n return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n return new Promise((resolve, reject) => {\n suppressTracing(() => {\n let body = streamFromBody(request.body);\n\n const headers: Record<string, string> = {};\n\n if (request.body.length > GZIP_THRESHOLD) {\n headers['content-encoding'] = 'gzip';\n body = body.pipe(createGzip());\n }\n\n const req = https.request(\n {\n method: 'POST',\n headers,\n hostname,\n path: `${pathname}${search}`,\n port,\n protocol,\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n\n res.setEncoding('utf8');\n\n // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n // https://nodejs.org/api/http.html#http_message_headers\n const retryAfterHeader = res.headers['retry-after'] ?? null;\n const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n resolve({\n statusCode: res.statusCode,\n headers: {\n 'retry-after': retryAfterHeader,\n 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader)\n ? rateLimitsHeader[0] || null\n : rateLimitsHeader,\n },\n });\n },\n );\n\n req.on('error', reject);\n body.pipe(req);\n });\n });\n };\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nfunction makeNodeTransport(options: BaseTransportOptions): Transport {\n const requestExecutor = createRequestExecutor(options);\n return createTransport(options, requestExecutor);\n}\n\n/** A transport that can be optionally enabled as a later time than it's\n * creation */\nexport function makeOptionallyEnabledNodeTransport(\n shouldSendTelemetry: Promise<boolean>,\n): (options: BaseTransportOptions) => Transport {\n return nodeTransportOptions => {\n const nodeTransport = makeNodeTransport(nodeTransportOptions);\n\n return {\n flush: timeout => nodeTransport.flush(timeout),\n send: async request => {\n // If global.__SENTRY_INTERCEPT_TRANSPORT__ is an array, we push the\n // envelope into it for testing purposes.\n if ('__SENTRY_INTERCEPT_TRANSPORT__' in global && Array.isArray(global.__SENTRY_INTERCEPT_TRANSPORT__)) {\n global.__SENTRY_INTERCEPT_TRANSPORT__.push(request);\n return { statusCode: 200 };\n }\n\n if (await shouldSendTelemetry) {\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n const outDir = process.env['SENTRY_TEST_OUT_DIR'];\n mkdirSync(outDir, { recursive: true });\n const path = join(outDir, 'sentry-telemetry.json');\n appendFileSync(path, `${JSON.stringify(request)},\\n`);\n return { statusCode: 200 };\n }\n\n return nodeTransport.send(request);\n }\n\n return { statusCode: 200 };\n },\n };\n };\n}\n"],"names":["Readable","suppressTracing","createGzip","https","createTransport","mkdirSync","path","join","appendFileSync"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAiB,IAAA,GAAO,EAAA;AAM9B,SAAS,eAAe,IAAA,EAAqC;AAC3D,EAAA,OAAO,IAAIA,oBAAA,CAAS;AAAA,IAClB,IAAA,GAAO;AACL,MAAA,IAAA,CAAK,KAAK,IAAI,CAAA;AACd,MAAA,IAAA,CAAK,KAAK,IAAI,CAAA;AAAA,IAChB;AAAA,GACD,CAAA;AACH;AAKA,SAAS,sBAAsB,OAAA,EAAyD;AACtF,EAAA,MAAM,EAAE,QAAA,EAAU,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,QAAO,GAAI,IAAI,GAAA,CAAI,OAAA,CAAQ,GAAG,CAAA;AAC1E,EAAA,OAAO,SAAS,YAAY,OAAA,EAAkE;AAC5F,IAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AACtC,MAAAC,oBAAA,CAAgB,MAAM;AACpB,QAAA,IAAI,IAAA,GAAO,cAAA,CAAe,OAAA,CAAQ,IAAI,CAAA;AAEtC,QAAA,MAAM,UAAkC,EAAC;AAEzC,QAAA,IAAI,OAAA,CAAQ,IAAA,CAAK,MAAA,GAAS,cAAA,EAAgB;AACxC,UAAA,OAAA,CAAQ,kBAAkB,CAAA,GAAI,MAAA;AAC9B,UAAA,IAAA,GAAO,IAAA,CAAK,IAAA,CAAKC,oBAAA,EAAY,CAAA;AAAA,QAC/B;AAEA,QAAA,MAAM,MAAMC,gBAAA,CAAM,OA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AA,GAAgB,kBAAkB,oBAAoB,CAAA;AAE5D,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,CAAA,OAAA,KAAW,aAAA,CAAc,KAAA,CAAM,OAAO,CAAA;AAAA,MAC7C,IAAA,EAAM,OAAM,OAAA,KAAW;AAGrB,QAAA,IAAI,oCAAoC,MAAA,IAAU,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,8BAA8B,CAAA,EAAG;AACtG,UAAA,MAAA,CAAO,8BAAA,CAA+B,KAAK,OAAO,CAAA;AAClD,UAAA,OAAO,EAAE,YAAY,GAAA,EAAI;AAAA,QAC3B;AAEA,QAAA,IAAI,MAAM,mBAAA,EAAqB;AAC7B,UAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,qBAAqB,CAAA,EAAG;AACtC,YAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,qBAAqB,CAAA;AAChD,YAAAC,
|
|
1
|
+
{"version":3,"file":"transports.js","sources":["../../../../src/core/sentry/transports.ts"],"sourcesContent":["/**\n * This is a simplified version of the Sentry Node SDK's HTTP transport.\n */\nimport * as https from 'node:https';\nimport { Readable } from 'node:stream';\nimport { createGzip } from 'node:zlib';\nimport { createTransport, suppressTracing } from '@sentry/core';\nimport type {\n BaseTransportOptions,\n Transport,\n TransportMakeRequestResponse,\n TransportRequest,\n TransportRequestExecutor,\n} from '@sentry/core';\nimport { join } from 'node:path';\nimport { appendFileSync, mkdirSync } from 'node:fs';\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n return new Readable({\n read() {\n this.push(body);\n this.push(null);\n },\n });\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(options: BaseTransportOptions): TransportRequestExecutor {\n const { hostname, pathname, port, protocol, search } = new URL(options.url);\n return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n return new Promise((resolve, reject) => {\n suppressTracing(() => {\n let body = streamFromBody(request.body);\n\n const headers: Record<string, string> = {};\n\n if (request.body.length > GZIP_THRESHOLD) {\n headers['content-encoding'] = 'gzip';\n body = body.pipe(createGzip());\n }\n\n const req = https.request(\n {\n method: 'POST',\n headers,\n hostname,\n path: `${pathname}${search}`,\n port,\n protocol,\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n\n res.setEncoding('utf8');\n\n // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n // https://nodejs.org/api/http.html#http_message_headers\n const retryAfterHeader = res.headers['retry-after'] ?? null;\n const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n resolve({\n statusCode: res.statusCode,\n headers: {\n 'retry-after': retryAfterHeader,\n 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader)\n ? rateLimitsHeader[0] || null\n : rateLimitsHeader,\n },\n });\n },\n );\n\n req.on('error', reject);\n body.pipe(req);\n });\n });\n };\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nfunction makeNodeTransport(options: BaseTransportOptions): Transport {\n const requestExecutor = createRequestExecutor(options);\n return createTransport(options, requestExecutor);\n}\n\n/** A transport that can be optionally enabled as a later time than it's\n * creation */\nexport function makeOptionallyEnabledNodeTransport(\n shouldSendTelemetry: Promise<boolean>,\n): (options: BaseTransportOptions) => Transport {\n return nodeTransportOptions => {\n const nodeTransport = makeNodeTransport(nodeTransportOptions);\n\n return {\n flush: timeout => nodeTransport.flush(timeout),\n send: async request => {\n // If global.__SENTRY_INTERCEPT_TRANSPORT__ is an array, we push the\n // envelope into it for testing purposes.\n if ('__SENTRY_INTERCEPT_TRANSPORT__' in global && Array.isArray(global.__SENTRY_INTERCEPT_TRANSPORT__)) {\n global.__SENTRY_INTERCEPT_TRANSPORT__.push(request);\n return { statusCode: 200 };\n }\n\n if (await shouldSendTelemetry) {\n if (process.env['SENTRY_TEST_OUT_DIR']) {\n const outDir = process.env['SENTRY_TEST_OUT_DIR'];\n mkdirSync(outDir, { recursive: true });\n const path = join(outDir, 'sentry-telemetry.json');\n appendFileSync(path, `${JSON.stringify(request)},\\n`);\n return { statusCode: 200 };\n }\n\n return nodeTransport.send(request);\n }\n\n return { statusCode: 200 };\n },\n };\n };\n}\n"],"names":["Readable","suppressTracing","createGzip","https","createTransport","mkdirSync","path","join","appendFileSync"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAiB,IAAA,GAAO,EAAA;AAM9B,SAAS,eAAe,IAAA,EAAqC;AAC3D,EAAA,OAAO,IAAIA,oBAAA,CAAS;AAAA,IAClB,IAAA,GAAO;AACL,MAAA,IAAA,CAAK,KAAK,IAAI,CAAA;AACd,MAAA,IAAA,CAAK,KAAK,IAAI,CAAA;AAAA,IAChB;AAAA,GACD,CAAA;AACH;AAKA,SAAS,sBAAsB,OAAA,EAAyD;AACtF,EAAA,MAAM,EAAE,QAAA,EAAU,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,QAAO,GAAI,IAAI,GAAA,CAAI,OAAA,CAAQ,GAAG,CAAA;AAC1E,EAAA,OAAO,SAAS,YAAY,OAAA,EAAkE;AAC5F,IAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AACtC,MAAAC,oBAAA,CAAgB,MAAM;AACpB,QAAA,IAAI,IAAA,GAAO,cAAA,CAAe,OAAA,CAAQ,IAAI,CAAA;AAEtC,QAAA,MAAM,UAAkC,EAAC;AAEzC,QAAA,IAAI,OAAA,CAAQ,IAAA,CAAK,MAAA,GAAS,cAAA,EAAgB;AACxC,UAAA,OAAA,CAAQ,kBAAkB,CAAA,GAAI,MAAA;AAC9B,UAAA,IAAA,GAAO,IAAA,CAAK,IAAA,CAAKC,oBAAA,EAAY,CAAA;AAAA,QAC/B;AAEA,QA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AA,KAAwB;AAC7B,IAAA,MAAM,aAAA,GAAgB,kBAAkB,oBAAoB,CAAA;AAE5D,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,CAAA,OAAA,KAAW,aAAA,CAAc,KAAA,CAAM,OAAO,CAAA;AAAA,MAC7C,IAAA,EAAM,OAAM,OAAA,KAAW;AAGrB,QAAA,IAAI,oCAAoC,MAAA,IAAU,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,8BAA8B,CAAA,EAAG;AACtG,UAAA,MAAA,CAAO,8BAAA,CAA+B,KAAK,OAAO,CAAA;AAClD,UAAA,OAAO,EAAE,YAAY,GAAA,EAAI;AAAA,QAC3B;AAEA,QAAA,IAAI,MAAM,mBAAA,EAAqB;AAC7B,UAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,qBAAqB,CAAA,EAAG;AACtC,YAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,qBAAqB,CAAA;AAChD,YAAAC,YAAA,CAAU,MAAA,EAAQ,EAAE,SAAA,EAAW,IAAA,EAAM,CAAA;AACrC,YAAA,MAAMC,MAAA,GAAOC,SAAA,CAAK,MAAA,EAAQ,uBAAuB,CAAA;AACjD,YAAAC,iBAAA,CAAeF,MAAA,EAAM,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC,CAAA;AAAA,CAAK,CAAA;AACpD,YAAA,OAAO,EAAE,YAAY,GAAA,EAAI;AAAA,UAC3B;AAEA,UAAA,OAAO,aAAA,CAAc,KAAK,OAAO,CAAA;AAAA,QACnC;AAEA,QAAA,OAAO,EAAE,YAAY,GAAA,EAAI;AAAA,MAC3B;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}
|
package/build/cjs/core/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ const childProcess = require('child_process');
|
|
|
8
8
|
const MagicString = require('magic-string');
|
|
9
9
|
const server = require('@sentry/core/server');
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e.default : e; }
|
|
12
12
|
|
|
13
13
|
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
14
14
|
const fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.10.0\";\n"],"names":[],"mappings":";;AAAO,MAAM,WAAA,GAAc;;;;"}
|
|
@@ -14,7 +14,7 @@ const getCodeInjectionPosition = require('../core/get-code-injection-position.js
|
|
|
14
14
|
const debugIdUpload = require('../core/debug-id-upload.js');
|
|
15
15
|
|
|
16
16
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
17
|
-
|
|
17
|
+
function _interopDefault (e) { return e && e.__esModule ? e.default : e; }
|
|
18
18
|
|
|
19
19
|
function _interopNamespace(e) {
|
|
20
20
|
if (e && e.__esModule) return e;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { getDebugIdSnippet } from '../core/index.js';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { createSentryBuildPluginManager } from '../core/build-plugin-manager.js';
|
|
4
|
+
import { CodeInjection, generateReleaseInjectorCode, generateModuleMetadataInjectorCode } from '../core/utils.js';
|
|
5
|
+
import { createDebugIdUploadFunction } from '../core/debug-id-upload.js';
|
|
6
|
+
|
|
7
|
+
const pluginName = "sentry-bun-plugin";
|
|
8
|
+
const DEBUG_ID_PLACEHOLDER = "sentry-bun-debug-id-placeholder-0000";
|
|
9
|
+
const BUN_DEBUG_ID_REGEX = /^\/\/# debugId=([0-9a-fA-F]{32})$(?![\s\S]*^\/\/# debugId=)/m;
|
|
10
|
+
function bunDebugIdToUuid(bunDebugId) {
|
|
11
|
+
const hex = bunDebugId.toLowerCase();
|
|
12
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
13
|
+
}
|
|
14
|
+
function sentryBunPlugin(userOptions = {}) {
|
|
15
|
+
const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {
|
|
16
|
+
loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,
|
|
17
|
+
buildTool: "bun",
|
|
18
|
+
buildToolMajorVersion: process.versions["bun"]?.split(".")[0]
|
|
19
|
+
});
|
|
20
|
+
const {
|
|
21
|
+
logger,
|
|
22
|
+
normalizedOptions: options,
|
|
23
|
+
bundleSizeOptimizationReplacementValues: replacementValues,
|
|
24
|
+
bundleMetadata,
|
|
25
|
+
createDependencyOnBuildArtifacts
|
|
26
|
+
} = sentryBuildPluginManager;
|
|
27
|
+
if (options.disable) {
|
|
28
|
+
return { name: "sentry-bun-noop-plugin", setup: () => void 0 };
|
|
29
|
+
}
|
|
30
|
+
const staticInjectionCode = new CodeInjection();
|
|
31
|
+
if (!options.release.inject) {
|
|
32
|
+
logger.debug("Release injection disabled via `release.inject` option. Will not inject release.");
|
|
33
|
+
} else if (!options.release.name) {
|
|
34
|
+
logger.debug(
|
|
35
|
+
"No release name provided. Will not inject release. Please set the `release.name` option to identify your release."
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
staticInjectionCode.append(
|
|
39
|
+
generateReleaseInjectorCode({
|
|
40
|
+
release: options.release.name,
|
|
41
|
+
injectBuildInformation: options._experiments.injectBuildInformation || false
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
if (Object.keys(bundleMetadata).length > 0) {
|
|
46
|
+
staticInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));
|
|
47
|
+
}
|
|
48
|
+
void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {
|
|
49
|
+
});
|
|
50
|
+
async function replaceDebugIdPlaceholder(bundlePath) {
|
|
51
|
+
const source = await fs.promises.readFile(bundlePath, "utf8");
|
|
52
|
+
const bunDebugId = source.match(BUN_DEBUG_ID_REGEX)?.[1];
|
|
53
|
+
if (!bunDebugId) {
|
|
54
|
+
logger.debug(`Bun wrote no debug ID into the bundle. File will not be source mapped: ${bundlePath}`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await fs.promises.writeFile(
|
|
58
|
+
bundlePath,
|
|
59
|
+
source.split(DEBUG_ID_PLACEHOLDER).join(bunDebugIdToUuid(bunDebugId)),
|
|
60
|
+
"utf8"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
name: pluginName,
|
|
65
|
+
setup(build) {
|
|
66
|
+
const config = build.config;
|
|
67
|
+
if (!config) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const injectDebugIds = options.sourcemaps?.disable !== true && !!config.outdir && !!config.sourcemap && config.sourcemap !== "none";
|
|
71
|
+
const injectionCode = new CodeInjection();
|
|
72
|
+
injectionCode.append(staticInjectionCode);
|
|
73
|
+
if (injectDebugIds) {
|
|
74
|
+
injectionCode.append(getDebugIdSnippet(DEBUG_ID_PLACEHOLDER));
|
|
75
|
+
}
|
|
76
|
+
if (!injectionCode.isEmpty()) {
|
|
77
|
+
config.banner = config.banner ? `${config.banner}
|
|
78
|
+
${injectionCode.code()}` : injectionCode.code();
|
|
79
|
+
}
|
|
80
|
+
if (Object.keys(replacementValues).length > 0) {
|
|
81
|
+
const replacementStringValues = {};
|
|
82
|
+
Object.entries(replacementValues).forEach(([key, value]) => {
|
|
83
|
+
replacementStringValues[key] = JSON.stringify(value);
|
|
84
|
+
});
|
|
85
|
+
config.define = { ...config.define, ...replacementStringValues };
|
|
86
|
+
}
|
|
87
|
+
const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();
|
|
88
|
+
const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });
|
|
89
|
+
build.onEnd(async (result) => {
|
|
90
|
+
try {
|
|
91
|
+
await sentryBuildPluginManager.createRelease();
|
|
92
|
+
if (injectDebugIds) {
|
|
93
|
+
const bundlePaths = result.outputs.filter((output) => output.kind === "entry-point" || output.kind === "chunk").map((output) => output.path);
|
|
94
|
+
await Promise.all(bundlePaths.map(replaceDebugIdPlaceholder));
|
|
95
|
+
if (options.sourcemaps?.disable !== "disable-upload") {
|
|
96
|
+
await upload(bundlePaths);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} finally {
|
|
100
|
+
freeGlobalDependencyOnBuildArtifacts();
|
|
101
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { sentryBunPlugin as default, sentryBunPlugin };
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/bun/index.ts"],"sourcesContent":["import type { Options } from '../core';\nimport {\n createSentryBuildPluginManager,\n generateReleaseInjectorCode,\n generateModuleMetadataInjectorCode,\n getDebugIdSnippet,\n createDebugIdUploadFunction,\n CodeInjection,\n} from '../core';\nimport * as fs from 'node:fs';\n\ninterface BunBuildArtifact {\n path: string;\n kind: string;\n}\n\ninterface BunBuildConfig {\n banner?: string;\n sourcemap?: 'none' | 'linked' | 'inline' | 'external' | boolean;\n outdir?: string;\n define?: Record<string, string>;\n}\n\ninterface BunPluginBuilder {\n // Bun passes no `config` when the plugin runs as a runtime plugin (`Bun.plugin()`)\n config?: BunBuildConfig;\n onEnd: (callback: (result: { outputs: BunBuildArtifact[] }) => void | Promise<void>) => void;\n}\n\ninterface BunPlugin {\n name: string;\n setup: (build: BunPluginBuilder) => void;\n}\n\nconst pluginName = 'sentry-bun-plugin';\n\n// Bun computes the debug ID of an output after it adds the banner, so the\n// banner holds this placeholder. It has the length of a debug ID, so the\n// swap does not move any code that the source map points to.\nconst DEBUG_ID_PLACEHOLDER = 'sentry-bun-debug-id-placeholder-0000';\n// Bun writes `//# sourceMappingURL=` after this comment for linked and\n// inline source maps, so match the last debug ID line, not the file end.\nconst BUN_DEBUG_ID_REGEX = /^\\/\\/# debugId=([0-9a-fA-F]{32})$(?![\\s\\S]*^\\/\\/# debugId=)/m;\n\nfunction bunDebugIdToUuid(bunDebugId: string): string {\n const hex = bunDebugId.toLowerCase();\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\nexport function sentryBunPlugin(userOptions: Options = {}): BunPlugin {\n const sentryBuildPluginManager = createSentryBuildPluginManager(userOptions, {\n loggerPrefix: userOptions._metaOptions?.loggerPrefixOverride ?? `[${pluginName}]`,\n buildTool: 'bun',\n buildToolMajorVersion: process.versions['bun']?.split('.')[0],\n });\n\n const {\n logger,\n normalizedOptions: options,\n bundleSizeOptimizationReplacementValues: replacementValues,\n bundleMetadata,\n createDependencyOnBuildArtifacts,\n } = sentryBuildPluginManager;\n\n if (options.disable) {\n return { name: 'sentry-bun-noop-plugin', setup: () => undefined };\n }\n\n const staticInjectionCode = new CodeInjection();\n\n if (!options.release.inject) {\n logger.debug('Release injection disabled via `release.inject` option. Will not inject release.');\n } else if (!options.release.name) {\n logger.debug(\n 'No release name provided. Will not inject release. Please set the `release.name` option to identify your release.',\n );\n } else {\n staticInjectionCode.append(\n generateReleaseInjectorCode({\n release: options.release.name,\n injectBuildInformation: options._experiments.injectBuildInformation || false,\n }),\n );\n }\n\n if (Object.keys(bundleMetadata).length > 0) {\n staticInjectionCode.append(generateModuleMetadataInjectorCode(bundleMetadata));\n }\n\n void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal().catch(() => {\n // Telemetry failures are acceptable\n });\n\n async function replaceDebugIdPlaceholder(bundlePath: string): Promise<void> {\n const source = await fs.promises.readFile(bundlePath, 'utf8');\n const bunDebugId = source.match(BUN_DEBUG_ID_REGEX)?.[1];\n if (!bunDebugId) {\n logger.debug(`Bun wrote no debug ID into the bundle. File will not be source mapped: ${bundlePath}`);\n return;\n }\n\n await fs.promises.writeFile(\n bundlePath,\n source.split(DEBUG_ID_PLACEHOLDER).join(bunDebugIdToUuid(bunDebugId)),\n 'utf8',\n );\n }\n\n return {\n name: pluginName,\n setup(build: BunPluginBuilder): void {\n const config = build.config;\n if (!config) {\n return;\n }\n\n // Without `outdir`, Bun writes no files that the placeholder can be\n // replaced in.\n const injectDebugIds =\n options.sourcemaps?.disable !== true && !!config.outdir && !!config.sourcemap && config.sourcemap !== 'none';\n\n const injectionCode = new CodeInjection();\n injectionCode.append(staticInjectionCode);\n if (injectDebugIds) {\n injectionCode.append(getDebugIdSnippet(DEBUG_ID_PLACEHOLDER));\n }\n\n if (!injectionCode.isEmpty()) {\n config.banner = config.banner ? `${config.banner}\\n${injectionCode.code()}` : injectionCode.code();\n }\n\n if (Object.keys(replacementValues).length > 0) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n config.define = { ...config.define, ...replacementStringValues };\n }\n\n const freeGlobalDependencyOnBuildArtifacts = createDependencyOnBuildArtifacts();\n const upload = createDebugIdUploadFunction({ sentryBuildPluginManager });\n\n build.onEnd(async result => {\n try {\n await sentryBuildPluginManager.createRelease();\n\n if (injectDebugIds) {\n const bundlePaths = result.outputs\n .filter(output => output.kind === 'entry-point' || output.kind === 'chunk')\n .map(output => output.path);\n\n await Promise.all(bundlePaths.map(replaceDebugIdPlaceholder));\n\n if (options.sourcemaps?.disable !== 'disable-upload') {\n await upload(bundlePaths);\n }\n }\n } finally {\n freeGlobalDependencyOnBuildArtifacts();\n await sentryBuildPluginManager.deleteArtifacts();\n }\n });\n },\n };\n}\n\nexport default sentryBunPlugin;\nexport type { Options as SentryBunPluginOptions } from '../core';\n"],"names":[],"mappings":";;;;;;AAkCA,MAAM,UAAA,GAAa,m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AC9E,MAAA,MAAM,MAAA,GAAS,2BAAA,CAA4B,EAAE,wBAAA,EAA0B,CAAA;AAEvE,MAAA,KAAA,CAAM,KAAA,CAAM,OAAM,MAAA,KAAU;AAC1B,QAAA,IAAI;AACF,UAAA,MAAM,yBAAyB,aAAA,EAAc;AAE7C,UAAA,IAAI,cAAA,EAAgB;AAClB,YAAA,MAAM,WAAA,GAAc,MAAA,CAAO,OAAA,CACxB,MAAA,CAAO,YAAU,MAAA,CAAO,IAAA,KAAS,aAAA,IAAiB,MAAA,CAAO,SAAS,OAAO,CAAA,CACzE,GAAA,CAAI,CAAA,MAAA,KAAU,OAAO,IAAI,CAAA;AAE5B,YAAA,MAAM,OAAA,CAAQ,GAAA,CAAI,WAAA,CAAY,GAAA,CAAI,yBAAyB,CAAC,CAAA;AAE5D,YAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,OAAA,KAAY,gBAAA,EAAkB;AACpD,cAAA,MAAM,OAAO,WAAW,CAAA;AAAA,YAC1B;AAAA,UACF;AAAA,QACF,CAAA,SAAE;AACA,UAAA,oCAAA,EAAqC;AACrC,UAAA,MAAM,yBAAyB,eAAA,EAAgB;AAAA,QACjD;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"11.10.0\";\n"],"names":[],"mappings":"AAAO,MAAM,WAAA,GAAc;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.
|
|
1
|
+
{"type":"module","version":"11.10.0","sideEffects":["./sentry-release-injection-file.js","./sentry-esbuild-debugid-injection-file.js"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Options } from '../core';
|
|
2
|
+
interface BunBuildArtifact {
|
|
3
|
+
path: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
}
|
|
6
|
+
interface BunBuildConfig {
|
|
7
|
+
banner?: string;
|
|
8
|
+
sourcemap?: 'none' | 'linked' | 'inline' | 'external' | boolean;
|
|
9
|
+
outdir?: string;
|
|
10
|
+
define?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
interface BunPluginBuilder {
|
|
13
|
+
config?: BunBuildConfig;
|
|
14
|
+
onEnd: (callback: (result: {
|
|
15
|
+
outputs: BunBuildArtifact[];
|
|
16
|
+
}) => void | Promise<void>) => void;
|
|
17
|
+
}
|
|
18
|
+
interface BunPlugin {
|
|
19
|
+
name: string;
|
|
20
|
+
setup: (build: BunPluginBuilder) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function sentryBunPlugin(userOptions?: Options): BunPlugin;
|
|
23
|
+
export default sentryBunPlugin;
|
|
24
|
+
export type { Options as SentryBunPluginOptions } from '../core';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvC,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,UAAU,gBAAgB;IAExB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CAC9F;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC1C;AAiBD,wBAAgB,eAAe,CAAC,WAAW,GAAE,OAAY,GAAG,SAAS,CAoHpE;eAEc,eAAe;AAC9B,YAAY,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.
|
|
1
|
+
export declare const LIB_VERSION = "11.10.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/core/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/core/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/bundler-plugins",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.10.0",
|
|
4
4
|
"description": "Sentry Bundler Plugins",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/main/packages/bundler-plugins",
|
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"import": "./build/esm/esbuild/index.js",
|
|
40
40
|
"require": "./build/cjs/esbuild/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./bun": {
|
|
43
|
+
"types": "./build/types/bun/index.d.ts",
|
|
44
|
+
"import": "./build/esm/bun/index.js",
|
|
45
|
+
"require": "./build/cjs/bun/index.js"
|
|
46
|
+
},
|
|
42
47
|
"./core": {
|
|
43
48
|
"types": "./build/types/core/index.d.ts",
|
|
44
49
|
"import": "./build/esm/core/index.js",
|
|
@@ -110,7 +115,7 @@
|
|
|
110
115
|
}
|
|
111
116
|
},
|
|
112
117
|
"dependencies": {
|
|
113
|
-
"@sentry/core": "11.
|
|
118
|
+
"@sentry/core": "11.10.0",
|
|
114
119
|
"dotenv": "^17.4.2",
|
|
115
120
|
"glob": "^13.0.6",
|
|
116
121
|
"magic-string": "~0.30.8 || ^1.0.0",
|
|
@@ -132,7 +137,10 @@
|
|
|
132
137
|
},
|
|
133
138
|
"devDependencies": {
|
|
134
139
|
"@babel/core": "^7.18.5",
|
|
140
|
+
"@babel/parser": "^7.29.8",
|
|
135
141
|
"@babel/preset-react": "^7.23.3",
|
|
142
|
+
"@sentry-internal/rollup-utils": "11.10.0",
|
|
143
|
+
"@sentry-internal/test-utils": "11.10.0",
|
|
136
144
|
"@types/babel__core": "^7.20.5",
|
|
137
145
|
"@types/node": "^20.19.0",
|
|
138
146
|
"premove": "^4.0.0",
|
|
@@ -140,9 +148,6 @@
|
|
|
140
148
|
"vitest": "^4.1.11",
|
|
141
149
|
"webpack": "5.104.1"
|
|
142
150
|
},
|
|
143
|
-
"volta": {
|
|
144
|
-
"extends": "../../package.json"
|
|
145
|
-
},
|
|
146
151
|
"engines": {
|
|
147
152
|
"node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
|
|
148
153
|
},
|