Skip to content

Commit

Permalink
chore(api): Fixed prisma script env errors (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b authored May 12, 2024
1 parent 249e07d commit 8762354
Show file tree
Hide file tree
Showing 4 changed files with 8,175 additions and 6,633 deletions.
20 changes: 13 additions & 7 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"db:generate-types": "pnpm dlx prisma generate --schema=src/prisma/schema.prisma",
"db:generate-migrations": "pnpx prisma migrate dev --create-only --skip-seed --schema=src/prisma/schema.prisma",
"db:deploy-migrations": " pnpx prisma migrate deploy --schema=src/prisma/schema.prisma",
"db:validate": "pnpm dlx prisma validate --schema=src/prisma/schema.prisma",
"db:generate-migrations": "pnpx dotenv-cli -e ../../.env -- pnpx prisma migrate dev --create-only --skip-seed --schema=src/prisma/schema.prisma",
"db:deploy-migrations": "pnpx dotenv-cli -e ../../.env -- pnpx prisma migrate deploy --schema=src/prisma/schema.prisma",
"db:validate": "pnpx dotenv-cli -e ../../.env -- pnpm dlx prisma validate --schema=src/prisma/schema.prisma",
"db:format": "pnpm dlx prisma format --schema=src/prisma/schema.prisma",
"db:reset": "pnpm dlx prisma migrate reset --force --schema=src/prisma/schema.prisma",
"sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist || echo 'Failed to upload source maps to Sentry'"
"db:reset": "pnpx dotenv-cli -e ../../.env -- pnpm dlx prisma migrate reset --force --schema=src/prisma/schema.prisma",
"sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist || echo 'Failed to upload source maps to Sentry'",
"e2e:prepare": "cd ../../ && docker compose down && docker compose -f docker-compose-test.yml up -d && cd apps/api && pnpm db:generate-types && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' pnpm run db:deploy-migrations",
"e2e": "pnpm run e2e:prepare && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' turbo run test --no-cache --filter=api -- --runInBand --config=jest.e2e-config.ts --coverage --coverageDirectory=../../coverage-e2e/api --coverageReporters=json && pnpm run e2e:teardown",
"e2e:teardown": "cd ../../ && docker compose -f docker-compose-test.yml down"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
Expand All @@ -32,7 +35,6 @@
"@nestjs/websockets": "^10.3.7",
"@socket.io/redis-adapter": "^8.3.0",
"@supabase/supabase-js": "^2.39.6",
"@types/uuid": "^9.0.8",
"chalk": "^4.1.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
Expand All @@ -53,10 +55,13 @@
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@prisma/client": "^5.13.0",
"@types/uuid": "^9.0.8",
"@types/cookie-parser": "^1.4.7",
"@types/eccrypto": "^1.1.6",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"dotenv-cli": "^7.4.2",
"@types/node": "^20.3.1",
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
Expand All @@ -68,6 +73,7 @@
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.5",
"prettier": "^3.0.0",
"prisma": "5.13.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
Expand Down Expand Up @@ -96,4 +102,4 @@
"keywords": [],
"author": "",
"license": "ISC"
}
}
1 change: 1 addition & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- keyshade-test
redis:
image: redis:6
container_name: integration-tests-redis
ports:
- '6379:6379'
networks:
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
"test": "turbo run test",
"test:api": "pnpm unit:api && pnpm e2e:api",
"unit:api": "pnpm db:generate-types && turbo run test --filter=api -- --config=jest.config.ts",
"e2e:api:prepare": "docker compose down && docker compose -f docker-compose-test.yml up -d && pnpm db:generate-types && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' pnpm run db:deploy-migrations",
"e2e:api": "pnpm run e2e:api:prepare && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' turbo run test --no-cache --filter=api -- --runInBand --config=jest.e2e-config.ts --coverage --coverageDirectory=../../coverage-e2e/api --coverageReporters=json && pnpm run e2e:api:teardown",
"e2e:api:teardown": "docker compose -f docker-compose-test.yml down",
"e2e:api:prepare": "pnpm run --filter=api e2e:prepare",
"e2e:api": "pnpm run --filter=api e2e",
"e2e:api:teardown": "pnpm run --filter=api e2e:teardown",
"test:web": "turbo run test --filter=web",
"test:workspace": "turbo run test --filter=workspace",
"db:generate-types": "pnpm run --filter=api db:generate-types",
Expand All @@ -130,17 +130,15 @@
"husky": "^9.0.11",
"prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.5.11",
"prisma": "5.12.1",
"tsconfig": "workspace:*",
"turbo": "^1.12.4"
},
"dependencies": {
"@million/lint": "^0.0.73",
"@prisma/client": "^5.13.0",
"@sentry/node": "^7.102.0",
"@sentry/profiling-node": "^7.102.0",
"million": "^3.0.5",
"sharp": "^0.33.3",
"zod": "^3.23.6"
}
}
}
Loading

0 comments on commit 8762354

Please sign in to comment.