Update scripts and documentation to use nx and new monorepo architecture (#2912)
* Update scripts and documentation to use nx and new monorepo architecture * Start fixing docker * Migrate eslint plugin and postgres setup * Fix docker * Fix patches * Fix * fix: wip try to fix the patches * Apply patches --------- Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
33
packages/twenty-docker/Makefile
Normal file
33
packages/twenty-docker/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
dev-build:
|
||||
@docker compose -f dev/docker-compose.yml down
|
||||
rm -rf ../twenty-front/node_modules
|
||||
rm -rf ../twenty-server/node_modules
|
||||
rm -rf ../twenty-docs/node_modules
|
||||
@docker volume rm twenty_node_modules_front > /dev/null 2>&1 || true
|
||||
@docker volume rm twenty_node_modules_server > /dev/null 2>&1 || true
|
||||
@docker volume rm twenty_node_modules_docs > /dev/null 2>&1 || true
|
||||
@docker compose -f dev/docker-compose.yml build
|
||||
|
||||
dev-up:
|
||||
@docker compose -f dev/docker-compose.yml up -d
|
||||
|
||||
dev-down:
|
||||
@docker compose -f dev/docker-compose.yml down -v
|
||||
|
||||
dev-sh:
|
||||
@docker compose -f dev/docker-compose.yml exec twenty-dev sh
|
||||
|
||||
dev-front-start:
|
||||
@docker compose -f dev/docker-compose.yml exec twenty-dev sh -c "cd /app/packages/twenty-front && yarn run start"
|
||||
|
||||
dev-server-start:
|
||||
@docker compose -f dev/docker-compose.yml exec twenty-dev sh -c "yarn nx run twenty-server:start:dev"
|
||||
|
||||
dev-server-database-init:
|
||||
@docker compose -f dev/docker-compose.yml exec twenty-dev sh -c "yarn nx run twenty-server:database:init"
|
||||
|
||||
dev-build-postgres:
|
||||
@docker stop twenty_postgres || true
|
||||
@docker rm twenty_postgres || true
|
||||
@docker volume rm twenty_db_data || true
|
||||
@docker compose up --build postgres -d
|
||||
@ -1,69 +0,0 @@
|
||||
build:
|
||||
@docker compose down
|
||||
rm -rf ../../front/node_modules
|
||||
rm -rf ../../server/node_modules
|
||||
rm -rf ../../docs/node_modules
|
||||
@docker volume rm twenty_node_modules_front > /dev/null 2>&1 || true
|
||||
@docker volume rm twenty_node_modules_server > /dev/null 2>&1 || true
|
||||
@docker volume rm twenty_node_modules_docs > /dev/null 2>&1 || true
|
||||
@docker compose build
|
||||
|
||||
provision-postgres-docker:
|
||||
@docker stop twenty_postgres || true
|
||||
@docker rm twenty_postgres || true
|
||||
@docker volume rm twenty_db_data || true
|
||||
@docker compose up --build postgres -d
|
||||
|
||||
provision-postgres-macos-arm:
|
||||
sh ./scripts/setup-postgres-macos-arm.sh
|
||||
|
||||
provision-postgres-macos-intel:
|
||||
sh ./scripts/setup-postgres-macos-intel.sh
|
||||
|
||||
provision-postgres-linux:
|
||||
sh ./scripts/setup-postgres-linux.sh
|
||||
|
||||
up:
|
||||
@docker compose up -d
|
||||
|
||||
down:
|
||||
@docker compose down -v
|
||||
|
||||
sh:
|
||||
@docker compose exec twenty-dev sh
|
||||
|
||||
front-start:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn start"
|
||||
|
||||
front-lint:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn lint"
|
||||
|
||||
front-test:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn test"
|
||||
|
||||
front-coverage:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn coverage"
|
||||
|
||||
front-graphql-generate:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn graphql:generate"
|
||||
|
||||
front-storybook:
|
||||
@docker compose exec twenty-dev sh -c "cd ./front && yarn storybook:dev"
|
||||
|
||||
server-start:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn start:dev"
|
||||
|
||||
server-database-init:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn database:init"
|
||||
|
||||
server-database-setup:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn database:setup"
|
||||
|
||||
server-database-migrate:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn database:migrate"
|
||||
|
||||
server-database-seed:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn database:seed"
|
||||
|
||||
server-database-reset:
|
||||
@docker compose exec twenty-dev sh -c "cd /app/server && yarn database:reset"
|
||||
@ -2,27 +2,33 @@ version: "3.9"
|
||||
services:
|
||||
twenty-dev:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: ./infra/dev/twenty-dev/Dockerfile
|
||||
context: ../../..
|
||||
dockerfile: ./packages/twenty-docker/dev/twenty-dev/Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001"
|
||||
- "6006:6006"
|
||||
volumes:
|
||||
- ../..:/app
|
||||
- /app/front/node_modules
|
||||
- /app/server/node_modules
|
||||
- ../../../packages/twenty-front:/app/packages/twenty-front
|
||||
- ../../../packages/twenty-server:/app/packages/twenty-server
|
||||
- ../../../packages/twenty-eslint-plugin:/app/packages/twenty-eslint-plugin
|
||||
- twenty_dev_node_modules_root:/app/node_modules
|
||||
- twenty_dev_node_modules_yarn:/app/.yarn
|
||||
- twenty_dev_node_modules_front:/app/packages/twenty-front/node_modules
|
||||
- twenty_dev_node_modules_server:/app/packages/twenty-server/node_modules
|
||||
depends_on:
|
||||
- postgres
|
||||
twenty-docs:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: ./infra/dev/twenty-docs/Dockerfile
|
||||
context: ../../..
|
||||
dockerfile: ./packages/twenty-docker/dev/twenty-docs/Dockerfile
|
||||
ports:
|
||||
- "5001:5001"
|
||||
volumes:
|
||||
- ../../docs:/app/docs
|
||||
- twenty_node_modules_docs:/app/docs/node_modules
|
||||
- ../../../packages/twenty-docs:/app/packages/twenty-docs
|
||||
- twenty_docs_node_modules_root:/app/node_modules
|
||||
- twenty_docs_node_modules_yarn:/app/.yarn
|
||||
- twenty_docs_node_modules_docs:/app/packages/twenty-docs/node_modules
|
||||
postgres:
|
||||
container_name: twenty_postgres
|
||||
build: ./postgres
|
||||
@ -37,6 +43,10 @@ services:
|
||||
volumes:
|
||||
twenty_db_data:
|
||||
name: twenty_db_data
|
||||
twenty_node_modules_front:
|
||||
twenty_node_modules_server:
|
||||
twenty_node_modules_docs:
|
||||
twenty_dev_node_modules_root:
|
||||
twenty_dev_node_modules_yarn:
|
||||
twenty_dev_node_modules_front:
|
||||
twenty_dev_node_modules_server:
|
||||
twenty_docs_node_modules_root:
|
||||
twenty_docs_node_modules_yarn:
|
||||
twenty_docs_node_modules_docs:
|
||||
|
||||
@ -1,21 +1,17 @@
|
||||
FROM node:18.16-bullseye as twenty-dev
|
||||
|
||||
COPY /../../packages /app/packages
|
||||
WORKDIR /app
|
||||
COPY ../../../../package.json .
|
||||
COPY ../../../../yarn.lock .
|
||||
COPY ../../../../.yarnrc.yml .
|
||||
COPY ../../../packages/twenty-front/package.json /app/packages/twenty-front/package.json
|
||||
COPY ../../../packages/twenty-server/package.json /app/packages/twenty-server/package.json
|
||||
COPY ../../../packages/twenty-eslint-plugin/package.json /app/packages/twenty-eslint-plugin/package.json
|
||||
|
||||
WORKDIR /app/front
|
||||
RUN corepack enable
|
||||
RUN yarn set version 4.0.2
|
||||
RUN yarn
|
||||
|
||||
COPY ../../front/package.json .
|
||||
COPY ../../front/yarn.lock .
|
||||
RUN yarn install
|
||||
RUN npx playwright install-deps
|
||||
|
||||
WORKDIR /app/server
|
||||
|
||||
COPY ../../server/package.json .
|
||||
COPY ../../server/yarn.lock .
|
||||
COPY ../../server/patches ./patches
|
||||
RUN yarn install
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
FROM node:18.16-bullseye as docs
|
||||
FROM node:18.16-bullseye as twenty-docs
|
||||
|
||||
WORKDIR /app/docs
|
||||
WORKDIR /app
|
||||
|
||||
COPY ../../docs/package.json .
|
||||
COPY ../../docs/yarn.lock .
|
||||
COPY ../../../../package.json .
|
||||
COPY ../../../../yarn.lock .
|
||||
COPY ../../../../.yarnrc.yml .
|
||||
COPY ../../../packages/twenty-docs/package.json /app/packages/twenty-docs/package.json
|
||||
|
||||
RUN yarn set version 4.0.2
|
||||
RUN yarn
|
||||
|
||||
COPY ../../docs .
|
||||
WORKDIR /app/packages/twenty-docs
|
||||
|
||||
CMD ["yarn", "start"]
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@ -57,13 +57,13 @@ You need to set some environment variables before you can work on the project. L
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
cp ./front/.env.example ./front/.env
|
||||
cp ./server/.env.example ./server/.env
|
||||
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
|
||||
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env
|
||||
```
|
||||
|
||||
The default values should work out of the box, except for the postgres URL, which requires a small modification.
|
||||
|
||||
Open `./server/.env` and change to the following:
|
||||
Open `./packages/twenty-server/.env` and change to the following:
|
||||
|
||||
```bash
|
||||
PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default?connection_limit=1
|
||||
@ -75,14 +75,9 @@ PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default?connection_limit=
|
||||
The project includes an environment containerized with Docker and orchestrated with `docker-compose`.
|
||||
This installation method will also provision a PostgreSQL container.
|
||||
|
||||
:::info
|
||||
|
||||
The configuration for the build is in the `infra/dev` folder, but you can run `make` commands directly from the root folder.
|
||||
|
||||
:::
|
||||
|
||||
```bash
|
||||
make build
|
||||
make -C packages/twenty-docker dev-build
|
||||
```
|
||||
|
||||
## Step 4: Migrate & seed
|
||||
@ -91,12 +86,12 @@ Before running the project, you need to initialize the database by running the m
|
||||
|
||||
Start the containers:
|
||||
```bash
|
||||
make up
|
||||
make -C packages/twenty-docker dev-up
|
||||
```
|
||||
|
||||
Setup database, run migrations, and seed:
|
||||
```bash
|
||||
make server-database-init
|
||||
make -C packages/twenty-docker dev-server-database-init
|
||||
```
|
||||
|
||||
## Step 5: Start Twenty
|
||||
@ -104,11 +99,11 @@ make server-database-init
|
||||
Run the project with the following commands from the `root` folder:
|
||||
|
||||
```bash
|
||||
make server-start
|
||||
make -C packages/twenty-docker dev-server-start
|
||||
```
|
||||
|
||||
```bash
|
||||
make front-start
|
||||
make -C packages/twenty-docker dev-front-start
|
||||
```
|
||||
|
||||
You should now have:
|
||||
@ -123,12 +118,11 @@ Sign in using a seeded demo account `tim@apple.dev` (password: `Applecar2025`) t
|
||||
If you don't want to use the `make` command and work directly from the container, you can also ssh directly into the container:
|
||||
|
||||
```bash
|
||||
make sh
|
||||
make -C packages/twenty-docker dev-sh
|
||||
```
|
||||
Then run commands through yarn:
|
||||
Then run commands through yarn and nx:
|
||||
```bash
|
||||
cd server
|
||||
yarn database:init
|
||||
yarn nx run twenty-server:database:init
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -33,10 +33,11 @@ Windows users can install the project through WSL2. [This guide](/contributor/lo
|
||||
The repository has the following structure:
|
||||
```
|
||||
twenty
|
||||
└───docs // contains this documentation
|
||||
└───front // contains the frontend code for the application
|
||||
└───server // contains the backend code for the application
|
||||
└───infra // contains docker configurations for development and production deployments
|
||||
└───packages // contains this documentation
|
||||
└───twenty-front // contains the frontend code for the application
|
||||
└───twenty-server // contains the backend code for the application
|
||||
└───twenty-docker // contains docker configurations for development and production build
|
||||
└───many other packages your are invited to discover such as twenty-docs, twenty-ui, twenty-eslint-plugin, twenty-zapier...
|
||||
```
|
||||
|
||||
## IDE Setup
|
||||
|
||||
@ -23,9 +23,14 @@ In this document, you'll learn how to install the project using yarn. You should
|
||||
Before you can install and use Twenty, make sure you install the following on your computer:
|
||||
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||
- [Node v18](https://nodejs.org/en/download)
|
||||
- [yarn v1](https://classic.yarnpkg.com/lang/en/docs/install/)
|
||||
- [yarn v4](https://yarnpkg.com/getting-started/install).
|
||||
- [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md)
|
||||
|
||||
:::info Note
|
||||
Yarn is now shipped with Node.js nowadays, so you don't need to install it separately.
|
||||
You should only have to run `corepack enable` to enable Yarn if you haven't done it yet.
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="wsl" label="Windows (WSL)" >
|
||||
@ -53,7 +58,7 @@ git config --global user.email "youremail@domain.com"
|
||||
```bash
|
||||
sudo apt-get install curl
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
corepack enable
|
||||
```
|
||||
Close and reopen your terminal to start using nvm.
|
||||
|
||||
@ -94,8 +99,16 @@ git clone https://github.com/twentyhq/twenty.git
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Step 2: Place yourself at the root of the project
|
||||
|
||||
## Step 2: Set up PostgreSQL Database
|
||||
```bash
|
||||
cd twenty
|
||||
```
|
||||
|
||||
All commands in the following steps should be run from the root of the project.
|
||||
|
||||
|
||||
## Step 3: Set up PostgreSQL Database
|
||||
You need to have a PostgreSQL instance available to be able to use Twenty.
|
||||
You need to provision this database with a `twenty` user (password: `twenty`), a `default` database and a `test` database.
|
||||
|
||||
@ -105,7 +118,6 @@ You need to provision this database with a `twenty` user (password: `twenty`), a
|
||||
<br /><br />
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
make provision-postgres-linux
|
||||
```
|
||||
|
||||
@ -113,7 +125,6 @@ make provision-postgres-linux
|
||||
<br /><br />
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
make provision-postgres-docker
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
@ -125,7 +136,6 @@ You can access this using `twenty` postgres user (password: `twenty`)
|
||||
<br /><br />
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
make provision-postgres-macos-intel #for intel architecture
|
||||
make provision-postgres-macos-arm #for M1/M2/M3 architecture
|
||||
```
|
||||
@ -134,7 +144,6 @@ make provision-postgres-macos-arm #for M1/M2/M3 architecture
|
||||
<br /><br />
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
make provision-postgres-docker
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
@ -145,7 +154,6 @@ You can access this using `twenty` postgres user (password: `twenty`)
|
||||
|
||||
It's better to provision your database locally:
|
||||
```bash
|
||||
cd twenty
|
||||
make provision-postgres-linux
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
@ -160,57 +168,42 @@ Twenty requires you to set some environment variables. Locally, you should set t
|
||||
|
||||
To do so, make copies of the `.env.example` files in `/front` and `/server`:
|
||||
```bash
|
||||
cp ./front/.env.example ./front/.env
|
||||
cp ./server/.env.example ./server/.env
|
||||
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
|
||||
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env
|
||||
```
|
||||
|
||||
## Step 4: Server setup
|
||||
## Step 4: Installing dependencies
|
||||
|
||||
:::info
|
||||
|
||||
Use `nvm` to install the correct `node` version. The `server/.nvmrc` ensures all contributors use the same version.
|
||||
Use `nvm` to install the correct `node` version. The `.nvmrc` ensures all contributors use the same version.
|
||||
|
||||
:::
|
||||
|
||||
To build Twenty server and seed some data into your database, run the following commands:
|
||||
```bash
|
||||
cd server
|
||||
nvm install #recommended
|
||||
nvm use #recommended
|
||||
corepack enable #to enable yarn if you haven't done it yet
|
||||
yarn set version stable #to set the yarn version to yarn version 4
|
||||
|
||||
yarn
|
||||
yarn database:init
|
||||
yarn start:dev
|
||||
```
|
||||
|
||||
## Step 5: Running the project
|
||||
|
||||
Setup your database with the following command:
|
||||
```bash
|
||||
yarn nx run twenty-server:database:init
|
||||
```
|
||||
|
||||
Start the server and the frontend:
|
||||
```bash
|
||||
yarn nx run twenty-server:database:init
|
||||
yarn nx run twenty-server:start:dev
|
||||
yarn nx run twenty-front:dev
|
||||
```
|
||||
|
||||
Twenty's server will be up and running at [http://localhost:3000/graphql](http://localhost:3000/graphql).
|
||||
|
||||
## Step 5: Frontend setup
|
||||
|
||||
:::info
|
||||
|
||||
For the frontend setup, too, it's better to use `nvm` to install the right node version.
|
||||
|
||||
:::
|
||||
|
||||
To set up the frontend, run the following commands in another terminal:
|
||||
|
||||
```bash
|
||||
cd front
|
||||
nvm install #recommended
|
||||
nvm use #recommended
|
||||
yarn
|
||||
yarn start
|
||||
```
|
||||
|
||||
Twenty's frontend will be running at [http://localhost:3001](http://localhost:3001). Just login using the seeded demo account: `tim@apple.dev` to start using Twenty.
|
||||
|
||||
# Troubleshouting
|
||||
|
||||
## Error: Failed to execute init.sql script.
|
||||
|
||||
```bash
|
||||
cp: ./infra/dev/postgres/init.sql: No such file or directory
|
||||
psql: error: /tmp/init.sql: No such file or directory
|
||||
```
|
||||
|
||||
If you get this error it means you are not launching the local database init script from the repo's root folder. Make sure you're in `twenty/` and not in `twenty/infra/dev/scripts`.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "eslint-plugin-twenty",
|
||||
"name": "twenty-eslint-plugin",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
@ -1 +0,0 @@
|
||||
18.16.0
|
||||
@ -4,12 +4,12 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev:clean": "yarn dev --force",
|
||||
"start": "vite --host",
|
||||
"start:clean": "yarn start --force",
|
||||
"build": "tsc && vite build && yarn build:inject-runtime-env",
|
||||
"build:inject-runtime-env": "./scripts/inject-runtime-env.sh",
|
||||
"preview": "vite preview",
|
||||
"eslint-plugin:setup": "cd ../packages/eslint-plugin-twenty/ && yarn && yarn build && cd ../../front/ && yarn upgrade eslint-plugin-twenty",
|
||||
"eslint-plugin:setup": "cd ../packages/twenty-eslint-plugin/ && yarn && yarn build && cd ../../front/ && yarn upgrade twenty-eslint-plugin",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"fmt:fix": "prettier --cache --write \"src/**/*.ts\" \"src/**/*.tsx\"",
|
||||
"fmt": "prettier --check \"src/**/*.ts\" \"src/**/*.tsx\"",
|
||||
@ -140,7 +140,6 @@
|
||||
"eslint-plugin-react-refresh": "^0.4.4",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-storybook": "^0.6.15",
|
||||
"eslint-plugin-twenty": "file:../eslint-plugin-twenty",
|
||||
"eslint-plugin-unused-imports": "^3.0.0",
|
||||
"http-server": "^14.1.1",
|
||||
"jest": "29.7.0",
|
||||
@ -151,13 +150,15 @@
|
||||
"storybook": "^7.6.3",
|
||||
"storybook-addon-cookie": "^3.1.0",
|
||||
"storybook-addon-pseudo-states": "^2.1.2",
|
||||
"twenty-eslint-plugin": "file:../twenty-eslint-plugin",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.0",
|
||||
"vite-plugin-svgr": "^4.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.16.0",
|
||||
"npm": "please-use-yarn"
|
||||
"npm": "please-use-yarn",
|
||||
"yarn": "^4.0.2"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
||||
8
packages/twenty-postgres/Makefile
Normal file
8
packages/twenty-postgres/Makefile
Normal file
@ -0,0 +1,8 @@
|
||||
provision-postgres-macos-arm:
|
||||
sh ./scripts/setup-postgres-macos-arm.sh
|
||||
|
||||
provision-postgres-macos-intel:
|
||||
sh ./scripts/setup-postgres-macos-intel.sh
|
||||
|
||||
provision-postgres-linux:
|
||||
sh ./scripts/setup-postgres-linux.sh
|
||||
1
packages/twenty-server/.gitignore
vendored
Normal file
1
packages/twenty-server/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
dist/*
|
||||
@ -1 +0,0 @@
|
||||
18.16.0
|
||||
@ -6,7 +6,6 @@
|
||||
"private": true,
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
"postinstall": "patch-package",
|
||||
"prebuild": "rimraf dist",
|
||||
"build": "nest build",
|
||||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
||||
@ -37,12 +36,12 @@
|
||||
"@aws-sdk/credential-providers": "^3.363.0",
|
||||
"@google-cloud/local-auth": "2.1.0",
|
||||
"@graphql-tools/schema": "^10.0.0",
|
||||
"@graphql-yoga/nestjs": "2.1.0",
|
||||
"@graphql-yoga/nestjs": "patch:@graphql-yoga/nestjs@2.1.0#./patches/@graphql-yoga+nestjs+2.1.0.patch",
|
||||
"@nestjs/apollo": "^11.0.5",
|
||||
"@nestjs/common": "^9.0.0",
|
||||
"@nestjs/config": "^2.3.2",
|
||||
"@nestjs/core": "^9.0.0",
|
||||
"@nestjs/graphql": "12.0.8",
|
||||
"@nestjs/graphql": "patch:@nestjs/graphql@12.0.8#./patches/@nestjs+graphql+12.0.8.patch",
|
||||
"@nestjs/jwt": "^10.0.3",
|
||||
"@nestjs/passport": "^9.0.3",
|
||||
"@nestjs/platform-express": "^9.0.0",
|
||||
@ -50,7 +49,7 @@
|
||||
"@nestjs/terminus": "^9.2.2",
|
||||
"@nestjs/typeorm": "^10.0.0",
|
||||
"@ptc-org/nestjs-query-core": "^4.2.0",
|
||||
"@ptc-org/nestjs-query-graphql": "4.2.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",
|
||||
"@sentry/node": "^7.66.0",
|
||||
"@sentry/profiling-node": "^1.2.6",
|
||||
@ -65,7 +64,7 @@
|
||||
"bullmq": "^4.14.0",
|
||||
"bytes": "^3.1.2",
|
||||
"class-transformer": "^0.5.1",
|
||||
"class-validator": "^0.14.0",
|
||||
"class-validator": "patch:class-validator@^0.14.0#./patches/class-validator+0.14.0.patch",
|
||||
"dataloader": "^2.2.2",
|
||||
"date-fns": "^2.30.0",
|
||||
"file-type": "16.5.4",
|
||||
@ -93,10 +92,8 @@
|
||||
"passport-google-oauth20": "^2.0.0",
|
||||
"passport-jwt": "^4.0.1",
|
||||
"passport-local": "^1.0.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"pg": "^8.11.3",
|
||||
"pg-boss": "^9.0.3",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.2.0",
|
||||
"sharp": "^0.32.1",
|
||||
@ -147,5 +144,10 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"graphql": "16.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.16.0",
|
||||
"npm": "please-use-yarn",
|
||||
"yarn": "^4.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js b/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
|
||||
diff --git a/dist/cjs/index.js b/dist/cjs/index.js
|
||||
index 1684394..8a92c3c 100644
|
||||
--- a/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
|
||||
+++ b/node_modules/@graphql-yoga/nestjs/dist/cjs/index.js
|
||||
--- a/dist/cjs/index.js
|
||||
+++ b/dist/cjs/index.js
|
||||
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
||||
const graphql_1 = require("graphql");
|
||||
const graphql_yoga_1 = require("graphql-yoga");
|
||||
@ -69,10 +69,10 @@ index 1684394..8a92c3c 100644
|
||||
graphqlEndpoint: options.path,
|
||||
// disable logging by default
|
||||
// however, if `true` use fastify logger
|
||||
diff --git a/node_modules/@graphql-yoga/nestjs/dist/esm/index.js b/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
|
||||
diff --git a/dist/esm/index.js b/dist/esm/index.js
|
||||
index 7068c51..8ba5d2a 100644
|
||||
--- a/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
|
||||
+++ b/node_modules/@graphql-yoga/nestjs/dist/esm/index.js
|
||||
--- a/dist/esm/index.js
|
||||
+++ b/dist/esm/index.js
|
||||
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
|
||||
import { printSchema } from 'graphql';
|
||||
import { createYoga, filter, pipe } from 'graphql-yoga';
|
||||
@ -140,10 +140,10 @@ index 7068c51..8ba5d2a 100644
|
||||
graphqlEndpoint: options.path,
|
||||
// disable logging by default
|
||||
// however, if `true` use fastify logger
|
||||
diff --git a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
|
||||
diff --git a/dist/typings/index.d.cts b/dist/typings/index.d.cts
|
||||
index 2c6a965..fd86dac 100644
|
||||
--- a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
|
||||
+++ b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.cts
|
||||
--- a/dist/typings/index.d.cts
|
||||
+++ b/dist/typings/index.d.cts
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
|
||||
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
||||
@ -178,10 +178,10 @@ index 2c6a965..fd86dac 100644
|
||||
preStartHook?: (app: FastifyInstance) => void;
|
||||
}): void;
|
||||
subscriptionWithFilter<TPayload, TVariables, TContext>(instanceRef: unknown, filterFn: (payload: TPayload, variables: TVariables, context: TContext) => boolean | Promise<boolean>, createSubscribeContext: Function): (args_0: TPayload, args_1: TVariables, args_2: TContext) => Promise<import("graphql-yoga").Repeater<TPayload, void, unknown>>;
|
||||
diff --git a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
|
||||
diff --git a/dist/typings/index.d.ts b/dist/typings/index.d.ts
|
||||
index 2c6a965..fd86dac 100644
|
||||
--- a/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
|
||||
+++ b/node_modules/@graphql-yoga/nestjs/dist/typings/index.d.ts
|
||||
--- a/dist/typings/index.d.ts
|
||||
+++ b/dist/typings/index.d.ts
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
|
||||
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
||||
@ -216,10 +216,10 @@ index 2c6a965..fd86dac 100644
|
||||
preStartHook?: (app: FastifyInstance) => void;
|
||||
}): void;
|
||||
subscriptionWithFilter<TPayload, TVariables, TContext>(instanceRef: unknown, filterFn: (payload: TPayload, variables: TVariables, context: TContext) => boolean | Promise<boolean>, createSubscribeContext: Function): (args_0: TPayload, args_1: TVariables, args_2: TContext) => Promise<import("graphql-yoga").Repeater<TPayload, void, unknown>>;
|
||||
diff --git a/node_modules/@graphql-yoga/nestjs/src/index.ts b/node_modules/@graphql-yoga/nestjs/src/index.ts
|
||||
diff --git a/src/index.ts b/src/index.ts
|
||||
index ce142f6..cda4117 100644
|
||||
--- a/node_modules/@graphql-yoga/nestjs/src/index.ts
|
||||
+++ b/node_modules/@graphql-yoga/nestjs/src/index.ts
|
||||
--- a/src/index.ts
|
||||
+++ b/src/index.ts
|
||||
@@ -1,9 +1,10 @@
|
||||
import type { Express, Request as ExpressRequest, Response as ExpressResponse } from 'express';
|
||||
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js b/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
|
||||
diff --git a/dist/schema-builder/graphql-schema.factory.js b/dist/schema-builder/graphql-schema.factory.js
|
||||
index 787bcbc..1c825bd 100644
|
||||
--- a/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
|
||||
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js
|
||||
--- a/dist/schema-builder/graphql-schema.factory.js
|
||||
+++ b/dist/schema-builder/graphql-schema.factory.js
|
||||
@@ -32,6 +32,7 @@ let GraphQLSchemaFactory = exports.GraphQLSchemaFactory = GraphQLSchemaFactory_1
|
||||
else {
|
||||
options = scalarsOrOptions;
|
||||
@ -10,10 +10,10 @@ index 787bcbc..1c825bd 100644
|
||||
lazy_metadata_storage_1.LazyMetadataStorage.load(resolvers);
|
||||
type_metadata_storage_1.TypeMetadataStorage.compile(options.orphanedTypes);
|
||||
this.typeDefinitionsGenerator.generate(options);
|
||||
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js b/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
|
||||
diff --git a/dist/schema-builder/storages/type-definitions.storage.js b/dist/schema-builder/storages/type-definitions.storage.js
|
||||
index d100444..158c592 100644
|
||||
--- a/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
|
||||
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/storages/type-definitions.storage.js
|
||||
--- a/dist/schema-builder/storages/type-definitions.storage.js
|
||||
+++ b/dist/schema-builder/storages/type-definitions.storage.js
|
||||
@@ -81,6 +81,10 @@ let TypeDefinitionsStorage = exports.TypeDefinitionsStorage = class TypeDefiniti
|
||||
}
|
||||
return;
|
||||
@ -25,10 +25,10 @@ index d100444..158c592 100644
|
||||
};
|
||||
exports.TypeDefinitionsStorage = TypeDefinitionsStorage = tslib_1.__decorate([
|
||||
(0, common_1.Injectable)()
|
||||
diff --git a/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js b/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
|
||||
diff --git a/dist/schema-builder/type-definitions.generator.js b/dist/schema-builder/type-definitions.generator.js
|
||||
index eb6bcfd..4fbc1ae 100644
|
||||
--- a/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
|
||||
+++ b/node_modules/@nestjs/graphql/dist/schema-builder/type-definitions.generator.js
|
||||
--- a/dist/schema-builder/type-definitions.generator.js
|
||||
+++ b/dist/schema-builder/type-definitions.generator.js
|
||||
@@ -26,6 +26,9 @@ let TypeDefinitionsGenerator = exports.TypeDefinitionsGenerator = class TypeDefi
|
||||
this.generateObjectTypeDefs(options);
|
||||
this.generateInputTypeDefs(options);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
|
||||
diff --git a/src/types/connection/cursor/page-info.type.js b/src/types/connection/cursor/page-info.type.js
|
||||
index 00d836d..8eef442 100644
|
||||
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
|
||||
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/cursor/page-info.type.js
|
||||
--- a/src/types/connection/cursor/page-info.type.js
|
||||
+++ b/src/types/connection/cursor/page-info.type.js
|
||||
@@ -39,7 +39,6 @@ const getOrCreatePageInfoType = () => {
|
||||
tslib_1.__metadata("design:type", String)
|
||||
], PageInfoTypeImpl.prototype, "endCursor", void 0);
|
||||
@ -10,10 +10,10 @@ index 00d836d..8eef442 100644
|
||||
(0, graphql_1.ObjectType)('PageInfo'),
|
||||
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean, String, String])
|
||||
], PageInfoTypeImpl);
|
||||
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
|
||||
diff --git a/src/types/connection/offset/offset-connection.type.js b/src/types/connection/offset/offset-connection.type.js
|
||||
index b47564f..d33f391 100644
|
||||
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
|
||||
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-connection.type.js
|
||||
--- a/src/types/connection/offset/offset-connection.type.js
|
||||
+++ b/src/types/connection/offset/offset-connection.type.js
|
||||
@@ -64,7 +64,6 @@ function getOrCreateOffsetConnectionType(TItemClass, opts) {
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
], AbstractConnection.prototype, "totalCount", null);
|
||||
@ -22,10 +22,10 @@ index b47564f..d33f391 100644
|
||||
(0, graphql_1.ObjectType)(connectionName),
|
||||
tslib_1.__metadata("design:paramtypes", [Object, Array, Function])
|
||||
], AbstractConnection);
|
||||
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
|
||||
diff --git a/src/types/connection/offset/offset-page-info.type.js b/src/types/connection/offset/offset-page-info.type.js
|
||||
index 4803306..d459b16 100644
|
||||
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
|
||||
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/connection/offset/offset-page-info.type.js
|
||||
--- a/src/types/connection/offset/offset-page-info.type.js
|
||||
+++ b/src/types/connection/offset/offset-page-info.type.js
|
||||
@@ -25,7 +25,6 @@ const getOrCreateOffsetPageInfoType = () => {
|
||||
tslib_1.__metadata("design:type", Boolean)
|
||||
], PageInfoTypeImpl.prototype, "hasPreviousPage", void 0);
|
||||
@ -34,10 +34,10 @@ index 4803306..d459b16 100644
|
||||
(0, graphql_1.ObjectType)('OffsetPageInfo'),
|
||||
tslib_1.__metadata("design:paramtypes", [Boolean, Boolean])
|
||||
], PageInfoTypeImpl);
|
||||
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
|
||||
diff --git a/src/types/delete-many-reponse.type.js b/src/types/delete-many-reponse.type.js
|
||||
index 4de72de..b42f05f 100644
|
||||
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
|
||||
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/delete-many-reponse.type.js
|
||||
--- a/src/types/delete-many-reponse.type.js
|
||||
+++ b/src/types/delete-many-reponse.type.js
|
||||
@@ -16,7 +16,6 @@ const DeleteManyResponseType = () => {
|
||||
tslib_1.__metadata("design:type", Number)
|
||||
], DeleteManyResponseTypeImpl.prototype, "deletedCount", void 0);
|
||||
@ -46,10 +46,10 @@ index 4de72de..b42f05f 100644
|
||||
(0, graphql_1.ObjectType)('DeleteManyResponse')
|
||||
], DeleteManyResponseTypeImpl);
|
||||
deleteManyResponseType = DeleteManyResponseTypeImpl;
|
||||
diff --git a/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js b/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
|
||||
diff --git a/src/types/update-many-response.type.js b/src/types/update-many-response.type.js
|
||||
index c525d14..74be84f 100644
|
||||
--- a/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
|
||||
+++ b/node_modules/@ptc-org/nestjs-query-graphql/src/types/update-many-response.type.js
|
||||
--- a/src/types/update-many-response.type.js
|
||||
+++ b/src/types/update-many-response.type.js
|
||||
@@ -16,7 +16,6 @@ const UpdateManyResponseType = () => {
|
||||
tslib_1.__metadata("design:type", Number)
|
||||
], UpdateManyResponseTypeImpl.prototype, "updatedCount", void 0);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -31,7 +31,6 @@ export class IsFieldMetadataDefaultValue
|
||||
|
||||
if (!type) {
|
||||
// Extract id value from the instance, should happen only when updating
|
||||
// @ts-expect-error Todo: Fix typing error
|
||||
const id: string | undefined = args.instance?.['id'];
|
||||
|
||||
if (!id) {
|
||||
|
||||
@ -25,7 +25,6 @@ export class IsFieldMetadataOptions {
|
||||
|
||||
if (!type) {
|
||||
// Extract id value from the instance, should happen only when updating
|
||||
// @ts-expect-error Todo: Fix typing error
|
||||
const id: string | undefined = args.instance?.['id'];
|
||||
|
||||
if (!id) {
|
||||
|
||||
Reference in New Issue
Block a user