chore: update environment configuration and enhance Prisma integration
Some checks failed
Lint and Check Types / validations (push) Failing after 47s

- Added MINIO_PORT to .env.example for Minio configuration.
- Updated package.json to include a script for Prisma generation.
- Modified turbo.json to ensure db:generate task is executed during build and dev processes.
- Updated CI workflow to run Prisma generate step.
- Adjusted imports in the API to reference the generated Prisma client correctly.
- Added .gitignore entry for Prisma client directory.
This commit is contained in:
Juan Sebastián Montoya 2025-05-06 18:36:47 -05:00
parent bb4deff66b
commit c7911953df
10 changed files with 20 additions and 8 deletions

View file

@ -11,6 +11,7 @@ MINIO_BUCKET_NAME=your-bucket-name
MINIO_ENDPOINT=your-endpoint
MINIO_SECRET_KEY=your-secret-key
MINIO_USE_SSL=true
MINIO_PORT=9000
NODE_ENV=production
TOKEN_SECRET=your-secret-key

View file

@ -1,7 +1,7 @@
name: CI
name: Lint and Check Types
on: [push]
jobs:
test:
validations:
runs-on: docker
steps:
- name: Checkout
@ -12,6 +12,8 @@ jobs:
node-version: 22
- name: Install
run: npm install
- name: Prisma Generate
run: npm run prisma:generate
- name: Lint
run: npm run lint
- name: Check Types

3
apps/api/.gitignore vendored
View file

@ -56,3 +56,6 @@ profile-*
profile*
*clinic*
*flamegraph*
# prisma
prisma/client

View file

@ -6,6 +6,7 @@
generator client {
provider = "prisma-client-js"
output = "./client"
}
datasource db {

View file

@ -3,7 +3,7 @@ import dotenv from 'dotenv';
import path from 'path';
const rootDir = path.resolve(process.cwd(), '../../');
dotenv.config({ path: `${rootDir}/.env.local` });
dotenv.config({ path: `${rootDir}/.env` });
const schema = z
.object({

View file

@ -4,7 +4,7 @@ import fastifyCookie from '@fastify/cookie';
import fastifyCors from '@fastify/cors';
import mercurius from 'mercurius';
import mercuriusCodegen from 'mercurius-codegen';
import { PrismaClient } from '@prisma/client';
import { PrismaClient } from '../prisma/client';
import config from './config';
import { resolvers } from './resolvers';
import schema from './schema';

View file

@ -2,7 +2,7 @@ import jwt from 'jsonwebtoken';
import { v4 as uuidv4 } from 'uuid';
import crypto from 'crypto';
import { TokenConfig } from '../config';
import { PrismaClient } from '@prisma/client';
import { PrismaClient } from '../../prisma/client';
import { MemcService } from './memc.service';
type TransactionClient = Omit<

View file

@ -1,4 +1,4 @@
import { PrismaClient } from '@prisma/client';
import type { PrismaClient } from '../prisma/client';
import {
MinioService,
TokenService,

View file

@ -7,7 +7,8 @@
"start:api": "turbo run start --filter=api",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"check-types": "turbo run check-types"
"check-types": "turbo run check-types",
"prisma:generate": "turbo run prisma:generate"
},
"devDependencies": {
"@types/node": "^22.13.9",

View file

@ -23,7 +23,7 @@
],
"tasks": {
"build": {
"dependsOn": ["^build"],
"dependsOn": ["^build", "^db:generate"],
"inputs": [".env*"],
"outputs": ["dist/**"]
},
@ -34,9 +34,13 @@
"dependsOn": ["^check-types"]
},
"dev": {
"dependsOn": ["^db:generate"],
"cache": false,
"persistent": true
},
"db:generate": {
"cache": false
},
"start": {
"cache": false,
"persistent": true