Turbo v2 (#32)

Updated to Turbo v2, and updated dependencies.
This commit is contained in:
Giancarlo Buomprisco
2024-06-06 15:36:16 +07:00
committed by GitHub
parent aba9076805
commit c9f0ec5d89
22 changed files with 399 additions and 709 deletions

View File

@@ -54,7 +54,6 @@ jobs:
SUPABASE_DB_WEBHOOK_SECRET: ${{ secrets.SUPABASE_DB_WEBHOOK_SECRET }} SUPABASE_DB_WEBHOOK_SECRET: ${{ secrets.SUPABASE_DB_WEBHOOK_SECRET }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }} STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
PLAYWRIGHT_SERVER_COMMAND: pnpm --filter web start:test
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -110,6 +109,9 @@ jobs:
- name: Production Build (test env) - name: Production Build (test env)
run: pnpm --filter web build:test run: pnpm --filter web build:test
- name: Next.js Server
run: pnpm --filter web start:test &
- name: Run Playwright tests - name: Run Playwright tests
run: pnpm run test run: pnpm run test

1
.npmrc
View File

@@ -2,3 +2,4 @@ peer-legacy-deps=true
dedupe-peer-dependents=true dedupe-peer-dependents=true
use-lockfile-v6=true use-lockfile-v6=true
resolution-mode=highest resolution-mode=highest
package-manager-strict=false

View File

@@ -29,22 +29,22 @@ export default defineConfig({
screenshot: 'only-on-failure', screenshot: 'only-on-failure',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry' trace: 'on-first-retry',
}, },
// test timeout set to 1 minutes // test timeout set to 1 minutes
timeout: 60 * 1000, timeout: 60 * 1000,
expect: { expect: {
// expect timeout set to 10 seconds // expect timeout set to 10 seconds
timeout: 10 * 1000 timeout: 10 * 1000,
}, },
/* Configure projects for major browsers */ /* Configure projects for major browsers */
projects: [ projects: [
{ {
name: 'chromium', name: 'chromium',
use: { ...devices['Desktop Chrome'] } use: { ...devices['Desktop Chrome'] },
} },
/* Test against mobile viewports. */ /* Test against mobile viewports. */
// { // {
// name: 'Mobile Chrome', // name: 'Mobile Chrome',
@@ -67,12 +67,14 @@ export default defineConfig({
], ],
/* Run your local dev server before starting the tests */ /* Run your local dev server before starting the tests */
webServer: process.env.PLAYWRIGHT_SERVER_COMMAND ? { webServer: process.env.PLAYWRIGHT_SERVER_COMMAND
? {
cwd: '../../', cwd: '../../',
command: process.env.PLAYWRIGHT_SERVER_COMMAND, command: process.env.PLAYWRIGHT_SERVER_COMMAND,
url: 'http://localhost:3000', url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,
stdout: 'pipe', stdout: 'pipe',
stderr: 'pipe', stderr: 'pipe',
} : undefined }
: undefined,
}); });

View File

