From d3378e482223f70a087dd34c2edef1fedaf6e53a Mon Sep 17 00:00:00 2001 From: dhinesh-m24 Date: Wed, 4 Feb 2026 11:56:19 +0530 Subject: [PATCH] feat: Update web makefile --- Makefile | 11 ++++++---- firebase.json | 4 ++-- makefiles/web.mk | 52 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index dd9040a0..86a23d33 100644 --- a/Makefile +++ b/Makefile @@ -21,10 +21,13 @@ help: @echo " KROW Workforce - Available Makefile Commands" @echo "--------------------------------------------------" @echo "" - @echo " --- CORE DEVELOPMENT ---" - @echo " make install - Installs web frontend dependencies." - @echo " make dev - Starts the local web frontend server." - @echo " make build - Builds the web frontend for production." + @echo " --- WEB APP DEVELOPMENT ---" + @echo " make web-install - Installs web frontend dependencies." + @echo " make web-info - List web development commands." + @echo " make web-dev - Starts the local web frontend server." + @echo " make web-build - Builds the web frontend for production (ENV=dev|staging)." + @echo " make web-lint - Runs linter for web frontend." + @echo " make web-preview - Previews the web frontend build." @echo " make launchpad-dev - Starts the local launchpad server (Firebase Hosting emulator)." @echo "" @echo " --- MOBILE APP DEVELOPMENT ---" diff --git a/firebase.json b/firebase.json index c9b664b4..887856f8 100644 --- a/firebase.json +++ b/firebase.json @@ -18,7 +18,7 @@ }, { "target": "app-dev", - "public": "apps/web-dashboard/dist", + "public": "apps/web/dist", "ignore": [ "firebase.json", "**/.*", @@ -33,7 +33,7 @@ }, { "target": "app-staging", - "public": "apps/web-dashboard/dist", + "public": "apps/web/dist", "ignore": [ "firebase.json", "**/.*", diff --git a/makefiles/web.mk b/makefiles/web.mk index 0ddeefcf..4e4ba6b7 100644 --- a/makefiles/web.mk +++ b/makefiles/web.mk @@ -1,21 +1,45 @@ -# --- Core Web Development --- +# --- Web App Development --- -.PHONY: install dev build deploy-app +.PHONY: web-install web-info web-dev web-build web-lint web-preview web-deploy -install: +WEB_DIR := apps/web + +# --- General --- +web-install: @echo "--> Installing web frontend dependencies..." - @cd apps/web-dashboard && npm install + @cd $(WEB_DIR) && pnpm install -dev: - @echo "--> Ensuring web frontend dependencies are installed..." - @cd apps/web-dashboard && npm install - @echo "--> Starting web frontend development server on http://localhost:5173 ..." - @cd apps/web-dashboard && npm run dev +web-info: + @echo "--> Web App Commands:" + @echo " make web-install - Install dependencies" + @echo " make web-dev - Start dev server" + @echo " make web-build - Build for production (ENV=dev|staging)" + @echo " make web-lint - Run linter" + @echo " make web-preview - Preview production build" + @echo " make web-deploy - Build and deploy (ENV=dev|staging)" -build: - @echo "--> Building web frontend for production..." - @cd apps/web-dashboard && VITE_APP_ENV=$(ENV) npm run build +web-dev: + @echo "--> Starting web frontend development server..." + @cd $(WEB_DIR) && pnpm dev -deploy-app: build - @echo "--> Deploying Frontend Web App to [$(ENV)] environment..." +web-build: + @echo "--> Building web frontend for [$(ENV)] environment..." + @cd $(WEB_DIR) && pnpm build -- --mode $(ENV) + +web-lint: + @echo "--> Linting web frontend..." + @cd $(WEB_DIR) && pnpm lint + +web-preview: + @echo "--> Previewing web frontend build..." + @cd $(WEB_DIR) && pnpm preview + +web-deploy: web-build + @echo "--> Deploying Web App to [$(ENV)] environment..." @firebase deploy --only hosting:$(HOSTING_TARGET) --project=$(FIREBASE_ALIAS) + +# Aliases for root level access +install: web-install +dev: web-dev +build: web-build +deploy-app: web-deploy