From 7136304c63b16e0ac26017eeab8cd3d3815dd6a9 Mon Sep 17 00:00:00 2001 From: Jackson Chen <90215880+Sma1lboy@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:28:09 -0600 Subject: [PATCH] feat: add build and start scripts for frontend and backend (#143) ## Summary by CodeRabbit - **New Features** - Added dedicated commands for building and starting both the frontend and backend, offering improved operational clarity and separation between environments. - **Chores** - Refined task dependencies and command configurations to enhance performance, streamline development workflows, and simplify maintenance. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- backend/package.json | 2 ++ codefox-common/package.json | 2 ++ frontend/package.json | 3 ++- llm-server/package.json | 6 ++++-- package.json | 6 +++++- turbo.json | 16 ++++++++++++++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index aaa90edb..a74cf3ff 100644 --- a/backend/package.json +++ b/backend/package.json @@ -8,10 +8,12 @@ "packageManager": "pnpm@9.1.0", "scripts": { "build": "nest build", + "build:backend": "pnpm build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "lint": "ts-prune \"{src,apps,libs,test}/**/*.ts\" && eslint \"{src,apps,libs,test}/**/*.ts\" --fix ", "start": "nest start", "start:dev": "NODE_OPTIONS=\"--experimental-specifier-resolution=node\" nest start --watch", + "start:backend": "pnpm start", "dev": "pnpm start:dev", "dev:backend": "pnpm start:dev", "start:debug": "nest start --debug --watch", diff --git a/codefox-common/package.json b/codefox-common/package.json index 8123a03b..d67eef64 100644 --- a/codefox-common/package.json +++ b/codefox-common/package.json @@ -19,6 +19,8 @@ ], "scripts": { "build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types", + "build:frontend": "pnpm run build", + "build:backend": "pnpm run build", "build:cjs": "tsc -p tsconfig.cjs.json", "build:esm": "tsc -p tsconfig.esm.json", "build:types": "tsc -p tsconfig.types.json", diff --git a/frontend/package.json b/frontend/package.json index e7c58a36..09b55b32 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,8 +4,9 @@ "private": true, "scripts": { "build": "next build", + "build:frontend": "next build", "dev": "next dev", - "start:dev": "next dev", + "start:frontend": "next start", "start:dev-watch": "tmuxinator start -p .tmuxinator/build.yml", "dev:watch": "tmuxinator start -p .tmuxinator/dev.yml", "start": "next start", diff --git a/llm-server/package.json b/llm-server/package.json index dc217305..2acccfee 100644 --- a/llm-server/package.json +++ b/llm-server/package.json @@ -5,11 +5,13 @@ "type": "module", "scripts": { "start": "NODE_OPTIONS='--enable-source-maps' nodemon --watch \"src/**/*.ts\" --exec \"tsx\" src/main.ts", + "start:backend": "pnpm start", "dev": "NODE_OPTIONS='--enable-source-maps' nodemon --watch \"src/**/*.ts\" --exec \"tsx\" src/main.ts", "dev:backend": "pnpm dev", - "build": " tsc", + "build": "tsc", + "build:backend": "pnpm build", "serve": "node --enable-source-maps dist/main.js", - "format": "prettier --write \"src/**/*.ts\" ", + "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.js", "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.js --watch", diff --git a/package.json b/package.json index 2ae4201b..982461ca 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "scripts": { "build": "turbo build", "build:common": "pnpm --filter codefox-common run build", + "build:frontend": "turbo build:frontend", + "build:backend": "turbo build:backend", "dev:turbo": "turbo dev", "dev": "tmuxinator start -p .tmuxinator/dev.yml", "lint": "eslint . --ext .js,.ts,.tsx", @@ -14,7 +16,9 @@ "dev:backend": "turbo dev:backend", "test": "turbo test", "fix": "eslint . --ext .js,.ts,.tsx --fix", - "start": "turbo start" + "start": "turbo start", + "start:frontend": "turbo start:frontend", + "start:backend": "turbo start:backend" }, "postinstall": "pnpm --filter codefox-common run build", "keywords": [], diff --git a/turbo.json b/turbo.json index dd42c2db..54bc2361 100644 --- a/turbo.json +++ b/turbo.json @@ -21,6 +21,22 @@ "start": { "dependsOn": ["^build"], "cache": false + }, + "start:frontend": { + "dependsOn": ["^build"], + "cache": false + }, + "start:backend": { + "dependsOn": ["^build"], + "cache": false + }, + "build:frontend": { + "dependsOn": ["^build:frontend"], + "cache": true + }, + "build:backend": { + "dependsOn": ["^build:backend"], + "cache": true } } }