From 3038cdeb6287720a42b905fc9cc09eda658f12cf Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 19 Mar 2022 22:46:57 +0100 Subject: feat: add vue small apps --- config/build.sh | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'config/build.sh') diff --git a/config/build.sh b/config/build.sh index 60f4ccb..9bf8230 100755 --- a/config/build.sh +++ b/config/build.sh @@ -1,13 +1,14 @@ #!/usr/bin/env bash # # Build -# Build all Angular & React projects. +# Build all Angular, React & Vue projects. ############################################################################### # 1.0. Config ############################################################################### _ANGULAR_PROJECTS="projects/angular-small-apps" _REACT_PROJECTS="projects/react-small-apps" +_VUE_PROJECTS="projects/vue-small-apps" ############################################################################### # 2.0. Helpers @@ -115,7 +116,38 @@ setup_react_projects() { } ############################################################################### -# 5.0. Main +# 5.0. Vue +############################################################################### + +install_vue_dependencies() { + if [ ! -d "./public/${_VUE_PROJECTS}" ]; then + error "Vue projects are missing." + printf "Exit.\n" + exit 1 + fi + + cd "./public/${_VUE_PROJECTS}" || exit + yarn + cd "$OLDPWD" || exit +} + +build_vue_app() { + [ $# -ne 1 ] && error_unexpected + + cd "./public/${_VUE_PROJECTS}" || exit + PUBLIC_URL="/${_VUE_PROJECTS}/apps/${1}/dist/" yarn --cwd "apps/${1}" run build + info "${1} built." + cd "$OLDPWD" || exit +} + +setup_vue_projects() { + install_vue_dependencies + build_vue_app "typing" + success "Vue apps are ready." +} + +############################################################################### +# 6.0. Main ############################################################################### # Check if Yarn is installed. @@ -130,11 +162,12 @@ is_yarn_installed() { fi } -# Build Angular & React projects. +# Build Angular, React & Vue projects. build_all_projects() { is_yarn_installed setup_angular_projects setup_react_projects + setup_vue_projects success "All projects have been built." } -- cgit v1.2.3