[RRFC] Structured data for `deprecated` packages about migration paths
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
Currently, deprecated packages show a short string with some information from the deprecated property. This often includes information about another package to migrate to, either due to a package rename or a fork. Unfortunately, this makes it hard or impossible to automate any sort of migration, in the same way that tools like Dependabot or Renovate can for version upgrades.
Allowing structured data in the deprecated property, with information about a replacement package or packages, would allow these tools to perform package migrations as well as package upgrades.
Example
Renovate currently has a manually curated list of these package migrations^1, and I am discussing whether or not this addition makes sense as part of the Open Source Vulnerability schema^2. I think there are definitely security applications for deprecated packages that have CVEs, it would also be useful for general package migrations.
How
Current Behaviour
The deprecated property in package.json currently only allows a string or boolean to show some information about what package to migrate to. For example:
"deprecated": "No longer supported. Migrate to @example/package-name"
Desired Behaviour
Allowing for structured data in the deprecated property would allow for automation to perform migrations in users code. For example:
"deprecated": {
"description": "No longer supported. Migrate to @example/package-name",
"migration": {
"name": "@example/package-name",
"version": "2.0.0"
}
}
References
- n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the current deprecated property behavior in package.json, then compare the proposed object with Renovate's replacements.ts and the referenced OSV schema issue. Done means the RFC reaches an agreed structured representation for replacement package metadata and its compatibility with existing string and boolean usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100