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

v7.20.6 #3643

Merged
merged 14 commits into from Aug 12, 2021
2 changes: 2 additions & 0 deletions AUTHORS
Expand Up @@ -789,3 +789,5 @@ Aluneed <31174087+aluneed@users.noreply.github.com>
relrelb <relrelbachar@gmail.com>
Cameron Tacklind <cameron@tacklind.com>
Demira Dimitrova <demiradimitrova@github.com>
AkiJoey <akijoey1010635951@gmail.com>
austincho <austin.cho14@gmail.com>
37 changes: 37 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,40 @@
## v7.20.6 (2021-08-12)

### DEPENDENCIES

* [`5bebf280f`](https://github.com/npm/cli/commit/5bebf280f228e818524f6989caab1cfba1ffaf90)
`tar@6.1.8`
* fix: reserve paths case-insensitively
* [`5d89de44d`](https://github.com/npm/cli/commit/5d89de44daa636dc151eaefcafabb357540d35ce)
`tar@6.1.7`:
* fix: normalize paths on Windows systems
* [`a1bdbea97`](https://github.com/npm/cli/commit/a1bdbea974ebfc6694b4c8ad5da86215c2924dde)
[#3569](https://github.com/npm/cli/issues/3569)
* remove byte-size
([@wraithgar](https://github.com/wraithgar))
* [`61782fa85`](https://github.com/npm/cli/commit/61782fa858c278455ce144f975c6b0e3ea2d9944)
`@npmcli/map-workspaces@1.0.4`:
* fix: better error message for duplicate workspace names
* [`b88f770fa`](https://github.com/npm/cli/commit/b88f770faa2651ca0833e1c9eb361e9e07e0bbc3)
`@npmcli/arborist@2.8.1`:
* [#3632] Fix "cannot read property path of null" error in 'npm dedupe'
* fix(shrinkwrap): always set name on the root node

### DOCUMENTATION

* [`001f2c1b7`](https://github.com/npm/cli/commit/001f2c1b7e9474049a45709f0e80ee3c474a4ba9)
[#3621](https://github.com/npm/cli/issues/3621)
fix(docs): do not include certain files
([@AkiJoey](https://github.com/AkiJoey))
* [`d1812f1a6`](https://github.com/npm/cli/commit/d1812f1a627d6a4d4cb6d07d7735d2d2cc2cf264)
[#3630](https://github.com/npm/cli/issues/3630)
fix(docs): update npm-publish access flag info
([@austincho](https://github.com/austincho))
* [`d5a099c7b`](https://github.com/npm/cli/commit/d5a099c7bf62977a5a5d8242c61f323a88e27c73)
[#3615](https://github.com/npm/cli/issues/3615)
fix(readme): add nvm-windows to installers links
([@Yash-Singh1](https://github.com/Yash-Singh1))

## v7.20.5 (2021-08-05)

### DEPENDENCIES
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -29,6 +29,7 @@ If you're looking to manage multiple versions of **`node`** &/or **`npm`**, cons
* [**`volta`**](https://github.com/volta-cli/volta)
* [**`nodenv`**](https://github.com/nodenv/nodenv)
* [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs)
* [**`nvm-windows`**](https://github.com/coreybutler/nvm-windows)

### Usage

Expand Down
5 changes: 5 additions & 0 deletions docs/content/commands/npm-publish.md
Expand Up @@ -132,6 +132,11 @@ If you want your scoped package to be publicly viewable (and installable)
set `--access=public`. The only valid values for `access` are `public` and
`restricted`. Unscoped packages _always_ have an access level of `public`.

Note: Using the `--access` flag on the `npm publish` command will only set
the package access level on the initial publish of the package. Any subsequent `npm publish`
commands using the `--access` flag will not have an effect to the access level.
To make changes to the access level after the initial publish use `npm access`.

#### `dry-run`

* Default: false
Expand Down
4 changes: 1 addition & 3 deletions docs/content/configuring-npm/package-json.md
Expand Up @@ -286,12 +286,10 @@ Certain files are always included, regardless of settings:

* `package.json`
* `README`
* `CHANGES` / `CHANGELOG` / `HISTORY`
* `LICENSE` / `LICENCE`
* `NOTICE`
* The file in the "main" field

`README`, `CHANGES`, `LICENSE` & `NOTICE` can have any case and extension.
`README` & `LICENSE` can have any case and extension.

Conversely, some files are always ignored:

Expand Down
22 changes: 22 additions & 0 deletions lib/utils/format-bytes.js
@@ -0,0 +1,22 @@
// Convert bytes to printable output, for file reporting in tarballs
// Only supports up to GB because that's way larger than anything the registry
// supports anyways.

const formatBytes = (bytes, space = true) => {
let spacer = ''
if (space)
spacer = ' '

if (bytes < 1000) // B
return `${bytes}${spacer}B`

if (bytes < 1000000) // kB
return `${(bytes / 1000).toFixed(1)}${spacer}kB`

if (bytes < 1000000000) // MB
return `${(bytes / 1000000).toFixed(1)}${spacer}MB`

return `${(bytes / 1000000000).toFixed(1)}${spacer}GB`
}

module.exports = formatBytes
10 changes: 5 additions & 5 deletions lib/utils/tar.js
@@ -1,7 +1,7 @@
const tar = require('tar')
const ssri = require('ssri')
const npmlog = require('npmlog')
const byteSize = require('byte-size')
const formatBytes = require('./format-bytes.js')
const columnify = require('columnify')

const logTar = (tarball, opts = {}) => {
Expand All @@ -11,9 +11,9 @@ const logTar = (tarball, opts = {}) => {
log.notice('=== Tarball Contents ===')
if (tarball.files.length) {
log.notice('', columnify(tarball.files.map((f) => {
const bytes = byteSize(f.size)
const bytes = formatBytes(f.size, false)
return (/^node_modules\//.test(f.path)) ? null
: { path: f.path, size: `${bytes.value}${bytes.unit}` }
: { path: f.path, size: `${bytes}` }
}).filter(f => f), {
include: ['size', 'path'],
showHeaders: false,
Expand All @@ -28,8 +28,8 @@ const logTar = (tarball, opts = {}) => {
{ name: 'name:', value: tarball.name },
{ name: 'version:', value: tarball.version },
tarball.filename && { name: 'filename:', value: tarball.filename },
{ name: 'package size:', value: byteSize(tarball.size) },
{ name: 'unpacked size:', value: byteSize(tarball.unpackedSize) },
{ name: 'package size:', value: formatBytes(tarball.size) },
{ name: 'unpacked size:', value: formatBytes(tarball.unpackedSize) },
{ name: 'shasum:', value: tarball.shasum },
{
name: 'integrity:',
Expand Down
6 changes: 3 additions & 3 deletions lib/view.js
@@ -1,13 +1,13 @@
// npm view [pkg [pkg ...]]

const byteSize = require('byte-size')
const color = require('ansicolors')
const columns = require('cli-columns')
const fs = require('fs')
const jsonParse = require('json-parse-even-better-errors')
const log = require('npmlog')
const npa = require('npm-package-arg')
const { resolve } = require('path')
const formatBytes = require('./utils/format-bytes.js')
const relativeDate = require('tiny-relative-date')
const semver = require('semver')
const style = require('ansistyles')
Expand Down Expand Up @@ -315,7 +315,7 @@ class View extends BaseCommand {
tags.push(`${style.bright(color.green(t))}: ${version}`)
})
const unpackedSize = manifest.dist.unpackedSize &&
byteSize(manifest.dist.unpackedSize)
formatBytes(manifest.dist.unpackedSize, true)
const licenseField = manifest.license || 'Proprietary'
const info = {
name: color.green(manifest.name),
Expand Down Expand Up @@ -356,7 +356,7 @@ class View extends BaseCommand {
manifest.dist.integrity && color.yellow(manifest.dist.integrity),
fileCount:
manifest.dist.fileCount && color.yellow(manifest.dist.fileCount),
unpackedSize: unpackedSize && color.yellow(unpackedSize.value) + ' ' + unpackedSize.unit,
unpackedSize: unpackedSize && color.yellow(unpackedSize),
}
if (info.license.toLowerCase().trim() === 'proprietary')
info.license = style.bright(color.red(info.license))
Expand Down
46 changes: 46 additions & 0 deletions node_modules/@npmcli/arborist/bin/dedupe.js

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

11 changes: 0 additions & 11 deletions node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js

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

19 changes: 8 additions & 11 deletions node_modules/@npmcli/arborist/lib/can-place-dep.js

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

17 changes: 16 additions & 1 deletion node_modules/@npmcli/arborist/lib/place-dep.js

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

6 changes: 4 additions & 2 deletions 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.

7 changes: 6 additions & 1 deletion node_modules/@npmcli/map-workspaces/index.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/map-workspaces/package.json

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

21 changes: 0 additions & 21 deletions node_modules/byte-size/LICENSE

This file was deleted.