claude-code-termux 1.0.2 → 1.0.5

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.
Files changed (2) hide show
  1. package/package.json +2 -5
  2. package/postinstall.js +34 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-termux",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "Claude Code CLI with Termux/Android compatibility fixes - a wrapper that patches issues with Sharp, ripgrep, and path resolution on ARM64 Android",
5
5
  "author": "Jimoh Ovbiagele <findingjimoh@gmail.com>",
6
6
  "license": "MIT",
@@ -28,10 +28,7 @@
28
28
  "test": "node scripts/verify-install.js"
29
29
  },
30
30
  "dependencies": {
31
- "@anthropic-ai/claude-code": "^2.1.3"
32
- },
33
- "optionalDependencies": {
34
- "@img/sharp-wasm32": "^0.33.5"
31
+ "@anthropic-ai/claude-code": "^2.1.7"
35
32
  },
36
33
  "engines": {
37
34
  "node": ">=18.0.0 <25.0.0"
package/postinstall.js CHANGED
@@ -170,6 +170,39 @@ function setupOAuthStorage() {
170
170
  }
171
171
  }
172
172
 
173
+ /**
174
+ * Install Sharp WASM for image support on Termux
175
+ * This must be installed with --force to bypass platform restrictions
176
+ */
177
+ function installSharpWasm() {
178
+ if (!isTermux) {
179
+ return;
180
+ }
181
+
182
+ console.log('[claude-code-termux] Installing Sharp WASM for image support...');
183
+
184
+ try {
185
+ // Check if already installed
186
+ try {
187
+ require.resolve('@img/sharp-wasm32');
188
+ console.log('[claude-code-termux] Sharp WASM already installed');
189
+ return;
190
+ } catch (e) {
191
+ // Not installed, proceed
192
+ }
193
+
194
+ // Install with --force to bypass platform restrictions
195
+ execSync('npm install @img/sharp-wasm32 --force --no-save', {
196
+ stdio: 'inherit',
197
+ cwd: __dirname
198
+ });
199
+ console.log('[claude-code-termux] Sharp WASM installed successfully');
200
+ } catch (err) {
201
+ console.error('[claude-code-termux] Failed to install Sharp WASM:', err.message);
202
+ console.log('[claude-code-termux] You can install it manually: npm install @img/sharp-wasm32 --force');
203
+ }
204
+ }
205
+
173
206
  /**
174
207
  * Main setup function
175
208
  */
@@ -188,13 +221,13 @@ function main() {
188
221
  setupRipgrep(claudeCodePath);
189
222
  copyLinuxBinariesAsAndroidFallback(claudeCodePath);
190
223
  setupOAuthStorage();
224
+ installSharpWasm();
191
225
  }
192
226
 
193
227
  console.log('[claude-code-termux] Post-install complete!');
194
228
 
195
229
  if (isTermux) {
196
230
  console.log('\n[claude-code-termux] Termux setup tips:');
197
- console.log(' - If you encounter Sharp errors, run: npm install @img/sharp-wasm32 --force');
198
231
  console.log(' - If you encounter ripgrep errors, run: pkg install ripgrep');
199
232
  console.log(' - Use API key auth: export ANTHROPIC_API_KEY=your-key');
200
233
  console.log('\nRun "claude" to start Claude Code!');