Skip to content

Commit

Permalink
Merge branch 'main' into chore/9623-rename-unintuitive-fn-names-in-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet committed Jan 24, 2025
2 parents 3a8009a + 570b2e3 commit 91920fc
Show file tree
Hide file tree
Showing 991 changed files with 24,535 additions and 8,946 deletions.
7 changes: 7 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
- Types in types/
- PascalCase components, camelCase others

## Translation
- Use @lingui/react/macro
- Use <Trans> within components
- Use t`string` elsewhere (from useLingui hook)
- Don't translate metadata (field names, object names, etc)
- Don't translate mocks

## Code Style
- Early returns
- No nested ternaries
Expand Down
14 changes: 9 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module.exports = {
root: true,
extends: [
'plugin:prettier/recommended',
'plugin:lingui/recommended',
extends: ['plugin:prettier/recommended', 'plugin:lingui/recommended'],
plugins: [
'@nx',
'prefer-arrow',
'import',
'unused-imports',
'unicorn',
'lingui',
],
plugins: ['@nx', 'prefer-arrow', 'import', 'unused-imports', 'unicorn', 'lingui'],
rules: {
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }],
Expand Down Expand Up @@ -141,4 +145,4 @@ module.exports = {
parser: 'jsonc-eslint-parser',
},
],
};
};
10 changes: 4 additions & 6 deletions .github/workflows/ci-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ jobs:
- name: Build twenty-shared
run: npx nx build twenty-shared

- name: Install Playwright Browsers
run: npx nx setup twenty-e2e-testing

- name: Setup environment files
run: |
cp packages/twenty-e2e-testing/.env.example packages/twenty-e2e-testing/.env
cp packages/twenty-front/.env.example packages/twenty-front/.env
cp packages/twenty-e2e-testing/.env.example packages/twenty-e2e-testing/.env
npx nx reset:env twenty-server
- name: Build frontend
Expand All @@ -87,7 +88,7 @@ jobs:
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";'
npx nx run twenty-server:database:reset
- name: Start server
run: |
npx nx start twenty-server &
Expand All @@ -105,9 +106,6 @@ jobs:
npx nx run twenty-server:worker:ci &
echo "Worker started"
- name: Install Playwright Browsers
run: npx nx setup twenty-e2e-testing

