From 49b8860694d0b1189982276943d42e05cb903ea1 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sat, 7 Aug 2021 18:13:59 -0400 Subject: [PATCH] =?UTF-8?q?nvm=20=F0=9F=90=8C=20->=20volta=20=E2=9A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://volta.sh/ --- Brewfile | 6 ------ npm/install_globals.sh | 26 ++++++++++++++++++++------ zsh/.zshrc | 3 +++ zsh/macos.zsh | 9 ++++----- zsh/path.zsh | 7 +++++-- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/Brewfile b/Brewfile index ed8515f..45199ee 100644 --- a/Brewfile +++ b/Brewfile @@ -93,10 +93,6 @@ brew "git-crypt" brew "gh" brew "hub" -# Node & NPM / NVM -brew "node" -brew "nvm" - # Mostly ordinary binaries brew "act" brew "aws-shell" @@ -187,14 +183,12 @@ brew "torsocks" brew "travis" brew "twilio/brew/twilio" brew "typescript" -brew "watchman" brew "whois", link: true brew "wireguard-tools" brew "wireguard-go" brew "wp-cli" # brew "wpengine/wpe-cli/wpe-cli" brew "xz" -brew "yarn" brew "youtube-dl" brew "yq" brew "yuicompressor" diff --git a/npm/install_globals.sh b/npm/install_globals.sh index 8c1216a..f5d550f 100755 --- a/npm/install_globals.sh +++ b/npm/install_globals.sh @@ -2,25 +2,37 @@ set -euo pipefail +# fetch and install Volta (better nvm) +if ! command -v volta &> /dev/null +then + curl https://get.volta.sh | bash -s -- --skip-setup +fi + +volta install node@lts +volta install node@latest # remove when LTS officially supports arm64 +volta install npm@6 # having issues with npm@7 and volta +volta install yarn@1 + +volta list node +volta list npm +volta list yarn + # npm ls --global --parseable --depth=0 | awk '{gsub(/\/.*\//,"",$1); print}' | sort -u packages=( @11ty/eleventy - @ampproject/toolbox-cli @babel/cli @babel/core @lhci/cli autoprefixer + browserify eslint express express-generator firebase-tools gatsby-cli - gitmoji-cli gulp - is-up-cli json-server netlify-cli - newman nodemon npm-check-updates pm2 @@ -32,13 +44,15 @@ packages=( serve standard stylelint - superstatic + svgo + terser vercel webpack webpack-cli - yo ) for p in "${packages[@]}"; do npm install --global "$p" || echo "$p not found" done + +volta list all diff --git a/zsh/.zshrc b/zsh/.zshrc index 12be285..d31f6b3 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -47,6 +47,9 @@ compinit -C # Load everything! source $ZSH/oh-my-zsh.sh +export ZPLUG_HOME=/opt/homebrew/opt/zplug +source $ZPLUG_HOME/init.zsh + # Fix slow paste problem w/ zsh-syntax-highlighting plugin # https://github.com/zsh-users/zsh-syntax-highlighting/issues/295 zstyle ':bracketed-paste-magic' active-widgets '.self-*' diff --git a/zsh/macos.zsh b/zsh/macos.zsh index 68bae70..89bf9eb 100644 --- a/zsh/macos.zsh +++ b/zsh/macos.zsh @@ -45,9 +45,8 @@ update() { brew cleanup echo -e "${YELLOW}Updating NPM/Yarn packages...${NC}" - npm install npm@latest --global - npm update --global - yarn global upgrade + volta run npm update --global + volta run yarn global upgrade echo -e "${YELLOW}Updating Ruby gems...${NC}" gem update --system @@ -65,8 +64,8 @@ update() { echo -e "${YELLOW}Updating Oh-My-ZSH...${NC}" omz update - # echo -e "${YELLOW}Updating MAS apps...${NC}" - # mas upgrade + echo -e "${YELLOW}Updating MAS apps...${NC}" + mas upgrade echo -e "${YELLOW}Check for macOS system updates...${NC}" softwareupdate --list diff --git a/zsh/path.zsh b/zsh/path.zsh index f72e8b9..6d6858a 100644 --- a/zsh/path.zsh +++ b/zsh/path.zsh @@ -16,6 +16,7 @@ export PATH="$GOPATH/bin:$PATH" #export PATH="$GOROOT/bin:$PATH" # Ruby +export PATH="$HOME/.gem/ruby/3.0.0/bin:$PATH" export RUBY_HOME="$HOMEBREW_PREFIX/opt/ruby/bin" export GEM_PATH="$HOMEBREW_PREFIX/lib/ruby/gems/3.0.0/bin" export PATH="$RUBY_HOME:$PATH" @@ -50,8 +51,6 @@ export PATH="$HOME/.config/yarn/global/node_modules/.bin:$PATH" export PATH="$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$PATH" export PATH="$HOMEBREW_PREFIX/opt/whois/bin:$PATH" export PATH="$HOMEBREW_PREFIX/opt/jpeg-turbo/bin:$PATH" -#export LDFLAGS="-L$HOMEBREW_PREFIX/opt/jpeg-turbo/lib" -#export CPPFLAGS="-I$HOMEBREW_PREFIX/opt/jpeg-turbo/include" # pyenv export PYENV_ROOT="$HOME/.pyenv" @@ -61,6 +60,10 @@ if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi +# volta +export VOLTA_HOME="$HOME/.volta" +export PATH="$VOLTA_HOME/bin:$PATH" + # ----- Third-party additions below: ----- # Google Cloud SDK