@@ -30,8 +30,6 @@ test.describe('Auth flow', () => {
await auth.visitConfirmEmailLink(email); await auth.visitConfirmEmailLink(email);
await page.waitForURL('**/home'); await page.waitForURL('**/home');
expect(page.url()).toContain('http://localhost:3000/home');
}); });
test('will sign-in with the correct credentials', async ({ page }) => { test('will sign-in with the correct credentials', async ({ page }) => {

View File

@@ -46,7 +46,7 @@ export class Mailbox {
deleteAfter: boolean; deleteAfter: boolean;
}, },
) { ) {
const url = `http://localhost:54324/api/v1/mailbox/${mailbox}`; const url = `http://127.0.0.1:54324/api/v1/mailbox/${mailbox}`;
const response = await fetch(url); const response = await fetch(url);

View File

@@ -32,7 +32,7 @@
}, },
"dependencies": { "dependencies": {
"@edge-csrf/nextjs": "2.0.0", "@edge-csrf/nextjs": "2.0.0",
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/accounts": "workspace:^", "@kit/accounts": "workspace:^",
"@kit/admin": "workspace:^", "@kit/admin": "workspace:^",
"@kit/auth": "workspace:^", "@kit/auth": "workspace:^",
@@ -56,7 +56,7 @@
"@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-icons": "^1.3.0",
"@supabase/supabase-js": "^2.43.4", "@supabase/supabase-js": "^2.43.4",
"@tanstack/react-query": "5.40.1", "@tanstack/react-query": "5.40.1",
"@tanstack/react-query-next-experimental": "^5.40.0", "@tanstack/react-query-next-experimental": "^5.40.1",
"@tanstack/react-table": "^8.17.3", "@tanstack/react-table": "^8.17.3",
"date-fns": "^3.6.0", "date-fns": "^3.6.0",
"lucide-react": "^0.383.0", "lucide-react": "^0.383.0",
@@ -85,9 +85,9 @@
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"dotenv-cli": "^7.4.2", "dotenv-cli": "^7.4.2",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"prettier": "^3.3.0", "prettier": "^3.3.1",
"supabase": "^1.172.2", "supabase": "^1.172.2",
"tailwindcss": "3.4.3", "tailwindcss": "3.4.4",
"typescript": "^5.4.5" "typescript": "^5.4.5"
}, },
"eslintConfig": { "eslintConfig": {

View File

@@ -26,7 +26,9 @@
"supabase:web:stop": "pnpm --filter web supabase:stop", "supabase:web:stop": "pnpm --filter web supabase:stop",
"supabase:web:typegen": "pnpm --filter web supabase:typegen", "supabase:web:typegen": "pnpm --filter web supabase:typegen",
"supabase:web:reset": "pnpm --filter web supabase:reset", "supabase:web:reset": "pnpm --filter web supabase:reset",
"stripe:listen": "pnpm --filter '@kit/stripe' start" "stripe:listen": "pnpm --filter '@kit/stripe' start",
"env:generate": "turbo gen env",
"env:validate": "turbo gen validate-env"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"workspaces": [ "workspaces": [
@@ -36,11 +38,11 @@
], ],
"dependencies": { "dependencies": {
"@manypkg/cli": "^0.21.4", "@manypkg/cli": "^0.21.4",
"@turbo/gen": "^1.13.3", "@turbo/gen": "^2.0.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"pnpm": "^9.1.4", "pnpm": "^9.2.0",
"prettier": "^3.3.0", "prettier": "^3.3.1",
"turbo": "^1.13.3", "turbo": "^2.0.1",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"yarn": "^1.22.22" "yarn": "^1.22.22"
}, },
@@ -49,5 +51,6 @@
"react": "18.3.1", "react": "18.3.1",
"react-dom": "18.3.1" "react-dom": "18.3.1"
} }
} },
"packageManager": "pnpm@9.1.4"
} }

View File

@@ -16,7 +16,7 @@
"./marketing": "./src/components/marketing.tsx" "./marketing": "./src/components/marketing.tsx"
}, },
"devDependencies": { "devDependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/billing": "workspace:^", "@kit/billing": "workspace:^",
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/lemon-squeezy": "workspace:^", "@kit/lemon-squeezy": "workspace:^",

View File

@@ -19,7 +19,7 @@
"nanoid": "^5.0.7" "nanoid": "^5.0.7"
}, },
"devDependencies": { "devDependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/billing-gateway": "workspace:^", "@kit/billing-gateway": "workspace:^",
"@kit/email-templates": "workspace:^", "@kit/email-templates": "workspace:^",
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",

View File

@@ -10,7 +10,7 @@
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"devDependencies": { "devDependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/next": "workspace:^", "@kit/next": "workspace:^",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",

View File

@@ -18,7 +18,7 @@
"./captcha/server": "./src/captcha/server/index.ts" "./captcha/server": "./src/captcha/server/index.ts"
}, },
"devDependencies": { "devDependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/shared": "workspace:^", "@kit/shared": "workspace:^",

View File

@@ -17,7 +17,7 @@
"nanoid": "^5.0.7" "nanoid": "^5.0.7"
}, },
"devDependencies": { "devDependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@kit/accounts": "workspace:^", "@kit/accounts": "workspace:^",
"@kit/billing-gateway": "workspace:*", "@kit/billing-gateway": "workspace:*",
"@kit/email-templates": "workspace:^", "@kit/email-templates": "workspace:^",

View File

@@ -24,11 +24,9 @@ export async function registerMonitoringInstrumentation() {
} }
case InstrumentationProvider.Sentry: { case InstrumentationProvider.Sentry: {
const { registerInstrumentation } = await import( // Sentry v8 automatically sets this up
'@kit/sentry/instrumentation'
);
return registerInstrumentation(); return;
} }
default: default:

