Remove hoisting on server (#13821)

Testing a different approach to fix broken buildPackageJson on server
build

How i have tested:

A. Local contributor setup
- run yarn
- build server
- run yarn workspace focus
- run server on dist

B. self-host
- docker build

Note: I think the dependencies I have added are suboptimized as the
image went from 2GB to 3.5GB. We might need to be more accurate
This commit is contained in:
Charles Bochet
2025-08-11 15:58:05 +02:00
committed by GitHub
parent b14063fe06
commit b55a48139c
7 changed files with 551 additions and 644 deletions
+1 -54
View File
@@ -2,10 +2,6 @@
"private": true,
"dependencies": {
"@apollo/client": "^3.7.17",
"@aws-sdk/client-lambda": "^3.700.0",
"@aws-sdk/client-s3": "^3.700.0",
"@aws-sdk/client-sts": "^3.700.0",
"@aws-sdk/credential-providers": "^3.700.0",
"@calcom/embed-react": "^1.5.3",
"@codesandbox/sandpack-react": "^2.13.5",
"@dagrejs/dagre": "^1.1.2",
@@ -19,26 +15,8 @@
"@hookform/resolvers": "^3.1.1",
"@linaria/core": "^6.2.0",
"@linaria/react": "^6.2.1",
"@microsoft/microsoft-graph-client": "^3.0.7",
"@nestjs/apollo": "^11.0.5",
"@nestjs/axios": "^3.0.1",
"@nestjs/cli": "^9.0.0",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/event-emitter": "^2.0.3",
"@nestjs/jwt": "^10.0.3",
"@nestjs/passport": "^9.0.3",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/serve-static": "^4.0.1",
"@nestjs/terminus": "^11.0.0",
"@nestjs/typeorm": "^10.0.0",
"@octokit/graphql": "^7.0.2",
"@ptc-org/nestjs-query-core": "^4.2.0",
"@ptc-org/nestjs-query-typeorm": "4.2.1-alpha.2",
"@react-email/components": "0.0.35",
"@react-email/render": "0.0.17",
"@sentry/node": "^9.26.0",
"@sentry/profiling-node": "^9.26.0",
"@sentry/react": "^9.26.0",
"@sniptt/guards": "^0.2.0",
@@ -50,26 +28,17 @@
"@types/lodash.chunk": "^4.2.9",
"@types/lodash.merge": "^4.6.7",
"@types/lodash.pick": "^4.3.7",
"@types/nodemailer": "^6.4.14",
"@types/passport-microsoft": "^1.0.3",
"@wyw-in-js/vite": "^0.5.3",
"@xyflow/react": "^12.4.2",
"add": "^2.0.6",
"addressparser": "^1.0.1",
"apollo-link-rest": "^0.9.0",
"apollo-server-express": "^3.12.0",
"apollo-upload-client": "^17.0.0",
"archiver": "^7.0.1",
"axios": "^1.6.2",
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"bullmq": "^5.40.0",
"bytes": "^3.1.2",
"class-transformer": "^0.5.1",
"cron-parser": "^5.1.1",
"cron-validate": "^1.4.5",
"danger-plugin-todos": "^1.3.1",
"dataloader": "^2.2.2",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"deep-equal": "^2.2.2",
@@ -82,21 +51,8 @@
"fuse.js": "^7.1.0",
"googleapis": "105",
"graphiql": "^3.1.1",
"graphql": "16.8.0",
"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-sse": "^2.5.4",
"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.4",
"hex-rgb": "^5.0.0",
"iframe-resizer-react": "^1.1.0",
"imapflow": "^1.0.186",
"immer": "^10.1.1",
"jest-mock-extended": "^3.0.4",
"js-cookie": "^3.0.5",
@@ -121,16 +77,8 @@
"lodash.snakecase": "^4.1.1",
"lodash.upperfirst": "^4.3.1",
"luxon": "^3.3.0",
"mailparser": "^3.7.3",
"microdiff": "^1.3.2",
"moize": "^6.1.6",
"nest-commander": "^3.12.0",
"nodemailer": "^6.9.8",
"openapi-types": "^12.1.3",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"passport-microsoft": "^2.0.0",
"patch-package": "^8.0.0",
"pg": "^8.11.3",
"pg-boss": "^9.0.3",
@@ -168,7 +116,6 @@
"stripe": "^17.3.1",
"ts-key-enum": "^2.0.12",
"tslib": "^2.3.0",
"tsup": "^8.2.4",
"type-fest": "4.10.1",
"typescript": "5.3.3",
"use-debounce": "^10.0.0",
@@ -188,7 +135,6 @@
"@graphql-codegen/typescript": "^3.0.4",
"@graphql-codegen/typescript-operations": "^3.0.4",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@microsoft/microsoft-graph-types": "^2.40.0",
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
@@ -257,6 +203,7 @@
"@types/node": "^24.0.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/react": "^18.2.39",
"@types/react-datepicker": "^6.2.0",
-5
View File
@@ -29,11 +29,6 @@ COPY ./packages/twenty-shared /app/packages/twenty-shared
COPY ./packages/twenty-server /app/packages/twenty-server
RUN npx nx run twenty-server:build
RUN mv /app/packages/twenty-server/dist /app/packages/twenty-server/build
RUN npx nx run twenty-server:build:packageJson
RUN mv /app/packages/twenty-server/dist/package.json /app/packages/twenty-server/package.json
RUN rm -rf /app/packages/twenty-server/dist
RUN mv /app/packages/twenty-server/build /app/packages/twenty-server/dist
RUN yarn workspaces focus --production twenty-emails twenty-shared twenty-server
+1
View File
@@ -54,6 +54,7 @@
"buffer": "^6.0.3",
"docx": "^9.1.0",
"file-saver": "^2.0.5",
"graphql-sse": "^2.5.4",
"input-otp": "^1.4.2",
"react-markdown": "^10.1.0",
"react-qr-code": "^2.0.18",
+131
View File
@@ -17,55 +17,185 @@
"dependencies": {
"@ai-sdk/anthropic": "^1.2.12",
"@ai-sdk/openai": "^1.3.22",
"@aws-sdk/client-lambda": "3.825.0",
"@aws-sdk/client-s3": "3.825.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",
"@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/cli": "5.1.2",
"@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",
"@monaco-editor/react": "^4.6.0",
"@nestjs/axios": "3.0.2",
"@nestjs/cache-manager": "^2.2.1",
"@nestjs/common": "9.4.3",
"@nestjs/config": "2.3.4",
"@nestjs/core": "9.4.3",
"@nestjs/devtools-integration": "^0.1.6",
"@nestjs/event-emitter": "2.0.4",
"@nestjs/graphql": "patch:@nestjs/graphql@12.1.1#./patches/@nestjs+graphql+12.1.1.patch",
"@nestjs/jwt": "10.2.0",
"@nestjs/passport": "9.0.3",
"@nestjs/platform-express": "9.4.3",
"@nestjs/schedule": "^3.0.0",
"@nestjs/serve-static": "4.0.2",
"@nestjs/terminus": "11.0.0",
"@nestjs/typeorm": "10.0.2",
"@node-saml/node-saml": "5.0.0",
"@node-saml/passport-saml": "^5.0.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",
"@preconstruct/cli": "2.8.12",
"@prettier/sync": "0.5.3",
"@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/components": "0.0.35",
"@react-email/render": "0.0.17",
"@revertdotdev/revert-react": "^0.0.21",
"@sentry/nestjs": "^8.55.0",
"@sentry/node": "9.26.0",
"@sentry/profiling-node": "9.26.0",
"@sniptt/guards": "0.2.0",
"@types/babel__preset-env": "7.10.0",
"@types/express-session": "1.18.0",
"@types/handlebars": "4.1.0",
"@types/lodash.differencewith": "4.5.9",
"@types/lodash.merge": "4.6.9",
"@types/lodash.omitby": "4.6.9",
"@types/lodash.uniq": "4.5.9",
"@types/lodash.uniqby": "4.7.9",
"@types/openid-client": "3.7.0",
"@types/psl": "1.1.3",
"@types/unzipper": "0.10.10",
"@yarnpkg/types": "^4.0.0",
"addressparser": "1.0.1",
"ai": "^4.3.16",
"apollo-server-core": "3.13.0",
"archiver": "7.0.1",
"axios": "1.10.0",
"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": "patch:class-validator@0.14.0#./patches/class-validator+0.14.0.patch",
"class-validator-jsonschema": "^5.0.2",
"cloudflare": "^4.5.0",
"connect-redis": "^7.1.1",
"cron-parser": "5.1.1",
"cron-validate": "1.4.5",
"dataloader": "2.2.2",
"date-fns": "2.30.0",
"deep-equal": "2.2.3",
"dompurify": "3.1.6",
"dotenv": "16.4.5",
"express": "4.21.2",
"express-session": "^1.18.1",
"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.0",
"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",
"handlebars": "^4.7.8",
"imapflow": "1.0.187",
"ioredis": "5.6.0",
"jsdom": "~22.1.0",
"json-schema": "0.4.0",
"jsonc-eslint-parser": "2.4.0",
"jsonwebtoken": "9.0.2",
"jwt-decode": "^4.0.0",
"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.pick": "4.4.0",
"lodash.snakecase": "4.1.1",
"lodash.uniq": "^4.5.0",
"lodash.uniqby": "^4.7.0",
"lodash.upperfirst": "4.3.1",
"mailparser": "3.7.3",
"microdiff": "1.4.0",
"monaco-editor": "^0.51.0",
"monaco-editor-auto-typings": "^0.4.5",
"ms": "2.1.3",
"nest-commander": "3.14.0",
"node-ical": "^0.20.1",
"nodemailer": "6.9.14",
"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",
"pg": "8.12.0",
"pg-boss": "9.0.3",
"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",
"slash": "5.1.0",
"stripe": "17.3.1",
"transliteration": "2.3.5",
"ts-morph": "^24.0.0",
"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",
"typescript": "5.3.3",
"unzipper": "^0.12.3",
"uuid": "9.0.1",
"vite-tsconfig-paths": "4.3.2",
"zod": "3.23.8",
"zod-to-json-schema": "^3.23.1"
},
"devDependencies": {
@@ -85,6 +215,7 @@
"@types/lodash.uniq": "^4.5.9",
"@types/lodash.uniqby": "^4.7.9",
"@types/lodash.upperfirst": "^4.3.7",
"@types/nodemailer": "^6.4.17",
"@types/openid-client": "^3.7.0",
"@types/psl": "^1.1.3",
"@types/react": "^18.2.39",
-1
View File
@@ -1,6 +1,5 @@
import { type ThemeType } from './theme';
declare module '@emotion/react' {
export interface Theme extends ThemeType {}
}
@@ -1,4 +1,4 @@
import { ANIMATION } from './Animation';
import { ANIMATION } from './Animation';
import { COLOR } from './Colors';
import { GRAY_SCALE } from './GrayScale';
import { ICON } from './Icon';
+417 -583
View File
File diff suppressed because it is too large Load Diff