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/v8.1.2 #3957

Merged
merged 6 commits into from
Oct 28, 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
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -805,3 +805,4 @@ Edward Thomson <[email protected]>
Behnam Mohammadi <[email protected]>
gfyoung <[email protected]>
Luke Karrys <[email protected]>
Pelle Wessman <[email protected]>
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## v8.1.2 (2021-10-28)

### BUG FIXES

* [`cb9f43551`](https://github.com/npm/cli/commit/cb9f43551f46bf27095cd7bd6c1885a441004cd2)
[#3949](https://github.com/npm/cli/issues/3949)
allow `--lockfile-version` config to be string and coerce to number ([@lukekarrys](https://github.com/lukekarrys))
* [`070901d7a`](https://github.com/npm/cli/commit/070901d7a6e3110a04ef41d8fcf14ffbfcce1496)
[#3943](https://github.com/npm/cli/issues/3943)
fix(publish): clean args before logging
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`8af94726b`](https://github.com/npm/cli/commit/8af94726b098031c7c0cae7ed50cc4e2e3499181)
[#3953](https://github.com/npm/cli/issues/3953)
`[email protected]`
* [`38cee94`](https://github.com/npm/arborist/commit/38cee94afa53d578830cc282348a803a8a6eefad)
[#340](https://github.com/npm/arborist/pull/340)
fix: set lockfileVersion from file during reset
* [`d310bd3`](https://github.com/npm/arborist/commit/d310bd3290c3a81e8285ceeb6eda9c9b5aa867d7)
[#339](https://github.com/npm/arborist/pull/339)
fix: always set originalLockfileVersion when doing shrinkwrap reset

## v8.1.1 (2021-10-21)

### DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ When passed to `npm config` this refers to which config file to use.

* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
* Type: null, 1, 2, or 3
* Type: null, 1, 2, 3, "1", "2", or "3"

Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
Expand Down
3 changes: 2 additions & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const pacote = require('pacote')
const npa = require('npm-package-arg')
const npmFetch = require('npm-registry-fetch')
const chalk = require('chalk')
const replaceInfo = require('./utils/replace-info.js')

const otplease = require('./utils/otplease.js')
const { getContents, logTar } = require('./utils/tar.js')
Expand Down Expand Up @@ -68,7 +69,7 @@ class Publish extends BaseCommand {
if (args.length !== 1)
throw this.usageError()

log.verbose('publish', args)
log.verbose('publish', replaceInfo(args))

const unicode = this.npm.config.get('unicode')
const dryRun = this.npm.config.get('dry-run')
Expand Down
6 changes: 4 additions & 2 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ define('location', {

define('lockfile-version', {
default: null,
type: [null, 1, 2, 3],
type: [null, 1, 2, 3, '1', '2', '3'],
defaultDescription: `
Version 2 if no lockfile or current lockfile version less than or equal to
2, otherwise maintain current lockfile version
Expand All @@ -1179,7 +1179,9 @@ define('lockfile-version', {
on disk than lockfile version 2, but not interoperable with older npm
versions. Ideal if all users are on npm version 7 and higher.
`,
flatten,
flatten: (key, obj, flatOptions) => {
flatOptions.lockfileVersion = obj[key] && parseInt(obj[key], 10)
},
})

define('loglevel', {
Expand Down
35 changes: 23 additions & 12 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.

11 changes: 5 additions & 6 deletions node_modules/@npmcli/arborist/package.json

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

18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "8.1.1",
"version": "8.1.2",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
Expand Down Expand Up @@ -55,7 +55,7 @@
},
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/arborist": "^4.0.2",
"@npmcli/arborist": "^4.0.3",
"@npmcli/ci-detect": "^1.4.0",
"@npmcli/config": "^2.3.0",
"@npmcli/map-workspaces": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for lockf

* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
* Type: null, 1, 2, or 3
* Type: null, 1, 2, 3, "1", "2", or "3"

Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ When passed to \`npm config\` this refers to which config file to use.

* Default: Version 2 if no lockfile or current lockfile version less than or
equal to 2, otherwise maintain current lockfile version
* Type: null, 1, 2, or 3
* Type: null, 1, 2, 3, "1", "2", or "3"

Set the lockfile format version to be used in package-lock.json and
npm-shrinkwrap-json files. Possible options are:
Expand Down
9 changes: 9 additions & 0 deletions test/lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,3 +892,12 @@ t.test('workspaces derived', t => {
t.equal(flat.workspacesEnabled, false)
t.end()
})

t.test('lockfile version', t => {
const flat = {}
definitions['lockfile-version'].flatten('lockfile-version', {
'lockfile-version': '3',
}, flat)
t.match(flat.lockfileVersion, 3, 'flattens to a number')
t.end()
})