Browse Source

fix: update devcontainer and postCreateCommand to streamline pnpm global tool installation

Yuki Takei 5 days ago
parent
commit
63272d5daa
2 changed files with 8 additions and 9 deletions
  1. 4 4
      .devcontainer/app/devcontainer.json
  2. 4 5
      .devcontainer/app/postCreateCommand.sh

+ 4 - 4
.devcontainer/app/devcontainer.json

@@ -21,12 +21,12 @@
   // Use 'postCreateCommand' to run commands after the container is created.
   "postCreateCommand": "/bin/bash ./.devcontainer/app/postCreateCommand.sh",
 
-  // Expose pnpm's global bin to every shell spawned by VS Code (integrated terminal,
-  // lifecycle commands, and extension shells such as Claude Code) without relying on
-  // ~/.bashrc, which non-interactive shells don't source.
+  // Expose tool install dirs (pnpm global, uv/claude) to every shell spawned by VS Code
+  // (integrated terminal, lifecycle commands, and extension shells such as Claude Code)
+  // without relying on ~/.bashrc, which non-interactive shells don't source.
   "remoteEnv": {
     "PNPM_HOME": "/home/vscode/.local/share/pnpm",
-    "PATH": "/home/vscode/.local/share/pnpm:${containerEnv:PATH}"
+    "PATH": "/home/vscode/.local/share/pnpm/bin:/home/vscode/.local/bin:${containerEnv:PATH}"
   },
 
   // Configure tool-specific properties.

+ 4 - 5
.devcontainer/app/postCreateCommand.sh

@@ -17,12 +17,11 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
 # Install Claude Code
 curl -fsSL https://claude.ai/install.sh | bash
 
-# Install global Node.js tools via pnpm.
-# PNPM_HOME and PATH are exposed to every VS Code shell via `remoteEnv` in devcontainer.json,
-# so installed binaries are discoverable without sourcing ~/.bashrc.
-# - turbo: monorepo task runner used by `turbo run bootstrap` below
-# - typescript-language-server, typescript: for Claude Code LSP plugin
+# Setup pnpm
+export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
+export PATH="$PNPM_HOME/bin:$HOME/.local/bin:$PATH"
 mkdir -p "$PNPM_HOME"
+
 pnpm install --global turbo typescript-language-server typescript
 
 # Install dependencies