chore: gradual dependency upgrade (P0–P5)#59
Conversation
- Upgraded various dependencies in package.json files, including TypeScript, ESLint, Prettier, and several NestJS packages. - Replaced the old ESLint configuration files with new ones using the modern ES module format. - Removed outdated ESLint configuration files from apps/api and apps/web. - Added new tsconfig.eslint.json files for better TypeScript integration with ESLint. - Updated lock files to reflect the changes in dependencies. - Enhanced linting commands for improved code quality checks.
- Added peer dependency rules for eslint-plugin-react-hooks in package.json. - Updated @types/react and @types/react-dom versions to 19.2.14 and 19.2.3 respectively. - Adjusted globals version to 15.15.0 across multiple package.json files. - Introduced parser options in ESLint configuration for better TypeScript support. - Refactored useRef initialization in useVersionCheck.ts for improved type safety. - Enhanced KeyAnalytics component with better formatting and tooltip handling for charts. - Updated devDependencies in multiple packages to ensure compatibility with the latest TypeScript and Node types.
- Upgraded lucide-react to version 1.0.1 in apps/web. - Updated @vitejs/plugin-react to version 6.0.1 in apps/web. - Bumped typescript-eslint to version 8.57.2 in apps/web, apps/api, and packages/cli. - Updated class-validator to version 0.15.1 in proprietary/entitlement and apps/api. - Upgraded @fastify/static to version 9.0.0 in apps/api. - Updated @types/supertest to version 7.2.0 in apps/api. - Upgraded commander to version 14.0.3 in packages/cli. - Updated esbuild to version 0.27.4 in packages/cli. - Added new peer dependency rule for @nestjs/mapped-types in the root package.json.
- Updated `globals` version to 17.4.0 in apps/api and apps/web. - Added `@tailwindcss/vite` dependency in apps/web. - Removed outdated PostCSS and Tailwind configuration files from apps/web. - Integrated Tailwind CSS into the Vite configuration for apps/web. - Updated ESLint configuration to use `vitest` instead of `jest` for testing in proprietary/entitlement. - Refactored tests to utilize `vitest` and updated related imports. - Added new integration tests for entitlement functionality. - Updated Prisma client and related configurations for better compatibility.
The entitlement package migrated from Jest to Vitest, but the API's Jest config includes `../../proprietary` in its roots, causing it to pick up Vitest-based specs that can't run under Jest/CJS. Made-with: Cursor
Runs Vitest for entitlement specs (excluding integration tests that require a running Postgres) alongside the existing API Jest suite. Made-with: Cursor
Adds vitest ^4.1.1 as devDependency and "test": "vitest run" script. The 2 existing test files already import from vitest — this just makes them runnable via pnpm test. Made-with: Cursor
c4bd62b to
a70ddc8
Compare
|
Why are there new models for prisma? |
Sorry, config was changed, will revert them back to node_modules based models |
I am not married to either approach. Just trying to figure out what caused the change and why, what are the pros/cons of either approach? |
|
Well, this is more explicit, but to be honest, I can't really see good reason to add 18K rows just for visibility. |
# Conflicts: # apps/api/package.json # pnpm-lock.yaml # proprietary/entitlement/package.json
Upgraded various dependencies across multiple packages, including TypeScript, ESLint, Prettier, NestJS, and others. Reflects updates in all relevant lockfile versions.
Deleted the unused `class.ts` file generated by Prisma to clean up the proprietary/entitlement module.
Integrated a setup script to initialize Docker containers and prepare Postgres for entitlement integration tests. Updated Vitest config to include `globalSetup`. Refactored alias resolution for path module imports.
…ess function Updated the 'subdomain' parameter to '_subdomain' to indicate it is unused. No functional changes introduced.
…fastify and retry-axios
I agree, that's why I asked if it is required or much better for one reason or another (it could've been that the newer versions of Prisma need it for some reason) |
|
|
||
| // Apply Prisma migrations/schema to the test database | ||
| console.log(' Applying Prisma schema to test database...'); | ||
| execSync('npx prisma db push --force-reset --accept-data-loss', { |
There was a problem hiding this comment.
Why do we need the --force-reset? Since it is in the global setup, will it impact only integrations or unit tests as well?
There was a problem hiding this comment.
this setup file is used in entitlement tests only and the integration tests only.
The idea is that the database is clean on each test run.
Do you know if any tests rely on persisting data across runs? If so, we can skip this part
There was a problem hiding this comment.
No, and even if they were relying on them, it would be an anti pattern. My concern was if the cleaning up with this was happening more often than needed, slowing down the tests.
| private readonly logger = new Logger(PrismaService.name); | ||
|
|
||
| constructor() { | ||
| const adapter = new PrismaPg({ connectionString: process.env.ENTITLEMENT_DATABASE_URL }); |
There was a problem hiding this comment.
Why the ENTITLEMENT_DATABASE_URL specifically? What does the connectionString expect?
There was a problem hiding this comment.
monitor/proprietary/entitlement/README.md
Line 119 in 662e661
It seems this is what the connection url is in K8S.
Also prisma 7 requires this sort of setup:
https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/introduction#importing-prisma-client

Closes #57
Summary
Phased dependency upgrade across the monorepo, targeting all actionable outdated packages while deferring items blocked on upstream ecosystem support.
P0 — Low-risk bumps
P1 — API
@fastify/static8 → 9,class-validator0.14 → 0.15,@types/supertest6 → 7typescript-eslintpatch, ESLint migrated to flat config (eslint.config.mjs)P2 — CLI
commander12 → 14,esbuild0.25 → 0.27P3 — Entitlement (breaking upgrades)
@prisma/adapter-pg),prisma.config.ts, removedurlfrom schema, updated all import paths to generated clientapiVersionfrom constructor,current_period_start/endmoved tosubscription.items.data[0]ts-jest/@types/jest, native ESM/TS supportreflect-metadata0.1 → 0.2,@types/node20 → 22"type": "module", updatedtsconfig.json(module: ESNext, moduleResolution: bundler)scripts/run-integration-tests.sh(Docker checks, schema push, test runner)P4 — Web
@vitejs/plugin-react4 → 6,lucide-react0.x → 1.xuseRefexplicit init, RechartsTooltipformatter arity)P5 — Tailwind + ESLint
@import "tailwindcss",@themedirectives),@tailwindcss/viteplugin, removedpostcss.config.js+tailwind.config.jsglobals15 → 17,eslint-plugin-react-hooksflat config fixDeferred (blocked on upstream)
@lancedb/lancedb0.23 → 0.27apache-arrowpeer conflict (needs ≤18.1.0, have 21.x)@inquirer/prompts7 → 8typescript5.9 → 6.0typescript-eslint+ts-jest(api) lack TS 6 support@types/node22 → 25Verification
pnpm build— all packages/apps build clean (Turbo)tsc --noEmit— no type errors in api, web, entitlement, clipnpm --filter @betterdb/semantic-cache test— passespnpm --filter @app/entitlement test— 18 tests pass (12 unit + 6 integration)Made with Cursor