Skip to content

Commit

Permalink
Merge pull request #222 from JV-conseil-Internet-Consulting/dev
Browse files Browse the repository at this point in the history
yarn@4.1.0 .bash/osx/uglifyjs.sh
  • Loading branch information
JV-conseil authored Mar 2, 2024
2 parents 79fa2b6 + f51cefc commit 86b3122
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
22 changes: 22 additions & 0 deletions .bash/osx/uglifyjs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# -*- coding: UTF-8 -*-
#
# author : JV-conseil
# credits : JV-conseil
# copyright : Copyright (c) 2019-2024 JV-conseil
# All rights reserved
#====================================================
set -Eeou pipefail
shopt -s failglob

_jvcl_::_uglifyjs() {
local _file
while IFS= read -rd '' _file; do
(
printf "yarn run uglifyjs %s -cmo %s\n" "${_file}" "${_file/.js/.min.js}" &&
yarn run uglifyjs "${_file}" -cmo "${_file/.js/.min.js}"
) || :
done < <(find _includes/scripts -type f -name "*.js" ! -name "*.min.js" -print0)
}

_jvcl_::_uglifyjs
25 changes: 15 additions & 10 deletions .bash/osx/yarn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
# shellcheck source=/dev/null
. ".bash/incl/all.sh"

_jvcl_::npm_audit() {
_jvcl_::yarn_audit() {
_jvcl_::h1 "npm audit..."
yarn npm audit || :
_jvcl_::h1 "depcheck..."
npx depcheck --detailed || :
_jvcl_::h1 "yarn upgrade-interactive..."
printf "Exit the terminal to allow the command to continue\n"
yarn upgrade-interactive || :
}

_jvcl_::webpack() {
_jvcl_::h1 "yarn run format..."
_jvcl_::h1 "webpack..."
yarn run format
if [ "${WEBPACK_MODE}" == "production" ]; then
yarn run build
Expand All @@ -32,7 +36,7 @@ _jvcl_::npm_package_version() {
}

_jvcl_::_sass_bootstrap() {
_jvcl_::h1 "copy node_modules..."
_jvcl_::h1 "node_modules copying..."
cp -pvrf "./node_modules/bootstrap/scss/"{_functions,_variables,_maps,_mixins,_utilities,_grid,_forms,_buttons,forms,mixins,vendor}* "./_sass/bootstrap"
}

Expand All @@ -47,19 +51,20 @@ _jvcl_::_sass_tippyjs() {

_jvcl_::yarn_update() {
if ! type "yarn" &>/dev/null; then
printf "\nERROR: yarn is not installed\n"
printf "\nERROR: yarn is not installed\n\n"
return
fi
_jvcl_::h1 "yarn update..."
yarn set version stable &&
yarn install &&
yarn up &&
yarn upgrade-interactive
(
yarn set version stable &&
yarn install &&
yarn up
) || :
}

_jvcl_::main() {
_jvcl_::yarn_update || :
_jvcl_::npm_audit
_jvcl_::yarn_update
_jvcl_::yarn_audit || :
_jvcl_::_sass_bootstrap
# _jvcl_::_sass_tippyjs
_jvcl_::webpack
Expand Down
4 changes: 2 additions & 2 deletions .bash/settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

BASH_STRICT_MODE=1
DEBUG=3
JEKYLL_ENV=production #development
WEBPACK_MODE=production #development
JEKYLL_ENV=production # development
WEBPACK_MODE=production # development

# GitHub Metadata
# <https://jekyll.github.io/github-metadata/configuration/>
Expand Down

0 comments on commit 86b3122

Please sign in to comment.