Skip to content

Commit ce99389

Browse files
committed
fix(bundler-plugins): add README.md, LICENSE, lint, fix package links
1 parent caa3f25 commit ce99389

45 files changed

Lines changed: 2544 additions & 2791 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxfmtrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"ignorePatterns": [
1010
"packages/browser/test/loader.js",
1111
"packages/replay-worker/examples/worker.min.js",
12-
"dev-packages/browser-integration-tests/fixtures",
12+
"dev-packages/browser-integration-tests/fixtures/**",
13+
"dev-packages/bundler-plugin-integration-tests/fixtures/**",
14+
"packages/bundler-plugins/test/core/fixtures/**",
1315
"**/test.ts-snapshots/**",
1416
"/.nx/cache",
1517
"/.nx/workspace-data"

.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"test/manual/**",
3939
"types/**",
4040
"scripts/*.js",
41-
"node_modules/**"
41+
"node_modules/**",
42+
"packages/bundler-plugins/test/core/fixtures/**"
4243
]
4344
}

dev-packages/.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"typescript/no-misused-spread": "off",
1010
"typescript/no-base-to-string": "off",
1111
"typescript/await-thenable": "off"
12-
}
12+
},
13+
"ignorePatterns": ["bundler-plugin-integration-tests/fixtures/**"]
1314
}
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
/* eslint-disable no-console */
2-
import { promises as fs } from "fs";
3-
import { join } from "path";
4-
import { fileURLToPath } from "url";
5-
import { execSync } from "child_process";
2+
import { promises as fs } from 'fs';
3+
import { join } from 'path';
4+
import { fileURLToPath } from 'url';
5+
import { execSync } from 'child_process';
66

7-
console.log("Installing all dependencies for fixtures...");
7+
console.log('Installing all dependencies for fixtures...');
88

9-
const __dirname = fileURLToPath(new URL(".", import.meta.url));
10-
const fixturesDir = join(__dirname, "fixtures");
9+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
10+
const fixturesDir = join(__dirname, 'fixtures');
1111
const entries = await fs.readdir(fixturesDir, { withFileTypes: true });
1212

1313
// Get all directories
14-
const directories = entries
15-
.filter((entry) => entry.isDirectory())
16-
.map((entry) => join(fixturesDir, entry.name));
14+
const directories = entries.filter(entry => entry.isDirectory()).map(entry => join(fixturesDir, entry.name));
1715

