Skip to content

Commit 1a6a160

Browse files
authored
fix: bring back sentry (#596)
* fix: sentry * chore: make eslint happy
1 parent aaf4173 commit 1a6a160

File tree

10 files changed

+33
-94
lines changed

10 files changed

+33
-94
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ CLERK_PUBLISHABLE_KEY=
22
CLERK_SECRET_KEY=
33
DATABASE_URL=
44
TSIMS_URL=
5-
SENTRY_DSM=
5+
SENTRY_DSN=
66
CLUB_DATA_SECRET_KEY=
7+
SENTRY_AUTH_TOKEN=

components/custom/CAS/Record/view-activity-records/DataTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
const props = defineProps<{
2626
columns: ColumnDef<TData, TValue>[]
2727
data: TData[]
28+
// eslint-disable-next-line ts/no-unsafe-function-type
2829
refreshFunction: Function
2930
}>()
3031

env.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

nuxt.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ export default defineNuxtConfig({
2121
'@nuxt/fonts',
2222
'nuxt-svgo',
2323
'dayjs-nuxt',
24+
'@sentry/nuxt/module',
25+
'@nuxt/image',
2426
],
2527
build: {
2628
transpile: ['vue-clerk', '@clerk/clerk-js'],
2729
},
2830
runtimeConfig: {
2931
public: {
3032
sentry: {
31-
dsn: process.env.SENTRY_DSM,
33+
dsn: process.env.SENTRY_DSN,
3234
environment: 'development',
3335
},
3436
clerkPublishableKey: process.env.CLERK_PUBLISHABLE_KEY,
@@ -38,11 +40,6 @@ export default defineNuxtConfig({
3840
tsimsUrl: process.env.TSIMS_URL,
3941
clerkSecretKey: process.env.CLERK_SECRET_KEY,
4042
},
41-
features: {
42-
// Solves the weird issue where netlify's Functions bundling process fails.
43-
// ref: https://answers.netlify.com/t/typeerror-pattern-is-too-long/98172/5
44-
inlineStyles: false,
45-
},
4643
shadcn: {
4744
/**
4845
* Prefix for all the imported component
@@ -60,4 +57,12 @@ export default defineNuxtConfig({
6057
defaultLocale: 'zh-cn',
6158
defaultTimezone: 'Asia/Shanghai',
6259
},
60+
sentry: {
61+
debug: true,
62+
sourceMapsUploadOptions: {
63+
org: 'computerization',
64+
project: 'enspire',
65+
authToken: process.env.SENTRY_AUTH_TOKEN,
66+
},
67+
},
6368
})

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": "nuxt build",
77
"dev": "nuxt dev",
88
"generate": "nuxt generate",
9-
"preview": "nuxt preview",
9+
"preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview",
1010
"postinstall": "nuxt prepare && prisma generate",
1111
"update-club-info": "tsx utils/update-club-info.ts",
1212
"lint": "eslint .",
@@ -18,6 +18,7 @@
1818
"@clerk/themes": "^2.1.9",
1919
"@nuxt/content": "^2.12.1",
2020
"@radix-icons/vue": "^1.0.0",
21+
"@sentry/nuxt": "^8.25.0",
2122
"@tanstack/vue-table": "^8.17.3",
2223
"@unovis/ts": "^1.4.3",
2324
"@unovis/vue": "^1.4.3",
@@ -41,19 +42,17 @@
4142
"v-calendar": "^3.1.2",
4243
"vaul-vue": "^0.2.0",
4344
"vee-validate": "^4.13.1",
44-
"vue-clerk": "^0.4.3",
45+
"vue-clerk": "^0.4.15",
4546
"zod": "^3.23.8"
4647
},
4748
"devDependencies": {
4849
"@antfu/eslint-config": "^2.21.1",
4950
"@nuxt/fonts": "^0.7.0",
51+
"@nuxt/image": "^1.7.0",
5052
"@nuxtjs/google-fonts": "^3.2.0",
5153
"@nuxtjs/tailwindcss": "^6.12.0",
5254
"@prisma/client": "^5.15.0",
5355
"@rollup/plugin-wasm": "^6.2.2",
54-
"@sentry/node": "^7.117.0",
55-
"@sentry/profiling-node": "^7.110.0",
56-
"@sentry/vue": "^8.9.2",
5756
"@tailwindcss/typography": "^0.5.13",
5857
"@types/node-fetch": "^2.6.11",
5958
"@types/uuid": "^9.0.8",

plugins/clerk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { clerkPlugin } from 'vue-clerk/plugin'
1+
import { clerkPlugin } from 'vue-clerk'
22

33
export default defineNuxtPlugin(async (nuxtApp) => {
44
nuxtApp.vueApp.use(clerkPlugin, {

plugins/sentry.client.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

public/instrument.server.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/nuxt'
2+
3+
// Only run `init` when DSN is available
4+
if (process.env.SENTRY_DSN) {
5+
Sentry.init({
6+
dsn: process.env.SENTRY_DSN,
7+
})
8+
}

sentry.client.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as Sentry from '@sentry/nuxt'
2+
3+
Sentry.init({
4+
// There isn't any way to get the dsn from env var here
5+
dsn: 'https://fa9f1c768005ae729e6fb560d2b02713@o4506819268444160.ingest.us.sentry.io/4506822264029184',
6+
})

server/plugins/sentry.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)