Skip to content

Release/v7.24.0 #3770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,8 @@ austincho <[email protected]>
Nathan Fritz <[email protected]>
tripu <[email protected]>
Matsuuu <[email protected]>
Anders Kaseorg <[email protected]>
John Gee <[email protected]>
Ayush Rawal <[email protected]>
Nate Green <[email protected]>
Jacob Yacovelli <[email protected]>
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
## v7.24.0 (2021-09-16)

### FEATURES

* [`c7787b3fb`](https://github.com/npm/cli/commit/c7787b3fb7630aab84aae83ebf9a7117c7173b6b)
[`1fbbe1e04`](https://github.com/npm/cli/commit/1fbbe1e04be5d79c7b49910324e64c19ed599eeb)
bundled npm-install-checks ([@wraithgar](https://github.com/wraithgar))

### BUG FIXES

* [`0320bd77e`](https://github.com/npm/cli/commit/0320bd77e2a38f48a88e377df4b122fd21043a83)
[#3739](https://github.com/npm/cli/issues/3739)
fix(view): Show the correct publish date for versions selected by range ([@andersk](https://github.com/andersk))
* [`e4a521857`](https://github.com/npm/cli/commit/e4a5218573583149af795982a39fa64a4116cdab)
[#3748](https://github.com/npm/cli/issues/3748)
fix(install.sh): don't remove old npm first
([@wraithgar](https://github.com/wraithgar))
* [`b4aac345b`](https://github.com/npm/cli/commit/b4aac345b0a7cdec4d713c5be4daea37330b2b26)
[#3754](https://github.com/npm/cli/issues/3754)
fix(config): user-agent properly shows ci
([@wraithgar](https://github.com/wraithgar))
* [`b807cd62e`](https://github.com/npm/cli/commit/b807cd62eabe337e3243415c9870ea36d9289e12)
[#3738](https://github.com/npm/cli/issues/3738)
fix(search): return valid json for no results
([@AyushRawal](https://github.com/AyushRawal))
* [`2def17a3b`](https://github.com/npm/cli/commit/2def17a3b625b92b40c6185ff4b47e8ed006492c)
[#3760](https://github.com/npm/cli/issues/3760)
fix(install): use configured registry when checking manifest
([@yacoman89](https://github.com/yacoman89))
* [`ca792acdd`](https://github.com/npm/cli/commit/ca792acdd4ba683d8415c88188ec6739033fb4fd)
[#3761](https://github.com/npm/cli/issues/3761)
fix(logs): clean args for failed commands
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`59743972c`](https://github.com/npm/cli/commit/59743972c2ae1d2dd601aaa6c59974c686b1cb29)
[#3747](https://github.com/npm/cli/issues/3747)
fix(did-you-mean): succeed if cwd is not a package
([@wraithgar](https://github.com/wraithgar))
* [`ac8e4ad18`](https://github.com/npm/cli/commit/ac8e4ad18a6b726dd2c3abcb0f605701cca0ae2c)
`[email protected]`:
* fix: bin script path
* [`371655a6b`](https://github.com/npm/cli/commit/371655a6b0e6664fec67f16cb247cc9f174a5197)
`[email protected]`:
* fix: re-emit 'error' event if missed and new listener added
* fix: do not blow up if process is missing

### DOCUMENTATION

* [`4d93b484a`](https://github.com/npm/cli/commit/4d93b484abb50e3704fb436db572b93fb36c7ac3)
[#3759](https://github.com/npm/cli/issues/3759)
fix(docs): use correct hyperlink to package-json
([@nategreen](https://github.com/nategreen))

## v7.23.0 (2021-09-09)

### FEATURES
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ It should be noted that our team does not accept third-party dependency updates/

### Tools/Automation

Our core team is responsible for the maintaince of the tooling/automation in this project & we ask collaborators to kindle not make changes to these when contributing (ex. `.github/*`, `.eslintrc.json`, `.licensee.json` etc.)
Our core team is responsible for the maintenance of the tooling/automation in this project & we ask collaborators to kindly not make changes to these when contributing (ex. `.github/*`, `.eslintrc.json`, `.licensee.json` etc.)
2 changes: 1 addition & 1 deletion docs/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ package.json file, then your package scripts would have the
in your code with `process.env.npm_package_name` and
`process.env.npm_package_version`, and so on for other fields.

See [`package-json.md`](/using-npm/package-json) for more on package configs.
See [`package-json.md`](/configuring-npm/package-json) for more on package configs.

#### current lifecycle event

Expand Down
3 changes: 2 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class Install extends ArboristWorkspaceCmd {
// be very strict about engines when trying to update npm itself
const npmInstall = args.find(arg => arg.startsWith('npm@') || arg === 'npm')
if (isGlobalInstall && npmInstall) {
const npmManifest = await pacote.manifest(npmInstall)
const npmOptions = this.npm.flatOptions
const npmManifest = await pacote.manifest(npmInstall, npmOptions)
try {
checks.checkEngine(npmManifest, npmManifest.version, process.version)
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion lib/search/format-package-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class JSONOutputStream extends Minipass {
}

end () {
super.write(this._didFirst ? ']\n' : '\n]\n')
super.write(this._didFirst ? ']\n' : '\n[]\n')
super.end()
}
}
Expand Down
12 changes: 11 additions & 1 deletion lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2053,10 +2053,14 @@ define('user-agent', {
.replace(/\{workspaces\}/gi, inWorkspaces)
.replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '')
.trim()

// We can't clobber the original or else subsequent flattening will fail
// (i.e. when we change the underlying config values)
// obj[key] = flatOptions.userAgent

// user-agent is a unique kind of config item that gets set from a template
// and ends up translated. Because of this, the normal "should we set this
// to process.env also doesn't work
obj[key] = flatOptions.userAgent
process.env.npm_config_user_agent = flatOptions.userAgent
},
})
Expand Down Expand Up @@ -2140,6 +2144,9 @@ define('workspace', {
a workspace which does not yet exist, to create the folder and set it
up as a brand new workspace within the project.
`,
flatten: (key, obj, flatOptions) => {
definitions['user-agent'].flatten('user-agent', obj, flatOptions)
},
})

define('workspaces', {
Expand All @@ -2151,6 +2158,9 @@ define('workspaces', {
Enable running a command in the context of **all** the configured
workspaces.
`,
flatten: (key, obj, flatOptions) => {
definitions['user-agent'].flatten('user-agent', obj, flatOptions)
},
})

define('yes', {
Expand Down
29 changes: 15 additions & 14 deletions lib/utils/did-you-mean.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ const readJson = require('read-package-json-fast')
const { cmdList } = require('./cmd-list.js')

const didYouMean = async (npm, path, scmd) => {
const bestCmd = cmdList
let best = cmdList
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 && scmd !== cmd)
.map(str => ` npm ${str} # ${npm.commands[str].description}`)

const pkg = await readJson(`${path}/package.json`)
const { scripts } = pkg
// We would already be suggesting this in `npm x` so omit them here
const runScripts = ['stop', 'start', 'test', 'restart']
const bestRun = Object.keys(scripts || {})
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 &&
!runScripts.includes(cmd))
.map(str => ` npm run ${str} # run the "${str}" package script`)

const { bin } = pkg
const bestBin = Object.keys(bin || {})
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4)
.map(str => ` npm exec ${str} # run the "${str}" command from either this or a remote npm package`)

const best = [...bestCmd, ...bestRun, ...bestBin]
try {
const { bin, scripts } = await readJson(`${path}/package.json`)
best = best.concat(
Object.keys(scripts || {})
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 &&
!runScripts.includes(cmd))
.map(str => ` npm run ${str} # run the "${str}" package script`),
Object.keys(bin || {})
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4)
.map(str => ` npm exec ${str} # run the "${str}" command from either this or a remote npm package`)
)
} catch (_) {
// gracefully ignore not being in a folder w/ a package.json
}

if (best.length === 0)
return ''
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ module.exports = (er, npm) => {
detail.push(['signal', er.signal])

if (er.cmd && Array.isArray(er.args))
detail.push(['command', ...[er.cmd, ...er.args]])
detail.push(['command', ...[er.cmd, ...er.args.map(replaceInfo)]])

if (er.stdout)
detail.push(['', er.stdout.trim()])
Expand Down
2 changes: 1 addition & 1 deletion lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class View extends BaseCommand {
email: color.cyan(manifest._npmUser.email),
}),
modified: !packument.time ? undefined
: color.yellow(relativeDate(packument.time[packument.version])),
: color.yellow(relativeDate(packument.time[manifest.version])),
maintainers: (packument.maintainers || []).map((u) => unparsePerson({
name: color.yellow(u.name),
email: color.cyan(u.email),
Expand Down
15 changes: 0 additions & 15 deletions node_modules/init-package-json/LICENSE

This file was deleted.

18 changes: 18 additions & 0 deletions node_modules/init-package-json/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading