Skip to content
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

Release/v7.15.1 #3340

Merged
merged 10 commits into from May 31, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [10.x, 12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x]
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x, '16.1', 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -782,3 +782,4 @@ Nariyasu Heseri <heserisiyookang@gmail.com>
rethab <rethab@protonmail.ch>
Spencer Wilson <5624115+spencerwilson@users.noreply.github.com>
Daniel Park <gimli01@github.com>
Daniel Park <daniel.park@endevors.io>
18 changes: 18 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,21 @@
## v7.15.1 (2021-05-31)

### BUG FIXES

* [`598a17a26`](https://github.com/npm/cli/commit/598a17a2671c9e3bc204dddd6488169c9a72c6a1)
[#3329](https://github.com/npm/cli/issues/3329)
fix(libnpmexec): don't detach output from npm
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`c4fc03e9e`](https://github.com/npm/cli/commit/c4fc03e9eb3a6386e8feacb67c19f0a1578dfe38)
`@npmcli/arborist@2.6.1`
* fixes reifying deps with mismatching version ranges between
actual and virtual trees
* [`9159fa62a`](https://github.com/npm/cli/commit/9159fa62a10dee09daef178fc7be161a02824004)
`libnpmexec@1.2.0`

## v7.15.0 (2021-05-27)

### FEATURES
Expand Down
8 changes: 4 additions & 4 deletions lib/diff.js
Expand Up @@ -8,7 +8,7 @@ const npmlog = require('npmlog')
const pacote = require('pacote')
const pickManifest = require('npm-pick-manifest')

const readLocalPkg = require('./utils/read-local-package.js')
const readPackageName = require('./utils/read-package-name.js')
const BaseCommand = require('./base-command.js')

class Diff extends BaseCommand {
Expand Down Expand Up @@ -97,7 +97,7 @@ class Diff extends BaseCommand {
let noPackageJson
let pkgName
try {
pkgName = await readLocalPkg(this.npm)
pkgName = await readPackageName(this.npm.prefix)
} catch (e) {
npmlog.verbose('diff', 'could not read project dir package.json')
noPackageJson = true
Expand All @@ -120,7 +120,7 @@ class Diff extends BaseCommand {
let noPackageJson
let pkgName
try {
pkgName = await readLocalPkg(this.npm)
pkgName = await readPackageName(this.npm.prefix)
} catch (e) {
npmlog.verbose('diff', 'could not read project dir package.json')
noPackageJson = true
Expand Down Expand Up @@ -238,7 +238,7 @@ class Diff extends BaseCommand {
if (semverA && semverB) {
let pkgName
try {
pkgName = await readLocalPkg(this.npm)
pkgName = await readPackageName(this.npm.prefix)
} catch (e) {
npmlog.verbose('diff', 'could not read project dir package.json')
}
Expand Down
14 changes: 8 additions & 6 deletions lib/dist-tag.js
Expand Up @@ -4,7 +4,7 @@ const regFetch = require('npm-registry-fetch')
const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const readPackageName = require('./utils/read-package-name.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

Expand Down Expand Up @@ -64,7 +64,7 @@ class DistTag extends BaseCommand {
// should be listing the existing tags
return this.list(cmdName, opts)
} else
throw this.usage
throw this.usageError()
}

execWorkspaces (args, filters, cb) {
Expand Down Expand Up @@ -102,7 +102,7 @@ class DistTag extends BaseCommand {
log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version)

if (!spec.name || !version || !defaultTag)
throw this.usage
throw this.usageError()

const t = defaultTag.trim()

Expand Down Expand Up @@ -135,7 +135,7 @@ class DistTag extends BaseCommand {
log.verbose('dist-tag del', tag, 'from', spec.name)

if (!spec.name)
throw this.usage
throw this.usageError()

const tags = await this.fetchTags(spec, opts)
if (!tags[tag]) {
Expand All @@ -157,9 +157,11 @@ class DistTag extends BaseCommand {

async list (spec, opts) {
if (!spec) {
const pkg = await readLocalPkgName(this.npm)
if (this.npm.config.get('global'))
throw this.usageError()
const pkg = await readPackageName(this.npm.prefix)
if (!pkg)
throw this.usage
throw this.usageError()

return this.list(pkg, opts)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/exec.js
Expand Up @@ -76,8 +76,8 @@ class Exec extends BaseCommand {
localBin,
log,
globalBin,
output,
} = this.npm
const output = (...outputArgs) => this.npm.output(...outputArgs)
const scriptShell = this.npm.config.get('script-shell') || undefined
const packages = this.npm.config.get('package')
const yes = this.npm.config.get('yes')
Expand Down
7 changes: 6 additions & 1 deletion lib/init.js
Expand Up @@ -113,8 +113,13 @@ class Init extends BaseCommand {
localBin,
log,
globalBin,
output,
} = this.npm
// this function is definitely called. But because of coverage map stuff
// it ends up both uncovered, and the coverage report doesn't even mention.
// the tests do assert that some output happens, so we know this line is
// being hit.
/* istanbul ignore next */
const output = (...outputArgs) => this.npm.output(...outputArgs)
const locationMsg = await getLocationMsg({ color, path })
const runPath = path
const scriptShell = this.npm.config.get('script-shell') || undefined
Expand Down
19 changes: 14 additions & 5 deletions lib/owner.js
Expand Up @@ -4,7 +4,7 @@ const npmFetch = require('npm-registry-fetch')
const pacote = require('pacote')

const otplease = require('./utils/otplease.js')
const readLocalPkg = require('./utils/read-local-package.js')
const readLocalPkgName = require('./utils/read-package-name.js')
const BaseCommand = require('./base-command.js')

class Owner extends BaseCommand {
Expand Down Expand Up @@ -47,7 +47,9 @@ class Owner extends BaseCommand {

// reaches registry in order to autocomplete rm
if (argv[2] === 'rm') {
const pkgName = await readLocalPkg(this.npm)
if (this.npm.config.get('global'))
return []
const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName)
return []

Expand Down Expand Up @@ -84,7 +86,10 @@ class Owner extends BaseCommand {

async ls (pkg, opts) {
if (!pkg) {
const pkgName = await readLocalPkg(this.npm)
if (this.npm.config.get('global'))
throw this.usageError()

const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName)
throw this.usageError()

Expand Down Expand Up @@ -113,7 +118,9 @@ class Owner extends BaseCommand {
throw this.usageError()

if (!pkg) {
const pkgName = await readLocalPkg(this.npm)
if (this.npm.config.get('global'))
throw this.usageError()
const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName)
throw this.usageError()

Expand All @@ -131,7 +138,9 @@ class Owner extends BaseCommand {
throw this.usageError()

if (!pkg) {
const pkgName = await readLocalPkg(this.npm)
if (this.npm.config.get('global'))
throw this.usageError()
const pkgName = await readLocalPkgName(this.npm.prefix)
if (!pkgName)
throw this.usageError()

Expand Down
@@ -1,10 +1,7 @@
const { resolve } = require('path')
const readJson = require('read-package-json-fast')
async function readLocalPackageName (npm) {
if (npm.config.get('global'))
return

const filepath = resolve(npm.prefix, 'package.json')
async function readLocalPackageName (prefix) {
const filepath = resolve(prefix, 'package.json')
const json = await readJson(filepath)
return json.name
}
Expand Down
20 changes: 18 additions & 2 deletions node_modules/@npmcli/arborist/lib/diff.js

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

7 changes: 6 additions & 1 deletion node_modules/@npmcli/arborist/lib/shrinkwrap.js

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

2 changes: 1 addition & 1 deletion node_modules/@npmcli/arborist/package.json

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

17 changes: 17 additions & 0 deletions node_modules/libnpmexec/CHANGELOG.md

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

2 changes: 1 addition & 1 deletion node_modules/libnpmexec/README.md

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

3 changes: 2 additions & 1 deletion node_modules/libnpmexec/lib/index.js

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

1 change: 1 addition & 0 deletions node_modules/libnpmexec/lib/is-windows.js

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

2 changes: 1 addition & 1 deletion node_modules/libnpmexec/package.json

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