From 13941856bf92bcacd116420cc1854f4f2acef285 Mon Sep 17 00:00:00 2001 From: iker-barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 2 Mar 2021 10:51:26 +0100 Subject: [PATCH 1/7] docs: Add docs for sourcemaps in NextJS --- packages/nextjs/README.md | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index be8fac64345d..3ab3d10fd5b9 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -17,3 +17,44 @@ TODO: npm version, npm dm, npm dt, typedoc ## Usage TODO + +## Sourcemaps + +It's assumed that `@sentry/nextjs` is running in the project. +Configuring sourcemaps with the NextJS SDK only takes a few steps. + +1. If you're using TypeScript, make sure sourcemaps are generated. +2. Create the `.sentryclirc` file in the root of your project directory. +3. [Install](https://docs.sentry.io/product/cli/installation/) +and [configure](https://docs.sentry.io/product/cli/configuration/) +[`sentry-cli`](https://github.com/getsentry/sentry-cli). +4. Add the Sentry organization name and project name as environment variables. +5. Install and configure the [`sentry-webpack-plugin`](https://docs.sentry.io/platforms/javascript/sourcemaps/tools/webpack/), +by creating the following `next.config.js` in the root of your project directory: + +```js +const SentryWebpackPlugin = require("@sentry/webpack-plugin"); + +module.exports = { + productionBrowserSourceMaps: true, + webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { + config.plugins.push( + new SentryWebpackPlugin({ + // sentry-cli configuration + authToken: process.env.SENTRY_AUTH_TOKEN, + org: process.env.SENTRY_ORG, + project: process.env.SENTRY_PROJ, + + // webpack specific configuration + urlPrefix: "~/_next/", + include: ".next/", + ignore: ["node_modules", "webpack.config.js"], + + dryRun: true, // useful for dev environments; set to false in production + }) + ); + + return config; + }, +}; +``` From e38af12ac10d40cbea1a645b1efa333d2cc97e03 Mon Sep 17 00:00:00 2001 From: iker-barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 2 Mar 2021 11:30:43 +0100 Subject: [PATCH 2/7] docs: Remove unnecessary file --- packages/nextjs/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index 3ab3d10fd5b9..a5c463b9fcdc 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -24,12 +24,11 @@ It's assumed that `@sentry/nextjs` is running in the project. Configuring sourcemaps with the NextJS SDK only takes a few steps. 1. If you're using TypeScript, make sure sourcemaps are generated. -2. Create the `.sentryclirc` file in the root of your project directory. -3. [Install](https://docs.sentry.io/product/cli/installation/) +2. [Install](https://docs.sentry.io/product/cli/installation/) and [configure](https://docs.sentry.io/product/cli/configuration/) [`sentry-cli`](https://github.com/getsentry/sentry-cli). -4. Add the Sentry organization name and project name as environment variables. -5. Install and configure the [`sentry-webpack-plugin`](https://docs.sentry.io/platforms/javascript/sourcemaps/tools/webpack/), +3. Add the Sentry organization name and project name as environment variables. +4. Install and configure the [`sentry-webpack-plugin`](https://docs.sentry.io/platforms/javascript/sourcemaps/tools/webpack/), by creating the following `next.config.js` in the root of your project directory: ```js From c7dc6f8bbfafd5f080009c8f0e53194485340f88 Mon Sep 17 00:00:00 2001 From: iker-barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 2 Mar 2021 12:27:54 +0100 Subject: [PATCH 3/7] ref: Removed unnecessary file This file was supposed to be removed in a prior refacto --- packages/nextjs/test/sample.test.ts | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/nextjs/test/sample.test.ts diff --git a/packages/nextjs/test/sample.test.ts b/packages/nextjs/test/sample.test.ts deleted file mode 100644 index 2b94e001ade6..000000000000 --- a/packages/nextjs/test/sample.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('sample test', () => { - test('true is truthy', () => { - expect(true).toBeTruthy(); - }); -}); From e9d5d22320696d68d0e2d8b41ce5b8f26dd71b5a Mon Sep 17 00:00:00 2001 From: iker-barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 2 Mar 2021 12:58:38 +0100 Subject: [PATCH 4/7] feat: Sourcemap config to manual --- packages/nextjs/README.md | 4 +- packages/nextjs/package.json | 7 +- yarn.lock | 128 ++++++++++++++++++++++++++++++++--- 3 files changed, 126 insertions(+), 13 deletions(-) diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index a5c463b9fcdc..236fbde70e28 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -18,7 +18,7 @@ TODO: npm version, npm dm, npm dt, typedoc TODO -## Sourcemaps +## Manual sourcemap configuration It's assumed that `@sentry/nextjs` is running in the project. Configuring sourcemaps with the NextJS SDK only takes a few steps. @@ -48,8 +48,6 @@ module.exports = { urlPrefix: "~/_next/", include: ".next/", ignore: ["node_modules", "webpack.config.js"], - - dryRun: true, // useful for dev environments; set to false in production }) ); diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 60198a3935a2..f7520f7444bd 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -20,7 +20,9 @@ "@sentry/core": "6.2.0", "@sentry/minimal": "6.2.0", "@sentry/node": "6.2.0", - "@sentry/react": "6.2.0" + "@sentry/react": "6.2.0", + "@sentry/wizard": "^1.1.4", + "@sentry/webpack-plugin": "1.14.1" }, "devDependencies": { "@sentry/types": "6.2.0", @@ -44,7 +46,8 @@ "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", "test": "jest", "test:watch": "jest --watch", - "pack": "npm pack" + "pack": "npm pack", + "postinstall": "sentry-wizard nextjs" }, "volta": { "extends": "../../package.json" diff --git a/yarn.lock b/yarn.lock index afc2984a37f5..94bb2bd2ca0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3286,6 +3286,17 @@ "@sentry/utils" "6.2.0" tslib "^1.9.3" +"@sentry/cli@^1.52.4", "@sentry/cli@^1.58.0": + version "1.63.0" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.63.0.tgz#e69f05e2abab3c68a68958b55556618067e1dea9" + integrity sha512-JXB7uER6P8NkvxU+u8f4uDaCYdJ01aSz4g337CzpywOCuWDcm1mxPwc6hyVfNUyzVmQA1PaV2/opckyfUHJs6g== + dependencies: + https-proxy-agent "^5.0.0" + mkdirp "^0.5.5" + node-fetch "^2.6.0" + progress "^2.0.3" + proxy-from-env "^1.1.0" + "@sentry/core@6.2.0": version "6.2.0" resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.2.0.tgz#be1c33854fc94e1a4d867f7c2c311cf1cefb8ee9" @@ -3366,6 +3377,29 @@ "@sentry/types" "6.2.0" tslib "^1.9.3" +"@sentry/webpack-plugin@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.14.1.tgz#f7aceac17820677f6064293d1f5d01ac72012d14" + integrity sha512-Elxs21Z9hHNd+s9dCFVkbr/xLa+7Pb8zfqSCzvPOraHCBseE2onyzM7gostmxLtInboEwO0yRTQ5ohmfhhpa2A== + dependencies: + "@sentry/cli" "^1.58.0" + +"@sentry/wizard@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@sentry/wizard/-/wizard-1.1.4.tgz#df51af4271d11f729b938dde4864514b69e4aac9" + integrity sha512-xVpL0lnQK2bbEwUKKjs3dKhy27va8HW75Q8r1vaR63iBCpB5LpP4Q4NN5G/VEWdYnH8rcazsOA207716E1cm4g== + dependencies: + "@sentry/cli" "^1.52.4" + chalk "^2.4.1" + glob "^7.1.3" + inquirer "^6.2.0" + lodash "^4.17.15" + opn "^5.4.0" + r2 "^2.0.1" + read-env "^1.3.0" + xcode "2.0.0" + yargs "^12.0.2" + "@simple-dom/interface@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f" @@ -5888,7 +5922,7 @@ base64-js@^1.0.2, base64-js@^1.3.0: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== -base64-js@^1.3.1: +base64-js@^1.2.3, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -5947,6 +5981,11 @@ bfj@^6.1.1: hoopy "^0.1.4" tryer "^1.0.1" +big-integer@^1.6.44: + version "1.6.48" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" + integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== + big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -6074,6 +6113,20 @@ bower-endpoint-parser@0.2.2: resolved "https://registry.yarnpkg.com/bower-endpoint-parser/-/bower-endpoint-parser-0.2.2.tgz#00b565adbfab6f2d35addde977e97962acbcb3f6" integrity sha1-ALVlrb+rby01rd3pd+l5Yqy8s/Y= +bplist-creator@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/bplist-creator/-/bplist-creator-0.0.8.tgz#56b2a6e79e9aec3fc33bf831d09347d73794e79c" + integrity sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA== + dependencies: + stream-buffers "~2.2.0" + +bplist-parser@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" + integrity sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw== + dependencies: + big-integer "^1.6.44" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -7122,6 +7175,11 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" +camelcase@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" + integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== + camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -7184,7 +7242,7 @@ cardinal@^1.0.0: ansicolors "~0.2.1" redeyed "~1.0.0" -caseless@~0.12.0: +caseless@^0.12.0, caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= @@ -15290,7 +15348,7 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1: +node-fetch@^2.0.0-alpha.8, node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -15747,6 +15805,13 @@ opener@^1.5.1: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== +opn@^5.4.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" + integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== + dependencies: + is-wsl "^1.1.0" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -16403,6 +16468,15 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" +plist@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c" + integrity sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ== + dependencies: + base64-js "^1.2.3" + xmlbuilder "^9.0.7" + xmldom "0.1.x" + plugin-error@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" @@ -16951,7 +17025,7 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.1" -proxy-from-env@^1.0.0: +proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== @@ -17137,6 +17211,15 @@ qunit@^2.9.3: node-watch "0.6.1" resolve "1.9.0" +r2@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/r2/-/r2-2.0.1.tgz#94cd802ecfce9a622549c8182032d8e4a2b2e612" + integrity sha512-EEmxoxYCe3LHzAUhRIRxdCKERpeRNmlLj6KLUSORqnK6dWl/K5ShmDGZqM2lRZQeqJgF+wyqk0s1M7SWUveNOQ== + dependencies: + caseless "^0.12.0" + node-fetch "^2.0.0-alpha.8" + typedarray-to-buffer "^3.1.2" + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -17268,6 +17351,13 @@ read-cmd-shim@^1.0.1: dependencies: graceful-fs "^4.1.2" +read-env@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/read-env/-/read-env-1.3.0.tgz#e26e1e446992b3216e9a3c6f6ac51064fe91fdff" + integrity sha512-DbCgZ8oHwZreK/E2E27RGk3EUPapMhYGSGIt02k9sX6R3tCFc4u4tkltKvkCvzEQ3SOLUaiYHAnGb+TdsnPp0A== + dependencies: + camelcase "5.0.0" + "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: version "2.1.1" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.1.1.tgz#16aa66c59e7d4dad6288f179dd9295fd59bb98f1" @@ -18370,6 +18460,15 @@ simple-html-tokenizer@^0.5.8, simple-html-tokenizer@^0.5.9: resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.9.tgz#1a83fe97f5a3e39b335fddf71cfe9b0263b581c2" integrity sha512-w/3FEDN94r4JQ9WoYrIr8RqDIPZdyNkdpbK9glFady1CAEyD97XWCv8HFetQO21w81e7h7Nh59iYTyG1mUJftg== +simple-plist@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/simple-plist/-/simple-plist-1.1.1.tgz#54367ca28bc5996a982c325c1c4a4c1a05f4047c" + integrity sha512-pKMCVKvZbZTsqYR6RKgLfBHkh2cV89GXcA/0CVPje3sOiNOnXA8+rp/ciAMZ7JRaUdLzlEM6JFfUn+fS6Nt3hg== + dependencies: + bplist-creator "0.0.8" + bplist-parser "0.2.0" + plist "^3.0.1" + simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" @@ -18830,6 +18929,11 @@ stream-browserify@^2.0.1, stream-browserify@^2.0.2: inherits "~2.0.1" readable-stream "^2.0.2" +stream-buffers@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" + integrity sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ= + stream-combiner@~0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" @@ -19839,7 +19943,7 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typedarray-to-buffer@^3.1.5: +typedarray-to-buffer@^3.1.2, typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== @@ -20778,6 +20882,14 @@ ws@~3.3.1: safe-buffer "~5.1.0" ultron "~1.1.0" +xcode@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xcode/-/xcode-2.0.0.tgz#134f1f94c26fbfe8a9aaa9724bfb2772419da1a2" + integrity sha512-5xF6RCjAdDEiEsbbZaS/gBRt3jZ/177otZcpoLCjGN/u1LrfgH7/Sgeeavpr/jELpyDqN2im3AKosl2G2W8hfw== + dependencies: + simple-plist "^1.0.0" + uuid "^3.3.2" + xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" @@ -20796,7 +20908,7 @@ xml2js@0.4.19: sax ">=0.6.0" xmlbuilder "~9.0.1" -xmlbuilder@~9.0.1: +xmlbuilder@^9.0.7, xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= @@ -20806,7 +20918,7 @@ xmlchars@^2.1.1, xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xmldom@^0.1.19: +xmldom@0.1.x, xmldom@^0.1.19: version "0.1.31" resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff" integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ== @@ -20920,7 +21032,7 @@ yargs@13.3.2, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^12.0.1: +yargs@^12.0.1, yargs@^12.0.2: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== From 11eb091f8cb8b4ce58cc0b8433e549b2b2ff9058 Mon Sep 17 00:00:00 2001 From: iker-barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:35:25 +0100 Subject: [PATCH 5/7] fix: Delete `postinstall` --- packages/nextjs/package.json | 3 +-- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index f7520f7444bd..d55bb68bad53 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -46,8 +46,7 @@ "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", "test": "jest", "test:watch": "jest --watch", - "pack": "npm pack", - "postinstall": "sentry-wizard nextjs" + "pack": "npm pack" }, "volta": { "extends": "../../package.json" diff --git a/yarn.lock b/yarn.lock index 94bb2bd2ca0c..395b440a2741 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3377,7 +3377,7 @@ "@sentry/types" "6.2.0" tslib "^1.9.3" -"@sentry/webpack-plugin@^1.14.1": +"@sentry/webpack-plugin@1.14.1": version "1.14.1" resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.14.1.tgz#f7aceac17820677f6064293d1f5d01ac72012d14" integrity sha512-Elxs21Z9hHNd+s9dCFVkbr/xLa+7Pb8zfqSCzvPOraHCBseE2onyzM7gostmxLtInboEwO0yRTQ5ohmfhhpa2A== From 4d0907315468c792d92341c776892ea5896f8507 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 3 Mar 2021 09:20:07 +0100 Subject: [PATCH 6/7] Update package.json --- packages/nextjs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index a4a59f1b0ed7..3574a5517723 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -21,7 +21,7 @@ "@sentry/minimal": "6.2.1", "@sentry/node": "6.2.1", "@sentry/react": "6.2.1", - "@sentry/wizard": "^1.1.4", + "@sentry/wizard": "1.2.0", "@sentry/webpack-plugin": "1.14.1" }, "devDependencies": { From 1704c7ea41a55e2602e6d6c9574158c3faf2aaaa Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 3 Mar 2021 09:22:32 +0100 Subject: [PATCH 7/7] ref: Remove source map section Update wizard --- packages/nextjs/README.md | 38 -------------------------------------- yarn.lock | 8 ++++---- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index 236fbde70e28..be8fac64345d 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -17,41 +17,3 @@ TODO: npm version, npm dm, npm dt, typedoc ## Usage TODO - -## Manual sourcemap configuration - -It's assumed that `@sentry/nextjs` is running in the project. -Configuring sourcemaps with the NextJS SDK only takes a few steps. - -1. If you're using TypeScript, make sure sourcemaps are generated. -2. [Install](https://docs.sentry.io/product/cli/installation/) -and [configure](https://docs.sentry.io/product/cli/configuration/) -[`sentry-cli`](https://github.com/getsentry/sentry-cli). -3. Add the Sentry organization name and project name as environment variables. -4. Install and configure the [`sentry-webpack-plugin`](https://docs.sentry.io/platforms/javascript/sourcemaps/tools/webpack/), -by creating the following `next.config.js` in the root of your project directory: - -```js -const SentryWebpackPlugin = require("@sentry/webpack-plugin"); - -module.exports = { - productionBrowserSourceMaps: true, - webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { - config.plugins.push( - new SentryWebpackPlugin({ - // sentry-cli configuration - authToken: process.env.SENTRY_AUTH_TOKEN, - org: process.env.SENTRY_ORG, - project: process.env.SENTRY_PROJ, - - // webpack specific configuration - urlPrefix: "~/_next/", - include: ".next/", - ignore: ["node_modules", "webpack.config.js"], - }) - ); - - return config; - }, -}; -``` diff --git a/yarn.lock b/yarn.lock index e52f89889137..53d2d0b7e868 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3384,10 +3384,10 @@ dependencies: "@sentry/cli" "^1.58.0" -"@sentry/wizard@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@sentry/wizard/-/wizard-1.1.4.tgz#df51af4271d11f729b938dde4864514b69e4aac9" - integrity sha512-xVpL0lnQK2bbEwUKKjs3dKhy27va8HW75Q8r1vaR63iBCpB5LpP4Q4NN5G/VEWdYnH8rcazsOA207716E1cm4g== +"@sentry/wizard@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@sentry/wizard/-/wizard-1.2.0.tgz#9ed9e0eb8501ef1b94ff6fbea57fffb6ed6a08ae" + integrity sha512-VxtRO8k4hL1pZ1Nfv9ps5GmMMoKH8b6gMmicrAbXUeO8BHSJ6EOW24OtvRDShvZJ5bxY1lR6f/dUaC7qt1E+MA== dependencies: "@sentry/cli" "^1.52.4" chalk "^2.4.1"