From e9a3eda9b277ac14e812b6f5bec1f361480e2c0d Mon Sep 17 00:00:00 2001 From: NHoarau Date: Sun, 31 May 2026 22:24:15 +0400 Subject: [PATCH] fix api dev --- .gitignore | 2 + apps/api/package.json | 5 ++- apps/api/tsconfig.build.json | 2 +- apps/api/tsconfig.json | 12 ++---- package.json | 1 + packages/db/package.json | 9 ++-- packages/db/tsconfig.json | 18 ++++++++ pnpm-lock.yaml | 84 +++++++++++++++++++++++++++++------- turbo.json | 1 + 9 files changed, 105 insertions(+), 29 deletions(-) create mode 100644 packages/db/tsconfig.json diff --git a/.gitignore b/.gitignore index 7ab19ef..10f93a5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ node_modules #Ignore vscode AI rules .github/instructions/codacy.instructions.md + +packages/db/dist diff --git a/apps/api/package.json b/apps/api/package.json index 18116a0..a58a3e9 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -8,11 +8,11 @@ "scripts": { "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", - "start": "nest start", + "start": "nest build && node dist/main.js", "dev": "nest start --watch", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", + "start:prod": "node dist/main.js", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "vitest run", "test:watch": "vitest", @@ -25,6 +25,7 @@ "@nestjs/common": "^11.0.1", "@nestjs/core": "^11.0.1", "@nestjs/platform-express": "^11.0.1", + "@proj/db": "workspace:*", "drizzle-orm": "^0.45.1", "postgres": "^3.4.8", "reflect-metadata": "^0.2.2", diff --git a/apps/api/tsconfig.build.json b/apps/api/tsconfig.build.json index 64f86c6..cfdf1d3 100644 --- a/apps/api/tsconfig.build.json +++ b/apps/api/tsconfig.build.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] + "exclude": ["node_modules", "test", "dist", "vitest.config.ts", "vitest.config.e2e.ts", "**/*spec.ts"] } diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json index 86f8366..3adc4d7 100644 --- a/apps/api/tsconfig.json +++ b/apps/api/tsconfig.json @@ -12,18 +12,14 @@ "allowSyntheticDefaultImports": true, "target": "ES2023", "sourceMap": true, - "rootDir": "../..", + "rootDir": "src", "outDir": "./dist", - "incremental": true, "skipLibCheck": true, "strictNullChecks": true, "forceConsistentCasingInFileNames": true, "noImplicitAny": false, "strictBindCallApply": false, - "noFallthroughCasesInSwitch": false, - "paths": { - "@proj/db": ["../../packages/db/index.ts"], - "@proj/db/*": ["../../packages/db/*"] - } - } + "noFallthroughCasesInSwitch": false + }, + "include": ["src/**/*.ts"] } diff --git a/package.json b/package.json index c739c99..26988c8 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "clean": "turbo clean && rm -rf node_modules" }, "devDependencies": { + "@ai-sdk/openai-compatible": "^2.0.48", "turbo": "^2.9.16" } } diff --git a/packages/db/package.json b/packages/db/package.json index bbce8e3..defc8d0 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,9 +1,10 @@ { "name": "@proj/db", "version": "0.0.0", - "main": "./index.ts", - "types": "./index.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "scripts": { + "build": "tsc -p tsconfig.json", "db:generate": "drizzle-kit generate:pg", "db:push": "drizzle-kit push:pg" }, @@ -12,6 +13,8 @@ "postgres": "latest" }, "devDependencies": { - "drizzle-kit": "latest" + "@types/node": "^22.0.0", + "drizzle-kit": "latest", + "typescript": "^5.7.0" } } diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json new file mode 100644 index 0000000..9b8f435 --- /dev/null +++ b/packages/db/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "nodenext", + "moduleResolution": "nodenext", + "outDir": "./dist", + "rootDir": ".", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["*.ts"], + "exclude": ["dist"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48dff04..cfeff0d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@ai-sdk/openai-compatible': + specifier: ^2.0.48 + version: 2.0.48(zod@4.4.3) turbo: specifier: ^2.9.16 version: 2.9.16 @@ -23,6 +26,9 @@ importers: '@nestjs/platform-express': specifier: ^11.0.1 version: 11.1.14(@nestjs/common@11.1.14)(@nestjs/core@11.1.14) + '@proj/db': + specifier: workspace:* + version: link:../../packages/db drizzle-orm: specifier: ^0.45.1 version: 0.45.1(postgres@3.4.8) @@ -134,7 +140,7 @@ importers: version: 3.23.0(@playwright/test@1.58.2)(@vue/test-utils@2.4.6)(happy-dom@20.7.0)(playwright-core@1.58.2)(typescript@5.9.3)(vitest@4.0.18) '@nuxt/ui': specifier: ^4.4.0 - version: 4.4.0(@tiptap/extensions@3.24.0)(@tiptap/y-tiptap@3.0.4)(embla-carousel@8.6.0)(tailwindcss@4.2.1)(typescript@5.9.3)(vite@7.3.3)(vue@3.5.35)(yjs@13.6.31) + version: 4.4.0(@tiptap/extensions@3.24.0)(@tiptap/y-tiptap@3.0.4)(embla-carousel@8.6.0)(tailwindcss@4.2.1)(typescript@5.9.3)(vite@7.3.3)(vue@3.5.35)(yjs@13.6.31)(zod@4.4.3) nuxt: specifier: ^4.3.0 version: 4.3.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(@vue/compiler-sfc@3.5.35)(eslint@9.39.3)(typescript@5.9.3)(vite@7.3.3)(vue-tsc@3.2.5) @@ -182,12 +188,48 @@ importers: specifier: latest version: 3.4.8 devDependencies: + '@types/node': + specifier: ^22.0.0 + version: 22.19.19 drizzle-kit: specifier: latest version: 0.31.9 + typescript: + specifier: ^5.7.0 + version: 5.9.3 packages: + /@ai-sdk/openai-compatible@2.0.48(zod@4.4.3): + resolution: {integrity: sha512-z9MC6M4Oh/yUY/F/eszOtO8wc2nMz99XmZQKd2gWTtyIfe716xTfrKe3aYZKg20NZDtyjqPPKPSR+wqz7q1T7Q==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + dependencies: + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.4.3) + zod: 4.4.3 + dev: true + + /@ai-sdk/provider-utils@4.0.27(zod@4.4.3): + resolution: {integrity: sha512-ubkAJ+xODouwtmN1tYlvTPphH1hPOBfZaEQe8U7skGvFAnIRs9PPpsq57bC2+Ky/MB4yzhd6YOsxTAx9sGpazw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + dependencies: + '@ai-sdk/provider': 3.0.10 + '@standard-schema/spec': 1.1.0 + eventsource-parser: 3.1.0 + zod: 4.4.3 + dev: true + + /@ai-sdk/provider@3.0.10: + resolution: {integrity: sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw==} + engines: {node: '>=18'} + dependencies: + json-schema: 0.4.0 + dev: true + /@alloc/quick-lru@5.2.0: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -2705,7 +2747,7 @@ packages: resolution: {integrity: sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 jest-regex-util: 30.0.1 dev: true @@ -2836,7 +2878,7 @@ packages: '@jest/schemas': 30.0.5 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.19.11 + '@types/node': 22.19.19 '@types/yargs': 17.0.35 chalk: 4.1.2 dev: true @@ -3739,7 +3781,7 @@ packages: - typescript dev: false - /@nuxt/ui@4.4.0(@tiptap/extensions@3.24.0)(@tiptap/y-tiptap@3.0.4)(embla-carousel@8.6.0)(tailwindcss@4.2.1)(typescript@5.9.3)(vite@7.3.3)(vue@3.5.35)(yjs@13.6.31): + /@nuxt/ui@4.4.0(@tiptap/extensions@3.24.0)(@tiptap/y-tiptap@3.0.4)(embla-carousel@8.6.0)(tailwindcss@4.2.1)(typescript@5.9.3)(vite@7.3.3)(vue@3.5.35)(yjs@13.6.31)(zod@4.4.3): resolution: {integrity: sha512-c9n8PgYSpFpC3GSz0LtAzceo/jjNyaI1yFJbDPJop5OoeeWqKOC3filsQFNPxo+i3v81EiGkZq+bJ7pnHxAGkA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -3838,6 +3880,7 @@ packages: unplugin-vue-components: 31.0.0(@nuxt/kit@4.3.1)(vue@3.5.35) vaul-vue: 0.4.1(reka-ui@2.7.0)(vue@3.5.35) vue-component-type-helpers: 3.2.5 + zod: 4.4.3 transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -6327,7 +6370,7 @@ packages: resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} dependencies: '@types/connect': 3.4.38 - '@types/node': 22.19.11 + '@types/node': 22.19.19 dev: true /@types/chai@5.2.3: @@ -6339,7 +6382,7 @@ packages: /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 dev: true /@types/cookiejar@2.1.5: @@ -6377,7 +6420,7 @@ packages: /@types/express-serve-static-core@5.1.1: resolution: {integrity: sha512-v4zIMr/cX7/d2BpAEX3KNKL/JrT1s43s96lLvvdTmza1oEvDudCqK9aF/djc/SWgy8Yh0h30TZx5VpzqFCxk5A==} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 '@types/send': 1.2.1 @@ -6449,7 +6492,6 @@ packages: resolution: {integrity: sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==} dependencies: undici-types: 6.21.0 - dev: true /@types/qs@6.14.0: resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==} @@ -6466,14 +6508,14 @@ packages: /@types/send@1.2.1: resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 dev: true /@types/serve-static@2.2.0: resolution: {integrity: sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==} dependencies: '@types/http-errors': 2.0.5 - '@types/node': 22.19.11 + '@types/node': 22.19.19 dev: true /@types/stack-utils@2.0.3: @@ -6485,7 +6527,7 @@ packages: dependencies: '@types/cookiejar': 2.1.5 '@types/methods': 1.1.4 - '@types/node': 22.19.11 + '@types/node': 22.19.19 form-data: 4.0.5 dev: true @@ -6510,7 +6552,7 @@ packages: /@types/ws@8.18.1: resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 /@types/yargs-parser@21.0.3: resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -9946,6 +9988,11 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + /eventsource-parser@3.1.0: + resolution: {integrity: sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==} + engines: {node: '>=18.0.0'} + dev: true + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -11349,7 +11396,7 @@ packages: engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} dependencies: '@jest/types': 30.2.0 - '@types/node': 22.19.11 + '@types/node': 22.19.19 jest-util: 30.2.0 dev: true @@ -11502,7 +11549,7 @@ packages: engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} dependencies: '@jest/types': 30.2.0 - '@types/node': 22.19.11 + '@types/node': 22.19.19 chalk: 4.1.2 ci-info: 4.4.0 graceful-fs: 4.2.11 @@ -11551,7 +11598,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 22.19.11 + '@types/node': 22.19.19 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -11663,6 +11710,10 @@ packages: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true + /json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + dev: true + /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -16387,3 +16438,6 @@ packages: compress-commons: 6.0.2 readable-stream: 4.7.0 dev: false + + /zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} diff --git a/turbo.json b/turbo.json index 72d79e1..cec925f 100644 --- a/turbo.json +++ b/turbo.json @@ -2,6 +2,7 @@ "$schema": "https://turborepo.dev/schema.json", "tasks": { "build": { + "dependsOn": ["^build"], "outputs": ["dist/**"] }, "check-types": {