5dfb66917c
## Overview This PR upgrades all NestJS dependencies from version 10.x to 11.x, following the [official migration guide](https://docs.nestjs.com/migration-guide). This builds on top of the v9 to v10 upgrade completed in PR #15835. ## Changes ### Dependencies Updated **Core packages (10.x → 11.x):** - `@nestjs/common`: 10.4.16 → 11.0.8 - `@nestjs/core`: 10.4.16 → 11.0.8 - `@nestjs/platform-express`: 10.4.16 → 11.0.8 - `@nestjs/config`: 3.2.3 → 3.3.0 - `@nestjs/passport`: 10.0.3 → 11.0.0 - `@nestjs/axios`: 3.0.2 → 3.1.2 - `@nestjs/schedule`: ^3.0.0 → ^4.1.1 - `@nestjs/serve-static`: 4.0.2 → 5.0.1 - `@nestjs/cache-manager`: ^2.2.1 → ^2.3.0 - `@nestjs/jwt`: 10.2.0 → 11.0.0 - `@nestjs/typeorm`: 10.0.2 → 11.0.0 - `@nestjs/terminus`: 11.0.0 (already on v11) - `@nestjs/event-emitter`: 2.1.0 (compatible) **DevDependencies:** - `@nestjs/testing`: ^10.4.16 → ^11.0.8 - `@nestjs/schematics`: ^10.1.0 → ^11.0.2 - `@nestjs/cli`: 10.3.0 → 11.0.0 ### Code Changes **Fixed: TwentyConfigModule conditional imports** - Updated `TwentyConfigModule.forRoot()` to use spread operator for conditional imports - Fixes TypeScript error with NestJS 11's stricter DynamicModule type checking **Cleanup: Removed unused package** - Removed `@revertdotdev/revert-react` (not being used anywhere in the codebase) ## Breaking Changes Addressed ### 1. ✅ Reflector Type Inference - **Impact**: None - codebase only uses `reflector.get()` method - **Analysis**: Does not use `getAllAndMerge()` or `getAllAndOverride()` (the methods with breaking changes) - **Files reviewed**: feature-flag.guard.ts, message-queue-metadata.accessor.ts, workspace-query-hook-metadata.accessor.ts ### 2. ✅ Lifecycle Hooks Execution Order - **Change**: Termination hooks (`OnModuleDestroy`, `BeforeApplicationShutdown`, `OnApplicationShutdown`) now execute in REVERSE order - **Analysis**: Reviewed all lifecycle hook implementations - Redis client cleanup - Database connection cleanup (GlobalWorkspaceDataSource) - BullMQ queue/worker cleanup - Cache storage cleanup - **Result**: Dependency order is safe - services using connections clean up before the connections themselves ### 3. ✅ Middleware Registration Order - **Change**: Global middleware now executes first regardless of import order - **Analysis**: Middleware is not registered as global, so execution order remains consistent - **Files reviewed**: app.module.ts, middleware.module.ts ## Testing All tests passing and build successful: **Unit Tests (283+ tests):** - ✅ Health module: 38 tests passed - ✅ Auth module: 115 tests passed (passport v11 integration) - ✅ REST API: 90 tests passed (middleware and express platform) - ✅ Feature flags: 17 tests passed (Reflector usage) - ✅ Workspace: 23 tests passed **Build & Quality:** - ✅ Type checking: Passed - ✅ Linting: Passed - ✅ Build: 3,683 files compiled successfully ## Verification Tested critical NestJS functionality: - ✅ Authentication & Security (JWT, OAuth, guards) - ✅ HTTP Platform (Express integration, REST endpoints) - ✅ Dependency Injection (Services, factories, providers) - ✅ Cache Management (Redis with @nestjs/cache-manager) - ✅ GraphQL (Query runners, resolvers) - ✅ Configuration (Environment config) - ✅ Scheduling (Cron jobs with @nestjs/schedule v4) - ✅ Lifecycle Hooks (Module initialization and cleanup) - ✅ Reflector (Metadata reflection in guards) ## Related PRs - #15835 - Upgrade NestJS from 9.x to 10.x (completed) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Upgrades NestJS to v11 and updates routing patterns, auth strategies, GraphQL schema options, and build/dist paths (scripts, Docker, Nx, migrations, assets), plus enables Devtools in development. > > - **Backend (NestJS 11 upgrade)**: > - Bump `@nestjs/*` packages (core, platform-express, jwt, passport, typeorm, serve-static, schedule, cli/testing/schematics) to v11. > - Update REST/route-trigger/file controllers to new wildcard syntax (`*path`). > - Refactor OAuth (Google/Microsoft) and SAML strategies (abstract base + explicit `validate`); minor typings. > - Enable `DevtoolsModule` in development. > - **GraphQL**: > - Add `buildSchemaOptions.orphanedTypes` for client-config types; keep Yoga/Sentry setup. > - **Build/Runtime & Config**: > - Standardize dist layout (remove `src` in paths): update scripts, Docker `CMD`, Nx `project.json`, render scripts, TypeORM migration paths, asset resolution. > - Adjust `nest-cli.json` (watchOptions, asset globs, migrations outDir, monorepo/root). > - Improve config module imports (spread conditional); tsconfig excludes `node_modules`. > - Minor Nx default: `start` target caching disabled. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1139fd85a97d0c72314d416d07464cc3c9942783. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
227 lines
7.5 KiB
JSON
227 lines
7.5 KiB
JSON
{
|
|
"name": "twenty-server",
|
|
"description": "",
|
|
"author": "",
|
|
"private": true,
|
|
"license": "AGPL-3.0",
|
|
"scripts": {
|
|
"nx": "NX_DEFAULT_PROJECT=twenty-server node ../../node_modules/nx/bin/nx.js",
|
|
"start:prod": "node dist/main",
|
|
"command:prod": "node dist/command/command",
|
|
"worker:prod": "node dist/queue-worker/queue-worker",
|
|
"database:init:prod": "npx ts-node ./scripts/setup-db.ts && yarn database:migrate:prod",
|
|
"database:migrate:prod": "npx -y typeorm migration:run -d dist/database/typeorm/core/core.datasource",
|
|
"clickhouse:migrate:prod": "node dist/database/clickHouse/migrations/run-migrations.js",
|
|
"typeorm": "../../node_modules/typeorm/.bin/typeorm"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/anthropic": "^2.0.17",
|
|
"@ai-sdk/openai": "^2.0.30",
|
|
"@ai-sdk/provider-utils": "^3.0.9",
|
|
"@ai-sdk/xai": "^2.0.19",
|
|
"@aws-sdk/client-lambda": "3.825.0",
|
|
"@aws-sdk/client-s3": "3.825.0",
|
|
"@aws-sdk/client-sesv2": "^3.888.0",
|
|
"@aws-sdk/client-sts": "3.825.0",
|
|
"@aws-sdk/credential-providers": "3.825.0",
|
|
"@babel/preset-env": "7.26.9",
|
|
"@blocknote/server-util": "^0.31.1",
|
|
"@clickhouse/client": "^1.11.0",
|
|
"@dagrejs/dagre": "^1.1.2",
|
|
"@envelop/core": "4.0.3",
|
|
"@envelop/on-resolve": "4.1.0",
|
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
"@eslint/js": "9.32.0",
|
|
"@faker-js/faker": "9.8.0",
|
|
"@graphql-tools/schema": "10.0.4",
|
|
"@graphql-tools/utils": "9.2.1",
|
|
"@graphql-yoga/nestjs": "patch:@graphql-yoga/nestjs@2.1.0#./patches/@graphql-yoga+nestjs+2.1.0.patch",
|
|
"@lingui/conf": "5.1.2",
|
|
"@lingui/core": "^5.1.2",
|
|
"@lingui/format-po": "5.1.2",
|
|
"@lingui/react": "5.1.2",
|
|
"@lingui/vite-plugin": "5.1.2",
|
|
"@microsoft/microsoft-graph-client": "3.0.7",
|
|
"@microsoft/microsoft-graph-types": "^2.40.0",
|
|
"@nestjs/axios": "3.1.2",
|
|
"@nestjs/cache-manager": "^2.3.0",
|
|
"@nestjs/common": "11.1.9",
|
|
"@nestjs/config": "3.3.0",
|
|
"@nestjs/core": "11.1.9",
|
|
"@nestjs/event-emitter": "2.1.0",
|
|
"@nestjs/graphql": "patch:@nestjs/graphql@12.1.1#./patches/@nestjs+graphql+12.1.1.patch",
|
|
"@nestjs/jwt": "11.0.1",
|
|
"@nestjs/passport": "11.0.5",
|
|
"@nestjs/platform-express": "11.1.9",
|
|
"@nestjs/schedule": "^6.0.1",
|
|
"@nestjs/serve-static": "5.0.4",
|
|
"@nestjs/terminus": "11.0.0",
|
|
"@nestjs/typeorm": "11.0.0",
|
|
"@node-saml/node-saml": "5.1.0",
|
|
"@node-saml/passport-saml": "^5.1.0",
|
|
"@opentelemetry/api": "^1.9.0",
|
|
"@opentelemetry/auto-instrumentations-node": "^0.60.0",
|
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.200.0",
|
|
"@opentelemetry/sdk-metrics": "^2.0.0",
|
|
"@opentelemetry/sdk-node": "^0.202.0",
|
|
"@ptc-org/nestjs-query-core": "4.4.0",
|
|
"@ptc-org/nestjs-query-graphql": "patch:@ptc-org/nestjs-query-graphql@4.2.0#./patches/@ptc-org+nestjs-query-graphql+4.2.0.patch",
|
|
"@ptc-org/nestjs-query-typeorm": "4.2.1-alpha.2",
|
|
"@react-email/render": "^1.2.3",
|
|
"@sentry/nestjs": "^10.0.0",
|
|
"@sentry/node": "^10.0.0",
|
|
"@sentry/profiling-node": "^10.0.0",
|
|
"@sniptt/guards": "0.2.0",
|
|
"addressparser": "1.0.1",
|
|
"ai": "^5.0.44",
|
|
"apollo-server-core": "3.13.0",
|
|
"archiver": "7.0.1",
|
|
"axios": "1.12.2",
|
|
"babel-plugin-module-resolver": "5.0.2",
|
|
"bcrypt": "5.1.1",
|
|
"bullmq": "5.40.0",
|
|
"bytes": "3.1.2",
|
|
"cache-manager": "^5.4.0",
|
|
"cache-manager-redis-yet": "^4.1.2",
|
|
"chalk": "4.1.2",
|
|
"class-transformer": "0.5.1",
|
|
"class-validator": "0.14.0",
|
|
"class-validator-jsonschema": "^5.0.2",
|
|
"cloudflare": "^4.5.0",
|
|
"connect-redis": "^7.1.1",
|
|
"cron-parser": "5.1.1",
|
|
"dataloader": "2.2.2",
|
|
"date-fns": "2.30.0",
|
|
"deep-equal": "2.2.3",
|
|
"dompurify": "3.2.6",
|
|
"dotenv": "16.4.5",
|
|
"express": "4.21.2",
|
|
"express-session": "^1.18.2",
|
|
"file-type": "16.5.4",
|
|
"gaxios": "5.1.3",
|
|
"glob": "11.0.1",
|
|
"google-auth-library": "8.9.0",
|
|
"googleapis": "105.0.0",
|
|
"graphql": "16.8.1",
|
|
"graphql-fields": "2.0.3",
|
|
"graphql-middleware": "^6.1.35",
|
|
"graphql-rate-limit": "3.3.0",
|
|
"graphql-redis-subscriptions": "2.7.0",
|
|
"graphql-scalars": "1.23.0",
|
|
"graphql-subscriptions": "2.0.0",
|
|
"graphql-tag": "2.12.6",
|
|
"graphql-type-json": "0.3.2",
|
|
"graphql-upload": "13.0.0",
|
|
"graphql-yoga": "4.0.5",
|
|
"html-to-text": "^9.0.5",
|
|
"imapflow": "1.1.0",
|
|
"ioredis": "5.6.0",
|
|
"jsdom": "^26.1.0",
|
|
"json-schema": "0.4.0",
|
|
"jsonc-eslint-parser": "2.4.0",
|
|
"jsonwebtoken": "9.0.2",
|
|
"libphonenumber-js": "1.11.5",
|
|
"lodash.camelcase": "4.3.0",
|
|
"lodash.chunk": "4.2.0",
|
|
"lodash.compact": "3.0.1",
|
|
"lodash.differencewith": "^4.5.0",
|
|
"lodash.groupby": "4.6.0",
|
|
"lodash.isempty": "4.4.0",
|
|
"lodash.isequal": "4.5.0",
|
|
"lodash.isobject": "3.0.2",
|
|
"lodash.kebabcase": "4.1.1",
|
|
"lodash.merge": "^4.6.2",
|
|
"lodash.omit": "4.5.0",
|
|
"lodash.omitby": "^4.6.0",
|
|
"lodash.snakecase": "4.1.1",
|
|
"lodash.uniq": "^4.5.0",
|
|
"lodash.uniqby": "^4.7.0",
|
|
"lodash.upperfirst": "4.3.1",
|
|
"mailparser": "3.7.5",
|
|
"microdiff": "1.4.0",
|
|
"ms": "2.1.3",
|
|
"nest-commander": "^3.19.1",
|
|
"node-ical": "^0.20.1",
|
|
"nodemailer": "^7.0.10",
|
|
"openapi-types": "12.1.3",
|
|
"openid-client": "^5.7.0",
|
|
"otplib": "^12.0.1",
|
|
"passport": "^0.7.0",
|
|
"passport-google-oauth20": "2.0.0",
|
|
"passport-jwt": "4.0.1",
|
|
"passport-microsoft": "2.1.0",
|
|
"path-to-regexp": "^8.2.0",
|
|
"pg": "8.12.0",
|
|
"planer": "1.2.0",
|
|
"pluralize": "8.0.0",
|
|
"psl": "^1.9.0",
|
|
"react": "18.3.1",
|
|
"react-dom": "18.3.1",
|
|
"redis": "^4.7.0",
|
|
"reflect-metadata": "0.2.2",
|
|
"rxjs": "7.8.1",
|
|
"semver": "7.6.3",
|
|
"sharp": "0.32.6",
|
|
"stripe": "17.3.1",
|
|
"transliteration": "2.3.5",
|
|
"tsconfig-paths": "^4.2.0",
|
|
"tsdav": "^2.1.5",
|
|
"tslib": "2.8.1",
|
|
"type-fest": "4.10.1",
|
|
"typeorm": "patch:typeorm@0.3.20#./patches/typeorm+0.3.20.patch",
|
|
"unzipper": "^0.12.3",
|
|
"uuid": "9.0.1",
|
|
"vite-tsconfig-paths": "4.3.2",
|
|
"zod": "^4.1.11"
|
|
},
|
|
"devDependencies": {
|
|
"@faker-js/faker": "^9.8.0",
|
|
"@lingui/cli": "^5.1.2",
|
|
"@nestjs/cli": "11.0.10",
|
|
"@nestjs/devtools-integration": "^0.2.1",
|
|
"@nestjs/schematics": "^11.0.9",
|
|
"@nestjs/testing": "^11.1.9",
|
|
"@nx/js": "21.3.11",
|
|
"@types/babel__preset-env": "7.10.0",
|
|
"@types/bytes": "^3.1.1",
|
|
"@types/dompurify": "^3.0.5",
|
|
"@types/express": "^4.17.13",
|
|
"@types/express-session": "^1.18.0",
|
|
"@types/graphql-upload": "^8.0.12",
|
|
"@types/html-to-text": "^9.0.4",
|
|
"@types/lodash.chunk": "^4.2.9",
|
|
"@types/lodash.differencewith": "^4.5.9",
|
|
"@types/lodash.isempty": "^4.4.7",
|
|
"@types/lodash.isequal": "^4.5.8",
|
|
"@types/lodash.isobject": "^3.0.7",
|
|
"@types/lodash.merge": "^4.6.9",
|
|
"@types/lodash.omit": "^4.5.9",
|
|
"@types/lodash.omitby": "^4.6.9",
|
|
"@types/lodash.snakecase": "^4.1.7",
|
|
"@types/lodash.uniq": "^4.5.9",
|
|
"@types/lodash.uniqby": "^4.7.9",
|
|
"@types/lodash.upperfirst": "^4.3.7",
|
|
"@types/mailparser": "^3.4.6",
|
|
"@types/ms": "^0.7.31",
|
|
"@types/node": "^24.0.0",
|
|
"@types/nodemailer": "^7.0.3",
|
|
"@types/openid-client": "^3.7.0",
|
|
"@types/passport-google-oauth20": "^2.0.11",
|
|
"@types/passport-jwt": "^3.0.8",
|
|
"@types/passport-microsoft": "^2.1.0",
|
|
"@types/pluralize": "^0.0.33",
|
|
"@types/psl": "^1.1.3",
|
|
"@types/react": "^18.2.39",
|
|
"@types/unzipper": "^0",
|
|
"@yarnpkg/types": "^4.0.0",
|
|
"rimraf": "^5.0.5",
|
|
"twenty-emails": "workspace:*",
|
|
"twenty-shared": "workspace:*"
|
|
},
|
|
"engines": {
|
|
"node": "^24.5.0",
|
|
"npm": "please-use-yarn",
|
|
"yarn": "^4.0.2"
|
|
}
|
|
}
|