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 6.12.0 #264

Merged
merged 27 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sudo: true
# need to declare the language as well as the matrix below
language: node_js

Expand Down
6 changes: 6 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,9 @@ Olivier Chevet <[email protected]>
Maël Nison <[email protected]>
Sara Ahbabou <[email protected]>
Gareth Jones <[email protected]>
Ruy Adorno <[email protected]>
Michael Perrotte <[email protected]>
Ben Blank <[email protected]>
Christian Clauss <[email protected]>
Nikita Lebedev <[email protected]>
Henrik Gemal <[email protected]>
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
## 6.12.0 (2019-10-08):

Now `npm ci` runs prepare scripts for git dependencies, and respects the
`--no-optional` argument. Warnings for `engine` mismatches are printed
again. Various other fixes and cleanups.

### BUG FIXES

* [`890b245dc`](https://github.com/npm/cli/commit/890b245dc1f609590d8ab993fac7cf5a37ed46a5)
[#252](https://github.com/npm/cli/pull/252) ci: add dirPacker to options
([@claudiahdz](https://github.com/claudiahdz))
* [`f3299acd0`](https://github.com/npm/cli/commit/f3299acd0b4249500e940776aca77cc6c0977263)
[#257](https://github.com/npm/cli/pull/257)
[npm.community#4792](https://npm.community/t/engines-and-engines-strict-ignored/4792)
warn message on engine mismatch
([@ruyadorno](https://github.com/ruyadorno))
* [`bbc92fb8f`](https://github.com/npm/cli/commit/bbc92fb8f3478ff67071ebaff551f01c1ea42ced)
[#259](https://github.com/npm/cli/pull/259)
[npm.community#10288](https://npm.community/t/npm-token-err-figgypudding-options-cannot-be-modified-use-concat-instead/10288)
Fix figgyPudding error in `npm token`
([@benblank](https://github.com/benblank))
* [`70f54dcb5`](https://github.com/npm/cli/commit/70f54dcb5693b301c6b357922b7e8d16b57d8b00)
[#241](https://github.com/npm/cli/pull/241) doctor: Make OK more
consistent ([@gemal](https://github.com/gemal))

### FEATURES

* [`ed993a29c`](https://github.com/npm/cli/commit/ed993a29ccf923425317c433844d55dbea2f23ee)
[#249](https://github.com/npm/cli/pull/249) Add CI environment variables
to user-agent ([@isaacs](https://github.com/isaacs))
* [`f6b0459a4`](https://github.com/npm/cli/commit/f6b0459a466a2c663dbd549cdc331e7732552dca)
[#248](https://github.com/npm/cli/pull/248) Add option to save
package-lock without formatting Adds a new config
`--format-package-lock`, which defaults to true.
([@bl00mber](https://github.com/bl00mber))

### DEPENDENCIES

* [`0ca063c5d`](https://github.com/npm/cli/commit/0ca063c5dc961c4aa17373f4b33fb54c51c8c8d6)
`[email protected]`:
- fix: filter functions and undefined out of makeEnv
([@isaacs](https://github.com/isaacs))
* [`5df6b0ea2`](https://github.com/npm/cli/commit/5df6b0ea2e3106ba65bba649cc8d7f02f4738236)
`[email protected]`:
- fix: pack git directories properly
([@claudiahdz](https://github.com/claudiahdz))
- respect no-optional argument
([@cruzdanilo](https://github.com/cruzdanilo))
* [`7e04f728c`](https://github.com/npm/cli/commit/7e04f728cc4cd4853a8fc99e2df0a12988897589)
`[email protected]`
* [`5c380e5a3`](https://github.com/npm/cli/commit/5c380e5a33d760bb66a4285b032ae5f50af27199)
`[email protected]` ([@isaacs](https://github.com/isaacs))
* [`62f2ca692`](https://github.com/npm/cli/commit/62f2ca692ac0c0467ef4cf74f91777a5175258c4)
`[email protected]` ([@isaacs](https://github.com/isaacs))
* [`0ff0ea47a`](https://github.com/npm/cli/commit/0ff0ea47a8840dd7d952bde7f7983a5016cda8ea)
`[email protected]` ([@isaacs](https://github.com/isaacs))
* [`f46edae94`](https://github.com/npm/cli/commit/f46edae9450b707650a0efab09aa1e9295a18070)
`[email protected]` ([@isaacs](https://github.com/isaacs))

### TESTING

* [`44a2b036b`](https://github.com/npm/cli/commit/44a2b036b34324ec85943908264b2e36de5a9435)
[#262](https://github.com/npm/cli/pull/262) fix root-ownership race
conditions in meta-test ([@isaacs](https://github.com/isaacs))

## 6.11.3 (2019-09-03):

Fix npm ci regressions and npm outdated depth.
Expand Down
7 changes: 7 additions & 0 deletions doc/misc/npm-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ Makes various commands more forceful.
* skips cache when requesting from the registry.
* prevents checks against clobbering non-npm files.

### format-package-lock

* Default: true
* Type: Boolean

Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable file.

### fetch-retries

* Default: 2
Expand Down
4 changes: 3 additions & 1 deletion lib/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const npm = require('./npm.js')
const Installer = require('libcipm')
const log = require('npmlog')
const path = require('path')
const pack = require('./pack.js')

ci.usage = 'npm ci'

Expand All @@ -27,7 +28,8 @@ function ci (args, cb) {
fmode: npm.modes.file,
umask: npm.modes.umask,
npmVersion: npm.version,
tmp: npm.tmp
tmp: npm.tmp,
dirPacker: pack.packGitDep
}

for (const key in npm.config.list[0]) {
Expand Down
5 changes: 4 additions & 1 deletion lib/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
editor: osenv.editor(),
'engine-strict': false,
force: false,
'format-package-lock': true,

'fetch-retries': 2,
'fetch-retry-factor': 10,
Expand Down Expand Up @@ -201,7 +202,8 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'user-agent': 'npm/{npm-version} ' +
'node/{node-version} ' +
'{platform} ' +
'{arch}',
'{arch} ' +
'{ci}',
'read-only': false,
'rebuild-bundle': true,
registry: 'https://registry.npmjs.org/',
Expand Down Expand Up @@ -282,6 +284,7 @@ exports.types = {
editor: String,
'engine-strict': Boolean,
force: Boolean,
'format-package-lock': Boolean,
'fetch-retries': Number,
'fetch-retry-factor': Number,
'fetch-retry-mintimeout': Number,
Expand Down
2 changes: 1 addition & 1 deletion lib/doctor/check-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function checkPing (cb) {
if (err && err.code && err.code.match(/^E\d{3}$/)) {
return cb(null, [err.code.substr(1)])
} else {
cb(null, [200, 'OK'])
cb(null, [200, 'ok'])
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion lib/install/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Object.keys(actions).forEach(function (actionName) {
if (pkg.knownInstallable) {
actionP = runAction(action, staging, pkg, log)
} else {
actionP = isInstallable(pkg.package).then(() => {
actionP = isInstallable(null, pkg.package).then(() => {
pkg.knownInstallable = true
return runAction(action, staging, pkg, log)
})
Expand Down
2 changes: 1 addition & 1 deletion lib/install/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ function resolveWithNewModule (pkg, tree, log, next) {
validate('OOOF', arguments)

log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status')
return isInstallable(pkg, (err) => {
return isInstallable(tree, pkg, (err) => {
let installable = !err
addBundled(pkg, (bundleErr) => {
var parent = earliestInstallable(tree, tree, pkg, log) || tree
Expand Down
25 changes: 18 additions & 7 deletions lib/install/validate-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (idealTree, args, next) {
chain([
[hasMinimumFields, pkg],
[checkSelf, idealTree, pkg, force],
[isInstallable, pkg]
[isInstallable, idealTree, pkg]
], done)
}, next)
}
Expand All @@ -31,13 +31,24 @@ function hasMinimumFields (pkg, cb) {
}
}

function getWarnings (pkg) {
while (pkg.parent) pkg = pkg.parent
if (!pkg.warnings) pkg.warnings = []
return pkg.warnings
function setWarnings (idealTree, warn) {
function top (tree) {
if (tree.parent) return top(tree.parent)
return tree
}

var topTree = top(idealTree)
if (!topTree.warnings) topTree.warnings = []

if (topTree.warnings.every(i => (
i.code !== warn.code ||
i.required !== warn.required ||
i.pkgid !== warn.pkgid))) {
topTree.warnings.push(warn)
}
}

var isInstallable = module.exports.isInstallable = function (pkg, next) {
var isInstallable = module.exports.isInstallable = function (idealTree, pkg, next) {
var force = npm.config.get('force')
var nodeVersion = npm.config.get('node-version')
if (/-/.test(nodeVersion)) {
Expand All @@ -48,7 +59,7 @@ var isInstallable = module.exports.isInstallable = function (pkg, next) {
var strict = npm.config.get('engine-strict')
checkEngine(pkg, npm.version, nodeVersion, force, strict, iferr(next, thenWarnEngineIssues))
function thenWarnEngineIssues (warn) {
if (warn) getWarnings(pkg).push(warn)
if (idealTree && warn) setWarnings(idealTree, warn)
checkPlatform(pkg, force, next)
}
}
Expand Down
22 changes: 21 additions & 1 deletion lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,27 @@
ua = ua.replace(/\{npm-version\}/gi, npm.version)
ua = ua.replace(/\{platform\}/gi, process.platform)
ua = ua.replace(/\{arch\}/gi, process.arch)
config.set('user-agent', ua)

// continuous integration platforms
const ci = process.env.GERRIT_PROJECT ? 'ci/gerrit'
: process.env.GITLAB_CI ? 'ci/gitlab'
: process.env.CIRCLECI ? 'ci/circle-ci'
: process.env.SEMAPHORE ? 'ci/semaphore'
: process.env.DRONE ? 'ci/drone'
: process.env.GITHUB_ACTION ? 'ci/github-actions'
: process.env.TDDIUM ? 'ci/tddium'
: process.env.JENKINS_URL ? 'ci/jenkins'
: process.env['bamboo.buildKey'] ? 'ci/bamboo'
: process.env.GO_PIPELINE_NAME ? 'ci/gocd'
// codeship and a few others
: process.env.CI_NAME ? `ci/${process.env.CI_NAME}`
// test travis last, since many of these mimic it
: process.env.TRAVIS ? 'ci/travis-ci'
: process.env.CI === 'true' || process.env.CI === '1' ? 'ci/custom'
: ''
ua = ua.replace(/\{ci\}/gi, ci)

config.set('user-agent', ua.trim())

if (config.get('metrics-registry') == null) {
config.set('metrics-registry', config.get('registry'))
Expand Down
8 changes: 6 additions & 2 deletions lib/shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,15 @@ function checkPackageFile (dir, name) {
return readFile(
file, 'utf8'
).then((data) => {
const format = npm.config.get('format-package-lock') !== false
const indent = format ? detectIndent(data).indent : 0
const newline = format ? detectNewline(data) : 0

return {
path: file,
raw: data,
indent: detectIndent(data).indent,
newline: detectNewline(data)
indent,
newline
}
}).catch({code: 'ENOENT'}, () => {})
}
1 change: 0 additions & 1 deletion lib/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ function config () {
})
} else {
conf = conf.concat({ auth: {} })
conf.auth = {}
}
if (conf.otp) conf.auth.otp = conf.otp
return conf
Expand Down
1 change: 1 addition & 0 deletions node_modules/fs-minipass/index.js

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

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

Loading