Skip to content

Commit

Permalink
feat(changelog): Add back spotlight (#10894)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Jul 29, 2024
1 parent 5df6606 commit cd3b609
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 14 deletions.
12 changes: 12 additions & 0 deletions apps/changelog/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {withSentryConfig} from '@sentry/nextjs';
import WebpackHookPlugin from 'webpack-hook-plugin';

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -7,6 +8,17 @@ const nextConfig = {
ignoreDuringBuilds: true,
},
transpilePackages: ['next-mdx-remote'],
webpack: (config, {dev, nextRuntime}) => {
if (dev && nextRuntime === 'nodejs') {
config.plugins.push(
new WebpackHookPlugin({
onBuildStart: ['npx @spotlightjs/spotlight'],
})
);
}

return config;
},
async redirects() {
return [
{
Expand Down
4 changes: 3 additions & 1 deletion apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "8.20.0",
"@spotlightjs/spotlight": "^2.1.1",
"next": "^15.0.0-canary.83",
"next-auth": "^4.24.5",
"next-mdx-remote": "^4.4.1",
Expand All @@ -35,7 +36,8 @@
"rehype-slug": "^6.0.0",
"rss": "^1.2.2",
"sass": "^1.69.5",
"textarea-markdown-editor": "^1.0.4"
"textarea-markdown-editor": "^1.0.4",
"webpack-hook-plugin": "^1.0.7"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
Expand Down
16 changes: 6 additions & 10 deletions apps/changelog/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@

import * as SentryCore from '@sentry/core';
import * as Sentry from '@sentry/nextjs';
import * as Spotlight from '@spotlightjs/spotlight';

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Adjust this value in production, or use tracesSampler for greater control
environment: process.env.NODE_ENV,
tracesSampleRate: 1,

replaysOnErrorSampleRate: 1.0,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
Sentry.replayIntegration(),
SentryCore.thirdPartyErrorFilterIntegration({
filterKeys: ['sentry-changelog'],
behaviour: 'drop-error-if-contains-third-party-frames',
}),
],

debug: process.env.NODE_ENV !== 'production',
});

if (process.env.NODE_ENV === 'development') {
Spotlight.init();
}
2 changes: 1 addition & 1 deletion apps/changelog/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
environment: process.env.NODE_ENV,
debug: process.env.NODE_ENV !== 'production',
spotlight: process.env.NODE_ENV === 'development',
});
2 changes: 1 addition & 1 deletion apps/changelog/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Sentry.init({
tracesSampleRate: 1,
environment: process.env.NODE_ENV,
integrations: [Sentry.prismaIntegration()],
debug: process.env.NODE_ENV !== 'production',
spotlight: process.env.NODE_ENV === 'development',
});
32 changes: 31 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2898,11 +2898,21 @@
resolved "https://registry.npmjs.org/@spotlightjs/overlay/-/overlay-2.0.0-alpha.1.tgz"
integrity sha512-BJM8l9mJ6obTX/3xw1Erj9Pk/eVOP8oUtb3PoNjwQfnOrio7J8wlWjSETES22EslVPFI1kpl2UMtB+s91Ic8zQ==

"@spotlightjs/overlay@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@spotlightjs/overlay/-/overlay-2.1.0.tgz#47f6f616c3401bbe4b2094936018e4c840a0a66f"
integrity sha512-4A718MNG81N1q81lH45BppN/Z94lEHa9U8dUtfjpBdnSngJnwz6Ku3gmFhQQfEOcei+xtPdLgCVP3ODfu0etsg==

"@spotlightjs/sidecar@1.4.0":
version "1.4.0"
resolved "https://registry.npmjs.org/@spotlightjs/sidecar/-/sidecar-1.4.0.tgz"
integrity sha512-onj/phrNtDI8a79zc8jfxJ5BITQk5klO4xSoQXxiYeQWTZcegVeO8VftOVfWPBnMY/axnh+ltxJm/cHaV5SP6Q==

"@spotlightjs/sidecar@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@spotlightjs/sidecar/-/sidecar-1.5.0.tgz#b7afb8d0e4aaeaaa6d425b0f6a3eef97f78ae3e4"
integrity sha512-ASGHrRKQ40+kN/SAVEVD5GY3tt7gJM4lziEALHKb5rBXKHKIDqCckgEY4n8FhzpTo1N8azVFVHEIriPtpWTEsg==

"@spotlightjs/spotlight@^2.0.0-alpha.1":
version "2.0.0-alpha.1"
resolved "https://registry.npmjs.org/@spotlightjs/spotlight/-/spotlight-2.0.0-alpha.1.tgz"
Expand All @@ -2911,6 +2921,16 @@
"@spotlightjs/overlay" "2.0.0-alpha.1"
"@spotlightjs/sidecar" "1.4.0"

"@spotlightjs/spotlight@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@spotlightjs/spotlight/-/spotlight-2.1.1.tgz#c57a60c8a4164c2bf6cbf10c72fcf2dcaead8639"
integrity sha512-i67sfCEIXvsHMtGMfE7U0F0MQMcrMRc54ToyaqvzZZ4aRCcUpPdl50KChcixY1ksuI7KiiP0q4h+NbjOzrrX7w==
dependencies:
"@spotlightjs/overlay" "2.1.0"
"@spotlightjs/sidecar" "1.5.0"
import-meta-resolve "^4.1.0"
source-map "^0.7.4"

"@swc/counter@^0.1.3":
version "0.1.3"
resolved "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz"
Expand Down Expand Up @@ -6532,6 +6552,11 @@ import-local@^3.0.2:
pkg-dir "^4.2.0"
resolve-cwd "^3.0.0"

import-meta-resolve@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#f9db8bead9fafa61adb811db77a2bf22c5399706"
integrity sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==

imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz"
Expand Down Expand Up @@ -10722,7 +10747,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

source-map@^0.7.0:
source-map@^0.7.0, source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
Expand Down Expand Up @@ -11809,6 +11834,11 @@ webidl-conversions@^7.0.0:
resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz"
integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==

webpack-hook-plugin@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/webpack-hook-plugin/-/webpack-hook-plugin-1.0.7.tgz#689c2a24e16df247be91d8649e9da048774308ec"
integrity sha512-8GJ+LiR+0rrShCSeeFMaKONX7xMMW3H9Hszmy5IsCereZUJ5AoLhJgn5BhySQChA4Q5lZ7/9KtidDypYHQDDmA==

webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz"
Expand Down

0 comments on commit cd3b609

Please sign in to comment.