[RRFC] `npm publish --if-needed`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
My company uses CD to publish our internal npm packages. However, the publish job, if ran twice, will error the second time, because the package is already published.
If we make the job never fail, then we might be hiding other issues.
Currently, our planned workaround is similar to:
npm packnpm show @scope/package dist.shasum- if there is a version, confirm the tarball's shasum matches the published one and succeed, else fail
- else, publish (and fail if the publish fails)
Desired Behaviour
It would be great if we could do npm publish --repeatable (however it's spelled) that would not fail if i'm attempting to publish the same package contents over a matching version.
Thoughts?
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
Start by reviewing the proposed workflow in this issue: npm pack, npm show @scope/package dist.shasum, and npm publish. Clarify the RFC's command spelling and behavior for matching versus differing package contents, then document acceptance criteria for repeatable publishes and failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, release
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100