chore: Refactor mobile build scripts to use Melos

Updated Makefile, mobile.mk, and melos.yaml to centralize mobile app build, start, and code generation commands using Melos scripts. Added info and install-melos commands for easier onboarding and workspace setup. Documentation updated to reflect staff app naming and new command structure.
This commit is contained in:
Achintha Isuru
2026-01-22 10:55:46 -05:00
parent cf59935ec8
commit ecc7aece6e
6 changed files with 168 additions and 67 deletions

View File

@@ -9,6 +9,27 @@ command:
usePubspecOverrides: true
scripts:
info:
run: |
echo " 🚀 KROW WORKFORCE CUSTOM COMMANDS 🚀"
echo "============================================================"
echo " BUILD COMMANDS:"
echo " - melos run build:client : Build Client App (APK)"
echo " - melos run build:staff : Build Staff App (APK)"
echo " - melos run build:design-system : Build Design System Viewer"
echo ""
echo " DEBUG/START COMMANDS:"
echo " - melos run start:client -- -d <ID> : Run Client App"
echo " - melos run start:staff -- -d <ID> : Run Staff App"
echo " - melos run start:design-system : Run DS Viewer"
echo " (e.g., melos run start:client -- -d chrome)"
echo ""
echo " CODE GENERATION:"
echo " - melos run gen:l10n : Generate Slang l10n"
echo " - melos run gen:build : Run build_runner"
echo "============================================================"
description: "Display information about available custom Melos commands."
gen:l10n:
exec: dart run slang
description: "Generate localization files using Slang across all packages."
@@ -20,3 +41,33 @@ scripts:
description: "Run build_runner build across all packages."
packageFilters:
dependsOn: build_runner
build:client:
run: |
melos run gen:l10n --filter="core_localization"
melos run gen:build --filter="core_localization"
melos exec --scope="krowwithus_client" -- "flutter build apk"
description: "Build the Client app (Android APK by default)."
build:staff:
run: |
melos run gen:l10n --filter="core_localization"
melos run gen:build --filter="core_localization"
melos exec --scope="krowwithus_staff" -- "flutter build apk"
description: "Build the Staff app (Android APK by default)."
build:design-system-viewer:
run: melos exec --scope="design_system_viewer" -- "flutter build apk"
description: "Build the Design System Viewer app (Android APK by default)."
start:client:
run: melos exec --scope="krowwithus_client" -- "flutter run"
description: "Start the Client app. Pass platform using -- -d <platform>, e.g. -d chrome"
start:staff:
run: melos exec --scope="krowwithus_staff" -- "flutter run"
description: "Start the Staff app. Pass platform using -- -d <platform>, e.g. -d chrome"
start:design-system-viewer:
run: melos exec --scope="design_system_viewer" -- "flutter run"
description: "Start the Design System Viewer app. Pass platform using -- -d <platform>, e.g. -d chrome"