View File

@@ -1,35 +1,3 @@
# Sentry Monitoring / @kit/sentry # Sentry Monitoring / @kit/sentry
Please set the following environment variable: Please refer to the [documentation](https://makerkit.dev/docs/next-supabase-turbo/sentry).
```bash
NEXT_PUBLIC_MONITORING_PROVIDER=sentry
NEXT_PUBLIC_SENTRY_DSN=your_dsn
```
Create the following file at the root of your project:
```tsx title="sentry.client.config.ts"
export * from '@kit/sentry/config/client';
```
Create the following file at the root of your project:
```tsx title="sentry.server.config.ts"
export * from '@kit/sentry/config/server';
```
Create the following file at the root of your project:
```tsx title="sentry.edge.config.ts"
export * from '@kit/sentry/config/edge';
```
Finally, update the Next.js configuration in your `next.config.js` file:
```tsx title="next.config.mjs"
import { withSentryConfig } from "@sentry/nextjs";
// wrap your Next.js configuration with the Sentry configuration
withSentryConfig(nextConfig);
```

View File

@@ -12,17 +12,11 @@
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",
"./provider": "./src/components/provider.tsx", "./provider": "./src/components/provider.tsx",
"./instrumentation": "./src/instrumentation.ts",
"./config/client": "./src/sentry.client.config.ts", "./config/client": "./src/sentry.client.config.ts",
"./config/server": "./src/sentry.client.server.ts" "./config/server": "./src/sentry.client.server.ts"
}, },
"dependencies": { "dependencies": {
"@opentelemetry/exporter-jaeger": "1.24.1", "@sentry/nextjs": "^8.7.0"
"@opentelemetry/resources": "1.24.1",
"@opentelemetry/sdk-node": "0.51.1",
"@opentelemetry/semantic-conventions": "^1.24.1",
"@sentry/nextjs": "^8.7.0",
"@sentry/opentelemetry-node": "^7.114.0"
}, },
"devDependencies": { "devDependencies": {
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",

View File

@@ -1,50 +0,0 @@
/**
* @name registerInstrumentation
* @description This file is used to register Sentry instrumentation for your Next.js application.
*
* Please set the MONITORING_PROVIDER environment variable to 'sentry' to register Sentry instrumentation.
*/
export async function registerInstrumentation() {
const { initializeSentryServerClient } = await import(
'./sentry.server.config'
);
// initialize the Sentry client in the server
void initializeSentryServerClient();
if (process.env.ENABLE_MONITORING_INSTRUMENTATION !== 'true') {
return;
}
// make sure the instrumentation is only run in a Node.js environment
if (process.env.NEXT_RUNTIME === 'nodejs') {
const serviceName = process.env.INSTRUMENTATION_SERVICE_NAME;
if (!serviceName) {
throw new Error(
`You have set the Sentry instrumentation provider, but have not set the INSTRUMENTATION_SERVICE_NAME environment variable. Please set the INSTRUMENTATION_SERVICE_NAME environment variable.`,
);
}
const { Resource } = await import('@opentelemetry/resources');
const { NodeSDK } = await import('@opentelemetry/sdk-node');
const { SEMRESATTRS_SERVICE_NAME } = await import(
'@opentelemetry/semantic-conventions'
);
const { SentrySpanProcessor, SentryPropagator } = await import(
'@sentry/opentelemetry-node'
);
const sdk = new NodeSDK({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: serviceName,
}),
spanProcessors: [new SentrySpanProcessor()],
textMapPropagator: new SentryPropagator(),
});
sdk.start();
}
}

View File

