Support for npm tags
- Dominant language
- TypeScript
- Stars
- 853
- Forks
- 662
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 8
Description
Hey all, would you mind supporting tags (in addition to versions, which you support) for npm snap packages? i.e, `npm:@foo/bar@testnet` would work.
This would allow snap builders to safely subscribe to version updates per intended environment, a feat which isn't quite supported without.
Fwiw, I cloned locally and found that, syntactically, the [NpmSnapIdStruct](https://github.com/MetaMask/snaps/blob/main/packages/snaps-utils/src/snaps.ts#L266-L287) could just do a conditional check on whether a tag is appended at the end, (as well as append to the tests [here](https://github.com/MetaMask/snaps/blob/main/packages/rpc-methods/src/restricted/caveats/snapIds.test.ts#L31)?), but I don't know if that would actually equate to the tag actually being equated for later downstream.
This would be a huge add! 🙏
Contributor guide
Research direction
Start with NpmSnapIdStruct in packages/snaps-utils/src/snaps.ts and the related cases in packages/rpc-methods/src/restricted/caveats/snapIds.test.ts. Trace how parsed snap IDs are used downstream to determine whether npm tags must be preserved or resolved, then add coverage showing the intended tag behavior. Done means tagged npm snap IDs are accepted consistently without regressing version-based IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100