From 199844a55d3918ed3971a1b13279e922be27eaf8 Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 10:46:40 +1000 Subject: [PATCH 1/7] fix: replace asdf with mise Docs still need update. --- Brewfile | 2 +- config/zsh/.zshrc | 2 +- docs/INSTALL.md | 2 ++ environment/asdf.sh | 9 ++++++++- environment/mise.sh | 30 ++++++++++++++++++++++++++++++ install.sh | 2 +- 6 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 environment/mise.sh diff --git a/Brewfile b/Brewfile index a09622a..99afe73 100644 --- a/Brewfile +++ b/Brewfile @@ -5,7 +5,7 @@ tap "buo/cask-upgrade" tap "teamookla/speedtest" tap "common-fate/granted" brew "act" -brew "asdf" +brew "mise" brew "awscli" brew "bat" brew "direnv" diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 41a60a6..a7c130e 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -31,7 +31,6 @@ secret export GIT_USERNAME --silent # Source environment extensions source $DOTFILES/environment/npm.sh -source $DOTFILES/environment/asdf.sh source $DOTFILES/environment/awssdk.sh source $DOTFILES/environment/certs.sh source $DOTFILES/environment/git.sh @@ -46,3 +45,4 @@ source $DOTFILES/environment/weather.sh source $DOTFILES/environment/yarn.sh source $DOTFILES/environment/zim.sh source $DOTFILES/environment/zsh.sh +source $DOTFILES/environment/mise.sh diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 002b53c..3f08a71 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -8,6 +8,8 @@ [VS-Code]: https://code.visualstucdio.com/ [ZimFW]: https://github.com/zimfw/zimfw +# @todo Replace ASDF with Mise https://mise.jdx.dev/ + # Install This repo is self-installing for consistent cross-machine configuration. [See tutorial for more info.](https://www.jakewiesler.com/blog/managing-dotfiles) diff --git a/environment/asdf.sh b/environment/asdf.sh index 617e762..9004f75 100644 --- a/environment/asdf.sh +++ b/environment/asdf.sh @@ -1,4 +1,11 @@ # ASDF # http://asdf-vm.com/ # Add ASDF environment setup. -source $(brew --prefix asdf)/libexec/asdf.sh +# +## source $(brew --prefix asdf)/libexec/asdf.sh +# ā˜ļø not required since 0.16.1 +# Leaving this here for reference and in case of future changes. +export ASDF_DIR="$HOME/.asdf" +export ASDF_DATA_DIR="$HOME/.asdf" +export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" +export ASDF_CONCURRENCY=auto diff --git a/environment/mise.sh b/environment/mise.sh new file mode 100644 index 0000000..6560b61 --- /dev/null +++ b/environment/mise.sh @@ -0,0 +1,30 @@ +local __mise=mise +if (( ! $+commands[mise] )); then + if (( $+commands[rtx] )); then + __mise=rtx + else + return + fi +fi + +# Load mise hooks +eval "$($__mise activate zsh)" + +# Hook mise into current environment +eval "$($__mise hook-env -s zsh)" + +COMPLETIONS_PATH="$HOMEBREW_PREFIX/share/zsh/site-functions/_mise" + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `mise`. Otherwise, compinit will have already done that. +if [[ ! -f "$COMPLETIONS_PATH" ]]; then + typeset -g -A _comps + autoload -Uz _$__mise + _comps[$__mise]=_$__mise +fi + +# Generate and load mise completion +$__mise completion zsh >| "$COMPLETIONS_PATH" &| + +export NODE_PATH="$(mise which node)" +export NPM_PATH="$(mise which npm)" diff --git a/install.sh b/install.sh index 850bc99..71874f3 100755 --- a/install.sh +++ b/install.sh @@ -25,7 +25,7 @@ command brew bundle install --file=$DOTFILES/brewfile STOWS=$DOTFILES/config echo -e "\nšŸ”— Linking Stow packages" command stow -v -t $HOME -d $STOWS -S stow # link stow config before creating other links -command stow -v -t $HOME -d $STOWS -S asdf git npm zim zsh +command stow -v -t $HOME -d $STOWS -S git npm zim zsh # Link Stow for Tabby to override default config path, can't read from dotfiles. # @see https://github.com/Eugeny/tabby/discussions/9523 From 4a48b1ce34c5ce03f421c17ac241e8dff14c6cde Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 10:46:58 +1000 Subject: [PATCH 2/7] chore: update tabby configs --- config/tabby/tabby/config.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/tabby/tabby/config.yaml b/config/tabby/tabby/config.yaml index d9ded3b..99ee4c1 100644 --- a/config/tabby/tabby/config.yaml +++ b/config/tabby/tabby/config.yaml @@ -191,17 +191,17 @@ terminal: - '#8be9fd' - '#ffffff' font: Monaspace Xenon - ligatures: true cursor: underline customColorSchemes: [] - fallbackFont: Victor Mono - hideTabIndex: true + fallbackFont: Monaspace Xenon linePadding: 6 copyAsHTML: false bell: audible fontSize: 16 fontWeightBold: 400 fontWeight: 200 + hideTabIndex: true + minimumContrastRatio: 5 ssh: {} clickableLinks: modifier: metaKey @@ -209,7 +209,6 @@ accessibility: animations: false appearance: dockFill: 1 - vibrancy: true hacks: {} providerBlacklist: [] commandBlacklist: [] From 05c4e65e91c7d6d2688ee86dc641975a6b23bc4f Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 11:00:26 +1000 Subject: [PATCH 3/7] fix: zim load order and zsh cache --- config/zsh/.zshrc | 4 +++- environment/zsh.sh | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index a7c130e..efb7153 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -43,6 +43,8 @@ source $DOTFILES/environment/upbrew.sh source $DOTFILES/environment/utils.sh source $DOTFILES/environment/weather.sh source $DOTFILES/environment/yarn.sh -source $DOTFILES/environment/zim.sh source $DOTFILES/environment/zsh.sh source $DOTFILES/environment/mise.sh + +# Source ZimFW last to reference all other environment extensions +source $DOTFILES/environment/zim.sh diff --git a/environment/zsh.sh b/environment/zsh.sh index f13ccb1..c9f7190 100644 --- a/environment/zsh.sh +++ b/environment/zsh.sh @@ -11,5 +11,4 @@ COMPLETION_WAITING_DOTS="true" # Disable marking untracked files under VCS as dirty DISABLE_UNTRACKED_FILES_DIRTY="true" -# Enable auto-completion for shell commands on history search -# zstyle ':autocomplete:*' default-context history-incremental-search-backward +export ZSH_CACHE_DIR="$HOME/.cache/zsh" From 47edf4298f743f91d81ee4bfc6a703acca94e931 Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 11:01:24 +1000 Subject: [PATCH 4/7] fix: add ca certs node var variation --- environment/certs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/environment/certs.sh b/environment/certs.sh index c6ab3a4..a406698 100644 --- a/environment/certs.sh +++ b/environment/certs.sh @@ -5,5 +5,6 @@ export CERTIFICATE_BUNDLE=$HOME/.ssl/zscaler-bundle.pem export REQUESTS_CA_BUNDLE=$CERTIFICATE_BUNDLE export CURL_CA_BUNDLE=$CERTIFICATE_BUNDLE export NODE_EXTRA_CA_CERTS=$CERTIFICATE_BUNDLE +export NODE_CA_CERTS_ENV_VAR=$CERTIFICATE_BUNDLE export AWS_CA_BUNDLE=$CERTIFICATE_BUNDLE export SSL_CERT_FILE=$CERTIFICATE_BUNDLE From 6da90544e36feb81c2767c064d68385384325f0d Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 11:01:50 +1000 Subject: [PATCH 5/7] chore: add cloneAll function for pulling org repos --- environment/git.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/environment/git.sh b/environment/git.sh index 7c4d858..5cbc165 100644 --- a/environment/git.sh +++ b/environment/git.sh @@ -4,3 +4,19 @@ export GIT_CEILING_DIRECTORIES=$HOME alias ghtoken="export GITHUB_TOKEN=\"$(gh auth token)\"" + +alias gt="gittower ." + +# Utility to clone all repositories from a GitHub organization +# Requires a GITHUB_TOKEN env var with repo access +# Dependencies: gh, jq, parallel +# Usage: CloneAll +CloneAll() { + ORG=$1 + page=1 + while links=($(curl -H "Authorization: token ${GITHUB_TOKEN}" -s "https://api.github.com/orgs/${ORG}/repos?per_page=100&page=${page}" | jq -rc '.[] | {ssh_url} | .ssh_url')); [[ "$links" ]] + do + GIT_TERMINAL_PROMPT=0 parallel git clone --depth=1 {} ::: "${links[@]}" + ((++page)) + done +} From c9b338c9fe6ba1924fea965cb9076502c73b2bac Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 11:02:13 +1000 Subject: [PATCH 6/7] fix: pnpm config --- environment/pnpm.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/environment/pnpm.sh b/environment/pnpm.sh index 469de2e..623b039 100644 --- a/environment/pnpm.sh +++ b/environment/pnpm.sh @@ -1,14 +1,10 @@ -export PNPM_HOME="$HOME/Library/pnpm" -case ":$PATH:" in - *":$PNPM_HOME:"*) ;; - *) export PATH="$PNPM_HOME:$PATH" ;; -esac # PNPM shortcuts alias p="pnpm" alias pe="pnpm exec" alias px="pnpx" alias pa="pnpm add" +alias pr="pnpm remove" alias pf="pnpm add --filter" alias pd="pnpm add -D" alias pdf="pnpm add -D --filter" From 3cc48dba392c05f45abf16e9840eafacb3fb1c47 Mon Sep 17 00:00:00 2001 From: Tim Kinnane Date: Wed, 21 May 2025 11:07:49 +1000 Subject: [PATCH 7/7] ci: add codeowners and metadata --- .psmetadata | 8 ++++++++ CODEOWNERS | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 .psmetadata create mode 100644 CODEOWNERS diff --git a/.psmetadata b/.psmetadata new file mode 100644 index 0000000..9662868 --- /dev/null +++ b/.psmetadata @@ -0,0 +1,8 @@ +{ + "version": 3, + "team": "exp_hands_on_principals", + "jira-project-key": "PET2", + "slack-channel": "#innersource", + "in-use": false, + "bc": "innersource" +} diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..c2fed1c --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +* @ACloudGuru/principal-engineering-team @ACloudGuru/ci-admins +# TODO update when moved to ps-dev... +# * @ps-dev/trusted-committers-hands-on-tooling