Skip to content

Commit

Permalink
fix: use npx nx instead of yarn nx
Browse files Browse the repository at this point in the history
  • Loading branch information
thaisguigon committed Apr 18, 2024
1 parent 3b3a33f commit f12ef77
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-chromatic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
- name: Publish to Chromatic
run: |
cd packages/twenty-front
yarn nx chromatic:ci
npx nx chromatic:ci
2 changes: 1 addition & 1 deletion .github/workflows/ci-chrome-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-extension
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Docs / Install Dependencies
run: yarn
- name: Docs / Build Documentation
run: yarn nx build twenty-docs
run: npx nx build twenty-docs
vale:
name: runner / vale
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
- name: Server / Install Dependencies
run: 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 .env
run: |
cd packages/twenty-server
cp .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-server
2 changes: 1 addition & 1 deletion .github/workflows/ci-utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
- name: Utils / Install Dependencies
run: yarn
- name: Utils / Run Danger.js
run: cd packages/twenty-utils && yarn nx danger:ci
run: cd packages/twenty-utils && npx nx danger:ci
env:
DANGER_GITHUB_API_TOKEN: ${{ github.token }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Website / Install Dependencies
run: yarn
- name: Website / Build Website
run: yarn nx build twenty-website
run: npx nx build twenty-website
4 changes: 2 additions & 2 deletions packages/twenty-chrome-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
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.
14 changes: 7 additions & 7 deletions packages/twenty-chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-docker/twenty-docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY ./packages/twenty-ui /app/packages/twenty-ui
RUN yarn

COPY ./packages/twenty-docs /app/packages/twenty-docs
RUN yarn nx build twenty-docs
RUN npx nx build twenty-docs

CMD ["tail", "-f", "/dev/null"]

Expand Down
4 changes: 2 additions & 2 deletions packages/twenty-docker/twenty-website/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package
RUN yarn

COPY ./packages/twenty-website /app/packages/twenty-website
RUN yarn nx build twenty-website
RUN npx nx build twenty-website

FROM node:18.17.1-alpine as twenty-website

Expand All @@ -26,4 +26,4 @@ WORKDIR /app/packages/twenty-website
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the website."

CMD ["/bin/sh", "-c", "yarn nx start"]
CMD ["/bin/sh", "-c", "npx nx start"]
12 changes: 6 additions & 6 deletions packages/twenty-docs/docs/contributor/server/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@ import DocCardList from '@theme/DocCardList';
## Useful commands

These 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

If you want to reset the database, you can run the following command:

```bash
yarn nx database:reset
npx nx database:reset
```

:::warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 working

Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ yarn

Setup 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ FILE_TOKEN_SECRET=replace_me_with_a_random_string_refresh
If 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 proxy
Expand Down
20 changes: 10 additions & 10 deletions packages/twenty-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"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",
"storybook:build": "NODE_OPTIONS=--max-old-space-size=4096 npx storybook build",
"tsup": "npx tsup"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/twenty-server/scripts/run-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.json
12 changes: 6 additions & 6 deletions packages/twenty-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f12ef77

Please sign in to comment.