Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Sep 7, 2024
1 parent 2017a1b commit fbaba9c
Show file tree
Hide file tree
Showing 18 changed files with 171 additions and 8 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 6 additions & 0 deletions services/dub/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"name": "dub",
"envs": {
"DUB_API_KEY": {
"description": "The API key to use for Dub",
"required": true
}
},
"generate": {
"src/index.ts": "apps/app/src/libs/dub.ts"
}
Expand Down
12 changes: 11 additions & 1 deletion services/openpanel/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"name": "openpanel"
"name": "openpanel",
"envs": {
"OPENPANEL_API_KEY": {
"description": "The API key to use for OpenPanel",
"required": true
},
"OPENPANEL_PROJECT_ID": {
"description": "The project ID to use for OpenPanel",
"required": true
}
}
}
3 changes: 1 addition & 2 deletions services/openpanel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@v1/ui/*": ["../ui/src/*"]
"@/*": ["./src/*"]
}
},
"include": ["."],
Expand Down
8 changes: 7 additions & 1 deletion services/resend/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"name": "resend"
"name": "resend",
"envs": {
"RESEND_API_KEY": {
"description": "The API key to use for Resend",
"required": true
}
}
}
3 changes: 3 additions & 0 deletions services/resend/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Resend } from "resend";

export const resend = new Resend(process.env.RESEND_API_KEY!);
20 changes: 20 additions & 0 deletions services/sentry/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sentry",
"envs": {
"SENTRY_AUTH_TOKEN": {
"description": "The auth token to use for Sentry",
"required": true
},
"NEXT_PUBLIC_SENTRY_DSN": {
"description": "The DSN to use for Sentry",
"required": true
}
},
"generate": {
"src/instrumentation/src/index.ts": "apps/app/src/instrumentation.ts",
"src/global-error.tsx": "apps/app/src/global-error.tsx",
"src/sentry.server.config.ts": "apps/app/src/sentry.server.config.ts",
"src/sentry.edge.config.ts": "apps/app/src/sentry.edge.config.ts",
"src/sentry.client.config.ts": "apps/app/src/sentry.client.config.ts"
}
}
15 changes: 15 additions & 0 deletions services/sentry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@v1/sentry",
"version": "1.0.0",
"private": true,
"scripts": {
"clean": "rm -rf .turbo node_modules",
"lint": "biome check .",
"format": "biome format --write .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/nextjs": "^8",
"@supabase/sentry-js-integration": "^0.3.0"
}
}
File renamed without changes.
9 changes: 9 additions & 0 deletions services/sentry/src/instrumentation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("../sentry.server.config");
}

if (process.env.NEXT_RUNTIME === "edge") {
await import("../sentry.edge.config");
}
}
19 changes: 19 additions & 0 deletions services/sentry/src/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "./src/env.mjs";
import { withSentryConfig } from "@sentry/nextjs";

/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@v1/supabase"],
experimental: {
instrumentationHook: process.env.NODE_ENV === "production",
},
};

export default withSentryConfig(nextConfig, {
silent: !process.env.CI,
telemetry: false,
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
tunnelRoute: "/monitoring",
});
19 changes: 19 additions & 0 deletions services/sentry/src/sentry.client.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from "@sentry/nextjs";
import { supabaseIntegration } from "@supabase/sentry-js-integration";
import { createClient } from "@v1/supabase/client";

const client = createClient();

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
enabled: process.env.NODE_ENV === "production",
integrations: [
supabaseIntegration(client, Sentry, {
tracing: true,
breadcrumbs: true,
errors: true,
}),
],
});
8 changes: 8 additions & 0 deletions services/sentry/src/sentry.edge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
enabled: process.env.NODE_ENV === "production",
tracesSampleRate: 1,
debug: false,
});
19 changes: 19 additions & 0 deletions services/sentry/src/sentry.server.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from "@sentry/nextjs";
import { supabaseIntegration } from "@supabase/sentry-js-integration";
import { createClient } from "@v1/supabase/client";

const client = createClient();

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
enabled: process.env.NODE_ENV === "production",
integrations: [
supabaseIntegration(client, Sentry, {
tracing: true,
breadcrumbs: true,
errors: true,
}),
],
});
11 changes: 11 additions & 0 deletions services/sentry/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@v1/typescript/react-library.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["."],
"exclude": ["node_modules"]
}
12 changes: 11 additions & 1 deletion services/trigger/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"name": "trigger"
"name": "trigger",
"envs": {
"TRIGGER_API_KEY": {
"description": "The API key to use for Trigger",
"required": true
},
"TRIGGER_PROJECT_ID": {
"description": "The project ID to use for Trigger (https://trigger.dev/docs/trigger-config)",
"required": true
}
}
}
3 changes: 1 addition & 2 deletions services/trigger/trigger.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { TriggerConfig } from "@trigger.dev/sdk/v3";

export const config: TriggerConfig = {
// Replace <your-project-ref> with your project id: https://trigger.dev/docs/trigger-config
project: "<your-project-ref>",
project: process.env.TRIGGER_PROJECT_ID!,
logLevel: "log",
retries: {
enabledInDev: true,
Expand Down
12 changes: 11 additions & 1 deletion services/upstash/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"name": "upstash"
"name": "upstash",
"envs": {
"UPSTASH_REDIS_REST_URL": {
"description": "The URL to use for Upstash",
"required": true
},
"UPSTASH_REDIS_REST_TOKEN": {
"description": "The token to use for Upstash",
"required": true
}
}
}

0 comments on commit fbaba9c

Please sign in to comment.