From 245bd510aeb102e23de5e29a4888d32a6d64d3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Wed, 14 Jan 2026 13:56:30 +0100 Subject: [PATCH] chore: cleanup repository root structure (#17147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary This PR reduces clutter at the repository root to improve navigation on GitHub. The README is now visible much sooner when browsing the repo. ## Changes ### Deleted from root - `nx` wrapper script → use `npx nx` instead - `render.yaml` → no longer used - `jest.preset.js` → inlined `@nx/jest/preset` directly in each package's jest.config - `.prettierrc` → moved config to `package.json` - `.prettierignore` → patterns already covered by `.gitignore` ### Moved/Consolidated | From | To | |------|-----| | `Makefile` | `packages/twenty-docker/Makefile` (merged) | | `crowdin-app.yml` | `.github/crowdin-app.yml` | | `crowdin-docs.yml` | `.github/crowdin-docs.yml` | | `.vale.ini` | `.github/vale.ini` | | `tools/eslint-rules/` | `packages/twenty-eslint-rules/` | | `eslint.config.react.mjs` | `packages/twenty-front/eslint.config.react.mjs` | ## Result Root items reduced from ~32 to ~22 (folders + files). ## Files updated - GitHub workflow files updated to reference new crowdin config paths - Jest configs updated to use `@nx/jest/preset` directly - ESLint configs updated with new import paths - `nx.json` updated with new paths - `package.json` now includes prettier config and updated workspace paths - Dockerfile updated with new eslint-rules path --- crowdin-app.yml => .github/crowdin-app.yml | 0 crowdin-docs.yml => .github/crowdin-docs.yml | 0 .vale.ini => .github/vale.ini | 0 .github/workflows/docs-i18n-pull.yaml | 4 +- .github/workflows/docs-i18n-push.yaml | 4 +- .github/workflows/i18n-pull.yaml | 2 +- .github/workflows/i18n-push.yaml | 2 +- .prettierignore | 4 - .prettierrc | 5 -- Makefile | 48 ----------- jest.config.mjs | 5 -- jest.preset.js | 1 + nx | 5 -- package.json | 5 ++ .../browser-extension/eslint.config.mjs | 2 +- packages/twenty-docker/Makefile | 64 +++++++++++++- .../twenty-docker/twenty-website/Dockerfile | 2 +- packages/twenty-docker/twenty/Dockerfile | 1 - .../contribute/capabilities/local-setup.mdx | 12 +-- packages/twenty-emails/eslint.config.mjs | 2 +- packages/twenty-front/eslint.config.mjs | 2 +- packages/twenty-ui/eslint.config.mjs | 2 +- render.yaml | 83 ------------------- .../eslint-rules/eslint.config.react.mjs | 0 tools/eslint-rules/jest.config.mjs | 2 +- 25 files changed, 85 insertions(+), 172 deletions(-) rename crowdin-app.yml => .github/crowdin-app.yml (100%) rename crowdin-docs.yml => .github/crowdin-docs.yml (100%) rename .vale.ini => .github/vale.ini (100%) delete mode 100644 .prettierignore delete mode 100644 .prettierrc delete mode 100644 Makefile delete mode 100644 jest.config.mjs delete mode 100755 nx delete mode 100644 render.yaml rename eslint.config.react.mjs => tools/eslint-rules/eslint.config.react.mjs (100%) diff --git a/crowdin-app.yml b/.github/crowdin-app.yml similarity index 100% rename from crowdin-app.yml rename to .github/crowdin-app.yml diff --git a/crowdin-docs.yml b/.github/crowdin-docs.yml similarity index 100% rename from crowdin-docs.yml rename to .github/crowdin-docs.yml diff --git a/.vale.ini b/.github/vale.ini similarity index 100% rename from .vale.ini rename to .github/vale.ini diff --git a/.github/workflows/docs-i18n-pull.yaml b/.github/workflows/docs-i18n-pull.yaml index 919cc7bcd9..719cda6f65 100644 --- a/.github/workflows/docs-i18n-pull.yaml +++ b/.github/workflows/docs-i18n-pull.yaml @@ -24,7 +24,7 @@ on: pull_request: paths: - 'packages/twenty-docs/**' - - 'crowdin-docs.yml' + - '.github/crowdin-docs.yml' - '.github/workflows/docs-i18n-pull.yaml' concurrency: @@ -78,7 +78,7 @@ jobs: for lang in $LANGUAGES; do echo "=== Pulling translations for $lang ===" crowdin download \ - --config crowdin-docs.yml \ + --config .github/crowdin-docs.yml \ --token "$CROWDIN_PERSONAL_TOKEN" \ --base-url "https://twenty.api.crowdin.com" \ --language "$lang" \ diff --git a/.github/workflows/docs-i18n-push.yaml b/.github/workflows/docs-i18n-push.yaml index a3ccaa5b0c..7a645338cb 100644 --- a/.github/workflows/docs-i18n-push.yaml +++ b/.github/workflows/docs-i18n-push.yaml @@ -12,7 +12,7 @@ on: - 'packages/twenty-docs/**/*.mdx' - '!packages/twenty-docs/l/**' - 'packages/twenty-docs/navigation/navigation.template.json' - - 'crowdin-docs.yml' + - '.github/crowdin-docs.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -43,7 +43,7 @@ jobs: download_translations: false localization_branch_name: i18n-docs base_url: 'https://twenty.api.crowdin.com' - config: 'crowdin-docs.yml' + config: '.github/crowdin-docs.yml' env: # Docs translations project CROWDIN_PROJECT_ID: '2' diff --git a/.github/workflows/i18n-pull.yaml b/.github/workflows/i18n-pull.yaml index 0025e8ccdd..27e023af00 100644 --- a/.github/workflows/i18n-pull.yaml +++ b/.github/workflows/i18n-pull.yaml @@ -89,7 +89,7 @@ jobs: create_pull_request: false skip_ref_checkout: true dryrun_action: false - config: 'crowdin-app.yml' + config: '.github/crowdin-app.yml' env: GITHUB_TOKEN: ${{ github.token }} # App translations project diff --git a/.github/workflows/i18n-push.yaml b/.github/workflows/i18n-push.yaml index b003d7df2a..7b30d98bbe 100644 --- a/.github/workflows/i18n-push.yaml +++ b/.github/workflows/i18n-push.yaml @@ -87,7 +87,7 @@ jobs: download_translations: false localization_branch_name: i18n base_url: 'https://twenty.api.crowdin.com' - config: 'crowdin-app.yml' + config: '.github/crowdin-app.yml' env: # App translations project CROWDIN_PROJECT_ID: '1' diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index d155fdbd59..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -# Add files here to ignore them from prettier formatting -/dist -/coverage -/.nx/cache \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 6de9cff5b4..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all", - "endOfLine": "lf" -} diff --git a/Makefile b/Makefile deleted file mode 100644 index 830c7ab6d8..0000000000 --- a/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -DOCKER_NETWORK=twenty_network - -ensure-docker-network: - docker network inspect $(DOCKER_NETWORK) >/dev/null 2>&1 || docker network create $(DOCKER_NETWORK) - -postgres-on-docker: ensure-docker-network - docker run -d --network $(DOCKER_NETWORK) \ - --name twenty_pg \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e ALLOW_NOSSL=true \ - -v twenty_db_data:/var/lib/postgresql/data \ - -p 5432:5432 \ - postgres:16 - @echo "Waiting for PostgreSQL to be ready..." - @until docker exec twenty_pg psql -U postgres -d postgres \ - -c 'SELECT pg_is_in_recovery();' 2>/dev/null | grep -q 'f'; do \ - sleep 1; \ - done - docker exec twenty_pg psql -U postgres -d postgres \ - -c "CREATE DATABASE \"default\" WITH OWNER postgres;" \ - -c "CREATE DATABASE \"test\" WITH OWNER postgres;" - -redis-on-docker: ensure-docker-network - docker run -d --network $(DOCKER_NETWORK) --name twenty_redis -p 6379:6379 redis/redis-stack-server:latest - -clickhouse-on-docker: ensure-docker-network - docker run -d --network $(DOCKER_NETWORK) --name twenty_clickhouse -p 8123:8123 -p 9000:9000 -e CLICKHOUSE_PASSWORD=devPassword clickhouse/clickhouse-server:latest \ - -grafana-on-docker: ensure-docker-network - docker run -d --network $(DOCKER_NETWORK) \ - --name twenty_grafana \ - -p 4000:3000 \ - -e GF_SECURITY_ADMIN_USER=admin \ - -e GF_SECURITY_ADMIN_PASSWORD=admin \ - -e GF_INSTALL_PLUGINS=grafana-clickhouse-datasource \ - -v $(PWD)/packages/twenty-docker/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources \ - grafana/grafana-oss:latest - -opentelemetry-collector-on-docker: ensure-docker-network - docker run -d --network $(DOCKER_NETWORK) \ - --name twenty_otlp_collector \ - -p 4317:4317 \ - -p 4318:4318 \ - -p 13133:13133 \ - -v $(PWD)/packages/twenty-docker/otel-collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml \ - otel/opentelemetry-collector-contrib:latest \ - --config /etc/otel-collector-config.yaml \ No newline at end of file diff --git a/jest.config.mjs b/jest.config.mjs deleted file mode 100644 index d0dbd1b889..0000000000 --- a/jest.config.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { getJestProjects } from '@nx/jest'; - -export default { - projects: getJestProjects(), -}; diff --git a/jest.preset.js b/jest.preset.js index f078ddcec1..05984a2d53 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -1,3 +1,4 @@ const nxPreset = require('@nx/jest/preset').default; module.exports = { ...nxPreset }; + diff --git a/nx b/nx deleted file mode 100755 index e94326e36a..0000000000 --- a/nx +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -command -v node >/dev/null 2>&1 || { echo >&2 "Nx requires NodeJS to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ ."; exit 1; } -command -v npm >/dev/null 2>&1 || { echo >&2 "Nx requires npm to be available. To install NodeJS and NPM, see: https://nodejs.org/en/download/ ."; exit 1; } -path_to_root=$(dirname $BASH_SOURCE) -node $path_to_root/.nx/nxw.js $@ \ No newline at end of file diff --git a/package.json b/package.json index 2cf7e36daa..57883c8fc2 100644 --- a/package.json +++ b/package.json @@ -222,5 +222,10 @@ "packages/create-twenty-app", "tools/eslint-rules" ] + }, + "prettier": { + "singleQuote": true, + "trailingComma": "all", + "endOfLine": "lf" } } diff --git a/packages/twenty-apps/community/linkedin-browser-extension/browser-extension/eslint.config.mjs b/packages/twenty-apps/community/linkedin-browser-extension/browser-extension/eslint.config.mjs index 42621cdcab..f7f5688c3a 100755 --- a/packages/twenty-apps/community/linkedin-browser-extension/browser-extension/eslint.config.mjs +++ b/packages/twenty-apps/community/linkedin-browser-extension/browser-extension/eslint.config.mjs @@ -1,7 +1,7 @@ import typescriptParser from '@typescript-eslint/parser'; import path from 'path'; import { fileURLToPath } from 'url'; -import reactConfig from '../../eslint.config.react.mjs'; +import reactConfig from '../../../../../tools/eslint-rules/eslint.config.react.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); diff --git a/packages/twenty-docker/Makefile b/packages/twenty-docker/Makefile index bdda023dd5..fbcbcf5302 100644 --- a/packages/twenty-docker/Makefile +++ b/packages/twenty-docker/Makefile @@ -1,15 +1,21 @@ -# Makefile for building Twenty CRM docker images. +# Makefile for building and running Twenty CRM docker containers. # Set the tag and/or target build platform using make command-line variables assignments. # # Optional make variables: # PLATFORM - defaults to 'linux/amd64' # TAG - defaults to 'latest' # -# Example: make -# Example: make PLATFORM=linux/aarch64 TAG=my-tag +# Example: make prod-build +# Example: make PLATFORM=linux/aarch64 TAG=my-tag prod-build +# Example: make postgres-on-docker (for local development) PLATFORM ?= linux/amd64 TAG ?= latest +DOCKER_NETWORK=twenty_network + +# ============================================================================= +# Production Image Building +# ============================================================================= prod-build: @cd ../.. && docker build -f ./packages/twenty-docker/twenty/Dockerfile --platform $(PLATFORM) --tag twenty:$(TAG) . && cd - @@ -25,3 +31,55 @@ prod-website-build: prod-website-run: @docker run -d -p 3000:3000 --name twenty-website twenty-website:$(TAG) + +# ============================================================================= +# Local Development Services +# Run these from the repository root: make -C packages/twenty-docker +# ============================================================================= + +ensure-docker-network: + docker network inspect $(DOCKER_NETWORK) >/dev/null 2>&1 || docker network create $(DOCKER_NETWORK) + +postgres-on-docker: ensure-docker-network + docker run -d --network $(DOCKER_NETWORK) \ + --name twenty_pg \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e ALLOW_NOSSL=true \ + -v twenty_db_data:/var/lib/postgresql/data \ + -p 5432:5432 \ + postgres:16 + @echo "Waiting for PostgreSQL to be ready..." + @until docker exec twenty_pg psql -U postgres -d postgres \ + -c 'SELECT pg_is_in_recovery();' 2>/dev/null | grep -q 'f'; do \ + sleep 1; \ + done + docker exec twenty_pg psql -U postgres -d postgres \ + -c "CREATE DATABASE \"default\" WITH OWNER postgres;" \ + -c "CREATE DATABASE \"test\" WITH OWNER postgres;" + +redis-on-docker: ensure-docker-network + docker run -d --network $(DOCKER_NETWORK) --name twenty_redis -p 6379:6379 redis/redis-stack-server:latest + +clickhouse-on-docker: ensure-docker-network + docker run -d --network $(DOCKER_NETWORK) --name twenty_clickhouse -p 8123:8123 -p 9000:9000 -e CLICKHOUSE_PASSWORD=devPassword clickhouse/clickhouse-server:latest \ + +grafana-on-docker: ensure-docker-network + docker run -d --network $(DOCKER_NETWORK) \ + --name twenty_grafana \ + -p 4000:3000 \ + -e GF_SECURITY_ADMIN_USER=admin \ + -e GF_SECURITY_ADMIN_PASSWORD=admin \ + -e GF_INSTALL_PLUGINS=grafana-clickhouse-datasource \ + -v $(PWD)/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources \ + grafana/grafana-oss:latest + +opentelemetry-collector-on-docker: ensure-docker-network + docker run -d --network $(DOCKER_NETWORK) \ + --name twenty_otlp_collector \ + -p 4317:4317 \ + -p 4318:4318 \ + -p 13133:13133 \ + -v $(PWD)/otel-collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml \ + otel/opentelemetry-collector-contrib:latest \ + --config /etc/otel-collector-config.yaml diff --git a/packages/twenty-docker/twenty-website/Dockerfile b/packages/twenty-docker/twenty-website/Dockerfile index 2ff7cb808b..3f9c69a413 100644 --- a/packages/twenty-docker/twenty-website/Dockerfile +++ b/packages/twenty-docker/twenty-website/Dockerfile @@ -40,4 +40,4 @@ RUN chown -R 1000 /app # Use non root user with uid 1000 USER 1000 -CMD ["/bin/sh", "-c", "npx nx start"] \ No newline at end of file +CMD ["/bin/sh", "-c", "npx nx start"] diff --git a/packages/twenty-docker/twenty/Dockerfile b/packages/twenty-docker/twenty/Dockerfile index 84dae1ae4d..2a913cc2c6 100644 --- a/packages/twenty-docker/twenty/Dockerfile +++ b/packages/twenty-docker/twenty/Dockerfile @@ -8,7 +8,6 @@ COPY ./package.json ./yarn.lock ./.yarnrc.yml ./tsconfig.base.json ./nx.json /ap COPY ./.yarn/releases /app/.yarn/releases COPY ./.yarn/patches /app/.yarn/patches -COPY ./.prettierrc /app/ COPY ./packages/twenty-emails/package.json /app/packages/twenty-emails/ COPY ./packages/twenty-server/package.json /app/packages/twenty-server/ COPY ./packages/twenty-server/patches /app/packages/twenty-server/patches diff --git a/packages/twenty-docs/developers/contribute/capabilities/local-setup.mdx b/packages/twenty-docs/developers/contribute/capabilities/local-setup.mdx index 54be4aef33..3ca4c3fe4b 100644 --- a/packages/twenty-docs/developers/contribute/capabilities/local-setup.mdx +++ b/packages/twenty-docs/developers/contribute/capabilities/local-setup.mdx @@ -112,7 +112,7 @@ You should run all commands in the following steps from the root of the project. **Option 2:** If you have docker installed: ```bash - make postgres-on-docker + make -C packages/twenty-docker postgres-on-docker ``` @@ -162,7 +162,7 @@ You should run all commands in the following steps from the root of the project. **Option 2:** If you have docker installed: ```bash - make postgres-on-docker + make -C packages/twenty-docker postgres-on-docker ``` @@ -179,7 +179,7 @@ You should run all commands in the following steps from the root of the project. Running Docker on WSL adds an extra layer of complexity. Only use this option if you are comfortable with the extra steps involved, including turning on [Docker Desktop WSL2](https://docs.docker.com/desktop/wsl). ```bash - make postgres-on-docker + make -C packages/twenty-docker postgres-on-docker ``` @@ -196,7 +196,7 @@ Twenty requires a redis cache to provide the best performance **Option 2:** If you have docker installed: ```bash - make redis-on-docker + make -C packages/twenty-docker redis-on-docker ``` @@ -209,7 +209,7 @@ Twenty requires a redis cache to provide the best performance **Option 2:** If you have docker installed: ```bash - make redis-on-docker + make -C packages/twenty-docker redis-on-docker ``` @@ -218,7 +218,7 @@ Twenty requires a redis cache to provide the best performance **Option 2:** If you have docker installed: ```bash - make redis-on-docker + make -C packages/twenty-docker redis-on-docker ``` diff --git a/packages/twenty-emails/eslint.config.mjs b/packages/twenty-emails/eslint.config.mjs index 33e13bd330..cfb3c39044 100644 --- a/packages/twenty-emails/eslint.config.mjs +++ b/packages/twenty-emails/eslint.config.mjs @@ -1,7 +1,7 @@ import typescriptParser from '@typescript-eslint/parser'; import path from 'path'; import { fileURLToPath } from 'url'; -import reactConfig from '../../eslint.config.react.mjs'; +import reactConfig from '../../tools/eslint-rules/eslint.config.react.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); diff --git a/packages/twenty-front/eslint.config.mjs b/packages/twenty-front/eslint.config.mjs index 25acb896be..81f1cd36a7 100644 --- a/packages/twenty-front/eslint.config.mjs +++ b/packages/twenty-front/eslint.config.mjs @@ -1,7 +1,7 @@ import typescriptParser from '@typescript-eslint/parser'; import path from 'path'; import { fileURLToPath } from 'url'; -import reactConfig from '../../eslint.config.react.mjs'; +import reactConfig from '../../tools/eslint-rules/eslint.config.react.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); diff --git a/packages/twenty-ui/eslint.config.mjs b/packages/twenty-ui/eslint.config.mjs index de2b7ce81c..564a3ae1ec 100644 --- a/packages/twenty-ui/eslint.config.mjs +++ b/packages/twenty-ui/eslint.config.mjs @@ -1,7 +1,7 @@ import typescriptParser from '@typescript-eslint/parser'; import path from 'path'; import { fileURLToPath } from 'url'; -import reactConfig from '../../eslint.config.react.mjs'; +import reactConfig from '../../tools/eslint-rules/eslint.config.react.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); diff --git a/render.yaml b/render.yaml deleted file mode 100644 index b7850996ff..0000000000 --- a/render.yaml +++ /dev/null @@ -1,83 +0,0 @@ -services: -- type: web - name: server - runtime: image - image: - url: twentycrm/twenty:latest - dockerCommand: "sh -c ./scripts/render-run.sh" - autoDeploy: false - plan: standard - envVars: - - key: FRONT_BASE_URL - fromService: - name: server - type: web - envVarKey: RENDER_EXTERNAL_URL - - key: SERVER_URL - fromService: - name: server - type: web - envVarKey: RENDER_EXTERNAL_URL - - key: APP_SECRET - generateValue: true - - key: PG_DATABASE_HOST - fromService: - name: twenty_postgres - type: pserv - property: host - - key: PG_DATABASE_PORT - fromService: - name: twenty_postgres - type: pserv - property: port -- type: worker - name: worker - runtime: image - image: - url: twentycrm/twenty:latest - dockerCommand: "sh -c ./scripts/render-worker.sh" - autoDeploy: false - plan: standard - envVars: - - key: FRONT_BASE_URL - fromService: - name: server - type: web - envVarKey: RENDER_EXTERNAL_URL - - key: SERVER_URL - fromService: - name: server - type: web - envVarKey: RENDER_EXTERNAL_URL - - key: APP_SECRET - generateValue: true - - key: PG_DATABASE_HOST - fromService: - name: twenty_postgres - type: pserv - property: host - - key: PG_DATABASE_PORT - fromService: - name: twenty_postgres - type: pserv - property: port - disk: - name: twenty-disk - mountPath: /.local-storage - sizeGB: 5 -- type: pserv - name: twenty_postgres - plan: starter - runtime: image - image: - url: twentycrm/twenty-postgres:latest - autoDeploy: false - disk: - name: data - mountPath: /var/lib/postgresql/data - sizeGB: 10 - envVars: - - key: POSTGRES_USER - value: postgres - - key: POSTGRES_PASSWORD - value: postgres diff --git a/eslint.config.react.mjs b/tools/eslint-rules/eslint.config.react.mjs similarity index 100% rename from eslint.config.react.mjs rename to tools/eslint-rules/eslint.config.react.mjs diff --git a/tools/eslint-rules/jest.config.mjs b/tools/eslint-rules/jest.config.mjs index 58d5fe708d..83ef39037d 100644 --- a/tools/eslint-rules/jest.config.mjs +++ b/tools/eslint-rules/jest.config.mjs @@ -1,4 +1,4 @@ - + export default { displayName: 'eslint-rules', silent: false,