#!/usr/bin/env bash
set -e

YELLOW='\033[0;33m'
CYAN='\033[0;36m'
RESET='\033[0m' # No Color

echo -e "${YELLOW}[Clean] ${CYAN}Step (1): Removing dist folders from packages${RESET}"
npx lerna exec --parallel -- 'rm -rf dist'

echo -e "${YELLOW}[Clean] ${CYAN}Step (2): Cleaning via 'lerna clean' (removing node_modules from packages)${RESET}"
npx lerna clean --yes

echo -e "${YELLOW}[Clean] ${CYAN}Step (3): Removing root node_modules${RESET}"
rm -rf node_modules

echo -e "${YELLOW}[Clean] ${CYAN}Complete: You may use the 'all' to reinstall dependencies${RESET}"
