Skip to content

Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.

chore: update package manager and Playwright timeout settings; enhance Sentry configuration for better environment checks

VladSez549fed296c9d
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 74a9c71..2cd781c 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -45,6 +45,11 @@ jobs:
- name: 🎭 Run Playwright tests
id: playwright
+ env:
+ BASE_URL: ${{ github.event_name == 'deployment_status' && github.event.deployment_status.environment_url }}
+ SENTRY_ENABLED: false
+ NEXT_PUBLIC_SENTRY_ENABLED: false
+ continue-on-error: true
# calculate duration of the job and runs playwright test
run: |
start_time=$(date +%s)
@@ -57,11 +62,6 @@ jobs:
seconds=$((duration % 60))
echo "duration_formatted=${minutes}m ${seconds}s" >> "$GITHUB_OUTPUT"
- env:
- BASE_URL: ${{ github.event_name == 'deployment_status' && github.event.deployment_status.environment_url }}
- NEXT_PUBLIC_SENTRY_DSN: ""
- NEXT_PUBLIC_VERCEL_ENV: "test"
- continue-on-error: true
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #4.6.1
name: 🎲 Upload Playwright report
diff --git a/package.json b/package.json
index 6c95b5c..cf2845d 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "pdf-invoice-generator",
"version": "0.1.0",
"private": true,
- "packageManager": "[email protected]",
+ "packageManager": "[email protected]",
"engines": {
"node": ">=20.0.0"
},
diff --git a/playwright.config.ts b/playwright.config.ts
index cfc81f6..cab0712 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -31,7 +31,7 @@ export default defineConfig({
workers: process.env.CI ? 1 : undefined,
/* timeout for expect assertions */
expect: {
- timeout: 15_000,
+ timeout: 25_000,
},
// /* timeout for test execution */
diff --git a/sentry.client.config.ts b/sentry.client.config.ts
index e198f0e..e6c5031 100644
--- a/sentry.client.config.ts
+++ b/sentry.client.config.ts
@@ -4,20 +4,32 @@
import * as Sentry from "@sentry/nextjs";
-// we use NEXT_PUBLIC_VERCEL_ENV to check if we are in production because VERCEL_ENV is only available on the server
-const isVercelProd = process.env.NEXT_PUBLIC_VERCEL_ENV === "production";
+const isCI = process.env.CI === "true";
-Sentry.init({
- dsn: isVercelProd ? process.env.NEXT_PUBLIC_SENTRY_DSN : "",
- enabled: isVercelProd,
+// Check if we're on a Vercel preview deployment, we want to run only on prod domain
+const isVercelPreview =
+ typeof window !== "undefined" &&
+ window.location.hostname.includes(".vercel.app");
- // Adjust sampling in production for better performance/cost balance
- tracesSampleRate: 0.15, // Sample 15% of transactions
+// This is the client config, so we need to check the NEXT_PUBLIC_SENTRY_ENABLED environment variable
+const isSentryEnabled =
+ process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" &&
+ !isCI &&
+ !isVercelPreview;
- // Recommended production settings
- debug: false,
+if (isSentryEnabled) {
+ Sentry.init({
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+ enabled: isSentryEnabled,
- // Performance settings
- replaysSessionSampleRate: 0.1, // Sample 10% of sessions
- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
-});
+ // Adjust sampling in production for better performance/cost balance
+ tracesSampleRate: 0.15, // Sample 15% of transactions
+
+ // Recommended production settings
+ debug: false,
+
+ // Performance settings
+ replaysSessionSampleRate: 0.1, // Sample 10% of sessions
+ replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
+ });
+}
diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts
index 917b00d..5dfaba1 100644
--- a/sentry.edge.config.ts
+++ b/sentry.edge.config.ts
@@ -5,19 +5,23 @@
import * as Sentry from "@sentry/nextjs";
-const isVercelProd = process.env.VERCEL_ENV === "production";
+const isCI = process.env.CI === "true";
-Sentry.init({
- dsn: isVercelProd ? process.env.NEXT_PUBLIC_SENTRY_DSN : "",
- enabled: isVercelProd,
+const isSentryEnabled = process.env.SENTRY_ENABLED === "true" && !isCI;
- // Adjust sampling in production for better performance/cost balance
- tracesSampleRate: 0.15, // Sample 15% of transactions
+if (isSentryEnabled) {
+ Sentry.init({
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+ enabled: isSentryEnabled,
- // Recommended production settings
- debug: false,
+ // Adjust sampling in production for better performance/cost balance
+ tracesSampleRate: 0.15, // Sample 15% of transactions
- // Performance settings
- replaysSessionSampleRate: 0.1, // Sample 10% of sessions
- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
-});
+ // Recommended production settings
+ debug: false,
+
+ // Performance settings
+ replaysSessionSampleRate: 0.1, // Sample 10% of sessions
+ replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
+ });
+}
diff --git a/sentry.server.config.ts b/sentry.server.config.ts
index 5207333..ae3e704 100644
--- a/sentry.server.config.ts
+++ b/sentry.server.config.ts
@@ -4,19 +4,23 @@
import * as Sentry from "@sentry/nextjs";
-const isVercelProd = process.env.VERCEL_ENV === "production";
+const isCI = process.env.CI === "true";
-Sentry.init({
- dsn: isVercelProd ? process.env.NEXT_PUBLIC_SENTRY_DSN : "",
- enabled: isVercelProd,
+const isSentryEnabled = process.env.SENTRY_ENABLED === "true" && !isCI;
- // Adjust sampling in production for better performance/cost balance
- tracesSampleRate: 0.15, // Sample 15% of transactions
+if (isSentryEnabled) {
+ Sentry.init({
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+ enabled: isSentryEnabled,
- // Recommended production settings
- debug: false,
+ // Adjust sampling in production for better performance/cost balance
+ tracesSampleRate: 0.15, // Sample 15% of transactions
- // Performance settings
- replaysSessionSampleRate: 0.1, // Sample 10% of sessions
- replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
-});
+ // Recommended production settings
+ debug: false,
+
+ // Performance settings
+ replaysSessionSampleRate: 0.1, // Sample 10% of sessions
+ replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
+ });
+}