@@ -9,7 +9,7 @@
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^3.4.0", "@hookform/resolvers": "^3.6.0",
"@radix-ui/react-accordion": "1.1.2", "@radix-ui/react-accordion": "1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-avatar": "^1.0.4",
@@ -49,12 +49,12 @@
"eslint": "^8.57.0", "eslint": "^8.57.0",
"next": "14.2.3", "next": "14.2.3",
"next-themes": "0.3.0", "next-themes": "0.3.0",
"prettier": "^3.3.0", "prettier": "^3.3.1",
"react-day-picker": "^8.10.1", "react-day-picker": "^8.10.1",
"react-hook-form": "^7.51.4", "react-hook-form": "^7.51.4",
"react-i18next": "^14.1.2", "react-i18next": "^14.1.2",
"sonner": "^1.4.41", "sonner": "^1.4.41",
"tailwindcss": "3.4.3", "tailwindcss": "3.4.4",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"zod": "^3.23.8" "zod": "^3.23.8"

813
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@
"@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0", "@typescript-eslint/parser": "^7.12.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.13.3", "eslint-config-turbo": "^2.0.1",
"eslint-plugin-import": "^2.29.1", "eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.2", "eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2" "eslint-plugin-react-hooks": "^4.6.2"

View File

@@ -10,9 +10,8 @@
}, },
"dependencies": { "dependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1", "@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@tanstack/react-table": "^8.17.3",
"next": "14.2.3", "next": "14.2.3",
"prettier": "^3.3.0", "prettier": "^3.3.1",
"prettier-plugin-tailwindcss": "^0.6.1" "prettier-plugin-tailwindcss": "^0.6.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -17,7 +17,7 @@
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"next": "14.2.3", "next": "14.2.3",
"postcss": "8.4.38", "postcss": "8.4.38",
"tailwindcss": "3.4.3", "tailwindcss": "3.4.4",
"tailwindcss-animate": "^1.0.7" "tailwindcss-animate": "^1.0.7"
}, },
"devDependencies": { "devDependencies": {
@@ -25,7 +25,7 @@
"@kit/prettier-config": "workspace:^", "@kit/prettier-config": "workspace:^",
"@kit/tsconfig": "workspace:^", "@kit/tsconfig": "workspace:^",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"prettier": "^3.3.0", "prettier": "^3.3.1",
"typescript": "^5.4.5" "typescript": "^5.4.5"
}, },
"eslintConfig": { "eslintConfig": {

View File

@@ -3,60 +3,6 @@
"globalDependencies": [ "globalDependencies": [
"**/.env" "**/.env"
], ],
"pipeline": {
"topo": {
"dependsOn": [
"^topo"
]
},
"build": {
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"!.next/cache/**",
"next-env.d.ts"
]
},
"dev": {
"persistent": true,
"cache": false
},
"format": {
"outputs": [
"node_modules/.cache/.prettiercache"
],
"outputMode": "new-only"
},
"lint": {
"dependsOn": [
"^topo"
],
"outputs": [
"node_modules/.cache/.eslintcache"
]
},
"typecheck": {
"dependsOn": [
"^topo"
],
"outputs": [
"node_modules/.cache/tsbuildinfo.json"
]
},
"test": {
"dependsOn": [
"^topo"
]
},
"clean": {
"cache": false
},
"//#clean": {
"cache": false
}
},
"globalEnv": [ "globalEnv": [
"STRIPE_SECRET_KEY", "STRIPE_SECRET_KEY",
"STRIPE_WEBHOOK_SECRET", "STRIPE_WEBHOOK_SECRET",
@@ -91,5 +37,59 @@
"NEXT_PUBLIC_SUPABASE_URL", "NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_SUPABASE_ANON_KEY", "NEXT_PUBLIC_SUPABASE_ANON_KEY",
"SUPABASE_SERVICE_ROLE_KEY" "SUPABASE_SERVICE_ROLE_KEY"
],
"tasks": {
"topo": {
"dependsOn": [
"^topo"
] ]
},
"build": {
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"!.next/cache/**",
"next-env.d.ts"
]
},
"dev": {
"persistent": true,
"cache": false
},
"format": {
"outputs": [
"node_modules/.cache/.prettiercache"
],
"outputLogs": "new-only"
},
"lint": {
"dependsOn": [
"^topo"
],
"outputs": [
"node_modules/.cache/.eslintcache"
]
},
"typecheck": {
"dependsOn": [
"^topo"
],
"outputs": [
"node_modules/.cache/tsbuildinfo.json"
]
},
"test": {
"dependsOn": [
"^topo"
]
},
"clean": {
"cache": false
},
"//#clean": {
"cache": false
}
}
} }