Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(db): update turbo monorepo to v2 (major) #1297

Merged
merged 9 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion InReach.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
},
"prettier.resolveGlobalModules": false,
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.tsdk": "🚀 InReach App (@weareinreach/app)/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.workspaceSymbols.scope": "allOpenProjects",
"sonarlint.connectedMode.project": {
Expand Down
3 changes: 3 additions & 0 deletions apps/app/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin'
import { RelativeCiAgentWebpackPlugin } from '@relative-ci/agent'
import { withSentryConfig } from '@sentry/nextjs'
import { I18NextHMRPlugin } from 'i18next-hmr/webpack'
import createJiti from 'jiti'
import routes from 'nextjs-routes/config'

import path from 'path'
Expand All @@ -14,6 +15,8 @@ import i18nConfig from './next-i18next.config.mjs'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const jiti = createJiti(__filename)
jiti('../../packages/env')

const isVercelActiveDev = process.env.VERCEL_ENV === 'preview' && process.env.VERCEL_GIT_COMMIT_REF !== 'dev'
const isVercelProd = process.env.VERCEL_ENV === 'production'
Expand Down
1 change: 1 addition & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"eslint": "8.57.0",
"eslint-plugin-i18next": "6.0.3",
"i18next-hmr": "3.1.2",
"jiti": "1.21.6",
"listr2": "8.2.1",
"prettier": "3.3.2",
"trpc-panel": "1.3.4",
Expand Down
34 changes: 20 additions & 14 deletions apps/app/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"dependsOn": [
"build:prebuild",
Expand All @@ -12,26 +12,32 @@
"^db:dataMigrate"
],
"env": [
"DATABASE_URL",
"DB_DIRECT_URL",
"NEXTAUTH_SECRET",
"NEXTAUTH_URL",
"VERCEL_URL",
"PORT",
"AWS_REGION",
"COGNITO_ACCESS_KEY",
"COGNITO_CLIENT_ID",
"COGNITO_CLIENT_SECRET",
"COGNITO_ISSUER",
"COGNITO_USER_POOL_ID",
"AWS_REGION",
"COGNITO_ACCESS_KEY",
"COGNITO_SECRET",
"NODE_ENV",
"COGNITO_USER_POOL_ID",
"CRON_KEY",
"CROWDIN_TOKEN",
"DATABASE_URL",
"DB_DIRECT_URL",
"EDGE_CONFIG",
"FEATURE_FLAG_CONFIG",
"GOOGLE_PLACES_API_KEY",
"NEXT_PUBLIC_GOOGLE_MAPS_API",
"KV_REST_API_READ_ONLY_TOKEN",
"KV_REST_API_TOKEN",
"KV_REST_API_URL",
"KV_URL",
"NEXTAUTH_SECRET",
"NEXTAUTH_URL",
"NODE_ENV",
"PORT",
"SENTRY_AUTH_TOKEN",
"NEXT_PUBLIC_SENTRY_DSN",
"SENTRY_ORG",
"SENTRY_PROJECT",
"SENTRY_ORG"
"VERCEL_URL"
],
"outputs": [".next/**"]
},
Expand Down
2 changes: 1 addition & 1 deletion apps/web/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"dependsOn": [],
"env": [
Expand Down
2 changes: 1 addition & 1 deletion lambdas/cognito-messaging/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build:aws": {
"dependsOn": ["format", "lint:fix", "type-check"],
"inputs": ["./src/**"],
Expand Down
2 changes: 1 addition & 1 deletion lambdas/cognito-user-migrate/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build:aws": {
"dependsOn": ["format", "lint:fix", "^db:generate", "type-check"],
"inputs": ["./src/**"],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@changesets/cli": "2.27.5",
"@turbo/gen": "1.13.4",
"@turbo/gen": "2.0.3",
"@types/lint-staged": "13.3.0",
"@types/node": "20.14.2",
"@types/yargs": "17.0.32",
Expand All @@ -58,7 +58,7 @@
"prettier-plugin-prisma": "5.0.0",
"sherif": "0.8.4",
"tsx": "4.15.4",
"turbo": "1.13.4",
"turbo": "2.0.3",
"typescript": "5.4.5",
"typesync": "0.12.1",
"yargs": "17.7.2"
Expand Down
6 changes: 5 additions & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
"just-compact": "3.2.0"
},
"devDependencies": {
"@types/eslint": "8.56.10",
"@types/gtag.js": "0.0.20",
"@types/node": "20.14.2",
"@weareinreach/config": "workspace:*",
"@weareinreach/eslint-config": "workspace:*",
"eslint": "8.57.0",
"next": "14.2.4",
"nextjs-google-analytics": "2.3.3",
"type-fest": "4.20.0"
"type-fest": "4.20.0",
"typescript": "5.4.5"
},
"peerDependencies": {
"next": "14.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {}
"tasks": {}
}
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"zod": "3.23.8"
},
"devDependencies": {
"@turbo/gen": "1.13.4",
"@turbo/gen": "2.0.3",
"@types/eslint": "8.56.10",
"@types/google.maps": "3.55.9",
"@types/luxon": "3.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {}
"tasks": {}
}
2 changes: 2 additions & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"preinstall": "npx only-allow pnpm"
},
"devDependencies": {
"@types/eslint": "8.56.10",
"@types/node": "20.14.2",
"@weareinreach/eslint-config": "workspace:*",
"alex": "11.0.1",
"eslint": "8.57.0",
"next-i18next": "15.3.0",
"typescript": "5.4.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/crowdin/turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {}
"tasks": {}
}
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@snaplet/copycat": "5.0.0",
"@snaplet/seed": "0.97.20",
"@terraformer/wkt": "2.2.1",
"@turbo/gen": "1.13.4",
"@turbo/gen": "2.0.3",
"@turf/helpers": "7.0.0",
"@types/eslint": "8.56.10",
"@types/inquirer": "9.0.7",
Expand Down
6 changes: 3 additions & 3 deletions packages/db/turbo.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"db:dataMigrate": {
"dependsOn": ["db:generate", "db:deploy"],
"env": ["DATABASE_URL", "DB_DIRECT_URL"],
"inputs": ["./prisma/data-migrations/**/*.ts", "./prisma/dataMigrationRunner.ts"],
"outputMode": "new-only"
"outputLogs": "new-only"
},
"db:deploy": {
"dependsOn": ["db:generate", "^docker:up"],
"env": ["DATABASE_URL", "DB_DIRECT_URL"],
"inputs": ["./prisma/migrations/**/*"],
"outputMode": "new-only"
"outputLogs": "new-only"
},
"db:generate": {
"cache": false,
Expand Down
33 changes: 1 addition & 32 deletions packages/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,8 @@ export const env = createEnv({
NEXT_PUBLIC_VERCEL_ENV: z.enum(['production', 'development', 'preview']).optional(),
NEXT_PUBLIC_GA_MEASUREMENT_ID: z.string(),
},
runtimeEnv: {
// Server
CI: process.env.CI,
COGNITO_ACCESS_KEY: process.env.COGNITO_ACCESS_KEY,
COGNITO_CLIENT_ID: process.env.COGNITO_CLIENT_ID,
COGNITO_CLIENT_SECRET: process.env.COGNITO_CLIENT_SECRET,
COGNITO_SECRET: process.env.COGNITO_SECRET,
COGNITO_USER_POOL_ID: process.env.COGNITO_USER_POOL_ID,
CRON_KEY: process.env.CRON_KEY,
CROWDIN_TOKEN: process.env.CROWDIN_TOKEN,
DATABASE_URL: process.env.DATABASE_URL,
DB_DIRECT_URL: process.env.DB_DIRECT_URL,
EDGE_CONFIG_TOKEN: process.env.EDGE_CONFIG_TOKEN,
EDGE_CONFIG: process.env.EDGE_CONFIG,
FEATURE_FLAG_CONFIG: process.env.FEATURE_FLAG_CONFIG,
GOOGLE_PLACES_API_KEY: process.env.GOOGLE_PLACES_API_KEY,
KV_REST_API_READ_ONLY_TOKEN: process.env.KV_REST_API_READ_ONLY_TOKEN,
KV_REST_API_TOKEN: process.env.KV_REST_API_TOKEN,
KV_REST_API_URL: process.env.KV_REST_API_URL,
KV_URL: process.env.KV_URL,
NEXT_RUNTIME: process.env.NEXT_RUNTIME,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
NODE_ENV: process.env.NODE_ENV,
OTEL_SERVER: process.env.OTEL_SERVER,
PORT: process.env.PORT,
VERCEL_ENV: process.env.VERCEL_ENV,
VERCEL_URL: process.env.VERCEL_URL,
VERCEL: process.env.VERCEL,

// Client
experimental__runtimeEnv: {
NEXT_PUBLIC_GA_MEASUREMENT_ID: process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID,
NEXT_PUBLIC_GOOGLE_MAPS_API: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API,
NEXT_PUBLIC_VERCEL_ENV: process.env.NEXT_PUBLIC_VERCEL_ENV,
Expand All @@ -91,5 +62,3 @@ export const env = createEnv({
export const getEnv = <T extends keyof typeof env>(envVar: T): (typeof env)[T] => env[envVar]

export * from './checks'
// export const isDev = process.env.NODE_ENV === 'development'
// export const isVercelProd = process.env.VERCEL_ENV === 'production'
6 changes: 5 additions & 1 deletion packages/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"zod": "3.23.8"
},
"devDependencies": {
"@types/eslint": "8.56.10",
"@types/node": "20.14.2",
"@weareinreach/config": "workspace:*",
"@weareinreach/eslint-config": "workspace:*"
"@weareinreach/eslint-config": "workspace:*",
"eslint": "8.57.0",
"typescript": "5.4.5"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"eslint-plugin-node": "npm:eslint-plugin-n@16.6.2",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-turbo": "1.13.4",
"eslint-plugin-turbo": "2.0.3",
"next": "14.2.4",
"resolve-pkg-maps": "1.0.0",
"typescript": "5.4.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["./icon/iconList.ts", "./icon/iconCollection.ts"],
Expand Down
6 changes: 5 additions & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
"tslog": "4.9.3"
},
"devDependencies": {
"@types/eslint": "8.56.10",
"@types/luxon": "3.4.2",
"@types/node": "20.14.2",
"@weareinreach/config": "workspace:*",
"@weareinreach/eslint-config": "workspace:*"
"@weareinreach/eslint-config": "workspace:*",
"eslint": "8.57.0",
"typescript": "5.4.5"
}
}
2 changes: 1 addition & 1 deletion packages/util/turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {}
"tasks": {}
}
Loading
Loading