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 --- .gitmodules | 3 +++ config/build.sh | 39 ++++++++++++++++++++++++++++++++++++--- public/projects/vue-small-apps | 1 + src/js/config/projects.js | 20 ++++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) create mode 160000 public/projects/vue-small-apps diff --git a/.gitmodules b/.gitmodules index a7f2070..7578b82 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ url = git@github.com:ArmandPhilippot/react-small-apps.git [submodule "public/projects/angular-small-apps"] path = public/projects/angular-small-apps url = git@github.com:ArmandPhilippot/angular-small-apps.git +[submodule "public/projects/vue-small-apps"] + path = public/projects/vue-small-apps + url = git@github.com:ArmandPhilippot/vue-small-apps.git 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." } diff --git a/public/projects/vue-small-apps b/public/projects/vue-small-apps new file mode 160000 index 0000000..5e60ef7 --- /dev/null +++ b/public/projects/vue-small-apps @@ -0,0 +1 @@ +Subproject commit 5e60ef7741b2e2b0163dcd1dd85df936705157c5 diff --git a/src/js/config/projects.js b/src/js/config/projects.js index 5125c18..5c6bbf8 100644 --- a/src/js/config/projects.js +++ b/src/js/config/projects.js @@ -219,6 +219,26 @@ const projects = [ ], technologies: ['React', 'React router', 'Redux'], }, + { + id: 'typing', + name: 'Typing', + description: { + en: 'You can practice to type as quickly and accurately as possible a random list of words. Three dictionaries are available.\n\nLogin: demo\nPassword: demo', + fr: 'Vous pouvez vous entrainer à taper le plus rapidement une liste de mots générées alétatoirement. Trois dictionnaires sont disponibles.\n\nLogin : demo\nMot de passe : demo', + }, + path: './projects/vue-small-apps/apps/typing/dist/', + repo: [ + { + name: 'Github', + url: 'https://github.com/ArmandPhilippot/vue-small-apps/tree/main/apps/typing', + }, + { + name: 'Gitlab', + url: 'https://gitlab.com/ArmandPhilippot/vue-small-apps/-/tree/main/apps/typing', + }, + ], + technologies: ['Vue', 'Vue router'], + }, { id: 'users-list', name: 'Users list', -- cgit v1.2.3