From 2a494425ad5407c4f32c675b51ad1c33acd17c2f Mon Sep 17 00:00:00 2001 From: tobias Date: Tue, 21 May 2024 11:39:10 +0200 Subject: [PATCH] Create listen script for payload types --- package.json | 4 +++- payload/package.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 739ca0f..ed7c0f2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "license": "AGPL-3.0-or-later", "version": "1.2", "scripts": { - "dev": "docker compose up --build", + "dev": "yarn dev:docker & yarn payload:types", + "dev:docker": "docker compose up --build", + "payload:types": "yarn --cwd ./payload run generate:types:listen", "stop": "docker compose down", "dev:nobuild": "docker compose up" } diff --git a/payload/package.json b/payload/package.json index dd2d3c3..34abc92 100644 --- a/payload/package.json +++ b/payload/package.json @@ -10,7 +10,8 @@ "build:server": "tsc", "build": "yarn build:payload && yarn build:server", "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js node -r tsconfig-paths/register dist/server.js", - "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts node -r tsconfig-paths/register node_modules/payload/dist/bin/index.js generate:types" + "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts node -r tsconfig-paths/register node_modules/payload/dist/bin/index.js generate:types", + "generate:types:listen": "nodemon --watch src --ext ts --exec 'npm run generate:types'" }, "dependencies": { "cross-env": "^7.0.3",