Skip to content

Commit 7038bb3

Browse files
authored
Merge branch 'develop' into sig/nitro-utils-nuxt
2 parents 16a58c9 + 1ec4c49 commit 7038bb3

20 files changed

+648
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
1212

13+
Work in this release was contributed by @lsmurray. Thank you for your contribution!
14+
1315
## 8.42.0
1416

1517
### Important Changes

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"packages/integration-shims",
6868
"packages/nestjs",
6969
"packages/nextjs",
70+
"packages/nitro-utils",
7071
"packages/node",
7172
"packages/nuxt",
7273
"packages/opentelemetry",

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,20 +336,11 @@ export function constructWebpackConfigFunction(
336336

337337
if (sentryWebpackPlugin) {
338338
if (!userSentryOptions.sourcemaps?.disable) {
339-
// TODO(v9): Remove this warning
340-
if (newConfig.devtool === false) {
341-
const runtimePrefix = !isServer ? 'Client' : runtime === 'edge' ? 'Edge' : 'Node.js';
342-
// eslint-disable-next-line no-console
343-
console.warn(
344-
`[@sentry/nextjs - ${runtimePrefix}] You disabled sourcemaps with the Webpack \`devtool\` option. Currently, the Sentry SDK will override this option to generate sourcemaps. In future versions, the Sentry SDK will not override the \`devtool\` option if you explicitly disable it. If you want to generate and upload sourcemaps please set the \`devtool\` option to 'hidden-source-map' or undefined.`,
345-
);
346-
}
347-
348339
// TODO(v9): Remove this warning and print warning in case source map deletion is auto configured
349340
if (!isServer && !userSentryOptions.sourcemaps?.deleteSourcemapsAfterUpload) {
350341
// eslint-disable-next-line no-console
351342
console.warn(
352-
"[@sentry/nextjs] The Sentry SDK has enabled source map generation for your Next.js app. If you don't want to serve Source Maps to your users, either set the `deleteSourceMapsAfterUpload` option to true, or manually delete the source maps after the build. In future Sentry SDK versions `deleteSourceMapsAfterUpload` will default to `true`.",
343+
"[@sentry/nextjs] The Sentry SDK has enabled source map generation for your Next.js app. If you don't want to serve Source Maps to your users, either set the `deleteSourceMapsAfterUpload` option to true, or manually delete the source maps after the build. In future Sentry SDK versions `deleteSourceMapsAfterUpload` will default to `true`. If you do not want to generate and upload sourcemaps, set the `sourcemaps.disable` option in `withSentryConfig()`.",
353344
);
354345
}
355346

packages/nitro-utils/.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
extends: ['../../.eslintrc.js'],
3+
env: {
4+
node: true,
5+
},
6+
overrides: [
7+
{
8+
files: ['src/**'],
9+
rules: {
10+
'@sentry-internal/sdk/no-optional-chaining': 'off',
11+
},
12+
},
13+
{
14+
files: ['src/metrics/**'],
15+
rules: {
16+
'@typescript-eslint/explicit-function-return-type': 'off',
17+
'@typescript-eslint/no-non-null-assertion': 'off',
18+
},
19+
},
20+
],
21+
};

packages/nitro-utils/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020-2024 Functional Software, Inc. dba Sentry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/nitro-utils/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 Utilities for Nitro-based SDKs
8+
9+
## Links
10+
11+
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
12+
- [TypeDoc](http://getsentry.github.io/sentry-node/)
13+
14+
## General
15+
16+
Common utilities used by Sentry SDKs that use Nitro on the server-side.
17+
18+
Note: This package is only meant to be used internally, and as such is not part of our public API contract and does not
19+
follow semver.

packages/nitro-utils/package.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "@sentry-internal/nitro-utils",
3+
"version": "8.42.0",
4+
"description": "Utilities for all Sentry SDKs with Nitro on the server-side",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nitro-utils",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"engines": {
10+
"node": ">=16.20"
11+
},
12+
"files": [
13+
"/build"
14+
],
15+
"main": "build/cjs/index.js",
16+
"module": "build/esm/index.js",
17+
"types": "build/types/index.d.ts",
18+
"exports": {
19+
"./package.json": "./package.json",
20+
".": {
21+
"import": {
22+
"types": "./build/types/index.d.ts",
23+
"default": "./build/esm/index.js"
24+
},
25+
"require": {
26+
"types": "./build/types/index.d.ts",
27+
"default": "./build/cjs/index.js"
28+
}
29+
}
30+
},
31+
"typesVersions": {
32+
"<4.9": {
33+
"build/types/index.d.ts": [
34+
"build/types-ts3.8/index.d.ts"
35+
]
36+
}
37+
},
38+
"publishConfig": {
39+
"access": "public"
40+
},
41+
"dependencies": {
42+
"@sentry/core": "8.42.0"
43+
},
44+
"devDependencies": {
45+
"rollup": "^4.24.4"
46+
},
47+
"scripts": {
48+
"build": "run-p build:transpile build:types",
49+
"build:dev": "yarn build",
50+
"build:transpile": "rollup -c rollup.npm.config.mjs",
51+
"build:types": "run-s build:types:core build:types:downlevel",
52+
"build:types:core": "tsc -p tsconfig.types.json",
53+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
54+
"build:watch": "run-p build:transpile:watch build:types:watch",
55+
"build:dev:watch": "run-p build:transpile:watch build:types:watch",
56+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
57+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
58+
"build:tarball": "npm pack",
59+
"clean": "rimraf build coverage sentry-internal-nitro-utils-*.tgz",
60+
"fix": "eslint . --format stylish --fix",
61+
"lint": "eslint . --format stylish",
62+
"test": "yarn test:unit",
63+
"test:unit": "vitest run",
64+
"test:watch": "vitest --watch",
65+
"yalc:publish": "yalc publish --push --sig"
66+
},
67+
"volta": {
68+
"extends": "../../package.json"
69+
},
70+
"sideEffects": false
71+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
2+
3+
export default makeNPMConfigVariants(
4+
makeBaseNPMConfig({
5+
packageSpecificConfig: {
6+
output: {
7+
// set exports to 'named' or 'auto' so that rollup doesn't warn
8+
exports: 'named',
9+
// set preserveModules to true because we don't want to bundle everything into one file.
10+
preserveModules:
11+
process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined
12+
? true
13+
: Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES),
14+
},
15+
},
16+
}),
17+
);

packages/nitro-utils/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export {
2+
wrapServerEntryWithDynamicImport,
3+
type WrapServerEntryPluginOptions,
4+
} from './rollupPlugins/wrapServerEntryWithDynamicImport';

0 commit comments

Comments
 (0)