claudepod 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,12 +4,39 @@
4
4
 
5
5
  set -euo pipefail
6
6
 
7
+ # Clear npm prefix environment variables that conflict with NVM
8
+ unset npm_config_prefix 2>/dev/null || true
9
+ unset NPM_CONFIG_PREFIX 2>/dev/null || true
10
+
7
11
  echo "🐚 Setting up enhanced ZSH configuration..."
8
12
 
13
+ # State tracking directory
14
+ STATE_DIR="/workspace/.devcontainer/state"
15
+
16
+ # Function to create state marker
17
+ create_state_marker() {
18
+ local component="$1"
19
+ local method="${2:-unknown}"
20
+
21
+ mkdir -p "$STATE_DIR"
22
+ echo "$(date '+%Y-%m-%d %H:%M:%S') - $method" > "$STATE_DIR/${component}.installed"
23
+ chown -R node:node "$STATE_DIR"
24
+ }
25
+
26
+ # Function to check if component is already installed
27
+ is_component_installed() {
28
+ local component="$1"
29
+
30
+ [ -f "$STATE_DIR/${component}.installed" ]
31
+ }
32
+
9
33
  # Variables
10
34
  ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
11
35
  NODE_USER="node"
12
36
 
37
+ # Source shell configuration modules
38
+ source "/workspace/.devcontainer/scripts/shell/zsh-config.sh"
39
+
13
40
  # Function to install ZSH plugin
14
41
  install_zsh_plugin() {
15
42
  local plugin_name="$1"
@@ -42,206 +69,15 @@ install_powerlevel10k() {
42
69
  fi
43
70
  }
44
71
 
45
- # Function to create enhanced .zshrc
46
- create_zshrc() {
47
- echo "📝 Creating enhanced .zshrc configuration..."
48
-
49
- # Backup existing .zshrc if it exists
50
- if [ -f "$HOME/.zshrc" ]; then
51
- cp "$HOME/.zshrc" "$HOME/.zshrc.backup.$(date +%s)" 2>/dev/null || true
52
- fi
53
-
54
- cat > "$HOME/.zshrc" << 'EOF'
55
- # ClaudePod ZSH Configuration
56
- # Path to your oh-my-zsh installation
57
- export ZSH="$HOME/.oh-my-zsh"
58
-
59
- # Set name of the theme to load
60
- ZSH_THEME="powerlevel10k/powerlevel10k"
61
-
62
- # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
63
- if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
64
- source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
65
- fi
66
-
67
- # Disable P10k configuration wizard
68
- export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
69
-
70
- # ZSH Configuration
71
- CASE_SENSITIVE="false"
72
- HYPHEN_INSENSITIVE="true"
73
- DISABLE_AUTO_UPDATE="false"
74
- DISABLE_UPDATE_PROMPT="true"
75
- export UPDATE_ZSH_DAYS=7
76
- DISABLE_MAGIC_FUNCTIONS="false"
77
- DISABLE_LS_COLORS="false"
78
- DISABLE_AUTO_TITLE="false"
79
- ENABLE_CORRECTION="true"
80
- COMPLETION_WAITING_DOTS="true"
81
- DISABLE_UNTRACKED_FILES_DIRTY="false"
82
- HIST_STAMPS="yyyy-mm-dd"
83
-
84
- # ZSH Plugins
85
- plugins=(
86
- git
87
- docker
88
- docker-compose
89
- node
90
- npm
91
- python
92
- pip
93
- vscode
94
- zsh-syntax-highlighting
95
- zsh-autosuggestions
96
- zsh-completions
97
- fast-syntax-highlighting
98
- history-substring-search
99
- colored-man-pages
100
- command-not-found
101
- extract
102
- z
103
- )
104
-
105
- # Load Oh My Zsh
106
- source $ZSH/oh-my-zsh.sh
107
-
108
- # User configuration
109
- export LANG=en_US.UTF-8
110
- export EDITOR='code'
111
- export ARCHFLAGS="-arch x86_64"
112
-
113
- # History configuration
114
- HISTSIZE=50000
115
- SAVEHIST=50000
116
- setopt HIST_EXPIRE_DUPS_FIRST
117
- setopt HIST_IGNORE_DUPS
118
- setopt HIST_IGNORE_ALL_DUPS
119
- setopt HIST_IGNORE_SPACE
120
- setopt HIST_FIND_NO_DUPS
121
- setopt HIST_SAVE_NO_DUPS
122
- setopt HIST_BEEP
123
- setopt SHARE_HISTORY
124
-
125
- # Path configuration
126
- export PATH="$HOME/.local/bin:$PATH"
127
- export PATH="/usr/local/share/npm-global/bin:$PATH"
128
-
129
- # Node.js/NVM configuration
130
- export NVM_DIR="/usr/local/share/nvm"
131
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
132
- [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
133
-
134
- # Python configuration
135
- if command -v python3 &> /dev/null; then
136
- alias python=python3
137
- alias pip=pip3
138
- fi
72
+ # ZSH configuration is now handled by focused generator functions:
73
+ # - generate_zsh_basic_config(): Basic ZSH settings, plugins, history
74
+ # - generate_zsh_aliases(): All alias definitions
75
+ # - generate_zsh_functions(): Shell utility functions
76
+ # - generate_zsh_welcome(): Welcome message and final configuration
77
+ # - create_zshrc(): Main orchestrator function
78
+ # See: /workspace/.devcontainer/scripts/shell/zsh-config.sh
139
79
 
140
- # ClaudePod aliases
141
- alias ll='ls -alF'
142
- alias la='ls -A'
143
- alias l='ls -CF'
144
- alias gs='git status'
145
- alias gd='git diff'
146
- alias gc='git commit'
147
- alias gco='git checkout'
148
- alias gp='git push'
149
- alias gl='git log --oneline --graph --decorate'
150
- alias ga='git add'
151
- alias gb='git branch'
152
- alias gm='git merge'
153
- alias gr='git rebase'
154
- alias gf='git fetch'
155
- alias gpl='git pull'
156
-
157
- # Development aliases
158
- alias c='code .'
159
- alias cls='clear'
160
- alias h='history'
161
- alias ..='cd ..'
162
- alias ...='cd ../..'
163
- alias ....='cd ../../..'
164
- alias ~='cd ~'
165
-
166
- # Claude Code aliases
167
- alias claude='claude --model sonnet --dangerously-skip-permissions'
168
- alias claude-help='claude --help'
169
- alias claude-mcp='claude mcp list'
170
- alias claude-version='claude --version'
171
-
172
- # Docker aliases (if docker is available)
173
- if command -v docker &> /dev/null; then
174
- alias d='docker'
175
- alias dc='docker-compose'
176
- alias dps='docker ps'
177
- alias dpsa='docker ps -a'
178
- alias di='docker images'
179
- alias drm='docker rm'
180
- alias drmi='docker rmi'
181
- fi
182
-
183
- # Useful functions
184
- # Extract various archive formats
185
- extract() {
186
- if [ -f $1 ]; then
187
- case $1 in
188
- *.tar.bz2) tar xjf $1 ;;
189
- *.tar.gz) tar xzf $1 ;;
190
- *.bz2) bunzip2 $1 ;;
191
- *.rar) unrar e $1 ;;
192
- *.gz) gunzip $1 ;;
193
- *.tar) tar xf $1 ;;
194
- *.tbz2) tar xjf $1 ;;
195
- *.tgz) tar xzf $1 ;;
196
- *.zip) unzip $1 ;;
197
- *.Z) uncompress $1 ;;
198
- *.7z) 7z x $1 ;;
199
- *) echo "'$1' cannot be extracted via extract()" ;;
200
- esac
201
- else
202
- echo "'$1' is not a valid file"
203
- fi
204
- }
205
-
206
- # Create directory and cd into it
207
- mkcd() {
208
- mkdir -p "$1" && cd "$1"
209
- }
210
-
211
- # Find process by name
212
- findp() {
213
- ps aux | grep -v grep | grep "$1"
214
- }
215
-
216
- # Quick HTTP server
217
- serve() {
218
- local port="${1:-8000}"
219
- python3 -m http.server "$port"
220
- }
221
-
222
- # Load Powerlevel10k configuration
223
- if [[ -r ~/.p10k.zsh ]]; then
224
- source ~/.p10k.zsh
225
- fi
226
-
227
- # Auto-suggestions configuration
228
- ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#666666"
229
- ZSH_AUTOSUGGEST_STRATEGY=(history completion)
230
- ZSH_AUTOSUGGEST_USE_ASYNC=true
231
-
232
- # Syntax highlighting configuration
233
- ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
234
-
235
- # Welcome message
236
- if [[ -n "$ZSH_VERSION" && -z "$VSCODE_RESOLVING_ENVIRONMENT" ]]; then
237
- echo "🚀 Welcome to ClaudePod!"
238
- echo "💡 Type 'claude' to start using Claude Code"
239
- echo "📋 Run 'claude mcp list' to see available MCP servers"
240
- fi
241
- EOF
242
-
243
- echo "✅ Enhanced .zshrc created"
244
- }
80
+ # Note: The actual create_zshrc() function is now imported from the module above
245
81
 
