The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix: fix root start script (#5032)
Thaïsd3170fc1eaa5
diff --git a/.github/workflows/ci-chromatic.yaml b/.github/workflows/ci-chromatic.yamlindex fb0408e086e..8c87999e097 100644--- a/.github/workflows/ci-chromatic.yaml+++ b/.github/workflows/ci-chromatic.yaml@@ -41,4 +41,4 @@ jobs:- name: Publish to Chromaticrun: |cd packages/twenty-front- yarn nx chromatic:ci+ npx nx chromatic:cidiff --git a/.github/workflows/ci-chrome-extension.yaml b/.github/workflows/ci-chrome-extension.yamlindex c50ecbf0cef..f5c80ca95f7 100644--- a/.github/workflows/ci-chrome-extension.yaml+++ b/.github/workflows/ci-chrome-extension.yaml@@ -69,4 +69,4 @@ jobs:key: root-node_modules-${{hashFiles('yarn.lock')}}restore-keys: root-node_modules-- name: Chrome Extension / Run build- run: yarn nx build twenty-chrome-extension+ run: npx nx build twenty-chrome-extensiondiff --git a/.github/workflows/ci-docs.yaml b/.github/workflows/ci-docs.yamlindex 27a18f5dbe7..66a57f78c27 100644--- a/.github/workflows/ci-docs.yaml+++ b/.github/workflows/ci-docs.yaml@@ -28,7 +28,7 @@ jobs:- name: Docs / Install Dependenciesrun: yarn- name: Docs / Build Documentation- run: yarn nx build twenty-docs+ run: npx nx build twenty-docsvale:name: runner / valeruns-on: ubuntu-latestdiff --git a/.github/workflows/ci-front.yaml b/.github/workflows/ci-front.yamlindex d295f182bf9..0c65867b266 100644--- a/.github/workflows/ci-front.yaml+++ b/.github/workflows/ci-front.yaml@@ -77,7 +77,7 @@ jobs:- name: Run storybook testsrun: |npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \- "STORYBOOK_SCOPE=pages npx nx run twenty-front:storybook:static" \+ "STORYBOOK_SCOPE=pages npx nx run twenty-front:storybook:static:ci" \"npx wait-on tcp:6006 && STORYBOOK_SCOPE=pages npx nx run twenty-front:storybook:test"front-modules-sb-test:needs: front-yarn-install@@ -115,7 +115,7 @@ jobs:- name: Run storybook testsrun: |npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \- "STORYBOOK_SCOPE=modules npx nx run twenty-front:storybook:static" \+ "STORYBOOK_SCOPE=modules npx nx run twenty-front:storybook:static:ci" \"npx wait-on tcp:6006 && STORYBOOK_SCOPE=modules npx nx run twenty-front:storybook:test"front-lint-tsc:needs: front-yarn-installdiff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yamlindex b32016c8a62..53f86ce00b1 100644--- a/.github/workflows/ci-server.yaml+++ b/.github/workflows/ci-server.yaml@@ -36,14 +36,14 @@ jobs:- name: Server / Install Dependenciesrun: yarn- name: Server / Run linter- run: yarn nx lint twenty-server+ run: npx nx lint twenty-server- name: Server / Run jest tests- run: yarn nx test:unit twenty-server+ run: npx nx test:unit twenty-server- name: Server / Build- run: yarn nx build twenty-server+ run: npx nx build twenty-server- name: Server / Write .envrun: |cd packages/twenty-servercp .env.example .env- name: Worker / Run- run: MESSAGE_QUEUE_TYPE=sync yarn nx worker twenty-server+ run: MESSAGE_QUEUE_TYPE=sync npx nx worker twenty-serverdiff --git a/.github/workflows/ci-utils.yaml b/.github/workflows/ci-utils.yamlindex e77c430a059..ac65a6c5173 100644--- a/.github/workflows/ci-utils.yaml+++ b/.github/workflows/ci-utils.yaml@@ -28,6 +28,6 @@ jobs:- name: Utils / Install Dependenciesrun: yarn- name: Utils / Run Danger.js- run: cd packages/twenty-utils && yarn nx danger:ci+ run: cd packages/twenty-utils && npx nx danger:cienv:DANGER_GITHUB_API_TOKEN: ${{ github.token }}diff --git a/.github/workflows/ci-website.yaml b/.github/workflows/ci-website.yamlindex 2bed055536a..f925cb71897 100644--- a/.github/workflows/ci-website.yaml+++ b/.github/workflows/ci-website.yaml@@ -26,4 +26,4 @@ jobs:- name: Website / Install Dependenciesrun: yarn- name: Website / Build Website- run: yarn nx build twenty-website+ run: npx nx build twenty-websitediff --git a/package.json b/package.jsonindex c09b8d2f50b..51629ce86a8 100644--- a/package.json+++ b/package.json@@ -329,8 +329,9 @@"typescript": "5.3.3"},"version": "0.2.1",+ "nx": {},"scripts": {- "start:prod": "cross-env FORCE_COLOR=true concurrently -n \"twenty-server,twenty-front\" -c \"bgBlue.bold,bgGreen.bold\" \"yarn nx start twenty-server\" \"yarn nx start twenty-front\""+ "start": "nx run-many -t start -p twenty-server twenty-front"},"workspaces": {"packages": [diff --git a/packages/twenty-chrome-extension/README.md b/packages/twenty-chrome-extension/README.mdindex 749c477ef07..64e92e4130b 100644--- a/packages/twenty-chrome-extension/README.md+++ b/packages/twenty-chrome-extension/README.md@@ -22,7 +22,7 @@ VITE_FRONT_BASE_URL=http://localhost:3001- STEP 4: Now, execute the following command in the root directory to start up the development server on Port 3002. This will create a `dist` folder in `twenty-chrome-extension`.```-yarn nx start twenty-chrome-extension+npx nx start twenty-chrome-extension```- STEP 5: Open Google Chrome and head to the extensions page by typing `chrome://extensions` in the address bar.@@ -57,4 +57,4 @@ yarn nx start twenty-chrome-extension<img src="../twenty-chrome-extension/public/readme-images/05-img-five.png" width="600" /></p>-To install the extension in production mode without hmr (hot module reload), replace the command in STEP FOUR with `yarn nx build twenty-chrome-extension`. You may or may not want to execute STEP THREE based on your requirements.\ No newline at end of file+To install the extension in production mode without hmr (hot module reload), replace the command in STEP FOUR with `npx nx build twenty-chrome-extension`. You may or may not want to execute STEP THREE based on your requirements.\ No newline at end of filediff --git a/packages/twenty-chrome-extension/package.json b/packages/twenty-chrome-extension/package.jsonindex 237c74a514a..9cec9e87be7 100644--- a/packages/twenty-chrome-extension/package.json+++ b/packages/twenty-chrome-extension/package.json@@ -6,13 +6,13 @@"type": "module","scripts": {"nx": "NX_DEFAULT_PROJECT=twenty-chrome-extension node ../../node_modules/nx/bin/nx.js",- "clean": "rimraf ./dist",- "start": "yarn clean && vite",- "build": "yarn clean && tsc && vite build",- "lint": "eslint . --report-unused-disable-directives --max-warnings 0 --config .eslintrc.cjs",- "graphql:generate": "graphql-codegen",- "fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",- "fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\""+ "clean": "npx rimraf ./dist",+ "start": "yarn clean && npx vite",+ "build": "yarn clean && npx tsc && npx vite build",+ "lint": "npx eslint . --report-unused-disable-directives --max-warnings 0 --config .eslintrc.cjs",+ "graphql:generate": "npx graphql-codegen",+ "fmt": "npx prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",+ "fmt:fix": "npx prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\""},"dependencies": {"@types/chrome": "^0.0.256"diff --git a/packages/twenty-docker/twenty-docs/Dockerfile b/packages/twenty-docker/twenty-docs/Dockerfileindex 9e97d096755..d169292a9a6 100644--- a/packages/twenty-docker/twenty-docs/Dockerfile+++ b/packages/twenty-docker/twenty-docs/Dockerfile@@ -14,7 +14,7 @@ COPY ./packages/twenty-ui /app/packages/twenty-uiRUN yarnCOPY ./packages/twenty-docs /app/packages/twenty-docs-RUN yarn nx build twenty-docs+RUN npx nx build twenty-docsCMD ["tail", "-f", "/dev/null"]diff --git a/packages/twenty-docker/twenty-website/Dockerfile b/packages/twenty-docker/twenty-website/Dockerfileindex 42d06289274..e3b7420ff76 100644--- a/packages/twenty-docker/twenty-website/Dockerfile+++ b/packages/twenty-docker/twenty-website/Dockerfile@@ -13,7 +13,7 @@ COPY ./packages/twenty-website/package.json /app/packages/twenty-website/packageRUN yarnCOPY ./packages/twenty-website /app/packages/twenty-website-RUN yarn nx build twenty-website+RUN npx nx build twenty-websiteFROM node:18.17.1-alpine as twenty-website@@ -26,4 +26,4 @@ WORKDIR /app/packages/twenty-websiteLABEL org.opencontainers.image.source=https://github.com/twentyhq/twentyLABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the website."-CMD ["/bin/sh", "-c", "yarn nx start"]\ No newline at end of file+CMD ["/bin/sh", "-c", "npx nx start"]\ No newline at end of filediff --git a/packages/twenty-docs/docs/contributor/server/server.mdx b/packages/twenty-docs/docs/contributor/server/server.mdxindex 73292f3bbdc..4082d33ac41 100644--- a/packages/twenty-docs/docs/contributor/server/server.mdx+++ b/packages/twenty-docs/docs/contributor/server/server.mdx@@ -14,30 +14,30 @@ import DocCardList from '@theme/DocCardList';## Useful commandsThese commands should be exectued from packages/twenty-server folder.-From any other folder you can run `yarn nx <command>` twenty-server.+From any other folder you can run `npx nx <command>` twenty-server.### First time setup```-yarn nx database:reset # setup the database with dev seeds+npx nx database:reset # setup the database with dev seeds```### Starting the app```-yarn nx start+npx nx start```### Lint```-yarn nx lint+npx nx lint```### Test```-yarn nx test:unit+npx nx test:unit```### Resetting the database@@ -45,7 +45,7 @@ yarn nx test:unitIf you want to reset the database, you can run the following command:```bash-yarn nx database:reset+npx nx database:reset```:::warningdiff --git a/packages/twenty-docs/docs/start/local-setup/troubleshooting.mdx b/packages/twenty-docs/docs/start/local-setup/troubleshooting.mdxindex 8863fd6823f..23fc30f3731 100644--- a/packages/twenty-docs/docs/start/local-setup/troubleshooting.mdx+++ b/packages/twenty-docs/docs/start/local-setup/troubleshooting.mdx@@ -24,11 +24,11 @@ If you don't, make sure you don't have more than one postgres instance running o## Cannot find module 'twenty-emails' or its corresponding type declarations.-You have to build the package `twenty-emails` before running the initialization of the database with `yarn nx run twenty-emails:build`+You have to build the package `twenty-emails` before running the initialization of the database with `npx nx run twenty-emails:build`## Missing twenty-x package-Make sure to run yarn in the root directory and then run `yarn nx server:dev twenty-server`. If this still doesn't work try building the missing package manually.+Make sure to run yarn in the root directory and then run `npx nx server:dev twenty-server`. If this still doesn't work try building the missing package manually.## Lint on Save not workingdiff --git a/packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx b/packages/twenty-docs/docs/start/local-setup/yarn-setup.mdxindex fb793f7844f..defdb3d3140 100644--- a/packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx+++ b/packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx@@ -182,7 +182,7 @@ yarnSetup your database with the following command:```bash-yarn nx database:reset twenty-server+npx nx database:reset twenty-server```Start the server and the frontend:diff --git a/packages/twenty-docs/docs/start/self-hosting/docker-compose.mdx b/packages/twenty-docs/docs/start/self-hosting/docker-compose.mdxindex 660ed026fac..46f1d24584a 100644--- a/packages/twenty-docs/docs/start/self-hosting/docker-compose.mdx+++ b/packages/twenty-docs/docs/start/self-hosting/docker-compose.mdx@@ -44,7 +44,7 @@ FILE_TOKEN_SECRET=replace_me_with_a_random_string_refreshIf you encounter errors, (not able to log into the application after inputting an email) after the inital setup, try running the following commands and see if that solves your issue.```docker exec -it twenty-server-1 yarn-docker exec -it twenty-server-1 yarn nx database:reset+docker exec -it twenty-server-1 npx nx database:reset```### Cannot connect to server, running behind a reverse proxydiff --git a/packages/twenty-docs/package.json b/packages/twenty-docs/package.jsonindex 0389b157df0..d5950de53bf 100644--- a/packages/twenty-docs/package.json+++ b/packages/twenty-docs/package.json@@ -4,16 +4,16 @@"private": true,"scripts": {"nx": "NX_DEFAULT_PROJECT=twenty-docs node ../../node_modules/nx/bin/nx.js",- "docusaurus": "docusaurus",- "start": "docusaurus start --host 0.0.0.0 --port 5001",- "build": "docusaurus build",- "swizzle": "docusaurus swizzle",- "deploy": "docusaurus deploy",- "clear": "docusaurus clear",- "serve": "docusaurus serve",- "write-translations": "docusaurus write-translations",- "write-heading-ids": "docusaurus write-heading-ids",- "typecheck": "tsc"+ "docusaurus": "npx docusaurus",+ "start": "npx docusaurus start --host 0.0.0.0 --port 5001",+ "build": "npx docusaurus build",+ "swizzle": "npx docusaurus swizzle",+ "deploy": "npx docusaurus deploy",+ "clear": "npx docusaurus clear",+ "serve": "npx docusaurus serve",+ "write-translations": "npx docusaurus write-translations",+ "write-heading-ids": "npx docusaurus write-heading-ids",+ "typecheck": "npx tsc"},"overrides": {"trim": "^0.0.3",diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.jsonindex 79e8e54edf1..a329e339ea2 100644--- a/packages/twenty-front/package.json+++ b/packages/twenty-front/package.json@@ -7,7 +7,6 @@"build": "npx vite build && sh ./scripts/inject-runtime-env.sh","build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=3000 npx nx build","start:prod": "NODE_ENV=production npx vite --host",- "storybook:build": "npx storybook build","tsup": "npx tsup"},"engines": {diff --git a/packages/twenty-front/project.json b/packages/twenty-front/project.jsonindex b0423cfe98c..06f26ee0e11 100644--- a/packages/twenty-front/project.json+++ b/packages/twenty-front/project.json@@ -29,10 +29,10 @@"options": {"cwd": "{projectRoot}","command": "tsc -b tsconfig.json",- "incremental": true+ "args": ["--incremental"]},"configurations": {- "ci": { "incremental": false },+ "ci": { "args": [] },"watch": { "watch": true }}},@@ -91,6 +91,14 @@"watch": { "watch": true }}},+ "storybook:build": {+ "executor": "@nx/storybook:build",+ "outputs": ["{options.outputDir}"],+ "options": {+ "outputDir": "{projectRoot}/storybook-static",+ "configDir": "{projectRoot}/.storybook"+ }+ },"storybook:dev": {"executor": "@nx/storybook:storybook","options": {@@ -102,8 +110,8 @@"executor": "@nx/web:file-server","options": {"buildTarget": "twenty-front:storybook:build",- "staticFilePath": "{projectRoot}/storybook-static","port": 6006,+ "staticFilePath": "{projectRoot}/storybook-static","watch": false}},diff --git a/packages/twenty-front/src/emotion.d.ts b/packages/twenty-front/src/emotion.d.tsnew file mode 100644index 00000000000..90e71e26b63--- /dev/null+++ b/packages/twenty-front/src/emotion.d.ts@@ -0,0 +1,5 @@+import { ThemeType } from 'twenty-ui';++declare module '@emotion/react' {+ export interface Theme extends ThemeType {}+}diff --git a/packages/twenty-front/src/index.tsx b/packages/twenty-front/src/index.tsxindex 1f17ce21fe7..83e4c55e562 100644--- a/packages/twenty-front/src/index.tsx+++ b/packages/twenty-front/src/index.tsx@@ -21,7 +21,6 @@ import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogMaimport { SnackBarProvider } from '@/ui/feedback/snack-bar-manager/components/SnackBarProvider';import { SnackBarProviderScope } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarProviderScope';import { AppThemeProvider } from '@/ui/theme/components/AppThemeProvider';-import { ThemeType } from '@/ui/theme/constants/ThemeLight';import { UserProvider } from '@/users/components/UserProvider';import { UserProviderEffect } from '@/users/components/UserProviderEffect';import { PageChangeEffect } from '~/effect-components/PageChangeEffect';@@ -82,7 +81,3 @@ root.render(</AppErrorBoundary></RecoilRoot>,);--declare module '@emotion/react' {- export interface Theme extends ThemeType {}-}diff --git a/packages/twenty-front/tsconfig.app.json b/packages/twenty-front/tsconfig.app.jsonindex d5abf3c8781..7a17e21fdea 100644--- a/packages/twenty-front/tsconfig.app.json+++ b/packages/twenty-front/tsconfig.app.json@@ -1,7 +1,6 @@{"extends": "./tsconfig.json","compilerOptions": {- "outDir": "../../dist/out-tsc","types": ["node"]},"exclude": [@@ -13,5 +12,11 @@"**/*.test.ts","**/*.test.tsx"],- "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]+ "include": [+ "src/**/*.js",+ "src/**/*.jsx",+ "src/**/*.d.ts",+ "src/**/*.ts",+ "src/**/*.tsx"+ ]}diff --git a/packages/twenty-front/tsconfig.json b/packages/twenty-front/tsconfig.jsonindex 4bde090be09..05a1f410855 100644--- a/packages/twenty-front/tsconfig.json+++ b/packages/twenty-front/tsconfig.json@@ -19,6 +19,7 @@"noUnusedParameters": false,"noFallthroughCasesInSwitch": true,"forceConsistentCasingInFileNames": true,+ "outDir": "../../dist/out-tsc","paths": {"@/*": ["packages/twenty-front/src/modules/*"],"~/*": ["packages/twenty-front/src/*"],@@ -34,6 +35,9 @@},{"path": "./tsconfig.spec.json"+ },+ {+ "path": "./tsconfig.storybook.json"}],"extends": "../../tsconfig.base.json"diff --git a/packages/twenty-front/tsconfig.spec.json b/packages/twenty-front/tsconfig.spec.jsonindex d7432bfc9eb..7b115f8bbc8 100644--- a/packages/twenty-front/tsconfig.spec.json+++ b/packages/twenty-front/tsconfig.spec.json@@ -1,19 +1,15 @@{"extends": "./tsconfig.json","compilerOptions": {- "outDir": "../../dist/out-tsc","types": ["jest", "node"]},"include": [- ".storybook/**/*","**/__mocks__/**/*","jest.config.ts","setupTests.ts","src/**/*.d.ts","src/**/*.spec.ts","src/**/*.spec.tsx",- "src/**/*.stories.ts",- "src/**/*.stories.tsx","src/**/*.test.ts","src/**/*.test.tsx","tsup.config.ts",diff --git a/packages/twenty-front/tsconfig.storybook.json b/packages/twenty-front/tsconfig.storybook.jsonnew file mode 100644index 00000000000..af30860ffd4--- /dev/null+++ b/packages/twenty-front/tsconfig.storybook.json@@ -0,0 +1,14 @@+{+ "extends": "./tsconfig.json",+ "compilerOptions": {+ "emitDecoratorMetadata": true+ },+ "include": [+ ".storybook/*.ts",+ ".storybook/*.tsx",+ "src/**/*.d.ts",+ "src/**/*.stories.mdx",+ "src/**/*.stories.ts",+ "src/**/*.stories.tsx"+ ]+}diff --git a/packages/twenty-server/scripts/run-integration.sh b/packages/twenty-server/scripts/run-integration.shindex 8f48e2178f1..0da23f2dee6 100755--- a/packages/twenty-server/scripts/run-integration.sh+++ b/packages/twenty-server/scripts/run-integration.sh@@ -4,5 +4,5 @@DIR="$(cd "$(dirname "$0")" && pwd)"source $DIR/set-env-test.sh-yarn nx database:reset-yarn nx jest --config ./test/jest-e2e.json+npx nx database:reset+npx nx jest --config ./test/jest-e2e.jsondiff --git a/packages/twenty-website/package.json b/packages/twenty-website/package.jsonindex 01a36805651..a28bbba1cdd 100644--- a/packages/twenty-website/package.json+++ b/packages/twenty-website/package.json@@ -4,12 +4,12 @@"private": true,"scripts": {"nx": "NX_DEFAULT_PROJECT=twenty-website node ../../node_modules/nx/bin/nx.js",- "dev": "next dev",- "build": "next build",- "start": "next start",- "lint": "next lint",- "database:generate:pg": "drizzle-kit generate:pg --config=src/database/postgres/drizzle-posgres.config.ts",- "database:generate:sqlite": "drizzle-kit generate:sqlite --config=src/database/sqlite/drizzle-sqlite.config.ts"+ "dev": "npx next dev",+ "build": "npx next build",+ "start": "npx next start",+ "lint": "npx next lint",+ "database:generate:pg": "npx drizzle-kit generate:pg --config=src/database/postgres/drizzle-posgres.config.ts",+ "database:generate:sqlite": "npx drizzle-kit generate:sqlite --config=src/database/sqlite/drizzle-sqlite.config.ts"},"dependencies": {"postgres": "^3.4.3"diff --git a/project.json b/project.jsondeleted file mode 100644index 294a108043c..00000000000--- a/project.json+++ /dev/null@@ -1,12 +0,0 @@-{- "name": "twenty",- "$schema": "node_modules/nx/schemas/project-schema.json",- "targets": {- "start": {- "executor": "nx:run-script",- "options": {- "command": "nx run-many -t start -p twenty-server twenty-front"- }- }- }-}