feat(packages): add declarative npm package installation via chezmoi#5
Merged
feat(packages): add declarative npm package installation via chezmoi#5
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds declarative npm package installation to the chezmoi dotfiles setup. It introduces a new pattern for managing npm global packages through YAML configuration, automatically installing them when the package list changes.
- Adds
.chezmoidata/packages.yamlto declare npm packages - Creates
run_onchange_after_install-npm-packages.sh.tmplscript for automatic installation - Extends test verification to check npm package installation
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.chezmoidata/packages.yaml |
New YAML file declaring npm global packages (e.g., @anthropic-ai/claude-code) |
.chezmoiscripts/run_onchange_after_install-npm-packages.sh.tmpl |
New script that installs npm packages when package list changes, with mise integration |
test/verify-marketplace.sh |
Extended to verify npm package installation, supports both yq-based parsing and fallback |
test/test-coder-existing.sh |
Updated test fixture to use valid JSON instead of plain text |
.claude/skills/chezmoi-development/SKILL.md |
Added documentation for the declarative package installation pattern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@anthropic-ai/claude-codepackage to the default installationImplementation
New Files:
.chezmoidata/packages.yaml- Declares npm packages to install.chezmoiscripts/run_onchange_after_install-npm-packages.sh.tmpl- Installation script that runs when package list changesModified Files:
.claude/skills/chezmoi-development/SKILL.md- Added "Declarative Package Installation" section with npm exampletest/verify-marketplace.sh- Added npm package verificationtest/test-coder-existing.sh- Fixed test to use valid JSON in mock settings fileKey Features
run_onchange_prefix so script only runs when package list changesmise execto ensure npm commands work in mise-managed Node.js environmentTesting
All tests pass:
Each test verifies:
Documentation
Updated the chezmoi-development skill with comprehensive documentation: