Skip to content

Comments

feat: implement gitSubdir according to npa spec#442

Merged
wraithgar merged 1 commit intonpm:mainfrom
Kakadus:npa-gitSubdir
Feb 6, 2026
Merged

feat: implement gitSubdir according to npa spec#442
wraithgar merged 1 commit intonpm:mainfrom
Kakadus:npa-gitSubdir

Conversation

@Kakadus
Copy link
Contributor

@Kakadus Kakadus commented Jan 31, 2026

This implements the gitSubdir parameter, which is already parsed by npa, finally allowing users of npm to specifiy subdirectories in git dependencies.

The respective parsing logic has already been agreed on and implemented nearly 4 years ago here: npm/npm-package-arg#91. In this PR, the git fetcher is changed to resolve the gitSubdir parameter from the spec if found, as suggested by the author in the original npa PR.

References

Fixes npm/cli#528
Fixes npm/npm#2974
Relates to npm/npm-package-arg#46
Relates to npm/npm-package-arg#91

Inspired from and crediting sspiff@8bd5461, which seems to have been lost after merging the PR at npa.

@Kakadus Kakadus requested a review from a team as a code owner January 31, 2026 23:06
@wraithgar wraithgar self-assigned this Feb 6, 2026
@wraithgar wraithgar merged commit db21624 into npm:main Feb 6, 2026
14 checks passed
@github-actions github-actions bot mentioned this pull request Feb 6, 2026
wraithgar pushed a commit that referenced this pull request Feb 6, 2026
🤖 I have created a release *beep* *boop*
---


## [21.2.0](v21.1.0...v21.2.0)
(2026-02-06)
### Features
*
[`db21624`](db21624)
[#442](#442) implement gitSubdir
according to npa spec (#442) (@Kakadus)
*
[`c2a4217`](c2a4217)
[#443](#443) add allowRemote,
allowFile, allowDirectory (#443) (@wraithgar)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wraithgar wraithgar mentioned this pull request Feb 24, 2026
2 tasks
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.

[FEATURE] Allow adding Git branch dependencies in a subdirectory Allow subdirectories within git repos in npm install

2 participants