Skip to content

Commit dab2dfa

Browse files
Copilotrajbos
andcommitted
Document devcontainer fix in CONTRIBUTING.md
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent d243ca8 commit dab2dfa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Thank you for your interest in contributing to the Copilot Token Tracker extensi
77
- [Development Environment Setup](#development-environment-setup)
88
- [Using the DevContainer (Recommended)](#using-the-devcontainer-recommended)
99
- [Why Use a DevContainer for AI-Assisted Development?](#why-use-a-devcontainer-for-ai-assisted-development)
10+
- [DevContainer Configuration Notes](#devcontainer-configuration-notes)
1011
- [Manual Local Setup](#manual-local-setup)
1112
- [Development Workflow](#development-workflow)
1213
- [Available Scripts](#available-scripts)
@@ -114,7 +115,7 @@ The devcontainer allows you to confidently let AI assistants:
114115
- **Zero Configuration:** AI can start working immediately without environment setup
115116
- **Pre-installed Tools:** All required dependencies are ready to go
116117
- **Known State:** AI agents can make more accurate suggestions knowing the exact environment
117-
- **Automatic Setup:** The `postCreateCommand` ensures dependencies are always up-to-date
118+
- **Automatic Setup:** The `updateContentCommand` ensures dependencies are installed after content updates
118119

119120
### 💡 Real-World Scenario
120121

@@ -133,6 +134,16 @@ Without a devcontainer, you'd need to:
133134
- Risk system-level changes
134135
- Potentially need to uninstall packages or revert changes
135136

137+
### DevContainer Configuration Notes
138+
139+
The `.devcontainer/devcontainer.json` uses `updateContentCommand` instead of `postCreateCommand` for dependency installation:
140+
141+
- **Why `updateContentCommand`?** This lifecycle hook runs after workspace content is updated (including initial clone), making it more reliable for dependency installation in GitHub Codespaces and similar environments.
142+
- **Benefits:** More reliable timing, better suited for `npm ci` operations, and follows devcontainer best practices.
143+
- **Lifecycle Order:** The devcontainer executes hooks in this order: `onCreateCommand``updateContentCommand``postCreateCommand``postStartCommand`.
144+
145+
Using `updateContentCommand` prevents timeout issues that can occur with `postCreateCommand` during initial codespace creation, especially for projects with many dependencies.
146+
136147
## Manual Local Setup
137148

138149
If you prefer not to use the devcontainer, you can set up the extension locally:

0 commit comments

Comments
 (0)