feat: major dotfiles refactor with documentation and multi-platform improvements

- Add comprehensive CLAUDE.md with chezmoi best practices and AI assistant guidelines
- Restructure TODO.md with prioritized tasks and detailed organization
- Add PowerShell profile template for Windows platform support
- Split git configs into identity-specific templates (ryan/xevion)
- Convert nushell env.nu and gitconfig to templates for cross-platform rendering
- Refactor chezmoi hooks to TypeScript (.init_pre.ts, .update_pre.ts)
- Update .chezmoiignore with better platform-specific file handling
- Remove deprecated shellchecker.sh and tasks.json from VS Code config
- Add mise integration to shell configs (bash, zsh, nushell, PowerShell)
- Clean up commonrc.sh.tmpl WSL-specific code
- Disable Deno in VS Code settings, enable simple dialog mode
- Add nushell extension recommendation to VS Code

This commit establishes better cross-platform support (Windows/WSL/Linux),
improves documentation for future maintenance, and standardizes configuration
management patterns across the repository.
This commit is contained in:
Ryan Walters
2025-10-26 17:01:45 -05:00
parent 8b718db155
commit 02b9236ecf
21 changed files with 951 additions and 361 deletions

5
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"recommendations": [
"thenuprojectcontributors.vscode-nushell-lang"
]
}

View File

@@ -19,5 +19,6 @@
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"notebook.formatOnSave.enabled": false,
"deno.enable": true
"deno.enable": false,
"files.simpleDialog.enable": true
}

View File

@@ -1,51 +0,0 @@
#!/bin/bash
# set -u
ROOT="$1"
SHELLCHECK_OPTIONS="--color=never --format=gcc"
# Function to invoke shellcheck or chezmoi execute-template based on file type
invoke_checker() {
filepath="$1"
# If the file is a .tmpl file, use chezmoi execute-template
if [[ $filepath == *.tmpl ]]; then
# TODO: This still doesn't work, for some reason 'sed' just refuses to replace the 'stdin' placeholder with execute-template
if ! RENDERED_TEMPLATE=$(cat $filepath | chezmoi execute-template | sed -E "s|stdin|$filepath|"); then
# since stdin is used for this, the filepath appears as '-', and thus must be replaced
echo "$RENDERED_TEMPLATE" | shellcheck - $SHELLCHECK_OPTIONS | sed "s|^-|$filepath|"
else
echo $filepath
fi
else
# Otherwise, use shellcheck directly
shellcheck "$filepath" $SHELLCHECK_OPTIONS
fi
}
# chek that 'shellcheck' is available
if ! command -v shellcheck &> /dev/null; then
echo "shellcheck could not be found"
exit 1
fi
echo "initial shellcheck started"
# Run an initial scan of all shell scripts
while IFS= read -rd $'\0' file; do
invoke_checker "$file"
done < <(find "$ROOT" \( -name "*.sh" -o -name "*.sh.tmpl" \) -type f -print0)
echo "inotifywait started"
inotifywait -mr --quiet --format ' %w %f' -e modify $1 |
while read -r dir file; do
absolute_path=${dir}${file}
# Check if the changed file ends with .sh or .sh.tmpl
if [[ $absolute_path == *.sh || $absolute_path == *.sh.tmpl ]]; then
invoke_checker $absolute_path
fi
done
echo "inotify watcher stopped"

58
.vscode/tasks.json vendored
View File

@@ -1,58 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Shellcheck",
"type": "shell",
"isBackground": true,
"command": "${workspaceFolder}/.vscode/shellchecker.sh ${workspaceFolder}",
"problemMatcher": [
{
"source": "shellcheck",
"owner": "bash",
"fileLocation": ["autoDetect", "${workspaceFolder}"],
"pattern": {
// info/style joined into 'note'
"regexp": "^(.*):(\\d+):(\\d+):\\s*(error|warning|note):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
},
"background": {
"activeOnStart": true,
"beginsPattern": "^inotify watcher started$",
"endsPattern": "^inotify watcher stopped$"
}
},
{
"source": "chezmoi",
"owner": "chezmoi",
"fileLocation": ["autoDetect", "${workspaceFolder}"],
"pattern": {
"regexp": "^chezmoi: template: (.*):(\\d+):(\\d+): executing \".+\" (at .*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
}
],
"runOptions": {
"runOn": "folderOpen"
},
"presentation": {
"echo": true,
"reveal": "always",
"revealProblems": "never",
"focus": false,
"panel": "dedicated",
"clear": false
},
}
]
}