Skip to content

feat: add pnpm feature; persist Claude config in agents (agents v1.2.0)#3

Merged
arv merged 2 commits into
mainfrom
feat/pnpm-feature-and-claude-persist
Jun 11, 2026
Merged

feat: add pnpm feature; persist Claude config in agents (agents v1.2.0)#3
arv merged 2 commits into
mainfrom
feat/pnpm-feature-and-claude-persist

Conversation

@arv

@arv arv commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Goal

Make the dev container setup DRY — push the shared toolchain/persistence logic into features so consumer repos need no post-create.sh / post-start.sh at all.

Changes

New pnpm feature (v1.0.0)

  • corepack enable at build; corepack install at postCreate (pins pnpm from the workspace packageManager).
  • removeNpm option removes npm/npx to enforce pnpm. Deferred to postCreate so it runs after build-time global npm installs (e.g. the agents Codex install), avoiding the ordering trap of removing npm before other features use it.

agents v1.2.0 — persist Claude config

  • Mounts a devcontainer-claude-config volume at ~/.claude, sets CLAUDE_CONFIG_DIR, and chowns it — mirroring the gh-login persistence from v1.1.0.

Consumer payoff

A repo's devcontainer.json collapses to image + gitconfig mount + two feature lines + oxc — no lifecycle scripts, no .claude mount, no CLAUDE_CONFIG_DIR, no chown:

"features": {
  "ghcr.io/rocicorp/devcontainer-features/agents:1": {},
  "ghcr.io/rocicorp/devcontainer-features/pnpm:1": { "removeNpm": true }
}

Notes

  • Claude + gh volumes are shared across repos (account-level logins) — intentional, documented.
  • Mount paths assume the node remote user (our standard base image).

🤖 Generated with Claude Code

- New `pnpm` feature: corepack enable + `corepack install` (pins pnpm from
  packageManager at postCreate) with an optional `removeNpm` to enforce pnpm.
- agents v1.2.0: mount a persistent ~/.claude volume + set CLAUDE_CONFIG_DIR
  and chown it, mirroring the gh-login persistence.

Together these let a consumer repo drop its post-create.sh / post-start.sh
and the .claude mount entirely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot requested a review from darkgnotic June 11, 2026 10:29
Comment thread src/pnpm/devcontainer-feature.json Outdated
"options": {
"removeNpm": {
"type": "boolean",
"default": false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change default to true

Comment thread src/pnpm/install.sh Outdated
set -euo pipefail

# Option (booleans arrive as the strings "true"/"false").
REMOVE_NPM="${REMOVENPM:-false}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

Addresses PR review: enforce pnpm-only by default. Updates the option
default, the install.sh fallback, the test, and README usage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@arv arv merged commit 7728890 into main Jun 11, 2026
3 checks passed
Comment thread src/pnpm/install.sh
fi

echo "Enabling Corepack..."
corepack enable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this causes .pnpm-store/ folder to be created in the repo dir?

Image

Here's how we fixed in cloudzero repo: https://github.com/rocicorp/cloudzero/blob/5c10238ad6cd2368b70c35e345d0803482ee0e13/.devcontainer/post-create.sh#L4-L10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants