-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
158 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import { withSentryConfig } from "@sentry/nextjs"; | ||
import type { NextConfig } from "next"; | ||
import { withSentry } from "@cuurly/sentry-config/next"; | ||
|
||
const nextConfig: NextConfig = { | ||
const nextConfig = { | ||
images: { | ||
domains: ["res.cloudinary.com"], | ||
}, | ||
compiler: {}, | ||
}; | ||
|
||
const sentryOptions = { | ||
silent: false, | ||
org: "ezeikel", | ||
export default withSentry(nextConfig, { | ||
project: "cuurly-web", | ||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
widenClientFileUpload: true, | ||
transpileClientSDK: true, | ||
tunnelRoute: "/monitoring", | ||
hideSourceMaps: true, | ||
disableLogger: true, | ||
automaticVercelMonitors: true, | ||
}; | ||
|
||
const configWithSentry = withSentryConfig(nextConfig, sentryOptions); | ||
|
||
export default configWithSentry; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { initClientSentry } from "@cuurly/sentry-config/client"; | ||
|
||
Sentry.init({ | ||
dsn: "https://[email protected]/5263646", | ||
// Replay may only be enabled for the client-side | ||
integrations: [Sentry.replayIntegration()], | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for tracing. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus for 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0, | ||
|
||
// ... | ||
|
||
// Note: if you want to override the automatic release value, do not set a | ||
// `release` value here - use the environment variable `SENTRY_RELEASE`, so | ||
// that it will also get attached to your source maps | ||
}); | ||
initClientSentry( | ||
"https://[email protected]/5263646", | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { initEdgeSentry } from "@cuurly/sentry-config/edge"; | ||
|
||
Sentry.init({ | ||
dsn: "https://[email protected]/5263646", | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for tracing. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// ... | ||
|
||
// Note: if you want to override the automatic release value, do not set a | ||
// `release` value here - use the environment variable `SENTRY_RELEASE`, so | ||
// that it will also get attached to your source maps | ||
}); | ||
initEdgeSentry( | ||
"https://[email protected]/5263646", | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { initServerSentry } from "@cuurly/sentry-config/server"; | ||
|
||
Sentry.init({ | ||
dsn: "https://[email protected]/5263646", | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for tracing. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// ... | ||
|
||
// Note: if you want to override the automatic release value, do not set a | ||
// `release` value here - use the environment variable `SENTRY_RELEASE`, so | ||
// that it will also get attached to your source maps | ||
}); | ||
initServerSentry( | ||
"https://[email protected]/5263646", | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "@cuurly/tsconfig/base.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json", | ||
"target": "es2019", | ||
"module": "esnext", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": ["./**/*.ts", "index.ts"], | ||
"exclude": ["node_modules", "dist"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const getBaseConfig = (dsn) => ({ | ||
dsn, | ||
tracesSampleRate: 1.0, | ||
debug: process.env.NODE_ENV === "development", | ||
environment: process.env.NODE_ENV, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { getBaseConfig } from "./base.mjs"; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const initClientSentry = (dsn) => { | ||
Sentry.init({ | ||
...getBaseConfig(dsn), | ||
integrations: [Sentry.replayIntegration()], | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { getBaseConfig } from "./base.mjs"; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const initEdgeSentry = (dsn) => { | ||
Sentry.init({ | ||
...getBaseConfig(dsn), | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import eslintConfig from "@cuurly/eslint-config"; | ||
|
||
export default [...eslintConfig]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from "./client.mjs"; | ||
export * from "./server.mjs"; | ||
export * from "./edge.mjs"; | ||
export * from "./next.mjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { withSentryConfig } from "@sentry/nextjs"; | ||
|
||
export const getSentryWebpackPluginOptions = ({ org, project }) => ({ | ||
silent: false, | ||
org: org || "ezeikel", | ||
project: project || "cuurly-web", | ||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
widenClientFileUpload: true, | ||
transpileClientSDK: true, | ||
tunnelRoute: "/monitoring", | ||
hideSourceMaps: true, | ||
disableLogger: true, | ||
automaticVercelMonitors: true, | ||
}); | ||
|
||
export const withSentry = (config, options) => { | ||
return withSentryConfig(config, getSentryWebpackPluginOptions(options)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@cuurly/sentry-config", | ||
"version": "0.1.0", | ||
"private": true, | ||
"type": "module", | ||
"main": "index.js", | ||
"exports": { | ||
".": "./index.mjs", | ||
"./client": "./client.mjs", | ||
"./server": "./server.mjs", | ||
"./edge": "./edge.mjs", | ||
"./next": "./next.mjs" | ||
}, | ||
"scripts": { | ||
"clean": "git clean -xdf .next .turbo node_modules", | ||
"lint": "eslint", | ||
"lint:fix": "eslint --fix", | ||
"typecheck": "tsc --noEmit", | ||
"format": "prettier --write . --ignore-path ../../.gitignore --cache", | ||
"check-format": "prettier --check . --ignore-path ../../.gitignore --cache", | ||
"prepare": "husky" | ||
}, | ||
"lint-staged": { | ||
"**/*.+(js|jsx|json|ts|tsx|css|html|md)": [ | ||
"prettier --ignore-path .gitignore --write", | ||
"jest --findRelatedTests --passWithNoTests" | ||
] | ||
}, | ||
"dependencies": { | ||
"@sentry/nextjs": "^8.35.0" | ||
}, | ||
"devDependencies": { | ||
"@cuurly/eslint-config": "*", | ||
"@cuurly/prettier-config": "*", | ||
"@cuurly/tsconfig": "*" | ||
}, | ||
"peerDependencies": { | ||
"@sentry/nextjs": "^8.35.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import { getBaseConfig } from "./base.mjs"; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const initServerSentry = (dsn) => { | ||
Sentry.init({ | ||
...getBaseConfig(dsn), | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "@cuurly/tsconfig/base.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json", | ||
"target": "es2019", | ||
"module": "esnext", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": ["./**/*.ts", "index.mjs, "server.mjs", "next.mjs"", "edge.mjs", "client.mjs", "base.mjs"], | ||
"exclude": ["node_modules", "dist"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters