@sentry/bundler-plugins 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/LICENSE +29 -0
- package/README.md +31 -0
- package/build/cjs/babel-plugin/constants.js +126 -0
- package/build/cjs/babel-plugin/constants.js.map +1 -0
- package/build/cjs/babel-plugin/experimental.js +334 -0
- package/build/cjs/babel-plugin/experimental.js.map +1 -0
- package/build/cjs/babel-plugin/index.js +508 -0
- package/build/cjs/babel-plugin/index.js.map +1 -0
- package/build/cjs/core/build-plugin-manager.js +583 -0
- package/build/cjs/core/build-plugin-manager.js.map +1 -0
- package/build/cjs/core/debug-id-upload.js +184 -0
- package/build/cjs/core/debug-id-upload.js.map +1 -0
- package/build/cjs/core/glob.js +10 -0
- package/build/cjs/core/glob.js.map +1 -0
- package/build/cjs/core/index.js +113 -0
- package/build/cjs/core/index.js.map +1 -0
- package/build/cjs/core/logger.js +29 -0
- package/build/cjs/core/logger.js.map +1 -0
- package/build/cjs/core/options-mapping.js +115 -0
- package/build/cjs/core/options-mapping.js.map +1 -0
- package/build/cjs/core/sentry/telemetry.js +127 -0
- package/build/cjs/core/sentry/telemetry.js.map +1 -0
- package/build/cjs/core/sentry/transports.js +108 -0
- package/build/cjs/core/sentry/transports.js.map +1 -0
- package/build/cjs/core/utils.js +298 -0
- package/build/cjs/core/utils.js.map +1 -0
- package/build/cjs/core/version.js +6 -0
- package/build/cjs/core/version.js.map +1 -0
- package/build/cjs/esbuild/index.js +208 -0
- package/build/cjs/esbuild/index.js.map +1 -0
- package/build/cjs/rollup/index.js +193 -0
- package/build/cjs/rollup/index.js.map +1 -0
- package/build/cjs/vite/index.js +28 -0
- package/build/cjs/vite/index.js.map +1 -0
- package/build/cjs/webpack/component-annotation-transform.js +29 -0
- package/build/cjs/webpack/component-annotation-transform.js.map +1 -0
- package/build/cjs/webpack/index.js +25 -0
- package/build/cjs/webpack/index.js.map +1 -0
- package/build/cjs/webpack/webpack4and5.js +185 -0
- package/build/cjs/webpack/webpack4and5.js.map +1 -0
- package/build/cjs/webpack/webpack5.js +11 -0
- package/build/cjs/webpack/webpack5.js.map +1 -0
- package/build/esm/babel-plugin/constants.js +123 -0
- package/build/esm/babel-plugin/constants.js.map +1 -0
- package/build/esm/babel-plugin/experimental.js +332 -0
- package/build/esm/babel-plugin/experimental.js.map +1 -0
- package/build/esm/babel-plugin/index.js +505 -0
- package/build/esm/babel-plugin/index.js.map +1 -0
- package/build/esm/core/build-plugin-manager.js +561 -0
- package/build/esm/core/build-plugin-manager.js.map +1 -0
- package/build/esm/core/debug-id-upload.js +161 -0
- package/build/esm/core/debug-id-upload.js.map +1 -0
- package/build/esm/core/glob.js +8 -0
- package/build/esm/core/glob.js.map +1 -0
- package/build/esm/core/index.js +82 -0
- package/build/esm/core/index.js.map +1 -0
- package/build/esm/core/logger.js +27 -0
- package/build/esm/core/logger.js.map +1 -0
- package/build/esm/core/options-mapping.js +111 -0
- package/build/esm/core/options-mapping.js.map +1 -0
- package/build/esm/core/sentry/telemetry.js +118 -0
- package/build/esm/core/sentry/telemetry.js.map +1 -0
- package/build/esm/core/sentry/transports.js +92 -0
- package/build/esm/core/sentry/transports.js.map +1 -0
- package/build/esm/core/utils.js +271 -0
- package/build/esm/core/utils.js.map +1 -0
- package/build/esm/core/version.js +4 -0
- package/build/esm/core/version.js.map +1 -0
- package/build/esm/esbuild/index.js +190 -0
- package/build/esm/esbuild/index.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/rollup/index.js +172 -0
- package/build/esm/rollup/index.js.map +1 -0
- package/build/esm/vite/index.js +24 -0
- package/build/esm/vite/index.js.map +1 -0
- package/build/esm/webpack/component-annotation-transform.js +27 -0
- package/build/esm/webpack/component-annotation-transform.js.map +1 -0
- package/build/esm/webpack/index.js +21 -0
- package/build/esm/webpack/index.js.map +1 -0
- package/build/esm/webpack/webpack4and5.js +168 -0
- package/build/esm/webpack/webpack4and5.js.map +1 -0
- package/build/esm/webpack/webpack5.js +8 -0
- package/build/esm/webpack/webpack5.js.map +1 -0
- package/build/types/babel-plugin/constants.d.ts +27 -0
- package/build/types/babel-plugin/constants.d.ts.map +1 -0
- package/build/types/babel-plugin/experimental.d.ts +51 -0
- package/build/types/babel-plugin/experimental.d.ts.map +1 -0
- package/build/types/babel-plugin/index.d.ts +56 -0
- package/build/types/babel-plugin/index.d.ts.map +1 -0
- package/build/types/core/build-plugin-manager.d.ts +82 -0
- package/build/types/core/build-plugin-manager.d.ts.map +1 -0
- package/build/types/core/debug-id-upload.d.ts +17 -0
- package/build/types/core/debug-id-upload.d.ts.map +1 -0
- package/build/types/core/glob.d.ts +5 -0
- package/build/types/core/glob.d.ts.map +1 -0
- package/build/types/core/index.d.ts +53 -0
- package/build/types/core/index.d.ts.map +1 -0
- package/build/types/core/logger.d.ts +14 -0
- package/build/types/core/logger.d.ts.map +1 -0
- package/build/types/core/options-mapping.d.ts +82 -0
- package/build/types/core/options-mapping.d.ts.map +1 -0
- package/build/types/core/sentry/telemetry.d.ts +14 -0
- package/build/types/core/sentry/telemetry.d.ts.map +1 -0
- package/build/types/core/sentry/transports.d.ts +5 -0
- package/build/types/core/sentry/transports.d.ts.map +1 -0
- package/build/types/core/types.d.ts +570 -0
- package/build/types/core/types.d.ts.map +1 -0
- package/build/types/core/utils.d.ts +87 -0
- package/build/types/core/utils.d.ts.map +1 -0
- package/build/types/core/version.d.ts +2 -0
- package/build/types/core/version.d.ts.map +1 -0
- package/build/types/esbuild/index.d.ts +6 -0
- package/build/types/esbuild/index.d.ts.map +1 -0
- package/build/types/rollup/index.d.ts +56 -0
- package/build/types/rollup/index.d.ts.map +1 -0
- package/build/types/vite/index.d.ts +9 -0
- package/build/types/vite/index.d.ts.map +1 -0
- package/build/types/webpack/component-annotation-transform.d.ts +11 -0
- package/build/types/webpack/component-annotation-transform.d.ts.map +1 -0
- package/build/types/webpack/index.d.ts +5 -0
- package/build/types/webpack/index.d.ts.map +1 -0
- package/build/types/webpack/webpack4and5.d.ts +99 -0
- package/build/types/webpack/webpack4and5.d.ts.map +1 -0
- package/build/types/webpack/webpack5.d.ts +5 -0
- package/build/types/webpack/webpack5.d.ts.map +1 -0
- package/build/types-ts3.8/babel-plugin/constants.d.ts +27 -0
- package/build/types-ts3.8/babel-plugin/experimental.d.ts +51 -0
- package/build/types-ts3.8/babel-plugin/index.d.ts +56 -0
- package/build/types-ts3.8/core/build-plugin-manager.d.ts +82 -0
- package/build/types-ts3.8/core/debug-id-upload.d.ts +17 -0
- package/build/types-ts3.8/core/glob.d.ts +5 -0
- package/build/types-ts3.8/core/index.d.ts +53 -0
- package/build/types-ts3.8/core/logger.d.ts +14 -0
- package/build/types-ts3.8/core/options-mapping.d.ts +82 -0
- package/build/types-ts3.8/core/sentry/telemetry.d.ts +14 -0
- package/build/types-ts3.8/core/sentry/transports.d.ts +5 -0
- package/build/types-ts3.8/core/types.d.ts +570 -0
- package/build/types-ts3.8/core/utils.d.ts +87 -0
- package/build/types-ts3.8/core/version.d.ts +2 -0
- package/build/types-ts3.8/esbuild/index.d.ts +6 -0
- package/build/types-ts3.8/rollup/index.d.ts +56 -0
- package/build/types-ts3.8/vite/index.d.ts +9 -0
- package/build/types-ts3.8/webpack/component-annotation-transform.d.ts +11 -0
- package/build/types-ts3.8/webpack/index.d.ts +5 -0
- package/build/types-ts3.8/webpack/webpack4and5.d.ts +99 -0
- package/build/types-ts3.8/webpack/webpack5.d.ts +5 -0
- package/package.json +153 -0
- package/sentry-esbuild-debugid-injection-file.js +20 -0
- package/sentry-release-injection-file.js +4 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import SentryCli from '@sentry/cli';
|
|
2
|
+
import { createStackParser, nodeStackLineParser, applySdkMetadata, ServerRuntimeClient, Scope } from '@sentry/core';
|
|
3
|
+
import { SENTRY_SAAS_URL } from '../options-mapping.js';
|
|
4
|
+
import { makeOptionallyEnabledNodeTransport } from './transports.js';
|
|
5
|
+
import { getProjects } from '../utils.js';
|
|
6
|
+
import { LIB_VERSION } from '../version.js';
|
|
7
|
+
|
|
8
|
+
const SENTRY_SAAS_HOSTNAME = "sentry.io";
|
|
9
|
+
const stackParser = createStackParser(nodeStackLineParser());
|
|
10
|
+
function createSentryInstance(options, shouldSendTelemetry, buildTool, buildToolMajorVersion) {
|
|
11
|
+
const clientOptions = {
|
|
12
|
+
platform: "node",
|
|
13
|
+
runtime: { name: "node", version: global.process.version },
|
|
14
|
+
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
15
|
+
tracesSampleRate: 1,
|
|
16
|
+
sampleRate: 1,
|
|
17
|
+
release: LIB_VERSION,
|
|
18
|
+
integrations: [],
|
|
19
|
+
tracePropagationTargets: ["sentry.io/api"],
|
|
20
|
+
stackParser,
|
|
21
|
+
beforeSend: (event) => {
|
|
22
|
+
event.exception?.values?.forEach((exception) => {
|
|
23
|
+
delete exception.stacktrace;
|
|
24
|
+
});
|
|
25
|
+
delete event.server_name;
|
|
26
|
+
return event;
|
|
27
|
+
},
|
|
28
|
+
beforeSendTransaction: (event) => {
|
|
29
|
+
delete event.server_name;
|
|
30
|
+
return event;
|
|
31
|
+
},
|
|
32
|
+
// We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told
|
|
33
|
+
// us that the upload URL is the Sentry SaaS URL)
|
|
34
|
+
transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry)
|
|
35
|
+
};
|
|
36
|
+
applySdkMetadata(clientOptions, "node");
|
|
37
|
+
const client = new ServerRuntimeClient(clientOptions);
|
|
38
|
+
const scope = new Scope();
|
|
39
|
+
scope.setClient(client);
|
|
40
|
+
setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);
|
|
41
|
+
return { sentryScope: scope, sentryClient: client };
|
|
42
|
+
}
|
|
43
|
+
function setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion) {
|
|
44
|
+
const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;
|
|
45
|
+
scope.setTag("upload-legacy-sourcemaps", !!release.uploadLegacySourcemaps);
|
|
46
|
+
if (release.uploadLegacySourcemaps) {
|
|
47
|
+
scope.setTag(
|
|
48
|
+
"uploadLegacySourcemapsEntries",
|
|
49
|
+
Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
scope.setTag("module-metadata", !!options.moduleMetadata);
|
|
53
|
+
scope.setTag("inject-build-information", !!options._experiments.injectBuildInformation);
|
|
54
|
+
if (release.setCommits) {
|
|
55
|
+
scope.setTag("set-commits", release.setCommits.auto === true ? "auto" : "manual");
|
|
56
|
+
} else {
|
|
57
|
+
scope.setTag("set-commits", "undefined");
|
|
58
|
+
}
|
|
59
|
+
scope.setTag("finalize-release", release.finalize);
|
|
60
|
+
scope.setTag("deploy-options", !!release.deploy);
|
|
61
|
+
scope.setTag("custom-error-handler", !!errorHandler);
|
|
62
|
+
scope.setTag("sourcemaps-assets", !!sourcemaps?.assets);
|
|
63
|
+
scope.setTag("delete-after-upload", !!sourcemaps?.filesToDeleteAfterUpload);
|
|
64
|
+
scope.setTag("sourcemaps-disabled", !!sourcemaps?.disable);
|
|
65
|
+
scope.setTag("react-annotate", !!reactComponentAnnotation?.enabled);
|
|
66
|
+
scope.setTag("node", process.version);
|
|
67
|
+
scope.setTag("platform", process.platform);
|
|
68
|
+
scope.setTag("meta-framework", options._metaOptions.telemetry.metaFramework ?? "none");
|
|
69
|
+
scope.setTag("application-key-set", options.applicationKey !== void 0);
|
|
70
|
+
scope.setTag("ci", !!process.env["CI"]);
|
|
71
|
+
scope.setTags({
|
|
72
|
+
organization: org,
|
|
73
|
+
project: Array.isArray(project) ? project.join(", ") : project ?? "undefined",
|
|
74
|
+
bundler: buildTool
|
|
75
|
+
});
|
|
76
|
+
if (buildToolMajorVersion) {
|
|
77
|
+
scope.setTag("bundler-major-version", buildToolMajorVersion);
|
|
78
|
+
}
|
|
79
|
+
scope.setUser({ id: org });
|
|
80
|
+
}
|
|
81
|
+
async function allowedToSendTelemetry(options) {
|
|
82
|
+
const { silent, org, project, authToken, url, headers, telemetry, release } = options;
|
|
83
|
+
if (telemetry === false) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (url === SENTRY_SAAS_URL) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
const cli = new SentryCli(null, {
|
|
90
|
+
url,
|
|
91
|
+
authToken,
|
|
92
|
+
org,
|
|
93
|
+
project: getProjects(project)?.[0],
|
|
94
|
+
vcsRemote: release.vcsRemote,
|
|
95
|
+
silent,
|
|
96
|
+
headers
|
|
97
|
+
});
|
|
98
|
+
let cliInfo;
|
|
99
|
+
try {
|
|
100
|
+
cliInfo = await cli.execute(["info"], false);
|
|
101
|
+
} catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const cliInfoUrl = cliInfo.split(/(\r\n|\n|\r)/)[0]?.replace(/^Sentry Server: /, "")?.trim();
|
|
105
|
+
if (cliInfoUrl === void 0) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
return new URL(cliInfoUrl).hostname === SENTRY_SAAS_HOSTNAME;
|
|
109
|
+
}
|
|
110
|
+
async function safeFlushTelemetry(sentryClient) {
|
|
111
|
+
try {
|
|
112
|
+
await sentryClient.flush(2e3);
|
|
113
|
+
} catch {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { allowedToSendTelemetry, createSentryInstance, safeFlushTelemetry, setTelemetryDataOnScope };
|
|
118
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sources":["../../../../src/core/sentry/telemetry.ts"],"sourcesContent":["import SentryCli from '@sentry/cli';\nimport type { Client } from '@sentry/core';\nimport type { ServerRuntimeClientOptions } from '@sentry/core';\nimport { applySdkMetadata, ServerRuntimeClient } from '@sentry/core';\nimport type { NormalizedOptions } from '../options-mapping';\nimport { SENTRY_SAAS_URL } from '../options-mapping';\nimport { Scope } from '@sentry/core';\nimport { createStackParser, nodeStackLineParser } from '@sentry/core';\nimport { makeOptionallyEnabledNodeTransport } from './transports';\nimport { getProjects } from '../utils';\nimport { LIB_VERSION } from '../version';\n\nconst SENTRY_SAAS_HOSTNAME = 'sentry.io';\n\nconst stackParser = createStackParser(nodeStackLineParser());\n\nexport function createSentryInstance(\n options: NormalizedOptions,\n shouldSendTelemetry: Promise<boolean>,\n buildTool: string,\n buildToolMajorVersion: string | undefined,\n): { sentryScope: Scope; sentryClient: Client } {\n const clientOptions: ServerRuntimeClientOptions = {\n platform: 'node',\n runtime: { name: 'node', version: global.process.version },\n\n dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737',\n\n tracesSampleRate: 1,\n sampleRate: 1,\n\n release: LIB_VERSION,\n integrations: [],\n tracePropagationTargets: ['sentry.io/api'],\n\n stackParser,\n\n beforeSend: event => {\n event.exception?.values?.forEach(exception => {\n delete exception.stacktrace;\n });\n\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n beforeSendTransaction: event => {\n delete event.server_name; // Server name might contain PII\n return event;\n },\n\n // We create a transport that stalls sending events until we know that we're allowed to (i.e. when Sentry CLI told\n // us that the upload URL is the Sentry SaaS URL)\n transport: makeOptionallyEnabledNodeTransport(shouldSendTelemetry),\n };\n\n applySdkMetadata(clientOptions, 'node');\n\n const client = new ServerRuntimeClient(clientOptions);\n const scope = new Scope();\n scope.setClient(client);\n\n setTelemetryDataOnScope(options, scope, buildTool, buildToolMajorVersion);\n\n return { sentryScope: scope, sentryClient: client };\n}\n\nexport function setTelemetryDataOnScope(\n options: NormalizedOptions,\n scope: Scope,\n buildTool: string,\n buildToolMajorVersion?: string,\n): void {\n const { org, project, release, errorHandler, sourcemaps, reactComponentAnnotation } = options;\n\n scope.setTag('upload-legacy-sourcemaps', !!release.uploadLegacySourcemaps);\n if (release.uploadLegacySourcemaps) {\n scope.setTag(\n 'uploadLegacySourcemapsEntries',\n Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1,\n );\n }\n\n scope.setTag('module-metadata', !!options.moduleMetadata);\n scope.setTag('inject-build-information', !!options._experiments.injectBuildInformation);\n\n // Optional release pipeline steps\n if (release.setCommits) {\n scope.setTag('set-commits', release.setCommits.auto === true ? 'auto' : 'manual');\n } else {\n scope.setTag('set-commits', 'undefined');\n }\n scope.setTag('finalize-release', release.finalize);\n scope.setTag('deploy-options', !!release.deploy);\n\n // Miscellaneous options\n scope.setTag('custom-error-handler', !!errorHandler);\n scope.setTag('sourcemaps-assets', !!sourcemaps?.assets);\n scope.setTag('delete-after-upload', !!sourcemaps?.filesToDeleteAfterUpload);\n scope.setTag('sourcemaps-disabled', !!sourcemaps?.disable);\n\n scope.setTag('react-annotate', !!reactComponentAnnotation?.enabled);\n\n scope.setTag('node', process.version);\n scope.setTag('platform', process.platform);\n\n scope.setTag('meta-framework', options._metaOptions.telemetry.metaFramework ?? 'none');\n\n scope.setTag('application-key-set', options.applicationKey !== undefined);\n\n scope.setTag('ci', !!process.env['CI']);\n\n scope.setTags({\n organization: org,\n project: Array.isArray(project) ? project.join(', ') : (project ?? 'undefined'),\n bundler: buildTool,\n });\n\n if (buildToolMajorVersion) {\n scope.setTag('bundler-major-version', buildToolMajorVersion);\n }\n\n scope.setUser({ id: org });\n}\n\nexport async function allowedToSendTelemetry(options: NormalizedOptions): Promise<boolean> {\n const { silent, org, project, authToken, url, headers, telemetry, release } = options;\n\n // `options.telemetry` defaults to true\n if (telemetry === false) {\n return false;\n }\n\n if (url === SENTRY_SAAS_URL) {\n return true;\n }\n\n const cli = new SentryCli(null, {\n url,\n authToken,\n org,\n project: getProjects(project)?.[0],\n vcsRemote: release.vcsRemote,\n silent,\n headers,\n });\n\n let cliInfo;\n try {\n // Makes a call to SentryCLI to get the Sentry server URL the CLI uses.\n // We need to check and decide to use telemetry based on the CLI's response to this call\n // because only at this time we checked a possibly existing .sentryclirc file. This file\n // could point to another URL than the default URL.\n cliInfo = await cli.execute(['info'], false);\n } catch {\n return false;\n }\n\n const cliInfoUrl = cliInfo\n .split(/(\\r\\n|\\n|\\r)/)[0]\n ?.replace(/^Sentry Server: /, '')\n ?.trim();\n\n if (cliInfoUrl === undefined) {\n return false;\n }\n\n return new URL(cliInfoUrl).hostname === SENTRY_SAAS_HOSTNAME;\n}\n\n/**\n * Flushing the SDK client can fail. We never want to crash the plugin because of telemetry.\n */\nexport async function safeFlushTelemetry(sentryClient: Client): Promise<void> {\n try {\n await sentryClient.flush(2000);\n } catch {\n // Noop when flushing fails.\n // We don't even need to log anything because there's likely nothing the user can do and they likely will not care.\n }\n}\n"],"names":[],"mappings":";;;;;;;AAYA,MAAM,oBAAA,GAAuB,WAAA;AAE7B,MAAM,WAAA,GAAc,iBAAA,CAAkB,mBAAA,EAAqB,CAAA;AAEpD,SAAS,oBAAA,CACd,OAAA,EACA,mBAAA,EACA,SAAA,EACA,qBAAA,EAC8C;AAC9C,EAAA,MAAM,aAAA,GAA4C;AAAA,IAChD,QAAA,EAAU,MAAA;AAAA,IACV,SAAS,EAAE,IAAA,EAAM,QAAQ,OAAA,EAAS,MAAA,CAAO,QAAQ,OAAA,EAAQ;AAAA,IAEzD,GAAA,EAAK,sEAAA;AAAA,IAEL,gBAAA,EAAkB,CAAA;AAAA,IAClB,UAAA,EAAY,CAAA;AAAA,IAEZ,OAAA,EAAS,WAAA;AAAA,IACT,cAAc,EAAC;AAAA,IACf,uBAAA,EAAyB,CAAC,eAAe,CAAA;AAAA,IAEzC,WAAA;AAAA,IAEA,YAAY,CAAA,KAAA,KAAS;AACnB,MAAA,KAAA,CAAM,SAAA,EAAW,MAAA,EAAQ,OAAA,CAAQ,CAAA,SAAA,KAAa;AAC5C,QAAA,OAAO,SAAA,CAAU,UAAA;AAAA,MACnB,CAAC,CAAA;AAED,MAAA,OAAO,KAAA,CAAM,WAAA;AACb,M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OAAA,CAAQ,kBAAA,EAAoB,EAAE,CAAA,EAC9B,IAAA,EAAK;AAET,EAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAI,GAAA,CAAI,UAAU,CAAA,CAAE,QAAA,KAAa,oBAAA;AAC1C;AAKA,eAAsB,mBAAmB,YAAA,EAAqC;AAC5E,EAAA,IAAI;AACF,IAAA,MAAM,YAAA,CAAa,MAAM,GAAI,CAAA;AAAA,EAC/B,CAAA,CAAA,MAAQ;AAAA,EAGR;AACF;;;;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as https from 'node:https';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
|
+
import { createGzip } from 'node:zlib';
|
|
4
|
+
import { createTransport, suppressTracing } from '@sentry/core';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { mkdirSync, appendFileSync } from 'node:fs';
|
|
7
|
+
|
|
8
|
+
const GZIP_THRESHOLD = 1024 * 32;
|
|
9
|
+
function streamFromBody(body) {
|
|
10
|
+
return new Readable({
|
|
11
|
+
read() {
|
|
12
|
+
this.push(body);
|
|
13
|
+
this.push(null);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function createRequestExecutor(options) {
|
|
18
|
+
const { hostname, pathname, port, protocol, search } = new URL(options.url);
|
|
19
|
+
return function makeRequest(request) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
suppressTracing(() => {
|
|
22
|
+
let body = streamFromBody(request.body);
|
|
23
|
+
const headers = {};
|
|
24
|
+
if (request.body.length > GZIP_THRESHOLD) {
|
|
25
|
+
headers["content-encoding"] = "gzip";
|
|
26
|
+
body = body.pipe(createGzip());
|
|
27
|
+
}
|
|
28
|
+
const req = https.request(
|
|
29
|
+
{
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers,
|
|
32
|
+
hostname,
|
|
33
|
+
path: `${pathname}${search}`,
|
|
34
|
+
port,
|
|
35
|
+
protocol
|
|
36
|
+
},
|
|
37
|
+
(res) => {
|
|
38
|
+
res.on("data", () => {
|
|
39
|
+
});
|
|
40
|
+
res.on("end", () => {
|
|
41
|
+
});
|
|
42
|
+
res.setEncoding("utf8");
|
|
43
|
+
const retryAfterHeader = res.headers["retry-after"] ?? null;
|
|
44
|
+
const rateLimitsHeader = res.headers["x-sentry-rate-limits"] ?? null;
|
|
45
|
+
resolve({
|
|
46
|
+
statusCode: res.statusCode,
|
|
47
|
+
headers: {
|
|
48
|
+
"retry-after": retryAfterHeader,
|
|
49
|
+
"x-sentry-rate-limits": Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] || null : rateLimitsHeader
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
req.on("error", reject);
|
|
55
|
+
body.pipe(req);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function makeNodeTransport(options) {
|
|
61
|
+
const requestExecutor = createRequestExecutor(options);
|
|
62
|
+
return createTransport(options, requestExecutor);
|
|
63
|
+
}
|
|
64
|
+
function makeOptionallyEnabledNodeTransport(shouldSendTelemetry) {
|
|
65
|
+
return (nodeTransportOptions) => {
|
|
66
|
+
const nodeTransport = makeNodeTransport(nodeTransportOptions);
|
|
67
|
+
return {
|
|
68
|
+
flush: (timeout) => nodeTransport.flush(timeout),
|
|
69
|
+
send: async (request) => {
|
|
70
|
+
if ("__SENTRY_INTERCEPT_TRANSPORT__" in global && Array.isArray(global.__SENTRY_INTERCEPT_TRANSPORT__)) {
|
|
71
|
+
global.__SENTRY_INTERCEPT_TRANSPORT__.push(request);
|
|
72
|
+
return { statusCode: 200 };
|
|
73
|
+
}
|
|
74
|
+
if (await shouldSendTelemetry) {
|
|
75
|
+
if (process.env["SENTRY_TEST_OUT_DIR"]) {
|
|
76
|
+
const outDir = process.env["SENTRY_TEST_OUT_DIR"];
|
|
77
|
+
mkdirSync(outDir, { recursive: true });
|
|
78
|
+
const path = join(outDir, "sentry-telemetry.json");
|
|
79
|
+
appendFileSync(path, `${JSON.stringify(request)},
|
|
80
|
+
`);
|
|
81
|
+
return { statusCode: 200 };
|
|
82
|
+
}
|
|
83
|
+
return nodeTransport.send(request);
|
|
84
|
+
}
|
|
85
|
+
return { statusCode: 200 };
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { makeOptionallyEnabledNodeTransport };
|
|
92
|
+
//# sourceMappingURL=transports.js.map
|
|
@@ -0,0 +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":[],"mappings":";;;;;;;AAkBA,MAAM,iBAAiB,IAAA,GAAO,EAAA;AAM9B,SAAS,eAAe,IAAA,EAAqC;AAC3D,EAAA,OAAO,IAAI,QAAA,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,MAAA,eAAA,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,CAAK,UAAA,EAAY,CAAA;AAAA,QAC/B;AAEA,QAAA,MAAM,MAAM,KAAA,CAAM,OAAA;AAAA,UAChB;AAAA,YACE,MAAA,EAAQ,MAAA;AAAA,YACR,OAAA;AAAA,YACA,QAAA;AAAA,YACA,IAAA,EAAM,CAAA,EAAG,QAAQ,CAAA,EAAG,MAAM,CAAA,CAAA;AAAA,YAC1B,IAAA;AAAA,YACA;AAAA,WACF;AAAA,UACA,CAAA,G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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,YAAA,SAAA,CAAU,MAAA,EAAQ,EAAE,SAAA,EAAW,IAAA,EAAM,CAAA;AACrC,YAAA,MAAM,IAAA,GAAO,IAAA,CAAK,MAAA,EAAQ,uBAAuB,CAAA;AACjD,YAAA,cAAA,CAAe,IAAA,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;;;;"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import findUp from 'find-up';
|
|
2
|
+
import path__default from 'path';
|
|
3
|
+
import fs__default from 'fs';
|
|
4
|
+
import os__default from 'os';
|
|
5
|
+
import crypto from 'crypto';
|
|
6
|
+
import childProcess from 'child_process';
|
|
7
|
+
import MagicString from 'magic-string';
|
|
8
|
+
|
|
9
|
+
function arrayify(maybeArray) {
|
|
10
|
+
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
|
|
11
|
+
}
|
|
12
|
+
function getPackageJson({ cwd, stopAt } = {}) {
|
|
13
|
+
return lookupPackageJson(cwd ?? process.cwd(), path__default.normalize(stopAt ?? os__default.homedir()));
|
|
14
|
+
}
|
|
15
|
+
function parseMajorVersion(ver) {
|
|
16
|
+
let version = ver;
|
|
17
|
+
if (version.startsWith("v")) {
|
|
18
|
+
version = version.slice(1);
|
|
19
|
+
}
|
|
20
|
+
const regex = /^[\^~]?(\d+)(\.\d+)?(\.\d+)?(-.+)?/;
|
|
21
|
+
const match = version.match(regex);
|
|
22
|
+
if (match) {
|
|
23
|
+
return parseInt(match[1], 10);
|
|
24
|
+
}
|
|
25
|
+
const coerced = parseInt(version, 10);
|
|
26
|
+
if (!Number.isNaN(coerced)) {
|
|
27
|
+
return coerced;
|
|
28
|
+
}
|
|
29
|
+
const gteLteRegex = /^[<>]=\s*(\d+)(\.\d+)?(\.\d+)?(-.+)?/;
|
|
30
|
+
const gteLteMatch = version.match(gteLteRegex);
|
|
31
|
+
if (gteLteMatch) {
|
|
32
|
+
return parseInt(gteLteMatch[1], 10);
|
|
33
|
+
}
|
|
34
|
+
const ltRegex = /^<\s*(\d+)(\.\d+)?(\.\d+)?(-.+)?/;
|
|
35
|
+
const ltMatch = version.match(ltRegex);
|
|
36
|
+
if (ltMatch) {
|
|
37
|
+
const major = parseInt(ltMatch[1], 10);
|
|
38
|
+
if (
|
|
39
|
+
// minor version > 0
|
|
40
|
+
typeof ltMatch[2] === "string" && parseInt(ltMatch[2].slice(1), 10) > 0 || // patch version > 0
|
|
41
|
+
typeof ltMatch[3] === "string" && parseInt(ltMatch[3].slice(1), 10) > 0
|
|
42
|
+
) {
|
|
43
|
+
return major;
|
|
44
|
+
}
|
|
45
|
+
return major - 1;
|
|
46
|
+
}
|
|
47
|
+
const gtRegex = /^>\s*(\d+)(\.\d+)?(\.\d+)?(-.+)?/;
|
|
48
|
+
const gtMatch = version.match(gtRegex);
|
|
49
|
+
if (gtMatch) {
|
|
50
|
+
return parseInt(gtMatch[1], 10);
|
|
51
|
+
}
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
const PACKAGES_TO_INCLUDE_VERSION = [
|
|
55
|
+
"react",
|
|
56
|
+
"@angular/core",
|
|
57
|
+
"vue",
|
|
58
|
+
"ember-source",
|
|
59
|
+
"svelte",
|
|
60
|
+
"@sveltejs/kit",
|
|
61
|
+
"webpack",
|
|
62
|
+
"vite",
|
|
63
|
+
"gatsby",
|
|
64
|
+
"next",
|
|
65
|
+
"remix",
|
|
66
|
+
"rollup",
|
|
67
|
+
"esbuild"
|
|
68
|
+
];
|
|
69
|
+
function getDependencies(packageJson) {
|
|
70
|
+
const dependencies = Object.assign(
|
|
71
|
+
{},
|
|
72
|
+
packageJson["devDependencies"] ?? {},
|
|
73
|
+
packageJson["dependencies"] ?? {}
|
|
74
|
+
);
|
|
75
|
+
const deps = Object.keys(dependencies).sort();
|
|
76
|
+
const depsVersions = deps.reduce(
|
|
77
|
+
(depsVersions2, depName) => {
|
|
78
|
+
if (PACKAGES_TO_INCLUDE_VERSION.includes(depName)) {
|
|
79
|
+
const version = dependencies[depName];
|
|
80
|
+
const majorVersion = parseMajorVersion(version);
|
|
81
|
+
if (majorVersion) {
|
|
82
|
+
depsVersions2[depName] = majorVersion;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return depsVersions2;
|
|
86
|
+
},
|
|
87
|
+
{}
|
|
88
|
+
);
|
|
89
|
+
return { deps, depsVersions };
|
|
90
|
+
}
|
|
91
|
+
function lookupPackageJson(cwd, stopAt) {
|
|
92
|
+
const jsonPath = findUp.sync(
|
|
93
|
+
(dirName) => {
|
|
94
|
+
if (path__default.normalize(dirName) === stopAt) {
|
|
95
|
+
return findUp.stop;
|
|
96
|
+
}
|
|
97
|
+
return findUp.sync.exists(`${dirName}/package.json`) ? "package.json" : void 0;
|
|
98
|
+
},
|
|
99
|
+
{ cwd }
|
|
100
|
+
);
|
|
101
|
+
if (!jsonPath) {
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
const jsonStr = fs__default.readFileSync(jsonPath, "utf8");
|
|
106
|
+
const json = JSON.parse(jsonStr);
|
|
107
|
+
if ("name" in json || "private" in json) {
|
|
108
|
+
return json;
|
|
109
|
+
}
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
const newCwd = path__default.dirname(path__default.resolve(`${jsonPath}/..`));
|
|
113
|
+
return lookupPackageJson(newCwd, stopAt);
|
|
114
|
+
}
|
|
115
|
+
function stringToUUID(str) {
|
|
116
|
+
const sha256Hash = crypto.createHash("sha256").update(str).digest("hex");
|
|
117
|
+
const v4variant = ["8", "9", "a", "b"][sha256Hash.substring(16, 17).charCodeAt(0) % 4];
|
|
118
|
+
return `${sha256Hash.substring(0, 8)}-${sha256Hash.substring(8, 12)}-4${sha256Hash.substring(13, 16)}-${v4variant}${sha256Hash.substring(17, 20)}-${sha256Hash.substring(20, 32)}`.toLowerCase();
|
|
119
|
+
}
|
|
120
|
+
function gitRevision() {
|
|
121
|
+
let gitRevision2;
|
|
122
|
+
try {
|
|
123
|
+
gitRevision2 = childProcess.execSync("git rev-parse HEAD", { stdio: ["ignore", "pipe", "ignore"], windowsHide: true }).toString().trim();
|
|
124
|
+
} catch {
|
|
125
|
+
}
|
|
126
|
+
return gitRevision2;
|
|
127
|
+
}
|
|
128
|
+
function determineReleaseName() {
|
|
129
|
+
const possibleReleaseNameOfGitProvider = (
|
|
130
|
+
// GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
|
|
131
|
+
process.env["GITHUB_SHA"] || // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
|
|
132
|
+
process.env["CI_MERGE_REQUEST_SOURCE_BRANCH_SHA"] || process.env["CI_BUILD_REF"] || process.env["CI_COMMIT_SHA"] || // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/
|
|
133
|
+
process.env["BITBUCKET_COMMIT"]
|
|
134
|
+
);
|
|
135
|
+
const possibleReleaseNameOfCiProvidersWithSpecificEnvVar = (
|
|
136
|
+
// AppVeyor - https://www.appveyor.com/docs/environment-variables/
|
|
137
|
+
process.env["APPVEYOR_PULL_REQUEST_HEAD_COMMIT"] || process.env["APPVEYOR_REPO_COMMIT"] || // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
|
|
138
|
+
process.env["CODEBUILD_RESOLVED_SOURCE_VERSION"] || // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html
|
|
139
|
+
process.env["AWS_COMMIT_ID"] || // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
|
|
140
|
+
process.env["BUILD_SOURCEVERSION"] || // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/
|
|
141
|
+
process.env["GIT_CLONE_COMMIT_HASH"] || // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables
|
|
142
|
+
process.env["BUDDY_EXECUTION_REVISION"] || // Builtkite - https://buildkite.com/docs/pipelines/environment-variables
|
|
143
|
+
process.env["BUILDKITE_COMMIT"] || // CircleCI - https://circleci.com/docs/variables/
|
|
144
|
+
process.env["CIRCLE_SHA1"] || // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables
|
|
145
|
+
process.env["CIRRUS_CHANGE_IN_REPO"] || // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/
|
|
146
|
+
process.env["CF_REVISION"] || // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/
|
|
147
|
+
process.env["CM_COMMIT"] || // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables
|
|
148
|
+
process.env["CF_PAGES_COMMIT_SHA"] || // Drone - https://docs.drone.io/pipeline/environment/reference/
|
|
149
|
+
process.env["DRONE_COMMIT_SHA"] || // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables
|
|
150
|
+
process.env["FC_GIT_COMMIT_SHA"] || // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci
|
|
151
|
+
process.env["HEROKU_TEST_RUN_COMMIT_VERSION"] || // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
|
|
152
|
+
process.env["HEROKU_SLUG_COMMIT"] || // Railway - https://docs.railway.app/reference/variables#git-variables
|
|
153
|
+
process.env["RAILWAY_GIT_COMMIT_SHA"] || // Render - https://render.com/docs/environment-variables
|
|
154
|
+
process.env["RENDER_GIT_COMMIT"] || // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables
|
|
155
|
+
process.env["SEMAPHORE_GIT_SHA"] || // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
|
156
|
+
process.env["TRAVIS_PULL_REQUEST_SHA"] || // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables
|
|
157
|
+
process.env["VERCEL_GIT_COMMIT_SHA"] || process.env["VERCEL_GITHUB_COMMIT_SHA"] || process.env["VERCEL_GITLAB_COMMIT_SHA"] || process.env["VERCEL_BITBUCKET_COMMIT_SHA"] || // Zeit (now known as Vercel)
|
|
158
|
+
process.env["ZEIT_GITHUB_COMMIT_SHA"] || process.env["ZEIT_GITLAB_COMMIT_SHA"] || process.env["ZEIT_BITBUCKET_COMMIT_SHA"]
|
|
159
|
+
);
|
|
160
|
+
const possibleReleaseNameOfCiProvidersWithGenericEnvVar = (
|
|
161
|
+
// CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables
|
|
162
|
+
process.env["CI_COMMIT_ID"] || // Coolify - https://coolify.io/docs/knowledge-base/environment-variables
|
|
163
|
+
process.env["SOURCE_COMMIT"] || // Heroku #3 https://devcenter.heroku.com/changelog-items/630
|
|
164
|
+
process.env["SOURCE_VERSION"] || // Jenkins - https://plugins.jenkins.io/git/#environment-variables
|
|
165
|
+
process.env["GIT_COMMIT"] || // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
|
|
166
|
+
process.env["COMMIT_REF"] || // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html
|
|
167
|
+
process.env["BUILD_VCS_NUMBER"] || // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment
|
|
168
|
+
process.env["CI_COMMIT_SHA"]
|
|
169
|
+
);
|
|
170
|
+
return possibleReleaseNameOfGitProvider || possibleReleaseNameOfCiProvidersWithSpecificEnvVar || possibleReleaseNameOfCiProvidersWithGenericEnvVar || gitRevision();
|
|
171
|
+
}
|
|
172
|
+
function generateReleaseInjectorCode({
|
|
173
|
+
release,
|
|
174
|
+
injectBuildInformation
|
|
175
|
+
}) {
|
|
176
|
+
let code = `e.SENTRY_RELEASE={id:${JSON.stringify(release)}};`;
|
|
177
|
+
if (injectBuildInformation) {
|
|
178
|
+
const buildInfo = getBuildInformation();
|
|
179
|
+
code += `e.SENTRY_BUILD_INFO=${JSON.stringify(buildInfo)};`;
|
|
180
|
+
}
|
|
181
|
+
return new CodeInjection(code);
|
|
182
|
+
}
|
|
183
|
+
function generateModuleMetadataInjectorCode(metadata) {
|
|
184
|
+
return new CodeInjection(
|
|
185
|
+
`e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],${JSON.stringify(
|
|
186
|
+
metadata
|
|
187
|
+
)});`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function getBuildInformation() {
|
|
191
|
+
const packageJson = getPackageJson();
|
|
192
|
+
const { deps, depsVersions } = packageJson ? getDependencies(packageJson) : { deps: [], depsVersions: {} };
|
|
193
|
+
return {
|
|
194
|
+
deps,
|
|
195
|
+
depsVersions,
|
|
196
|
+
nodeVersion: parseMajorVersion(process.version)
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function stripQueryAndHashFromPath(path2) {
|
|
200
|
+
return path2.split("?")[0].split("#")[0];
|
|
201
|
+
}
|
|
202
|
+
function replaceBooleanFlagsInCode(code, replacementValues) {
|
|
203
|
+
const ms = new MagicString(code);
|
|
204
|
+
Object.keys(replacementValues).forEach((key) => {
|
|
205
|
+
const value = replacementValues[key];
|
|
206
|
+
if (typeof value === "boolean") {
|
|
207
|
+
ms.replaceAll(key, JSON.stringify(value));
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
if (ms.hasChanged()) {
|
|
211
|
+
return {
|
|
212
|
+
code: ms.toString(),
|
|
213
|
+
map: ms.generateMap({ hires: "boundary" })
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
function getTurborepoEnvPassthroughWarning(envVarName) {
|
|
219
|
+
return process.env["TURBO_HASH"] ? `
|
|
220
|
+
You seem to be using Turborepo, did you forget to put ${envVarName} in \`passThroughEnv\`? https://turbo.build/repo/docs/reference/configuration#passthroughenv` : "";
|
|
221
|
+
}
|
|
222
|
+
function getProjects(project) {
|
|
223
|
+
if (Array.isArray(project)) {
|
|
224
|
+
return project;
|
|
225
|
+
}
|
|
226
|
+
if (project) {
|
|
227
|
+
return [project];
|
|
228
|
+
}
|
|
229
|
+
return void 0;
|
|
230
|
+
}
|
|
231
|
+
function serializeIgnoreOptions(ignoreValue) {
|
|
232
|
+
const DEFAULT_IGNORE = ["node_modules"];
|
|
233
|
+
const ignoreOptions = Array.isArray(ignoreValue) ? ignoreValue : typeof ignoreValue === "string" ? [ignoreValue] : DEFAULT_IGNORE;
|
|
234
|
+
return ignoreOptions.reduce((acc, value) => acc.concat(["--ignore", String(value)]), []);
|
|
235
|
+
}
|
|
236
|
+
function containsOnlyImports(code) {
|
|
237
|
+
const codeWithoutImports = code.replace(/^\s*import\s+(?:'[^'\n]*'|"[^"\n]*"|`[^`\n]*`)[\s;]*$/gm, "").replace(/^\s*import\b[^'"`\n]*\bfrom\s+(?:'[^'\n]*'|"[^"\n]*"|`[^`\n]*`)[\s;]*$/gm, "").replace(/^\s*export\b[^'"`\n]*\bfrom\s+(?:'[^'\n]*'|"[^"\n]*"|`[^`\n]*`)[\s;]*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "").replace(/["']use strict["']\s*;?/g, "").trim();
|
|
238
|
+
return codeWithoutImports.length === 0;
|
|
239
|
+
}
|
|
240
|
+
class CodeInjection {
|
|
241
|
+
constructor(body = "") {
|
|
242
|
+
this.body = body;
|
|
243
|
+
this.header = `!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};`;
|
|
244
|
+
this.footer = "}catch(e){}}();";
|
|
245
|
+
}
|
|
246
|
+
code() {
|
|
247
|
+
if (this.isEmpty()) {
|
|
248
|
+
return "";
|
|
249
|
+
}
|
|
250
|
+
return this.header + this.body + this.footer;
|
|
251
|
+
}
|
|
252
|
+
isEmpty() {
|
|
253
|
+
return this.body.length === 0;
|
|
254
|
+
}
|
|
255
|
+
append(code) {
|
|
256
|
+
if (code instanceof CodeInjection) {
|
|
257
|
+
this.body += code.body;
|
|
258
|
+
} else {
|
|
259
|
+
this.body += code;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
clear() {
|
|
263
|
+
this.body = "";
|
|
264
|
+
}
|
|
265
|
+
clone() {
|
|
266
|
+
return new CodeInjection(this.body);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { CodeInjection, arrayify, containsOnlyImports, determineReleaseName, generateModuleMetadataInjectorCode, generateReleaseInjectorCode, getBuildInformation, getDependencies, getPackageJson, getProjects, getTurborepoEnvPassthroughWarning, parseMajorVersion, replaceBooleanFlagsInCode, serializeIgnoreOptions, stringToUUID, stripQueryAndHashFromPath };
|
|
271
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/core/utils.ts"],"sourcesContent":["/* oxlint-disable max-lines */\nimport findUp from 'find-up';\nimport path from 'path';\nimport fs from 'fs';\nimport os from 'os';\nimport crypto from 'crypto';\nimport childProcess from 'child_process';\nimport type { SourceMap } from 'magic-string';\nimport MagicString from 'magic-string';\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify<T = unknown>(maybeArray: T | T[]): T[] {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\ntype PackageJson = Record<string, unknown>;\n\n/**\n * Get the closes package.json from a given starting point upwards.\n * This handles a few edge cases:\n * * Check if a given file package.json appears to be an actual NPM package.json file\n * * Stop at the home dir, to avoid looking too deeply\n */\nexport function getPackageJson({ cwd, stopAt }: { cwd?: string; stopAt?: string } = {}): PackageJson | undefined {\n return lookupPackageJson(cwd ?? process.cwd(), path.normalize(stopAt ?? os.homedir()));\n}\n\nexport function parseMajorVersion(ver: string): number | undefined {\n let version = ver;\n // if it has a `v` prefix, remove it\n if (version.startsWith('v')) {\n version = version.slice(1);\n }\n\n // First, try simple lookup of exact, ~ and ^ versions\n const regex = /^[\\^~]?(\\d+)(\\.\\d+)?(\\.\\d+)?(-.+)?/;\n\n const match = version.match(regex);\n if (match) {\n return parseInt(match[1] as string, 10);\n }\n\n // Try to parse e.g. 1.x\n const coerced = parseInt(version, 10);\n if (!Number.isNaN(coerced)) {\n return coerced;\n }\n\n // Match <= and >= ranges.\n const gteLteRegex = /^[<>]=\\s*(\\d+)(\\.\\d+)?(\\.\\d+)?(-.+)?/;\n const gteLteMatch = version.match(gteLteRegex);\n if (gteLteMatch) {\n return parseInt(gteLteMatch[1] as string, 10);\n }\n\n // match < ranges\n const ltRegex = /^<\\s*(\\d+)(\\.\\d+)?(\\.\\d+)?(-.+)?/;\n const ltMatch = version.match(ltRegex);\n if (ltMatch) {\n // Two scenarios:\n // a) < 2.0.0 --> return 1\n // b) < 2.1.0 --> return 2\n\n const major = parseInt(ltMatch[1] as string, 10);\n\n if (\n // minor version > 0\n (typeof ltMatch[2] === 'string' && parseInt(ltMatch[2].slice(1), 10) > 0) ||\n // patch version > 0\n (typeof ltMatch[3] === 'string' && parseInt(ltMatch[3].slice(1), 10) > 0)\n ) {\n return major;\n }\n\n return major - 1;\n }\n\n // match > ranges\n const gtRegex = /^>\\s*(\\d+)(\\.\\d+)?(\\.\\d+)?(-.+)?/;\n const gtMatch = version.match(gtRegex);\n if (gtMatch) {\n // We always return the version here, even though it _may_ be incorrect\n // E.g. if given > 2.0.0, it should be 2 if there exists any 2.x.x version, else 3\n // Since there is no way for us to know this, we're going to assume any kind of patch/feature release probably exists\n return parseInt(gtMatch[1] as string, 10);\n }\n return undefined;\n}\n\n// This is an explicit list of packages where we want to include the (major) version number.\nconst PACKAGES_TO_INCLUDE_VERSION = [\n 'react',\n '@angular/core',\n 'vue',\n 'ember-source',\n 'svelte',\n '@sveltejs/kit',\n 'webpack',\n 'vite',\n 'gatsby',\n 'next',\n 'remix',\n 'rollup',\n 'esbuild',\n];\n\nexport function getDependencies(packageJson: PackageJson): {\n deps: string[];\n depsVersions: Record<string, number>;\n} {\n const dependencies: Record<string, string> = Object.assign(\n {},\n packageJson['devDependencies'] ?? {},\n packageJson['dependencies'] ?? {},\n );\n\n const deps = Object.keys(dependencies).sort();\n\n const depsVersions: Record<string, number> = deps.reduce(\n (depsVersions, depName) => {\n if (PACKAGES_TO_INCLUDE_VERSION.includes(depName)) {\n const version = dependencies[depName] as string;\n const majorVersion = parseMajorVersion(version);\n if (majorVersion) {\n depsVersions[depName] = majorVersion;\n }\n }\n return depsVersions;\n },\n {} as Record<string, number>,\n );\n\n return { deps, depsVersions };\n}\n\nfunction lookupPackageJson(cwd: string, stopAt: string): PackageJson | undefined {\n const jsonPath = findUp.sync(\n dirName => {\n // Stop if we reach this dir\n if (path.normalize(dirName) === stopAt) {\n return findUp.stop;\n }\n\n return findUp.sync.exists(`${dirName}/package.json`) ? 'package.json' : undefined;\n },\n { cwd },\n );\n\n if (!jsonPath) {\n return undefined;\n }\n\n try {\n const jsonStr = fs.readFileSync(jsonPath, 'utf8');\n const json = JSON.parse(jsonStr) as PackageJson;\n\n // Ensure it is an actual package.json\n // This is very much not bulletproof, but should be good enough\n if ('name' in json || 'private' in json) {\n return json;\n }\n } catch {\n // Ignore and walk up\n }\n\n // Continue up the tree, if we find a fitting package.json\n const newCwd = path.dirname(path.resolve(`${jsonPath}/..`));\n return lookupPackageJson(newCwd, stopAt);\n}\n\n/**\n * Deterministically hashes a string and turns the hash into a uuid.\n */\nexport function stringToUUID(str: string): string {\n const sha256Hash = crypto.createHash('sha256').update(str).digest('hex');\n\n // Position 16 is fixed to either 8, 9, a, or b in the uuid v4 spec (10xx in binary)\n // RFC 4122 section 4.4\n const v4variant = ['8', '9', 'a', 'b'][sha256Hash.substring(16, 17).charCodeAt(0) % 4] as string;\n\n return `${sha256Hash.substring(0, 8)}-${sha256Hash.substring(8, 12)}-4${sha256Hash.substring(13, 16)}-${v4variant}${sha256Hash.substring(17, 20)}-${sha256Hash.substring(20, 32)}`.toLowerCase();\n}\n\nfunction gitRevision(): string | undefined {\n let gitRevision: string | undefined;\n try {\n gitRevision = childProcess\n .execSync('git rev-parse HEAD', { stdio: ['ignore', 'pipe', 'ignore'], windowsHide: true })\n .toString()\n .trim();\n } catch {\n // noop\n }\n return gitRevision;\n}\n\n/**\n * Tries to guess a release name based on environmental data.\n */\n// oxlint-disable-next-line complexity\nexport function determineReleaseName(): string | undefined {\n // This list is in approximate alpha order, separated into 3 categories:\n // 1. Git providers\n // 2. CI providers with specific environment variables (has the provider name in the variable name)\n // 3. CI providers with generic environment variables (checked for last to prevent possible false positives)\n\n const possibleReleaseNameOfGitProvider =\n // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables\n process.env['GITHUB_SHA'] ||\n // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html\n process.env['CI_MERGE_REQUEST_SOURCE_BRANCH_SHA'] ||\n process.env['CI_BUILD_REF'] ||\n process.env['CI_COMMIT_SHA'] ||\n // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/\n process.env['BITBUCKET_COMMIT'];\n\n const possibleReleaseNameOfCiProvidersWithSpecificEnvVar =\n // AppVeyor - https://www.appveyor.com/docs/environment-variables/\n process.env['APPVEYOR_PULL_REQUEST_HEAD_COMMIT'] ||\n process.env['APPVEYOR_REPO_COMMIT'] ||\n // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html\n process.env['CODEBUILD_RESOLVED_SOURCE_VERSION'] ||\n // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html\n process.env['AWS_COMMIT_ID'] ||\n // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml\n process.env['BUILD_SOURCEVERSION'] ||\n // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/\n process.env['GIT_CLONE_COMMIT_HASH'] ||\n // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables\n process.env['BUDDY_EXECUTION_REVISION'] ||\n // Builtkite - https://buildkite.com/docs/pipelines/environment-variables\n process.env['BUILDKITE_COMMIT'] ||\n // CircleCI - https://circleci.com/docs/variables/\n process.env['CIRCLE_SHA1'] ||\n // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables\n process.env['CIRRUS_CHANGE_IN_REPO'] ||\n // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/\n process.env['CF_REVISION'] ||\n // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/\n process.env['CM_COMMIT'] ||\n // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables\n process.env['CF_PAGES_COMMIT_SHA'] ||\n // Drone - https://docs.drone.io/pipeline/environment/reference/\n process.env['DRONE_COMMIT_SHA'] ||\n // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables\n process.env['FC_GIT_COMMIT_SHA'] ||\n // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci\n process.env['HEROKU_TEST_RUN_COMMIT_VERSION'] ||\n // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases\n process.env['HEROKU_SLUG_COMMIT'] ||\n // Railway - https://docs.railway.app/reference/variables#git-variables\n process.env['RAILWAY_GIT_COMMIT_SHA'] ||\n // Render - https://render.com/docs/environment-variables\n process.env['RENDER_GIT_COMMIT'] ||\n // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables\n process.env['SEMAPHORE_GIT_SHA'] ||\n // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables\n process.env['TRAVIS_PULL_REQUEST_SHA'] ||\n // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables\n process.env['VERCEL_GIT_COMMIT_SHA'] ||\n process.env['VERCEL_GITHUB_COMMIT_SHA'] ||\n process.env['VERCEL_GITLAB_COMMIT_SHA'] ||\n process.env['VERCEL_BITBUCKET_COMMIT_SHA'] ||\n // Zeit (now known as Vercel)\n process.env['ZEIT_GITHUB_COMMIT_SHA'] ||\n process.env['ZEIT_GITLAB_COMMIT_SHA'] ||\n process.env['ZEIT_BITBUCKET_COMMIT_SHA'];\n\n const possibleReleaseNameOfCiProvidersWithGenericEnvVar =\n // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables\n process.env['CI_COMMIT_ID'] ||\n // Coolify - https://coolify.io/docs/knowledge-base/environment-variables\n process.env['SOURCE_COMMIT'] ||\n // Heroku #3 https://devcenter.heroku.com/changelog-items/630\n process.env['SOURCE_VERSION'] ||\n // Jenkins - https://plugins.jenkins.io/git/#environment-variables\n process.env['GIT_COMMIT'] ||\n // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata\n process.env['COMMIT_REF'] ||\n // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html\n process.env['BUILD_VCS_NUMBER'] ||\n // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment\n process.env['CI_COMMIT_SHA'];\n\n return (\n possibleReleaseNameOfGitProvider ||\n possibleReleaseNameOfCiProvidersWithSpecificEnvVar ||\n possibleReleaseNameOfCiProvidersWithGenericEnvVar ||\n gitRevision()\n );\n}\n\n/**\n * Generates code for the global injector which is responsible for setting the global\n * `SENTRY_RELEASE` & `SENTRY_BUILD_INFO` variables.\n */\nexport function generateReleaseInjectorCode({\n release,\n injectBuildInformation,\n}: {\n release: string;\n injectBuildInformation: boolean;\n}): CodeInjection {\n let code = `e.SENTRY_RELEASE={id:${JSON.stringify(release)}};`;\n\n if (injectBuildInformation) {\n const buildInfo = getBuildInformation();\n\n code += `e.SENTRY_BUILD_INFO=${JSON.stringify(buildInfo)};`;\n }\n\n return new CodeInjection(code);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function generateModuleMetadataInjectorCode(metadata: any): CodeInjection {\n // We are merging the metadata objects in case modules are bundled twice with the plugin\n // Use try-catch to avoid issues when bundlers rename global variables like 'window' to 'k'\n return new CodeInjection(\n `e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],${JSON.stringify(\n metadata,\n )});`,\n );\n}\n\nexport function getBuildInformation(): {\n deps: string[];\n depsVersions: Record<string, number>;\n nodeVersion: number | undefined;\n} {\n const packageJson = getPackageJson();\n\n const { deps, depsVersions } = packageJson ? getDependencies(packageJson) : { deps: [], depsVersions: {} };\n\n return {\n deps,\n depsVersions,\n nodeVersion: parseMajorVersion(process.version),\n };\n}\n\nexport function stripQueryAndHashFromPath(path: string): string {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return path.split('?')[0]!.split('#')[0]!;\n}\n\nexport function replaceBooleanFlagsInCode(\n code: string,\n replacementValues: Record<string, boolean | undefined>,\n): { code: string; map: SourceMap } | null {\n const ms = new MagicString(code);\n\n Object.keys(replacementValues).forEach(key => {\n const value = replacementValues[key];\n\n if (typeof value === 'boolean') {\n ms.replaceAll(key, JSON.stringify(value));\n }\n });\n\n if (ms.hasChanged()) {\n return {\n code: ms.toString(),\n map: ms.generateMap({ hires: 'boundary' }),\n };\n }\n\n return null;\n}\n\n// https://turbo.build/repo/docs/reference/system-environment-variables#environment-variables-in-tasks\nexport function getTurborepoEnvPassthroughWarning(envVarName: string): string {\n return process.env['TURBO_HASH']\n ? `\\nYou seem to be using Turborepo, did you forget to put ${envVarName} in \\`passThroughEnv\\`? https://turbo.build/repo/docs/reference/configuration#passthroughenv`\n : '';\n}\n\n/**\n * Gets the projects from the project option. This might be a single project or an array of projects.\n */\nexport function getProjects(project: string | string[] | undefined): string[] | undefined {\n if (Array.isArray(project)) {\n return project;\n }\n\n if (project) {\n return [project];\n }\n\n return undefined;\n}\n\n/**\n * Inlined functionality from @sentry/cli helper code to add `--ignore` options.\n *\n * Temporary workaround until we expose a function for injecting debug IDs. Currently, we directly call `execute` with CLI args to inject them.\n */\nexport function serializeIgnoreOptions(ignoreValue: string | string[] | undefined): string[] {\n const DEFAULT_IGNORE = ['node_modules'];\n\n const ignoreOptions: string[] = Array.isArray(ignoreValue)\n ? ignoreValue\n : typeof ignoreValue === 'string'\n ? [ignoreValue]\n : DEFAULT_IGNORE;\n\n return ignoreOptions.reduce((acc, value) => acc.concat(['--ignore', String(value)]), [] as string[]);\n}\n\n/**\n * Checks if a chunk contains only import/export statements and no substantial code.\n *\n * In Vite MPA (multi-page application) mode, HTML entry points create \"facade\" chunks\n * that only contain import statements to load shared modules. These should not have\n * Sentry code injected. However, in SPA mode, the main bundle also has an HTML facade\n * but contains substantial application code that SHOULD have debug IDs injected.\n *\n * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/829\n * @ref https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/839\n */\nexport function containsOnlyImports(code: string): boolean {\n const codeWithoutImports = code\n // Remove side effect imports: import '/path'; or import \"./path\";\n // Using explicit negated character classes to avoid polynomial backtracking\n .replace(/^\\s*import\\s+(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`\\n]*`)[\\s;]*$/gm, '')\n // Remove named/default imports: import x from '/path'; import { x } from '/path';\n .replace(/^\\s*import\\b[^'\"`\\n]*\\bfrom\\s+(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`\\n]*`)[\\s;]*$/gm, '')\n // Remove re-exports: export * from '/path'; export { x } from '/path';\n .replace(/^\\s*export\\b[^'\"`\\n]*\\bfrom\\s+(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`\\n]*`)[\\s;]*$/gm, '')\n // Remove block comments\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n // Remove line comments\n .replace(/\\/\\/.*$/gm, '')\n // Remove \"use strict\" directives\n .replace(/[\"']use strict[\"']\\s*;?/g, '')\n .trim();\n\n return codeWithoutImports.length === 0;\n}\n\nexport class CodeInjection {\n // The code below is mostly ternary operators because it saves bundle size.\n // The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)\n private readonly header: string;\n private readonly footer: string;\n\n constructor(private body: string = '') {\n this.header = `!function(){try{var e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:{};`;\n this.footer = '}catch(e){}}();';\n }\n\n public code(): string {\n if (this.isEmpty()) {\n return '';\n }\n\n return this.header + this.body + this.footer;\n }\n\n public isEmpty(): boolean {\n return this.body.length === 0;\n }\n\n public append(code: CodeInjection | string): void {\n if (code instanceof CodeInjection) {\n this.body += code.body;\n } else {\n this.body += code;\n }\n }\n\n public clear(): void {\n this.body = '';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,OAAA,CAAQ,WAAA,EAAa,EAAE,CAAA,CAEvB,OAAA,CAAQ,0BAAA,EAA4B,EAAE,CAAA,CACtC,IAAA,EAAK;AAER,EAAA,OAAO,mBAAmB,MAAA,KAAW,CAAA;AACvC;AAEO,MAAM,aAAA,CAAc;AAAA,EAMzB,WAAA,CAAoB,OAAe,EAAA,EAAI;AAAnB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAClB,IAAA,IAAA,CAAK,MAAA,GAAS,CAAA,qKAAA,CAAA;AACd,IAAA,IAAA,CAAK,MAAA,GAAS,iBAAA;AAAA,EAChB;AAAA,EAEO,IAAA,GAAe;AACpB,IAAA,IAAI,IAAA,CAAK,SAAQ,EAAG;AAClB,MAAA,OAAO,EAAA;AAAA,IACT;AAEA,IAAA,OAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,IAAA,GAAO,IAAA,CAAK,MAAA;AAAA,EACxC;AAAA,EAEO,OAAA,GAAmB;AACxB,IAAA,OAAO,IAAA,CAAK,KAAK,MAAA,KAAW,CAAA;AAAA,EAC9B;AAAA,EAEO,OAAO,IAAA,EAAoC;AAChD,IAAA,IAAI,gBAAgB,aAAA,EAAe;AACjC,MAAA,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA;AAAA,IACpB,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,IAAA,IAAQ,IAAA;AAAA,IACf;AAAA,EACF;AAAA,EAEO,KAAA,GAAc;AACnB,IAAA,IAAA,CAAK,IAAA,GAAO,EAAA;AAAA,EACd;AAAA,EAEO,KAAA,GAAuB;AAC5B,IAAA,OAAO,IAAI,aAAA,CAAc,IAAA,CAAK,IAAI,CAAA;AAAA,EACpC;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/core/version.ts"],"sourcesContent":["export const LIB_VERSION = \"10.60.0\";\n"],"names":[],"mappings":"AAAO,MAAM,WAAA,GAAc;;;;"}
|