add sentry user-feedback feature

This commit is contained in:
gregor 2024-07-13 15:02:30 +03:00
parent 0b620d028c
commit 8a0c6eeef3
5 changed files with 502 additions and 92 deletions

3
.gitignore vendored
View File

@ -27,3 +27,6 @@ dist-ssr
.vercel
.turbo
# Sentry Config File
.env.sentry-build-plugin

384
package-lock.json generated
View File

@ -11,6 +11,8 @@
"packages/*"
],
"dependencies": {
"@sentry/vite-plugin": "^2.21.1",
"@sentry/vue": "^8.17.0",
"@trpc/client": "^11.0.0-next-beta.316",
"@trpc/server": "^11.0.0-next-beta.316",
"nanoid": "^5.0.1",
@ -9577,6 +9579,371 @@
"join-component": "^1.1.0"
}
},
"node_modules/@sentry-internal/browser-utils": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.17.0.tgz",
"integrity": "sha512-BEYBIDX1y8paKsDk8PmjYfAYFNS+KSeEhOwJTr/RWjvx/Fyb5ZF2q4u7qMjeNFLcxKnMkQTGYE9CYf/7XWs4bA==",
"dependencies": {
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry-internal/feedback": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.17.0.tgz",
"integrity": "sha512-lFypwCqqcwgh++8sPZw9hAEKphXSgPIdSqoXakgwSKxGx2pCIBbzeyOWzUeBpGfBkTw813HiuRwNY+e0dF6b4Q==",
"dependencies": {
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry-internal/replay": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.17.0.tgz",
"integrity": "sha512-SBNXBbXEd4WdCIIa/9mkcrwUjxJxSQtYakJ00Xvv/gwqR1rmRFOVqVjLXisryDXCucdD4Rp5MqRT9H+BcSNVtg==",
"dependencies": {
"@sentry-internal/browser-utils": "8.17.0",
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry-internal/replay-canvas": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.17.0.tgz",
"integrity": "sha512-2FAbd/65zjPzlUQK/cKBzNPIClBKSPrHzfuB1ZM102JwSpvS5sljzhLvxua17uwU9V1Z9pbOT1pu5KtkUyc7lQ==",
"dependencies": {
"@sentry-internal/replay": "8.17.0",
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry/babel-plugin-component-annotate": {
"version": "2.21.1",
"resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.21.1.tgz",
"integrity": "sha512-u1L8gZ4He0WdyiIsohYkA/YOY1b6Oa5yIMRtfZZ9U5TiWYLgOfMWyb88X0GotZeghSbgxrse/yI4WeHnhAUQDQ==",
"engines": {
"node": ">= 14"
}
},
"node_modules/@sentry/browser": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.17.0.tgz",
"integrity": "sha512-dPMvxyS+ogu7/3+AI83U2IKaLO7hZUt3J35mtgOQhAETcyNaLZtJP1VNUAcW/VhJa3TMCfmG5A1+dkBp8A6cdA==",
"dependencies": {
"@sentry-internal/browser-utils": "8.17.0",
"@sentry-internal/feedback": "8.17.0",
"@sentry-internal/replay": "8.17.0",
"@sentry-internal/replay-canvas": "8.17.0",
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry/bundler-plugin-core": {
"version": "2.21.1",
"resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.21.1.tgz",
"integrity": "sha512-F8FdL/bS8cy1SY1Gw0Mfo3ROTqlrq9Lvt5QGvhXi22dpVcDkWmoTWE2k+sMEnXOa8SdThMc/gyC8lMwHGd3kFQ==",
"dependencies": {
"@babel/core": "^7.18.5",
"@sentry/babel-plugin-component-annotate": "2.21.1",
"@sentry/cli": "^2.22.3",
"dotenv": "^16.3.1",
"find-up": "^5.0.0",
"glob": "^9.3.2",
"magic-string": "0.30.8",
"unplugin": "1.0.1"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/glob": {
"version": "9.3.5",
"resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz",
"integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==",
"dependencies": {
"fs.realpath": "^1.0.0",
"minimatch": "^8.0.2",
"minipass": "^4.2.4",
"path-scurry": "^1.6.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/magic-string": {
"version": "0.30.8",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz",
"integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/minimatch": {
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz",
"integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/minipass": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz",
"integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/@sentry/cli": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.32.1.tgz",
"integrity": "sha512-MWkbkzZfnlE7s2pPbg4VozRSAeMlIObfZlTIou9ye6XnPt6ZmmxCLOuOgSKMv4sXg6aeqKNzMNiadThxCWyvPg==",
"hasInstallScript": true,
"dependencies": {
"https-proxy-agent": "^5.0.0",
"node-fetch": "^2.6.7",
"progress": "^2.0.3",
"proxy-from-env": "^1.1.0",
"which": "^2.0.2"
},
"bin": {
"sentry-cli": "bin/sentry-cli"
},
"engines": {
"node": ">= 10"
},
"optionalDependencies": {
"@sentry/cli-darwin": "2.32.1",
"@sentry/cli-linux-arm": "2.32.1",
"@sentry/cli-linux-arm64": "2.32.1",
"@sentry/cli-linux-i686": "2.32.1",
"@sentry/cli-linux-x64": "2.32.1",
"@sentry/cli-win32-i686": "2.32.1",
"@sentry/cli-win32-x64": "2.32.1"
}
},
"node_modules/@sentry/cli-darwin": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.32.1.tgz",
"integrity": "sha512-z/lEwANTYPCzbWTZ2+eeeNYxRLllC8knd0h+vtAKlhmGw/fyc/N39cznIFyFu+dLJ6tTdjOWOeikHtKuS/7onw==",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-arm": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.32.1.tgz",
"integrity": "sha512-m0lHkn+o4YKBq8KptGZvpT64FAwSl9mYvHZO9/ChnEGIJ/WyJwiN1X1r9JHVaW4iT5lD0Y5FAyq3JLkk0m0XHg==",
"cpu": [
"arm"
],
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-arm64": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.32.1.tgz",
"integrity": "sha512-hsGqHYuecUl1Yhq4MhiRejfh1gNlmhyNPcQEoO/DDRBnGnJyEAdiDpKXJcc2e/lT9k40B55Ob2CP1SeY040T2w==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-i686": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.32.1.tgz",
"integrity": "sha512-SuMLN1/ceFd3Q/B0DVyh5igjetTAF423txiABAHASenEev0lG0vZkRDXFclfgDtDUKRPmOXW7VDMirM3yZWQHQ==",
"cpu": [
"x86",
"ia32"
],
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-x64": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.32.1.tgz",
"integrity": "sha512-x4FGd6xgvFddz8V/dh6jii4wy9qjWyvYLBTz8Fhi9rIP+b8wQ3oxwHIdzntareetZP7C1ggx+hZheiYocNYVwA==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-win32-i686": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.32.1.tgz",
"integrity": "sha512-i6aZma9mFzR+hqMY5VliQZEX6ypP/zUjPK0VtIMYWs5cC6PsQLRmuoeJmy3Z7d4nlh0CdK5NPC813Ej6RY6/vg==",
"cpu": [
"x86",
"ia32"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-win32-x64": {
"version": "2.32.1",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.32.1.tgz",
"integrity": "sha512-B58w/lRHLb4MUSjJNfMMw2cQykfimDCMLMmeK+1EiT2RmSeNQliwhhBxYcKk82a8kszH6zg3wT2vCea7LyPUyA==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli/node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/@sentry/core": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.17.0.tgz",
"integrity": "sha512-s62O0Re6WcvaVbH1IEeAWmj/ca8UhaRoFaDnc5TR68reOycBrgnqCNq3qHxBsELOA6NJowoK+T29DDGs9QVXhQ==",
"dependencies": {
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry/types": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.17.0.tgz",
"integrity": "sha512-v0nI0+ajiGTijhF1W/ryn2+zFVFr6VPn6lao3W4qKj9MlltIHa4/uuGzTaiCFwoPw7g5bZ1Q09SStpDXVMkz2A==",
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry/utils": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.17.0.tgz",
"integrity": "sha512-HHtAPLOlvzhwgfYzxtuPnLUoGRMtMrFvopkii74zmx/1ZD4VN4PYPB2E5KFf3c18pTovw+kxF0ux6VrGiyAHsw==",
"dependencies": {
"@sentry/types": "8.17.0"
},
"engines": {
"node": ">=14.18"
}
},
"node_modules/@sentry/vite-plugin": {
"version": "2.21.1",
"resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-2.21.1.tgz",
"integrity": "sha512-i2PqeLafGBcSROnmr9mS0dL2/JBJji/4rJZ2U2A+tqtAhDAAaCUNalbn6xLp/hawLExt/wRuBj1J7j46sGDOaA==",
"dependencies": {
"@sentry/bundler-plugin-core": "2.21.1",
"unplugin": "1.0.1"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/@sentry/vue": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/@sentry/vue/-/vue-8.17.0.tgz",
"integrity": "sha512-2wYleNgeFio+2CHcXiJJVaw6ZYUmZzse0/YwdXUoMqA9dNvXqItOY08TOUA2JuaVX7xkIj0ii1wEiv6/QuMYJA==",
"dependencies": {
"@sentry/browser": "8.17.0",
"@sentry/core": "8.17.0",
"@sentry/types": "8.17.0",
"@sentry/utils": "8.17.0"
},
"engines": {
"node": ">=14.18"
},
"peerDependencies": {
"vue": "2.x || 3.x"
}
},
"node_modules/@shikijs/core": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.10.1.tgz",
@ -31634,6 +32001,22 @@
"node": ">= 0.8"
}
},
"node_modules/unplugin": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.0.1.tgz",
"integrity": "sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==",
"dependencies": {
"acorn": "^8.8.1",
"chokidar": "^3.5.3",
"webpack-sources": "^3.2.3",
"webpack-virtual-modules": "^0.5.0"
}
},
"node_modules/unplugin/node_modules/webpack-virtual-modules": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz",
"integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw=="
},
"node_modules/upath": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
@ -33319,7 +33702,6 @@
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
"dev": true,
"engines": {
"node": ">=10.13.0"
}

View File

@ -7,6 +7,8 @@
],
"packageManager": "npm@9.5.1",
"dependencies": {
"@sentry/vite-plugin": "^2.21.1",
"@sentry/vue": "^8.17.0",
"@trpc/client": "^11.0.0-next-beta.316",
"@trpc/server": "^11.0.0-next-beta.316",
"nanoid": "^5.0.1",

View File

@ -1,88 +1,110 @@
import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import { router } from "./router";
import { createPinia } from "pinia";
import { hint } from "./directives/hint.ts";
import { taskStore } from "@models/task.model.ts";
import { projectStore } from "@models/project.model.ts";
import { draftStore } from "@models/draft.model.ts";
import { apiKeyStore } from "@models/api-key.model.ts";
import { draftStore } from "@models/draft.model.ts";
import { projectStore } from "@models/project.model.ts";
import { projectStatusStore } from "@models/projectStauts.model.ts";
import { taskStore } from "@models/task.model.ts";
import * as Sentry from "@sentry/vue";
import { createTRPCClient, httpBatchLink } from "@trpc/client";
import type { AppRouter } from "backend";
import { vueSyncClientPlugin } from "vue-sync-client";
import * as cookie from "cookie";
import { projectStatusStore } from "@models/projectStauts.model.ts";
import { createPinia } from "pinia";
import { createApp } from "vue";
import { vueSyncClientPlugin } from "vue-sync-client";
import App from "./App.vue";
import { hint } from "./directives/hint.ts";
import { router } from "./router";
import "./style.css";
const pinia = createPinia();
export const trpc = createTRPCClient<AppRouter>({
links: [
httpBatchLink({
url: import.meta.env.PROD
? import.meta.env.VITE_SYNC_URL
: "http://localhost:4000",
fetch(url, options) {
const cookies = cookie.parse(document.cookie);
const sessionToken = cookies["session"];
links: [
httpBatchLink({
url: import.meta.env.PROD
? import.meta.env.VITE_SYNC_URL
: "http://localhost:4000",
fetch(url, options) {
const cookies = cookie.parse(document.cookie);
const sessionToken = cookies["session"];
return fetch(url, {
...options,
headers: {
...options?.headers,
Authorization: sessionToken,
},
});
},
}),
],
return fetch(url, {
...options,
headers: {
...options?.headers,
Authorization: sessionToken,
},
});
},
}),
],
});
createApp(App)
.directive("hint", hint)
.use(router)
.use(pinia)
.use(vueSyncClientPlugin, {
dbVersion: 11,
schema: [
taskStore,
apiKeyStore,
draftStore,
projectStore,
projectStatusStore,
],
onSync: async (sync, resolveFn) => {
if (sync.targetTable === draftStore.name) {
if (sync.action.actionName === "create")
await trpc.draft.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.draft.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.draft.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === taskStore.name) {
if (sync.action.actionName === "create")
await trpc.task.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.task.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.task.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === apiKeyStore.name) {
if (sync.action.actionName === "create")
await trpc.apiKey.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.apiKey.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.apiKey.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === projectStore.name) {
if (sync.action.actionName === "create")
await trpc.project.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.project.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.project.delete.mutate(sync.action.id as string);
}
const app = createApp(App)
resolveFn();
},
})
.mount("#app");
Sentry.init({
app,
dsn: "https://b2a7371c480bdfb4603b8e8189a46d35@o1186023.ingest.us.sentry.io/4507594362585088",
integrations: [
Sentry.feedbackIntegration({
colorScheme: "system",
isEmailRequired: true
})
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/api.cubicdone\.com/],
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
app
.directive("hint", hint)
.use(pinia)
.use(vueSyncClientPlugin, {
dbVersion: 11,
schema: [
taskStore,
apiKeyStore,
draftStore,
projectStore,
projectStatusStore,
],
onSync: async (sync, resolveFn) => {
if (sync.targetTable === draftStore.name) {
if (sync.action.actionName === "create")
await trpc.draft.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.draft.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.draft.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === taskStore.name) {
if (sync.action.actionName === "create")
await trpc.task.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.task.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.task.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === apiKeyStore.name) {
if (sync.action.actionName === "create")
await trpc.apiKey.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.apiKey.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.apiKey.delete.mutate(sync.action.id as string);
} else if (sync.targetTable === projectStore.name) {
if (sync.action.actionName === "create")
await trpc.project.create.mutate(sync.action.data);
else if (sync.action.actionName === "update")
await trpc.project.update.mutate(sync.action.data);
else if (sync.action.actionName === "delete")
await trpc.project.delete.mutate(sync.action.id as string);
}
resolveFn();
},
})
.use(router)
app.mount("#app");

View File

@ -1,3 +1,4 @@
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as path from "path";
@ -6,20 +7,19 @@ import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
createSVGSpritePlugin({
svgFolder: "./src/assets/svg",
transformIndexHtmlTag: {
injectTo: "body",
},
}),
VitePWA({
registerType: "autoUpdate",
injectRegister: "auto",
workbox: { globPatterns: ["**/*.{js,css,html,ico,png,svg}"] },
}),
],
plugins: [vue(), createSVGSpritePlugin({
svgFolder: "./src/assets/svg",
transformIndexHtmlTag: {
injectTo: "body",
},
}), VitePWA({
registerType: "autoUpdate",
injectRegister: "auto",
workbox: { globPatterns: ["**/*.{js,css,html,ico,png,svg}"] },
}), sentryVitePlugin({
org: "me-sgp",
project: "cubicdone"
})],
resolve: {
alias: [
{
@ -35,5 +35,6 @@ export default defineConfig({
build: {
target: "esnext",
sourcemap: true
},
});
});