- name: Run Playwright tests
run: npx nx test twenty-e2e-testing

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
PATH_TO_COVERAGE: packages/twenty-front/coverage/storybook
strategy:
matrix:
storybook_scope: [modules, pages]
storybook_scope: [modules, pages, performance]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -119,7 +119,7 @@ jobs:
mkdir -p ${{ env.PATH_TO_COVERAGE }}
npx nyc merge coverage-artifacts ${{ env.PATH_TO_COVERAGE }}/coverage-storybook.json
- name: Checking coverage
run: npx nx storybook:coverage twenty-front --checkCoverage=true
run: npx nx storybook:coverage twenty-front --checkCoverage=true --configuration=${{ matrix.storybook_scope }}
front-chromatic-deployment:
timeout-minutes: 30
if: contains(github.event.pull_request.labels.*.name, 'run-chromatic') || github.event_name == 'push'
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/ci-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ jobs:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/workflows/actions/yarn-install
- name: Build twenty-shared
run: npx nx build twenty-shared
- name: Restore server setup
id: restore-server-setup-cache
uses: ./.github/workflows/actions/restore-cache
with:
key: ${{ env.SERVER_SETUP_CACHE_KEY }}
- name: Build twenty-shared
run: npx nx build twenty-shared
- name: Server / Run lint & typecheck
uses: ./.github/workflows/actions/nx-affected
with:
Expand Down Expand Up @@ -97,6 +97,19 @@ jobs:
exit 1
fi
- name: GraphQL / Check for Pending Generation
if: steps.changed-files.outputs.any_changed == 'true'
run: |
GRAPHQL_GENERATE_OUTPUT=$(npx nx run twenty-front:graphql:generate || true)
GRAPHQL_METADATA_OUTPUT=$(npx nx run twenty-front:graphql:generate --configuration=metadata || true)
if [[ $GRAPHQL_GENERATE_OUTPUT == *"No changes detected"* && $GRAPHQL_METADATA_OUTPUT == *"No changes detected"* ]]; then
echo "GraphQL generation check passed."
else
echo "::error::Unexpected GraphQL changes detected. Please run the required commands and commit the changes."
echo "$GRAPHQL_GENERATE_OUTPUT"
echo "$GRAPHQL_METADATA_OUTPUT"
exit 1
fi
- name: Save server setup
uses: ./.github/workflows/actions/save-cache
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "Generating secrets..."
echo "# === Randomly generated secrets ===" >>.env
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
echo "PGPASSWORD_SUPERUSER=$(openssl rand -base64 32)" >>.env
echo "PGPASSWORD_SUPERUSER=$(openssl rand -hex 16)" >>.env
echo "Docker compose up..."
docker compose up -d || {
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Below are a few features we have implemented to date:
- [NestJS](https://nestjs.com/), with [BullMQ](https://bullmq.io/), [PostgreSQL](https://www.postgresql.org/), [Redis](https://redis.io/)
- [React](https://reactjs.org/), with [Recoil](https://recoiljs.org/) and [Emotion](https://emotion.sh/)
- [Greptile](https://greptile.com) for code reviews.
- [TranslationIO](https://translation.io/) for translations.


# Join the Community
Expand Down
4 changes: 2 additions & 2 deletions packages/twenty-chrome-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
"@/*": ["packages/twenty-chrome-extension/src/options/modules/*"],
"~/*": ["packages/twenty-chrome-extension/src/*"]
"@/*": ["./src/options/modules/*"],
"~/*": ["./src/*"]
},

/* Bundler mode */
Expand Down
5 changes: 3 additions & 2 deletions packages/twenty-docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
TAG=latest

#PGUSER_SUPERUSER=postgres
#PGPASSWORD_SUPERUSER=replace_me_with_a_strong_password
#PG_DATABASE_USER=postgres
#PG_DATABASE_PASSWORD=replace_me_with_a_strong_password_without_special_characters
#PG_DATABASE_HOST=db
#PG_DATABASE_PORT=5432
#REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000
Expand Down
10 changes: 5 additions & 5 deletions packages/twenty-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- "3000:3000"
environment:
PORT: 3000
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-db}:${PG_DATABASE_PORT:-5432}/default
SERVER_URL: ${SERVER_URL}
REDIS_URL: ${REDIS_URL:-redis://redis:6379}

Expand All @@ -47,7 +47,7 @@ services:
image: twentycrm/twenty:${TAG:-latest}
command: ["yarn", "worker:prod"]
environment:
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-db}:${PG_DATABASE_PORT:-5432}/default
SERVER_URL: ${SERVER_URL}
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
DISABLE_DB_MIGRATIONS: "true" # it already runs on the server
Expand All @@ -70,12 +70,12 @@ services:
volumes:
- db-data:/home/postgres/pgdata
environment:
PGUSER_SUPERUSER: ${PGUSER_SUPERUSER:-postgres}
PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-postgres}
PGUSER_SUPERUSER: ${PG_DATABASE_USER:-postgres}
PGPASSWORD_SUPERUSER: ${PG_DATABASE_PASSWORD:-postgres}
ALLOW_NOSSL: "true"
SPILO_PROVIDER: "local"
healthcheck:
test: pg_isready -U ${PGUSER_SUPERUSER:-postgres} -h localhost -d postgres
test: pg_isready -U ${PG_DATABASE_USER:-postgres} -h localhost -d postgres
interval: 5s
timeout: 5s
retries: 10
Expand Down
9 changes: 4 additions & 5 deletions packages/twenty-docker/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ else
fi

# Generate random strings for secrets
echo "# === Randomly generated secret ===" >>.env
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
echo "# === Randomly generated secret ===" >> .env
echo "APP_SECRET=$(openssl rand -base64 32)" >> .env

# Issue with Postgres spilo?
#echo "" >>.env
#echo "PGPASSWORD_SUPERUSER=$(openssl rand -hex 16)" >>.env
echo "" >> .env
echo "PG_DATABASE_PASSWORD=$(openssl rand -hex 16)" >> .env

echo -e "\t• .env configuration completed"

Expand Down
1 change: 1 addition & 0 deletions packages/twenty-e2e-testing/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Note that provide always without trailing forward slash to have expected behaviour
FRONTEND_BASE_URL=http://localhost:3001
BACKEND_BASE_URL=http://localhost:3000
DEFAULT_LOGIN=[email protected]
DEFAULT_PASSWORD=Applecar2025
WEBSITE_URL=https://twenty.com
Expand Down
33 changes: 0 additions & 33 deletions packages/twenty-e2e-testing/config/customreporter.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/twenty-e2e-testing/drivers/env_variables.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/twenty-e2e-testing/drivers/shell_driver.ts

This file was deleted.

Loading

0 comments on commit 91920fc

Please sign in to comment.