1816
for (const dir of directories) {
1917
try {
20-
const pkgString = await fs.readFile(join(dir, "package.json"), { encoding: "utf-8" });
18+
const pkgString = await fs.readFile(join(dir, 'package.json'), { encoding: 'utf-8' });
2119
const packageJson = JSON.parse(pkgString);
2220
// If there are no dependencies, skip installation
2321
if (!packageJson.dependencies) {
@@ -27,10 +25,10 @@ for (const dir of directories) {
2725
continue;
2826
}
2927

30-
execSync("pnpm install --force", {
28+
execSync('pnpm install --force', {
3129
cwd: dir,
32-
stdio: "inherit",
30+
stdio: 'inherit',
3331
});
3432
}
3533

36-
console.log("All fixture dependencies installed successfully!");
34+
console.log('All fixture dependencies installed successfully!');

packages/bundler-plugins/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# MIT License
2+
3+
Copyright (c) 2022-2026, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
- Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
- Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
- Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/bundler-plugins/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Sentry Bundler Plugins
8+
9+
Core package containing the bundler-agnostic functionality used by the [bundler plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins).
10+
11+
Check out the individual packages for more information and examples:
12+
13+
- [Rollup](https://www.npmjs.com/package/@sentry/rollup-plugin)
14+
- [Vite](https://www.npmjs.com/package/@sentry/vite-plugin)
15+
- [esbuild](https://www.npmjs.com/package/@sentry/esbuild-plugin)
16+
- [Webpack](https://www.npmjs.com/package/@sentry/webpack-plugin)
17+
18+
### Features
19+
20+
The Sentry bundler plugin package contains the following functionality:
21+
22+
- Sourcemap upload
23+
- Release creation in Sentry
24+
- Automatic release name discovery (based on CI environment - Vercel, AWS, Heroku, CircleCI, or current Git SHA)
25+
- Automatically associate errors with releases (Release injection)
26+
27+
### More information
28+
29+
- [Sentry Documentation](https://docs.sentry.io/quickstart/)
30+
- [Sentry Discord](https://discord.gg/Ww9hbqr)
31+
- [Sentry Stackoverflow](http://stackoverflow.com/questions/tagged/sentry)

packages/bundler-plugins/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "@sentry/bundler-plugins",
33
"version": "5.3.0",
44
"description": "Sentry Bundler Plugins",
5-
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
6-
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/bundler-plugins",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/main/packages/bundler-plugins",
77
"author": "Sentry",
88
"license": "MIT",
99
"publishConfig": {
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
import packageJson from "./package.json" with { type: "json" };
2-
import modulePackage from "module";
3-
import path from "node:path";
4-
import { fileURLToPath } from "node:url";
1+
import packageJson from './package.json' with { type: 'json' };
2+
import modulePackage from 'module';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
55

66
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7-
const srcDir = path.resolve(__dirname, "src");
7+
const srcDir = path.resolve(__dirname, 'src');
88

99
const external = [
1010
...Object.keys(packageJson.dependencies || {}),
1111
...modulePackage.builtinModules,
12-
"webpack",
13-
"rollup",
14-
"vite",
12+
'webpack',
13+
'rollup',
14+
'vite',
1515
];
1616

1717
export default {
18-
platform: "node",
18+
platform: 'node',
1919
input: [
20-
"src/babel-plugin/index.ts",
21-
"src/core/index.ts",
22-
"src/rollup/index.ts",
23-
"src/vite/index.ts",
24-
"src/esbuild/index.ts",
25-
"src/webpack/index.ts",
26-
"src/webpack/webpack5.ts",
27-
"src/webpack/component-annotation-transform.ts",
20+
'src/babel-plugin/index.ts',
21+
'src/core/index.ts',
22+
'src/rollup/index.ts',
23+
'src/vite/index.ts',
24+
'src/esbuild/index.ts',
25+
'src/webpack/index.ts',
26+
'src/webpack/webpack5.ts',
27+
'src/webpack/component-annotation-transform.ts',
2828
],
2929
external,
3030
output: [
3131
{
32-
dir: "./dist/esm",
33-
format: "esm",
34-
exports: "named",
32+
dir: './dist/esm',
33+
format: 'esm',
34+
exports: 'named',
3535
sourcemap: true,
36-
entryFileNames: (chunkInfo) => {
36+
entryFileNames: chunkInfo => {
3737
if (chunkInfo.facadeModuleId) {
3838
const rel = path.relative(srcDir, chunkInfo.facadeModuleId);
39-
return rel.replace(/\.ts$/, ".mjs");
39+
return rel.replace(/\.ts$/, '.mjs');
4040
}
41-
return "[name].mjs";
41+
return '[name].mjs';
4242
},
43-
chunkFileNames: "_chunks/[name]-[hash].mjs",
43+
chunkFileNames: '_chunks/[name]-[hash].mjs',
4444
},
4545
{
46-
dir: "./dist/cjs",
47-
format: "cjs",
48-
exports: "named",
46+
dir: './dist/cjs',
47+
format: 'cjs',
48+
exports: 'named',
4949
sourcemap: true,
50-
entryFileNames: (chunkInfo) => {
50+
entryFileNames: chunkInfo => {
5151
if (chunkInfo.facadeModuleId) {
5252
const rel = path.relative(srcDir, chunkInfo.facadeModuleId);
53-
return rel.replace(/\.ts$/, ".js");
53+
return rel.replace(/\.ts$/, '.js');
5454
}
55-
return "[name].js";
55+
return '[name].js';
5656
},
57-
chunkFileNames: "_chunks/[name]-[hash].js",
57+
chunkFileNames: '_chunks/[name]-[hash].js',
5858
},
5959
],
6060
};
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
try {
22
let globalObject =
3-
"undefined" != typeof window
3+
'undefined' != typeof window
44
? window
5-
: "undefined" != typeof global
5+
: 'undefined' != typeof global
66
? global
7-
: "undefined" != typeof globalThis
7+
: 'undefined' != typeof globalThis
88
? global
9-
: "undefined" != typeof self
9+
: 'undefined' != typeof self
1010
? self
1111
: {};
1212

1313
let stack = new globalObject.Error().stack;
1414

1515
if (stack) {
1616
globalObject._sentryDebugIds = globalObject._sentryDebugIds || {};
17-
globalObject._sentryDebugIds[stack] = "__SENTRY_DEBUG_ID__";
18-
globalObject._sentryDebugIdIdentifier = "sentry-dbid-__SENTRY_DEBUG_ID__";
17+
globalObject._sentryDebugIds[stack] = '__SENTRY_DEBUG_ID__';
18+
globalObject._sentryDebugIdIdentifier = 'sentry-dbid-__SENTRY_DEBUG_ID__';
1919
}
2020
} catch {}

0 commit comments

Comments
 (0)