246
82
  # Function to create Powerlevel10k configuration
247
83
  create_p10k_config() {
@@ -336,6 +172,18 @@ EOF
336
172
 
337
173
  # Main setup function
338
174
  main() {
175
+ # Check if ZSH setup is already complete
176
+ if is_component_installed "zsh-setup"; then
177
+ echo "✅ ZSH enhancement already complete (marker found)"
178
+ if [ -f "$HOME/.zshrc" ] && [ -d "$HOME/.oh-my-zsh/custom/themes/powerlevel10k" ]; then
179
+ echo "✓ .zshrc and Powerlevel10k theme verified"
180
+ return 0
181
+ else
182
+ echo "⚠️ Marker exists but files missing, re-running setup..."
183
+ rm -f "$STATE_DIR/zsh-setup.installed"
184
+ fi
185
+ fi
186
+
339
187
  echo "🐚 Starting ZSH enhancement setup..."
340
188
 
341
189
  # Ensure we're running as the correct user
@@ -350,9 +198,9 @@ main() {
350
198
  exit 1
351
199
  fi
352
200
 
353
- # Suppress NVM errors during this process
201
+ # Source NVM for this process
354
202
  export NVM_DIR="/usr/local/share/nvm"
355
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 2>/dev/null || true
203
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
356
204
 
357
205
  # Install Powerlevel10k theme
358
206
  install_powerlevel10k
@@ -377,9 +225,10 @@ main() {
377
225
  sudo chsh -s /usr/bin/zsh "$NODE_USER" || echo "⚠️ Could not change default shell"
378
226
  fi
379
227
 
228
+ create_state_marker "zsh-setup" "plugins+theme+config"
380
229
  echo "✅ ZSH enhancement setup complete!"
381
230
  echo "💡 Restart your terminal or run 'source ~/.zshrc' to apply changes"
382
231
  }
383
232
 
384
233
  # Execute main function
385
- main
234
+ main