Browse Source

fix: update devcontainer configuration to expose pnpm global bin and streamline global tool installation

Yuki Takei 6 days ago
parent
commit
b676a53d63

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

@@ -5,10 +5,10 @@
       "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
       "resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
       "integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
       "integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
     },
     },
-    "ghcr.io/devcontainers/features/node:1": {
-      "version": "1.7.1",
-      "resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
-      "integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
+    "ghcr.io/devcontainers/features/node:2": {
+      "version": "2.0.0",
+      "resolved": "ghcr.io/devcontainers/features/node@sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f",
+      "integrity": "sha256:fedd4c11f7adfb64283b578dddc7da906728daa25fa293351c9d913231acf12f"
     }
     }
   }
   }
 }
 }

+ 8 - 0
.devcontainer/app/devcontainer.json

@@ -21,6 +21,14 @@
   // Use 'postCreateCommand' to run commands after the container is created.
   // Use 'postCreateCommand' to run commands after the container is created.
   "postCreateCommand": "/bin/bash ./.devcontainer/app/postCreateCommand.sh",
   "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.
+  "remoteEnv": {
+    "PNPM_HOME": "/home/vscode/.local/share/pnpm",
+    "PATH": "/home/vscode/.local/share/pnpm:${containerEnv:PATH}"
+  },
+
   // Configure tool-specific properties.
   // Configure tool-specific properties.
   "customizations": {
   "customizations": {
     "vscode": {
     "vscode": {

+ 7 - 7
.devcontainer/app/postCreateCommand.sh

@@ -17,13 +17,13 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
 # Install Claude Code
 # Install Claude Code
 curl -fsSL https://claude.ai/install.sh | bash
 curl -fsSL https://claude.ai/install.sh | bash
 
 
-# Install turbo
-pnpm install turbo --global
-
-# Install typescript-language-server for Claude Code LSP plugin
-# Use `npm -g` (not `pnpm --global`) so the binary lands in nvm's node bin, which is on the default PATH.
-# pnpm's global bin requires PNPM_HOME from ~/.bashrc, which the Claude Code extension's shell doesn't source.
-npm install -g typescript-language-server typescript
+# 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
+mkdir -p "$PNPM_HOME"
+pnpm install --global turbo typescript-language-server typescript
 
 
 # Install dependencies
 # Install dependencies
 turbo run bootstrap
 turbo run bootstrap