-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: no implicit latest tag on publish when latest > version (#7939)
BREAKING CHANGE: Upon publishing, in order to apply a default "latest" dist tag, the command now retrieves all prior versions of the package. It will require that the version you're trying to publish is above the latest semver version in the registry, not including pre-release tags. Implements [npm RFC7](https://github.com/npm/rfcs/blob/main/accepted/0007-publish-without-tag.md). Related to prerelease dist-tag: #7910 A part of npm 11 roadmap: npm/statusboard#898 --------- Co-authored-by: Jordan Harband <[email protected]>
- Loading branch information
Showing
16 changed files
with
346 additions
and
387 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// ping the npm registry | ||
// used by the ping and doctor commands | ||
const fetch = require('npm-registry-fetch') | ||
const npmFetch = require('npm-registry-fetch') | ||
module.exports = async (flatOptions) => { | ||
const res = await fetch('/-/ping', { ...flatOptions, cache: false }) | ||
const res = await npmFetch('/-/ping', { ...flatOptions, cache: false }) | ||
return res.json().catch(() => ({})) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,12 +292,26 @@ const setupMockNpm = async (t, { | |
|
||
const loadNpmWithRegistry = async (t, opts) => { | ||
const mock = await setupMockNpm(t, opts) | ||
return { | ||
...mock, | ||
...loadRegistry(t, mock, opts), | ||
...loadFsAssertions(t, mock), | ||
} | ||
} | ||
|
||
const loadRegistry = (t, mock, opts) => { | ||
const registry = new MockRegistry({ | ||
tap: t, | ||
registry: mock.npm.config.get('registry'), | ||
strict: true, | ||
registry: opts.registry ?? mock.npm.config.get('registry'), | ||
authorization: opts.authorization, | ||
basic: opts.basic, | ||
debug: opts.debugRegistry ?? false, | ||
strict: opts.strictRegistryNock ?? true, | ||
}) | ||
return { registry } | ||
} | ||
|
||
const loadFsAssertions = (t, mock) => { | ||
const fileShouldExist = (filePath) => { | ||
t.equal( | ||
fsSync.existsSync(path.join(mock.npm.prefix, filePath)), true, `${filePath} should exist` | ||
|
@@ -352,7 +366,7 @@ const loadNpmWithRegistry = async (t, opts) => { | |
packageDirty, | ||
} | ||
|
||
return { registry, assert, ...mock } | ||
return { assert } | ||
} | ||
|
||
/** breaks down a spec "[email protected]" into different parts for mocking */ | ||
|
Oops, something went wrong.