From 4e7fe5ad599951fdc3d2363f4fcc9ea671f050d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Description
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard
in npm’s source tree will show:
npm@7.23.0 /path/to/npm
+npm@7.24.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 6670f691d59ac6..0956b0ef0d92a6 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -148,7 +148,7 @@ Table of contents
npm <command> [args]
Version
-7.23.0
+7.24.0
Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/docs/output/using-npm/scripts.html b/deps/npm/docs/output/using-npm/scripts.html
index 6dcf9a0416e4c2..1b4556a1f85dd1 100644
--- a/deps/npm/docs/output/using-npm/scripts.html
+++ b/deps/npm/docs/output/using-npm/scripts.html
@@ -379,7 +379,7 @@
package.json vars
npm_package_version
set to “1.2.5”. You can access these variables
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
for more on package configs.
+See package-json.md
for more on package configs.
current lifecycle event
Lastly, the npm_lifecycle_event
environment variable is set to
whichever stage of the cycle is being executed. So, you could have a
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 1589ff589c38e2..99f75b71384fa6 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -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) {
diff --git a/deps/npm/lib/search/format-package-stream.js b/deps/npm/lib/search/format-package-stream.js
index c88df5eb4be04d..fb7d81856d63f4 100644
--- a/deps/npm/lib/search/format-package-stream.js
+++ b/deps/npm/lib/search/format-package-stream.js
@@ -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()
}
}
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index 092e0fc435cb4e..009f60a7bce61d 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -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
},
})
@@ -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', {
@@ -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', {
diff --git a/deps/npm/lib/utils/did-you-mean.js b/deps/npm/lib/utils/did-you-mean.js
index 0cfdd035255eb1..c324253af24065 100644
--- a/deps/npm/lib/utils/did-you-mean.js
+++ b/deps/npm/lib/utils/did-you-mean.js
@@ -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 ''
diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js
index 6e12bcb918eef8..9343d37d541495 100644
--- a/deps/npm/lib/utils/error-message.js
+++ b/deps/npm/lib/utils/error-message.js
@@ -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()])
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js
index f4fc5974eeeca7..0124bfb7d35433 100644
--- a/deps/npm/lib/view.js
+++ b/deps/npm/lib/view.js
@@ -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),
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 8ff55b216f2a4b..e9c5d78d82abf1 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@7\.23\.0 /path/to/npm
+npm@7\.24\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index e9e11652387d3e..8e07933b219606 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm [args]
.RE
.SS Version
.P
-7\.23\.0
+7\.24\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/node_modules/init-package-json/LICENSE b/deps/npm/node_modules/init-package-json/LICENSE
deleted file mode 100644
index 05eeeb88c2ef4c..00000000000000
--- a/deps/npm/node_modules/init-package-json/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/init-package-json/LICENSE.md b/deps/npm/node_modules/init-package-json/LICENSE.md
new file mode 100644
index 00000000000000..845be76f64e789
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/LICENSE.md
@@ -0,0 +1,18 @@
+ISC License
+
+Copyright npm, Inc.
+
+Permission to use, copy, modify, and/or distribute this
+software for any purpose with or without fee is hereby
+granted, provided that the above copyright notice and this
+permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL
+WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
+USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/lib/default-input.js
similarity index 64%
rename from deps/npm/node_modules/init-package-json/default-input.js
rename to deps/npm/node_modules/init-package-json/lib/default-input.js
index d1f65841d6c5a3..0003472975760b 100644
--- a/deps/npm/node_modules/init-package-json/default-input.js
+++ b/deps/npm/node_modules/init-package-json/lib/default-input.js
@@ -1,5 +1,5 @@
+/* eslint-disable no-undef */
var fs = require('fs')
-var glob = require('glob')
var path = require('path')
var validateLicense = require('validate-npm-package-license')
var validateName = require('validate-npm-package-name')
@@ -15,35 +15,57 @@ function niceName (n) {
return n.replace(/^node-|[.-]js$/g, '').replace(/\s+/g, ' ').replace(/ /g, '-').toLowerCase()
}
-function readDeps (test, excluded) { return function (cb) {
- fs.readdir('node_modules', function (er, dir) {
- if (er) return cb()
- var deps = {}
- var n = dir.length
- if (n === 0) return cb(null, deps)
- dir.forEach(function (d) {
- if (d.match(/^\./)) return next()
- if (test !== isTestPkg(d) || excluded[d])
- return next()
-
- var dp = path.join(dirname, 'node_modules', d, 'package.json')
- fs.readFile(dp, 'utf8', function (er, p) {
- if (er) return next()
- try { p = JSON.parse(p) }
- catch (e) { return next() }
- if (!p.version) return next()
- if (p._requiredBy) {
- if (!p._requiredBy.some(function (req) { return req === '#USER' })) return next()
+function readDeps (test, excluded) {
+ return function (cb) {
+ fs.readdir('node_modules', function (er, dir) {
+ if (er) {
+ return cb()
+ }
+ var deps = {}
+ var n = dir.length
+ if (n === 0) {
+ return cb(null, deps)
+ }
+ dir.forEach(function (d) {
+ if (d.match(/^\./)) {
+ return next()
+ }
+ if (test !== isTestPkg(d) || excluded[d]) {
+ return next()
}
- deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version
- return next()
+
+ var dp = path.join(dirname, 'node_modules', d, 'package.json')
+ fs.readFile(dp, 'utf8', function (er, p) {
+ if (er) {
+ return next()
+ }
+ try {
+ p = JSON.parse(p)
+ } catch (e) {
+ return next()
+ }
+ if (!p.version) {
+ return next()
+ }
+ if (p._requiredBy) {
+ if (!p._requiredBy.some(function (req) {
+ return req === '#USER'
+ })) {
+ return next()
+ }
+ }
+ deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version
+ return next()
+ })
})
+ function next () {
+ if (--n === 0) {
+ return cb(null, deps)
+ }
+ }
})
- function next () {
- if (--n === 0) return cb(null, deps)
- }
- })
-}}
+ }
+}
var name = niceName(package.name || basename)
var spec
@@ -54,16 +76,20 @@ try {
}
var scope = config.get('scope')
if (scope) {
- if (scope.charAt(0) !== '@') scope = '@' + scope
+ if (scope.charAt(0) !== '@') {
+ scope = '@' + scope
+ }
if (spec.scope) {
name = scope + '/' + spec.name.split('/')[1]
} else {
name = scope + '/' + name
}
}
-exports.name = yes ? name : prompt('package name', name, function (data) {
+exports.name = yes ? name : prompt('package name', name, function (data) {
var its = validateName(data)
- if (its.validForNewPackages) return data
+ if (its.validForNewPackages) {
+ return data
+ }
var errors = (its.errors || []).concat(its.warnings || [])
var er = new Error('Sorry, ' + errors.join(' and ') + '.')
er.notValid = true
@@ -83,7 +109,9 @@ var version = package.version ||
exports.version = yes ?
version :
prompt('version', version, function (version) {
- if (semver.valid(version)) return version
+ if (semver.valid(version)) {
+ return version
+ }
var er = new Error('Invalid version: "' + version + '"')
er.notValid = true
return er
@@ -96,22 +124,25 @@ if (!package.description) {
if (!package.main) {
exports.main = function (cb) {
fs.readdir(dirname, function (er, f) {
- if (er) f = []
+ if (er) {
+ f = []
+ }
f = f.filter(function (f) {
return f.match(/\.js$/)
})
- if (f.indexOf('index.js') !== -1)
+ if (f.indexOf('index.js') !== -1) {
f = 'index.js'
- else if (f.indexOf('main.js') !== -1)
+ } else if (f.indexOf('main.js') !== -1) {
f = 'main.js'
- else if (f.indexOf(basename + '.js') !== -1)
+ } else if (f.indexOf(basename + '.js') !== -1) {
f = basename + '.js'
- else
+ } else {
f = f[0]
+ }
- var index = f || 'index.js'
+ var index = f || 'index.js'
return cb(null, yes ? index : prompt('entry point', index))
})
}
@@ -121,18 +152,24 @@ if (!package.bin) {
exports.bin = function (cb) {
fs.readdir(path.resolve(dirname, 'bin'), function (er, d) {
// no bins
- if (er) return cb()
+ if (er) {
+ return cb()
+ }
// just take the first js file we find there, or nada
- return cb(null, d.filter(function (f) {
- return f.match(/\.js$/)
- })[0])
+ let r = d.find(f => f.match(/\.js$/))
+ if (r) {
+ r = `bin/${r}`
+ }
+ return cb(null, r)
})
}
}
exports.directories = function (cb) {
fs.readdir(dirname, function (er, dirs) {
- if (er) return cb(er)
+ if (er) {
+ return cb(er)
+ }
var res = {}
dirs.forEach(function (d) {
switch (d) {
@@ -143,7 +180,9 @@ exports.directories = function (cb) {
case 'lib': return res.lib = d
}
})
- if (Object.keys(res).length === 0) res = undefined
+ if (Object.keys(res).length === 0) {
+ res = undefined
+ }
return cb(null, res)
})
}
@@ -173,13 +212,15 @@ function setupScripts (d, cb) {
}
if (!s.test || s.test === notest) {
var commands = {
- 'tap':'tap test/*.js'
- , 'expresso':'expresso test'
- , 'mocha':'mocha'
+ tap: 'tap test/*.js',
+ expresso: 'expresso test',
+ mocha: 'mocha',
}
var command
Object.keys(commands).forEach(function (k) {
- if (d.indexOf(k) !== -1) command = commands[k]
+ if (d.indexOf(k) !== -1) {
+ command = commands[k]
+ }
})
var ps = 'test command'
if (yes) {
@@ -201,12 +242,18 @@ if (!package.repository) {
var i = gconf.indexOf('[remote "origin"]')
if (i !== -1) {
var u = gconf[i + 1]
- if (!u.match(/^\s*url =/)) u = gconf[i + 2]
- if (!u.match(/^\s*url =/)) u = null
- else u = u.replace(/^\s*url = /, '')
+ if (!u.match(/^\s*url =/)) {
+ u = gconf[i + 2]
+ }
+ if (!u.match(/^\s*url =/)) {
+ u = null
+ } else {
+ u = u.replace(/^\s*url = /, '')
+ }
}
- if (u && u.match(/^git@github.com:/))
+ if (u && u.match(/^git@github.com:/)) {
u = u.replace(/^git@github.com:/, 'https://github.com/')
+ }
return cb(null, yes ? u : prompt('git repository', u))
})
@@ -215,9 +262,15 @@ if (!package.repository) {
if (!package.keywords) {
exports.keywords = yes ? '' : prompt('keywords', function (s) {
- if (!s) return undefined
- if (Array.isArray(s)) s = s.join(' ')
- if (typeof s !== 'string') return s
+ if (!s) {
+ return undefined
+ }
+ if (Array.isArray(s)) {
+ s = s.join(' ')
+ }
+ if (typeof s !== 'string') {
+ return s
+ }
return s.split(/[\s,]+/)
})
}
@@ -225,15 +278,15 @@ if (!package.keywords) {
if (!package.author) {
exports.author = config.get('init.author.name') ||
config.get('init-author-name')
- ? {
- "name" : config.get('init.author.name') ||
+ ? {
+ name: config.get('init.author.name') ||
config.get('init-author-name'),
- "email" : config.get('init.author.email') ||
+ email: config.get('init.author.email') ||
config.get('init-author-email'),
- "url" : config.get('init.author.url') ||
- config.get('init-author-url')
+ url: config.get('init.author.url') ||
+ config.get('init-author-url'),
}
- : yes ? '' : prompt('author')
+ : yes ? '' : prompt('author')
}
const defaultDottedInitLicense = config &&
@@ -248,7 +301,9 @@ var license = package.license ||
'ISC'
exports.license = yes ? license : prompt('license', license, function (data) {
var its = validateLicense(data)
- if (its.validForNewPackages) return data
+ if (its.validForNewPackages) {
+ return data
+ }
var errors = (its.errors || []).concat(its.warnings || [])
var er = new Error('Sorry, ' + errors.join(' and ') + '.')
er.notValid = true
diff --git a/deps/npm/node_modules/init-package-json/init-package-json.js b/deps/npm/node_modules/init-package-json/lib/init-package-json.js
similarity index 79%
rename from deps/npm/node_modules/init-package-json/init-package-json.js
rename to deps/npm/node_modules/init-package-json/lib/init-package-json.js
index 83e7342d0aa4f4..bee79351caab3f 100644
--- a/deps/npm/node_modules/init-package-json/init-package-json.js
+++ b/deps/npm/node_modules/init-package-json/lib/init-package-json.js
@@ -12,7 +12,6 @@ var read = require('read')
// to validate the data object at the end as a worthwhile package
// and assign default values for things.
-// readJson.extras(file, data, cb)
var readJson = require('read-package-json')
function yes (conf) {
@@ -23,8 +22,10 @@ function yes (conf) {
}
function init (dir, input, config, cb) {
- if (typeof config === 'function')
- cb = config, config = {}
+ if (typeof config === 'function') {
+ cb = config
+ config = {}
+ }
// accept either a plain-jane object, or a config object
// with a "get" method.
@@ -36,7 +37,7 @@ function init (dir, input, config, cb) {
},
toJSON: function () {
return data
- }
+ },
}
}
@@ -52,14 +53,18 @@ function init (dir, input, config, cb) {
readJson(packageFile, function (er, d) {
readJson.extraSet = es
- if (er) pkg = {}
- else pkg = d
+ if (er) {
+ pkg = {}
+ } else {
+ pkg = d
+ }
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
- if (!pkg.version || !semver.valid(pkg.version))
+ if (!pkg.version || !semver.valid(pkg.version)) {
delete pkg.version
+ }
ctx.package = pkg
ctx.config = config || {}
@@ -71,7 +76,9 @@ function init (dir, input, config, cb) {
pz.on('error', cb)
pz.on('data', function (data) {
Object.keys(data).forEach(function (k) {
- if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k]
+ if (data[k] !== undefined && data[k] !== null) {
+ pkg[k] = data[k]
+ }
})
// only do a few of these.
@@ -81,8 +88,10 @@ function init (dir, input, config, cb) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson.extras(packageFile, pkg, function (er, pkg) {
+ if (er) {
+ return cb(er, pkg)
+ }
readJson.extraSet = es
- if (er) return cb(er, pkg)
pkg = unParsePeople(pkg)
// no need for the readme now.
delete pkg.readme
@@ -95,13 +104,15 @@ function init (dir, input, config, cb) {
delete pkg.gitHead
// if the repo is empty, remove it.
- if (!pkg.repository)
+ if (!pkg.repository) {
delete pkg.repository
+ }
// readJson filters out empty descriptions, but init-package-json
// traditionally leaves them alone
- if (!pkg.description)
+ if (!pkg.description) {
pkg.description = data.description
+ }
var d = JSON.stringify(updateDeps(pkg), null, 2) + '\n'
function write (yes) {
@@ -116,7 +127,7 @@ function init (dir, input, config, cb) {
return write(true)
}
console.log('About to write to %s:\n\n%s\n', packageFile, d)
- read({prompt:'Is this OK? ', default: 'yes'}, function (er, ok) {
+ read({prompt: 'Is this OK? ', default: 'yes'}, function (er, ok) {
if (er) {
return cb(er)
}
@@ -129,18 +140,19 @@ function init (dir, input, config, cb) {
})
})
})
-
}
-function updateDeps(depsData) {
+function updateDeps (depsData) {
// optionalDependencies don't need to be repeated in two places
if (depsData.dependencies) {
if (depsData.optionalDependencies) {
- for (const name of Object.keys(depsData.optionalDependencies))
+ for (const name of Object.keys(depsData.optionalDependencies)) {
delete depsData.dependencies[name]
+ }
}
- if (Object.keys(depsData.dependencies).length === 0)
+ if (Object.keys(depsData.dependencies).length === 0) {
delete depsData.dependencies
+ }
}
return depsData
@@ -148,21 +160,25 @@ function updateDeps(depsData) {
// turn the objects into somewhat more humane strings.
function unParsePeople (data) {
- if (data.author) data.author = unParsePerson(data.author)
- ;["maintainers", "contributors"].forEach(function (set) {
- if (!Array.isArray(data[set])) return;
+ if (data.author) {
+ data.author = unParsePerson(data.author)
+ }['maintainers', 'contributors'].forEach(function (set) {
+ if (!Array.isArray(data[set])) {
+ return
+ }
data[set] = data[set].map(unParsePerson)
})
return data
}
function unParsePerson (person) {
- if (typeof person === "string") return person
- var name = person.name || ""
+ if (typeof person === 'string') {
+ return person
+ }
+ var name = person.name || ''
var u = person.url || person.web
- var url = u ? (" ("+u+")") : ""
+ var url = u ? (' (' + u + ')') : ''
var e = person.email || person.mail
- var email = e ? (" <"+e+">") : ""
- return name+email+url
+ var email = e ? (' <' + e + '>') : ''
+ return name + email + url
}
-
diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json
index 0e07f48f49746d..6d642f6cf6879f 100644
--- a/deps/npm/node_modules/init-package-json/package.json
+++ b/deps/npm/node_modules/init-package-json/package.json
@@ -1,41 +1,46 @@
{
"name": "init-package-json",
- "version": "2.0.4",
- "main": "init-package-json.js",
+ "version": "2.0.5",
+ "main": "lib/init-package-json.js",
"scripts": {
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
- "prepublishOnly": "git push origin --follow-tags"
+ "prepublishOnly": "git push origin --follow-tags",
+ "lint": "eslint '**/*.js'",
+ "postlint": "npm-template-check",
+ "lintfix": "npm run lint -- --fix",
+ "snap": "tap",
+ "posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/init-package-json.git"
},
- "author": "Isaac Z. Schlueter (http://blog.izs.me/)",
+ "author": "GitHub Inc.",
"license": "ISC",
"description": "A node module to get your node module started",
"dependencies": {
- "glob": "^7.1.1",
- "npm-package-arg": "^8.1.2",
+ "npm-package-arg": "^8.1.5",
"promzard": "^0.3.0",
"read": "~1.0.1",
- "read-package-json": "^4.0.0",
+ "read-package-json": "^4.1.1",
"semver": "^7.3.5",
"validate-npm-package-license": "^3.0.4",
"validate-npm-package-name": "^3.0.0"
},
"devDependencies": {
"@npmcli/config": "^2.1.0",
- "mkdirp": "^1.0.4",
- "rimraf": "^3.0.2",
- "tap": "^14.11.0"
+ "@npmcli/template-oss": "^1.0.3",
+ "tap": "^15.0.9"
},
"engines": {
"node": ">=10"
},
"tap": {
- "jobs": "1"
+ "statements": "94",
+ "branches": "83",
+ "lines": "94"
},
"keywords": [
"init",
@@ -48,7 +53,8 @@
"start"
],
"files": [
- "default-input.js",
- "init-package-json.js"
- ]
+ "bin",
+ "lib"
+ ],
+ "templateVersion": "1.0.3"
}
diff --git a/deps/npm/node_modules/minipass/index.js b/deps/npm/node_modules/minipass/index.js
index 56cbd665d2526d..ae134a066d77f0 100644
--- a/deps/npm/node_modules/minipass/index.js
+++ b/deps/npm/node_modules/minipass/index.js
@@ -1,4 +1,8 @@
'use strict'
+const proc = typeof process === 'object' && process ? process : {
+ stdout: null,
+ stderr: null,
+}
const EE = require('events')
const Stream = require('stream')
const Yallist = require('yallist')
@@ -8,6 +12,7 @@ const EOF = Symbol('EOF')
const MAYBE_EMIT_END = Symbol('maybeEmitEnd')
const EMITTED_END = Symbol('emittedEnd')
const EMITTING_END = Symbol('emittingEnd')
+const EMITTED_ERROR = Symbol('emittedError')
const CLOSED = Symbol('closed')
const READ = Symbol('read')
const FLUSH = Symbol('flush')
@@ -66,6 +71,7 @@ module.exports = class Minipass extends Stream {
this[EMITTED_END] = false
this[EMITTING_END] = false
this[CLOSED] = false
+ this[EMITTED_ERROR] = null
this.writable = true
this.readable = true
this[BUFFERLENGTH] = 0
@@ -310,7 +316,7 @@ module.exports = class Minipass extends Stream {
const ended = this[EMITTED_END]
opts = opts || {}
- if (dest === process.stdout || dest === process.stderr)
+ if (dest === proc.stdout || dest === proc.stderr)
opts.end = false
else
opts.end = opts.end !== false
@@ -339,6 +345,8 @@ module.exports = class Minipass extends Stream {
else if (isEndish(ev) && this[EMITTED_END]) {
super.emit(ev)
this.removeAllListeners(ev)
+ } else if (ev === 'error' && this[EMITTED_ERROR]) {
+ fn.call(this, this[EMITTED_ERROR])
}
}
}
@@ -400,6 +408,8 @@ module.exports = class Minipass extends Stream {
// don't emit close before 'end' and 'finish'
if (!this[EMITTED_END] && !this[DESTROYED])
return
+ } else if (ev === 'error') {
+ this[EMITTED_ERROR] = data
}
// TODO: replace with a spread operator when Node v4 support drops
@@ -452,8 +462,8 @@ module.exports = class Minipass extends Stream {
promise () {
return new Promise((resolve, reject) => {
this.on(DESTROYED, () => reject(new Error('stream destroyed')))
- this.on('end', () => resolve())
this.on('error', er => reject(er))
+ this.on('end', () => resolve())
})
}
diff --git a/deps/npm/node_modules/minipass/package.json b/deps/npm/node_modules/minipass/package.json
index 54f62d56d46d86..165fa662ab4a7c 100644
--- a/deps/npm/node_modules/minipass/package.json
+++ b/deps/npm/node_modules/minipass/package.json
@@ -1,6 +1,6 @@
{
"name": "minipass",
- "version": "3.1.3",
+ "version": "3.1.5",
"description": "minimal implementation of a PassThrough stream",
"main": "index.js",
"dependencies": {
@@ -8,7 +8,7 @@
},
"devDependencies": {
"end-of-stream": "^1.4.0",
- "tap": "^14.6.5",
+ "tap": "^15.0.9",
"through2": "^2.0.3"
},
"scripts": {
diff --git a/deps/npm/package.json b/deps/npm/package.json
index 20b80c7ebe21c7..38b45947706dc7 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "7.23.0",
+ "version": "7.24.0",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
@@ -74,7 +74,7 @@
"graceful-fs": "^4.2.8",
"hosted-git-info": "^4.0.2",
"ini": "^2.0.0",
- "init-package-json": "^2.0.4",
+ "init-package-json": "^2.0.5",
"is-cidr": "^4.0.2",
"json-parse-even-better-errors": "^2.3.1",
"libnpmaccess": "^4.0.2",
diff --git a/deps/npm/tap-snapshots/test/lib/config.js.test.cjs b/deps/npm/tap-snapshots/test/lib/config.js.test.cjs
index 8f349a6f54249e..dab7ef55f64e82 100644
--- a/deps/npm/tap-snapshots/test/lib/config.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/config.js.test.cjs
@@ -146,7 +146,7 @@ exports[`test/lib/config.js TAP config list --json > output matches snapshot 1`]
"unicode": false,
"update-notifier": true,
"usage": false,
- "user-agent": "npm/{NPM-VERSION} node/{NODE-VERSION} {PLATFORM} {ARCH} workspaces/false",
+ "user-agent": "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}",
"version": false,
"versions": false,
"viewer": "{VIEWER}",
@@ -296,7 +296,7 @@ umask = 0
unicode = false
update-notifier = true
usage = false
-user-agent = "npm/{NPM-VERSION} node/{NODE-VERSION} {PLATFORM} {ARCH} workspaces/false"
+user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
; userconfig = "{HOME}/.npmrc" ; overridden by cli
version = false
versions = false
diff --git a/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
index 4eb5ea3bc5df59..c963ca2040e6f5 100644
--- a/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
@@ -180,6 +180,40 @@ Object {
}
`
+exports[`test/lib/utils/error-message.js TAP args are cleaned > must match snapshot 1`] = `
+Object {
+ "detail": Array [
+ Array [
+ "signal",
+ "SIGYOLO",
+ ],
+ Array [
+ "command",
+ "some command",
+ "a",
+ "r",
+ "g",
+ "s",
+ "https://evil:***@npmjs.org",
+ ],
+ Array [
+ "",
+ "stdout",
+ ],
+ Array [
+ "",
+ "stderr",
+ ],
+ ],
+ "summary": Array [
+ Array [
+ "",
+ "cmd err",
+ ],
+ ],
+}
+`
+
exports[`test/lib/utils/error-message.js TAP bad engine with config loaded > must match snapshot 1`] = `
Object {
"detail": Array [
diff --git a/deps/npm/tap-snapshots/test/lib/view.js.test.cjs b/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
index 27ba7b1eb69276..9ed8334138cf85 100644
--- a/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
@@ -82,7 +82,7 @@ dist
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
-published {TIME} ago[39m
+published [33myesterday[39m
`
exports[`test/lib/view.js TAP should log info of package in current working dir specific version > must match snapshot 1`] = `
@@ -99,7 +99,7 @@ dist
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
-published {TIME} ago[39m
+published [33myesterday[39m
`
exports[`test/lib/view.js TAP should log package info package from git > must match snapshot 1`] = `
@@ -302,7 +302,24 @@ dist
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
-published {TIME} ago[39m
+published [33myesterday[39m
+`
+
+exports[`test/lib/view.js TAP should log package info package with semver range > must match snapshot 1`] = `
+
+
+[4m[1m[32mblue[39m@[32m1.0.0[39m[22m[24m | [1m[31mProprietary[39m[22m | deps: [32mnone[39m | versions: [33m2[39m
+
+dist
+.tarball:[36mhttp://hm.blue.com/1.0.0.tgz[39m
+.shasum:[33m123[39m
+.integrity:[33m---[39m
+.unpackedSize:[33m1 B[39m
+
+dist-tags:
+[1m[32mlatest[39m[22m: 1.0.0
+
+published [33myesterday[39m
`
exports[`test/lib/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = `
diff --git a/deps/npm/test/lib/search.js b/deps/npm/test/lib/search.js
index 510a470f48088e..55b584b8aa7dc5 100644
--- a/deps/npm/test/lib/search.js
+++ b/deps/npm/test/lib/search.js
@@ -130,6 +130,37 @@ t.test('search --json', (t) => {
src.end()
})
+t.test('search --json', (t) => {
+ const src = new Minipass()
+ src.objectMode = true
+
+ npm.flatOptions.json = true
+ config.json = true
+ const libnpmsearch = {
+ stream () {
+ return src
+ },
+ }
+
+ const Search = t.mock('../../lib/search.js', {
+ ...mocks,
+ libnpmsearch,
+ })
+ const search = new Search(npm)
+
+ search.exec(['foo'], (err) => {
+ if (err)
+ throw err
+
+ t.equal(result, '\n[]\n', 'should have expected empty square brackets')
+
+ config.json = false
+ t.end()
+ })
+
+ src.end()
+})
+
t.test('search --searchexclude --searchopts', t => {
npm.flatOptions.search = {
...flatOptions.search,
diff --git a/deps/npm/test/lib/utils/config/definitions.js b/deps/npm/test/lib/utils/config/definitions.js
index 65193020d050c5..88993303b539cb 100644
--- a/deps/npm/test/lib/utils/config/definitions.js
+++ b/deps/npm/test/lib/utils/config/definitions.js
@@ -747,7 +747,7 @@ t.test('user-agent', t => {
definitions['user-agent'].flatten('user-agent', obj, flat)
t.equal(flat.userAgent, expectNoCI)
t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set')
- t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated')
+ t.not(obj['user-agent'], flat.userAgent, 'config user-agent template is not translated')
obj['ci-name'] = 'foo'
obj['user-agent'] = definitions['user-agent'].default
@@ -755,7 +755,7 @@ t.test('user-agent', t => {
definitions['user-agent'].flatten('user-agent', obj, flat)
t.equal(flat.userAgent, expectCI)
t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set')
- t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated')
+ t.not(obj['user-agent'], flat.userAgent, 'config user-agent template is not translated')
delete obj['ci-name']
obj.workspaces = true
@@ -764,7 +764,7 @@ t.test('user-agent', t => {
definitions['user-agent'].flatten('user-agent', obj, flat)
t.equal(flat.userAgent, expectWorkspaces)
t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set')
- t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated')
+ t.not(obj['user-agent'], flat.userAgent, 'config user-agent template is not translated')
delete obj.workspaces
obj.workspace = ['foo']
@@ -772,7 +772,7 @@ t.test('user-agent', t => {
definitions['user-agent'].flatten('user-agent', obj, flat)
t.equal(flat.userAgent, expectWorkspaces)
t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set')
- t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated')
+ t.not(obj['user-agent'], flat.userAgent, 'config user-agent template is not translated')
t.end()
})
@@ -853,3 +853,25 @@ t.test('package-lock-only', t => {
t.strictSame(flat, { packageLock: false, packageLockOnly: false })
t.end()
})
+
+t.test('workspaces', t => {
+ const obj = {
+ workspaces: true,
+ 'user-agent': definitions['user-agent'].default,
+ }
+ const flat = {}
+ definitions.workspaces.flatten('workspaces', obj, flat)
+ t.match(flat.userAgent, /workspaces\/true/)
+ t.end()
+})
+
+t.test('workspace', t => {
+ const obj = {
+ workspace: ['workspace-a'],
+ 'user-agent': definitions['user-agent'].default,
+ }
+ const flat = {}
+ definitions.workspace.flatten('workspaces', obj, flat)
+ t.match(flat.userAgent, /workspaces\/true/)
+ t.end()
+})
diff --git a/deps/npm/test/lib/utils/did-you-mean.js b/deps/npm/test/lib/utils/did-you-mean.js
index 15712b665be6eb..1285d5300853bc 100644
--- a/deps/npm/test/lib/utils/did-you-mean.js
+++ b/deps/npm/test/lib/utils/did-you-mean.js
@@ -5,34 +5,55 @@ const dym = require('../../../lib/utils/did-you-mean.js')
t.test('did-you-mean', t => {
npm.load(err => {
t.notOk(err)
- t.test('nistall', async t => {
- const result = await dym(npm, npm.localPrefix, 'nistall')
- t.match(result, 'npm install')
- })
- t.test('sttest', async t => {
- const result = await dym(npm, npm.localPrefix, 'sttest')
- t.match(result, 'npm test')
- t.match(result, 'npm run posttest')
+ t.test('with package.json', t => {
+ const testdir = t.testdir({
+ 'package.json': JSON.stringify({
+ bin: {
+ npx: 'exists',
+ },
+ scripts: {
+ install: 'exists',
+ posttest: 'exists',
+ },
+ }),
+ })
+ t.test('nistall', async t => {
+ const result = await dym(npm, testdir, 'nistall')
+ t.match(result, 'npm install')
+ })
+ t.test('sttest', async t => {
+ const result = await dym(npm, testdir, 'sttest')
+ t.match(result, 'npm test')
+ t.match(result, 'npm run posttest')
+ })
+ t.test('npz', async t => {
+ const result = await dym(npm, testdir, 'npxx')
+ t.match(result, 'npm exec npx')
+ })
+ t.test('qwuijbo', async t => {
+ const result = await dym(npm, testdir, 'qwuijbo')
+ t.match(result, '')
+ })
+ t.end()
})
- t.test('npz', async t => {
- const result = await dym(npm, npm.localPrefix, 'npxx')
- t.match(result, 'npm exec npx')
+ t.test('with no package.json', t => {
+ const testdir = t.testdir({})
+ t.test('nistall', async t => {
+ const result = await dym(npm, testdir, 'nistall')
+ t.match(result, 'npm install')
+ })
+ t.end()
})
- t.test('qwuijbo', async t => {
- const result = await dym(npm, npm.localPrefix, 'qwuijbo')
- t.match(result, '')
+ t.test('missing bin and script properties', async t => {
+ const testdir = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'missing-bin',
+ }),
+ })
+
+ const result = await dym(npm, testdir, 'nistall')
+ t.match(result, 'npm install')
})
t.end()
})
})
-
-t.test('missing bin and script properties', async t => {
- const path = t.testdir({
- 'package.json': JSON.stringify({
- name: 'missing-bin',
- }),
- })
-
- const result = await dym(npm, path, 'nistall')
- t.match(result, 'npm install')
-})
diff --git a/deps/npm/test/lib/utils/error-message.js b/deps/npm/test/lib/utils/error-message.js
index d1c67a95137c44..6b2b5c9222e77a 100644
--- a/deps/npm/test/lib/utils/error-message.js
+++ b/deps/npm/test/lib/utils/error-message.js
@@ -201,6 +201,17 @@ t.test('default message', t => {
t.end()
})
+t.test('args are cleaned', t => {
+ t.matchSnapshot(errorMessage(Object.assign(new Error('cmd err'), {
+ cmd: 'some command',
+ signal: 'SIGYOLO',
+ args: ['a', 'r', 'g', 's', 'https://evil:password@npmjs.org'],
+ stdout: 'stdout',
+ stderr: 'stderr',
+ }), npm))
+ t.end()
+})
+
t.test('eacces/eperm', t => {
const runTest = (windows, loaded, cachePath, cacheDest) => t => {
if (windows)
diff --git a/deps/npm/test/lib/view.js b/deps/npm/test/lib/view.js
index 793917adc6476d..096ababb29ae83 100644
--- a/deps/npm/test/lib/view.js
+++ b/deps/npm/test/lib/view.js
@@ -17,6 +17,9 @@ const cleanLogs = () => {
console.log = fn
}
+// 25 hours ago
+const yesterday = new Date(Date.now() - 1000 * 60 * 60 * 25)
+
const packument = (nv, opts) => {
if (!opts.fullMetadata)
throw new Error('must fetch fullMetadata')
@@ -40,7 +43,7 @@ const packument = (nv, opts) => {
latest: '1.0.0',
},
time: {
- '1.0.0': '2019-08-06T16:21:09.842Z',
+ '1.0.0': yesterday,
},
versions: {
'1.0.0': {
@@ -332,6 +335,13 @@ t.test('should log package info', t => {
})
})
+ t.test('package with semver range', t => {
+ view.exec(['blue@^1.0.0'], () => {
+ t.matchSnapshot(logs)
+ t.end()
+ })
+ })
+
t.test('package with no modified time', t => {
viewUnicode.exec(['cyan@1.0.0'], () => {
t.matchSnapshot(logs)
From 479658ba983c7b2554c71ec5fbe42d93a1f7bc91 Mon Sep 17 00:00:00 2001
From: RISHABH BUDHIRAJA
Date: Wed, 14 Jul 2021 23:25:49 +0530
Subject: [PATCH 04/62] doc: changes default values for fs.read fns
PR-URL: https://github.com/nodejs/node/pull/39163
Fixes: https://github.com/nodejs/node/issues/39034
Reviewed-By: Nitzan Uziely
Reviewed-By: Qingyu Deng
---
doc/api/fs.md | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/doc/api/fs.md b/doc/api/fs.md
index e3aa603dc5a870..d8b6c4bd587fb7 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -258,9 +258,7 @@ added: v10.0.0
* `buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the
file data read.
* `offset` {integer} The location in the buffer at which to start filling.
- **Default:** `0`
-* `length` {integer} The number of bytes to read. **Default:**
- `buffer.byteLength`
+* `length` {integer} The number of bytes to read.
* `position` {integer} The location where to begin reading data from the
file. If `null`, data will be read from the current file position, and
the position will be updated. If `position` is an integer, the current
@@ -2884,11 +2882,9 @@ changes:
* `fd` {integer}
* `buffer` {Buffer|TypedArray|DataView} The buffer that the data will be
- written to. **Default:** `Buffer.alloc(16384)`
-* `offset` {integer} The position in `buffer` to write the data to. **Default:**
- `0`
-* `length` {integer} The number of bytes to read. **Default:**
- `buffer.byteLength`
+ written to.
+* `offset` {integer} The position in `buffer` to write the data to.
+* `length` {integer} The number of bytes to read.
* `position` {integer|bigint} Specifies where to begin reading from in the
file. If `position` is `null` or `-1 `, data will be read from the current
file position, and the file position will be updated. If `position` is an
From d05cca94eaad70708c5a3d50862f62abbbb8406d Mon Sep 17 00:00:00 2001
From: "Node.js GitHub Bot"
Date: Sun, 19 Sep 2021 00:13:27 +0000
Subject: [PATCH 05/62] meta: update AUTHORS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PR-URL: https://github.com/nodejs/node/pull/40148
Reviewed-By: Rich Trott
Reviewed-By: Michaël Zasso
Reviewed-By: James M Snell
Reviewed-By: Michael Dawson
---
AUTHORS | 3 +++
1 file changed, 3 insertions(+)
diff --git a/AUTHORS b/AUTHORS
index 602727b0a389e3..fc25b4270f00ed 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3316,5 +3316,8 @@ Christian Boehlke
null <60427892+vierofernando@users.noreply.github.com>
Dominic Elm
treysis
+shfshanyue
+Nikita Galkin
+vipul kumar
# Generated by tools/update-authors.js
From 549f96889a77c39fa4f2257305788a00848f9e97 Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Fri, 17 Sep 2021 17:23:11 -0700
Subject: [PATCH 06/62] doc: update markdown formatting for *.md files
Fix formatting that will change when run through upcoming remark preset.
PR-URL: https://github.com/nodejs/node/pull/40154
Reviewed-By: Colin Ihrig
Reviewed-By: Antoine du Hamel
Reviewed-By: James M Snell
Reviewed-By: Luigi Pinca
Reviewed-By: Michael Dawson
---
BUILDING.md | 69 +++++++++++++++++++++++++++++++------------------
CHANGELOG.md | 8 +++---
CONTRIBUTING.md | 3 +++
GOVERNANCE.md | 4 +--
onboarding.md | 28 +++++++++++++-------
5 files changed, 72 insertions(+), 40 deletions(-)
diff --git a/BUILDING.md b/BUILDING.md
index 06cfaff6052bb4..cdc3ac42469f7b 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -120,31 +120,31 @@ platforms. This is true regardless of entries in the table below.
| FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 [7](#fn7) |
1: GCC 8 is not provided on the base platform. Users will
- need the
- [Toolchain test builds PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial)
- or similar to source a newer compiler.
+need the
+[Toolchain test builds PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial)
+or similar to source a newer compiler.
2: GCC 8 is not provided on the base platform. Users will
- need the
- [devtoolset-8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/)
- or later to source a newer compiler.
+need the
+[devtoolset-8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/)
+or later to source a newer compiler.
3: Older kernel versions may work for ARM64. However the
- Node.js test infrastructure only tests >= 4.5.
+Node.js test infrastructure only tests >= 4.5.
4: On Windows, running Node.js in Windows terminal emulators
- like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty)
- for the tty channels to work (e.g. `winpty node.exe script.js`).
- In "Git bash" if you call the node shell alias (`node` without the `.exe`
- extension), `winpty` is used automatically.
+like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty)
+for the tty channels to work (e.g. `winpty node.exe script.js`).
+In "Git bash" if you call the node shell alias (`node` without the `.exe`
+extension), `winpty` is used automatically.
5: The Windows Subsystem for Linux (WSL) is not
- supported, but the GNU/Linux build process and binaries should work. The
- community will only address issues that reproduce on native GNU/Linux
- systems. Issues that only reproduce on WSL should be reported in the
- [WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the
- Windows binary (`node.exe`) in WSL is not recommended. It will not work
- without workarounds such as stdio redirection.
+supported, but the GNU/Linux build process and binaries should work. The
+community will only address issues that reproduce on native GNU/Linux
+systems. Issues that only reproduce on WSL should be reported in the
+[WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the
+Windows binary (`node.exe`) in WSL is not recommended. It will not work
+without workarounds such as stdio redirection.
6: Running Node.js on x86 Windows should work and binaries
are provided. However, tests in our infrastructure only run on WoW64.
@@ -195,7 +195,7 @@ Ubuntu 14.04 and Debian 8.
#### OpenSSL asm support
OpenSSL-1.1.1 requires the following assembler version for use of asm
-support on x86_64 and ia32.
+support on x86\_64 and ia32.
For use of AVX-512,
@@ -212,9 +212,9 @@ For use of AVX2,
* nasm version 2.10 or higher in Windows
Please refer to
- for details.
+ for details.
- If compiling without one of the above, use `configure` with the
+If compiling without one of the above, use `configure` with the
`--openssl-no-asm` flag. Otherwise, `configure` will fail.
### Previous versions of this document
@@ -232,6 +232,7 @@ Consult previous versions of this document for older versions of Node.js:
### Note about Python
The Node.js project supports Python >= 3 for building and testing.
+
### Unix and macOS
#### Unix prerequisites
@@ -480,7 +481,7 @@ release version is actually installed when you run `make install`.
To use the debug build with all the normal dependencies overwrite the release
version in the install directory:
-``` console
+```console
$ make install PREFIX=/opt/node-debug/
$ cp -a -f out/Debug/node /opt/node-debug/node
```
@@ -496,7 +497,7 @@ was captured on (i.e. 64-bit `gdb` for `node` built on a 64-bit system, Linux
Example of generating a backtrace from the core dump:
-``` console
+```console
$ gdb /opt/node-debug/node core.node.8.1535359906
$ backtrace
```
@@ -507,12 +508,12 @@ $ backtrace
related bugs. ASAN builds are currently only supported on linux.
If you want to check it on Windows or macOS or you want a consistent toolchain
on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop)
- (using an image like `gengjiawen/node-build:2020-02-14`).
+(using an image like `gengjiawen/node-build:2020-02-14`).
The `--debug` is not necessary and will slow down build and testing, but it can
show clear stacktrace if ASAN hits an issue.
-``` console
+```console
$ ./configure --debug --enable-asan && make -j4
$ make test-only
```
@@ -521,6 +522,7 @@ $ make test-only
If you plan to frequently rebuild Node.js, especially if using several branches,
installing `ccache` can help to greatly reduce build times. Set up with:
+
```console
$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
$ ccache -o cache_dir=
@@ -528,13 +530,16 @@ $ ccache -o max_size=5.0G
$ export CC="ccache gcc" # add to your .profile
$ export CXX="ccache g++" # add to your .profile
```
+
This will allow for near-instantaneous rebuilds even when switching branches.
When modifying only the JS layer in `lib`, it is possible to externally load it
without modifying the executable:
+
```console
$ ./configure --node-builtin-modules-path $(pwd)
```
+
The resulting binary won't include any JS files and will try to load them from
the specified directory. The JS debugger of Visual Studio Code supports this
configuration since the November 2020 version and allows for setting
@@ -678,7 +683,7 @@ $ ./configure --with-intl=full-icu
### Trimmed: `small-icu` (English only) support
- In this configuration, only English data is included, but
+In this configuration, only English data is included, but
the full `Intl` (ECMA-402) APIs. It does not need to download
any dependencies to function. You can add full data at runtime.
@@ -774,6 +779,7 @@ If you want to build Node.js using openssl-3.0.0+quic, you can follow these
steps:
**clone OpenSSL source and prepare build**
+
```bash
git clone git@github.com:quictls/openssl.git
@@ -791,6 +797,7 @@ will publish the OpenSSL libraries and such. We will also use this path
(and sub-paths) later when compiling Node.js.
**compile and install OpenSSL**
+
```console
make -j8
make install
@@ -806,6 +813,7 @@ find the `fipsmodule.cnf` file - let's add the following to the end of the
`openssl.cnf` file.
**alter openssl.cnf**
+
```text
.include fipsmodule.cnf
@@ -826,6 +834,7 @@ sure that you specify an absolute path for the `.include fipsmodule.cnf` line -
using relative paths did not work on my system!
**alter openssl.cnf using a script**
+
```console
cat <> /path/to/install/dir/ssl/openssl.cnf
.include /path/to/install/dir/ssl/fipsmodule.cnf
@@ -845,12 +854,14 @@ EOT
As you might have picked a non-custom path for your OpenSSL install dir, we
have to export the following two environment variables in order for Node.js to
find our OpenSSL modules we built beforehand:
+
```console
export OPENSSL_CONF=/path/to/install/dir/ssl/openssl.cnf
export OPENSSL_MODULES=/path/to/install/dir/lib/ossl-modules
```
**build Node.js**
+
```console
./configure \
--shared-openssl \
@@ -865,6 +876,7 @@ make -j8
```
**verify the produced executable**
+
```console
ldd ./node
linux-vdso.so.1 (0x00007ffd7917b000)
@@ -884,12 +896,14 @@ If the `ldd` command says that `libcrypto` cannot be found one needs to set
`--shared-openssl-libpath` (see previous step).
**verify the OpenSSL version**
+
```console
./node -p process.versions.openssl
3.0.0-alpha16+quic
```
**verify that FIPS is available**
+
```console
./node -p 'process.config.variables.openssl_is_fips'
true
@@ -905,13 +919,16 @@ executable. See sections
[Enabling FIPS using OpenSSL config](#enabling-fips-using-openssl-config) below.
### Enabling FIPS using Node.js options
+
This is done using one of the Node.js options `--enable-fips` or
`--force-fips`, for example:
+
```console
$ node --enable-fips -p 'crypto.getFips()'
```
### Enabling FIPS using OpenSSL config
+
This example show that using OpenSSL's configuration file, FIPS can be enabled
without specifying the `--enable-fips` or `--force-fips` options by setting
`default_properties = fips=yes` in the FIPS configuration file. See
@@ -920,6 +937,7 @@ for details.
For this to work the OpenSSL configuration file (default openssl.cnf) needs to
be updated. The following shows an example:
+
```console
openssl_conf = openssl_init
@@ -939,6 +957,7 @@ activate = 1
[algorithm_sect]
default_properties = fips=yes
```
+
After this change Node.js can be run without the `--enable-fips` or `--force-fips`
options.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b9d45bae3ae90..14abca5112b895 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@ Please use the following table to find the changelog for a specific Node.js
release.
+
16Current
@@ -138,8 +139,9 @@ release.
LTS releases.
* Release versions in **bold** text are the most recent supported releases.
-----
-----
+***
+
+***
## 2016-05-06, Version 0.12.14 (Maintenance), @rvagg
@@ -1355,7 +1357,7 @@ release.
## 2009.08.21, Version 0.1.5
-Moved to doc/changelogs/CHANGELOG_V6.md#6.0.0.
## 2009.08.13, Version 0.1.4
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 30db8cf9b12524..d0d3f4f648ef96 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -29,8 +29,10 @@ See [details on our policy on Code of Conduct](./doc/guides/contributing/code-of
* [Notes](./doc/guides/contributing/pull-requests.md#notes)
+
## Developer's Certificate of Origin 1.1
+
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
@@ -54,3 +56,4 @@ By making a contribution to this project, I certify that:
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
+
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
index aa73e4b3ee7519..37ce1576cffccf 100644
--- a/GOVERNANCE.md
+++ b/GOVERNANCE.md
@@ -153,8 +153,8 @@ the nomination fails.
There are steps a nominator can take in advance to make a nomination as
frictionless as possible. To request feedback from other collaborators in
- private, use the [collaborators discussion page][]
- (which only collaborators may view). A nominator may also work with the
+private, use the [collaborators discussion page][]
+(which only collaborators may view). A nominator may also work with the
nominee to improve their contribution profile.
Collaborators might overlook someone with valuable contributions. In that case,
diff --git a/onboarding.md b/onboarding.md
index ae65f07f37b621..d74600dcce0061 100644
--- a/onboarding.md
+++ b/onboarding.md
@@ -51,12 +51,13 @@ onboarding session.
[Publicizing or hiding organization membership][].
* Notifications:
- * Use [https://github.com/notifications](https://github.com/notifications) or
+ * Use or
set up email
* Watching the main repository will flood your inbox (several hundred
notifications on typical weekdays), so be prepared
The project has two venues for real-time discussion:
+
* [`#nodejs-dev`](https://openjs-foundation.slack.com/archives/C019Y2T6STH) on
the [OpenJS Foundation](https://slack-invite.openjsf.org/)
@@ -71,7 +72,7 @@ The project has two venues for real-time discussion:
* The best outcome is for people who come to our issue tracker to feel like
they can come back again.
-* You are expected to follow *and* hold others accountable to the
+* You are expected to follow _and_ hold others accountable to the
[Code of Conduct][].
## Managing the issue tracker
@@ -88,7 +89,7 @@ The project has two venues for real-time discussion:
not perfect, of course. Feel free to apply relevant labels and remove
irrelevant labels from pull requests and issues.
* `semver-{minor,major}`:
- * If a change has the remote *chance* of breaking something, use the
+ * If a change has the remote _chance_ of breaking something, use the
`semver-major` label
* When adding a `semver-*` label, add a comment explaining why you're adding
it. Do it right away so you don't forget!
@@ -113,20 +114,26 @@ The project has two venues for real-time discussion:
## Reviewing pull requests
* The primary goal is for the codebase to improve.
+
* Secondary (but not far off) is for the person submitting code to succeed. A
pull request from a new contributor is an opportunity to grow the community.
+
* Review a bit at a time. Do not overwhelm new contributors.
* It is tempting to micro-optimize. Don't succumb to that temptation. We
change V8 often. Techniques that provide improved performance today may be
unnecessary in the future.
+
* Be aware: Your opinion carries a lot of weight!
+
* Nits (requests for small changes that are not essential) are fine, but try to
avoid stalling the pull request.
* Identify them as nits when you comment: `Nit: change foo() to bar().`
* If they are stalling the pull request, fix them yourself on merge.
+
* Insofar as possible, issues should be identified by tools rather than human
reviewers. If you are leaving comments about issues that could be identified
by tools but are not, consider implementing the necessary tooling.
+
* Minimum wait for comments time
* There is a minimum waiting time which we try to respect for non-trivial
changes so that people who may have important input in such a distributed
@@ -134,6 +141,7 @@ The project has two venues for real-time discussion:
* For non-trivial changes, leave the pull request open for at least 48 hours.
* If a pull request is abandoned, check if they'd mind if you took it over
(especially if it just has nits left).
+
* Approving a change
* Collaborators indicate that they have reviewed and approve of the changes in
a pull request using GitHub’s approval interface
@@ -159,7 +167,7 @@ The project has two venues for real-time discussion:
such as `async_hooks`.
* Continuous Integration (CI) Testing:
- * [https://ci.nodejs.org/](https://ci.nodejs.org/)
+ *
* It is not automatically run. You need to start it manually.
* Log in on CI is integrated with GitHub. Try to log in now!
* You will be using `node-test-pull-request` most of the time. Go there now!
@@ -228,12 +236,12 @@ needs to be pointed out separately during the onboarding.
* Almost any mistake you could make can be fixed or reverted.
* The existing collaborators trust you and are grateful for your help!
* Other repositories:
- * [https://github.com/nodejs/TSC](https://github.com/nodejs/TSC)
- * [https://github.com/nodejs/build](https://github.com/nodejs/build)
- * [https://github.com/nodejs/nodejs.org](https://github.com/nodejs/nodejs.org)
- * [https://github.com/nodejs/readable-stream](https://github.com/nodejs/readable-stream)
- * [https://github.com/nodejs/LTS](https://github.com/nodejs/LTS)
- * [https://github.com/nodejs/citgm](https://github.com/nodejs/citgm)
+ *
+ *
+ *
+ *
+ *
+ *
* The OpenJS Foundation hosts regular summits for active contributors to the
Node.js project, where we have face-to-face discussions about our work on the
project. The Foundation has travel funds to cover participants' expenses
From f367af443496dc0dc8cdb924fabf1dd0f535be45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Zasso?=
Date: Sun, 19 Sep 2021 09:34:44 +0200
Subject: [PATCH 07/62] tools: extend default yamllint config
PR-URL: https://github.com/nodejs/node/pull/40150
Reviewed-By: Antoine du Hamel
Reviewed-By: Colin Ihrig
Reviewed-By: James M Snell
---
.github/label-pr-config.yml | 24 +++++++++----------
.github/workflows/authors.yml | 8 +++----
.github/workflows/auto-start-ci.yml | 1 -
.github/workflows/close-stalled.yml | 34 +++++++++++++--------------
.github/workflows/commit-queue.yml | 1 -
.github/workflows/license-builder.yml | 4 ++--
.yamllint.yaml | 9 ++++++-
doc/.eslintrc.yaml | 4 ++--
lib/.eslintrc.yaml | 2 +-
tools/.eslintrc.yaml | 4 +++-
10 files changed, 49 insertions(+), 42 deletions(-)
diff --git a/.github/label-pr-config.yml b/.github/label-pr-config.yml
index 6e1bccd478991f..c7a66707c63fb7 100644
--- a/.github/label-pr-config.yml
+++ b/.github/label-pr-config.yml
@@ -103,9 +103,9 @@ subSystemLabels:
/^lib\/internal\/quic\/*/: quic, dont-land-on-v14.x, dont-land-on-v12.x
# All other lib/ files map directly
- /^lib\/_(\w+)_\w+\.js?$/: $1 # e.g. _(stream)_wrap
- /^lib(\/internal)?\/(\w+)\.js?$/: $2 # other .js files
- /^lib\/internal\/(\w+)(?:\/|$)/: $1 # internal subfolders
+ /^lib\/_(\w+)_\w+\.js?$/: $1 # e.g. _(stream)_wrap
+ /^lib(\/internal)?\/(\w+)\.js?$/: $2 # Other .js files
+ /^lib\/internal\/(\w+)(?:\/|$)/: $1 # internal subfolders
exlusiveLabels:
# more specific tests
@@ -125,26 +125,26 @@ exlusiveLabels:
/^test\//: test
- # specific map for webcrypto.md as it should be labeled 'crypto'
+ # Specific map for webcrypto.md as it should be labeled 'crypto'
/^doc\/api\/webcrypto.md$/: doc, crypto
- # specific map for modules.md as it should be labeled 'module' not 'modules'
+ # Specific map for modules.md as it should be labeled 'module' not 'modules'
/^doc\/api\/modules.md$/: doc, module
- # node-api is treated separately since it is not a JS core module but is still
- # considered a subsystem of sorts
+ # node-api is treated separately since it is not a JS core module but is still
+ # considered a subsystem of sorts
/^doc\/api\/n-api.md$/: doc, node-api
- # quic
+ # quic
/^doc\/api\/quic.md$/: doc, quic, dont-land-on-v14.x, dont-land-on-v12.x
- # add worker label to PRs that affect doc/api/worker_threads.md
+ # Add worker label to PRs that affect doc/api/worker_threads.md
/^doc\/api\/worker_threads.md$/: doc, worker
- # automatically tag JS subsystem-specific API doc changes
+ # Automatically tag JS subsystem-specific API doc changes
/^doc\/api\/(\w+)\.md$/: doc, $1
- # add deprecations label to PRs that affect doc/api/deprecations.md
+ # Add deprecations label to PRs that affect doc/api/deprecations.md
/^doc\/api\/deprecations.md$/: doc, deprecations
/^doc\/changelogs\//: release
/^doc\//: doc
- # more specific benchmarks
+ # More specific benchmarks
/^benchmark\/buffers\//: benchmark, buffer
/^benchmark\/(?:arrays|es)\//: benchmark, v8 engine
/^benchmark\/_http/: benchmark, http
diff --git a/.github/workflows/authors.yml b/.github/workflows/authors.yml
index 8171df166ab353..146fcdb6a2d4ad 100644
--- a/.github/workflows/authors.yml
+++ b/.github/workflows/authors.yml
@@ -12,15 +12,15 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
- fetch-depth: '0' # this is required to actually get all the authors
- - run: "tools/update-authors.js" # run the AUTHORS tool
- - uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR
+ fetch-depth: '0' # This is required to actually get all the authors
+ - run: "tools/update-authors.js" # Run the AUTHORS tool
+ - uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: Node.js GitHub Bot
body: "If this PR exists, there's presumably new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.\n\nPlease note that there might be duplicate entries. If there are, please remove them and add the duplicate emails to .mailmap directly to this PR."
- branch: "actions/authors-update" # custom branch *just* for this Action.
+ branch: "actions/authors-update" # Custom branch *just* for this Action.
commit-message: "meta: update AUTHORS"
labels: meta
title: "meta: update AUTHORS"
diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml
index c3527549e16af4..ef7c97d9e502b6 100644
--- a/.github/workflows/auto-start-ci.yml
+++ b/.github/workflows/auto-start-ci.yml
@@ -1,4 +1,3 @@
----
name: Auto Start CI
on:
diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml
index 916baf0463fa6c..351ddb78c012f8 100644
--- a/.github/workflows/close-stalled.yml
+++ b/.github/workflows/close-stalled.yml
@@ -1,26 +1,26 @@
name: Close stalled issues and PRs
on:
schedule:
- - cron: "0 0 * * *"
+ - cron: "0 0 * * *"
jobs:
stale:
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- - uses: actions/stale@v3
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- days-before-close: 30
- stale-pr-label: stalled
- stale-issue-label: stalled
- close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
- close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
- # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues
- only-labels: stalled
- # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits
- operations-per-run: 500
- # deactivates automatic removal of stalled label if issue gets any activity
- remove-stale-when-updated: false
- # deactivates automatic stale labelling as we prefer to do that manually
- days-before-stale: -1
+ - uses: actions/stale@v3
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ days-before-close: 30
+ stale-pr-label: stalled
+ stale-issue-label: stalled
+ close-issue-message: Closing this because it has stalled. Feel free to reopen if this issue is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
+ close-pr-message: Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.
+ # used to filter issues to check whether or not should be closed, avoids hitting maximum operations allowed if needing to paginate through all open issues
+ only-labels: stalled
+ # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits
+ operations-per-run: 500
+ # deactivates automatic removal of stalled label if issue gets any activity
+ remove-stale-when-updated: false
+ # deactivates automatic stale labelling as we prefer to do that manually
+ days-before-stale: -1
diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml
index 9b8e99c98e5582..b2d37f80906896 100644
--- a/.github/workflows/commit-queue.yml
+++ b/.github/workflows/commit-queue.yml
@@ -1,4 +1,3 @@
----
# This action requires the following secrets to be set on the repository:
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml
index 115bef9977d9d5..b6453d61ac5199 100644
--- a/.github/workflows/license-builder.yml
+++ b/.github/workflows/license-builder.yml
@@ -12,8 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - run: "./tools/license-builder.sh" # run the license builder tool
- - uses: gr2m/create-or-update-pull-request-action@v1.x # create a PR or update the Action's existing PR
+ - run: "./tools/license-builder.sh" # Run the license builder tool
+ - uses: gr2m/create-or-update-pull-request-action@v1.x # Create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
diff --git a/.yamllint.yaml b/.yamllint.yaml
index d4af06e4156947..97ec306ea3fa0c 100644
--- a/.yamllint.yaml
+++ b/.yamllint.yaml
@@ -1,8 +1,15 @@
-extends: relaxed
+extends: default
rules:
+ document-start:
+ present: false
line-length: disable
+ truthy:
+ allowed-values: ['true', 'false', 'on', 'off']
ignore: |
/deps/
node_modules/
+ /test/fixtures/wpt/
+ /tools/gyp/
+ /tools/pip/
diff --git a/doc/.eslintrc.yaml b/doc/.eslintrc.yaml
index 8e01bea6abd8a7..fbc115669a7166 100644
--- a/doc/.eslintrc.yaml
+++ b/doc/.eslintrc.yaml
@@ -1,14 +1,14 @@
## Docs-specific linter rules
rules:
- # ease some restrictions in doc examples
+ # Ease some restrictions in doc examples
no-restricted-properties: off
no-undef: off
no-unused-expressions: off
no-unused-vars: off
symbol-description: off
- # add new ECMAScript features gradually
+ # Add new ECMAScript features gradually
no-var: error
prefer-const: error
prefer-rest-params: error
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index 9f209505db9c33..90715e4ea37d69 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -6,7 +6,7 @@ rules:
no-buffer-constructor: error
no-mixed-operators:
- error
- - groups: [[ "&&", "||" ]]
+ - groups: [["&&", "||"]]
no-restricted-syntax:
# Config copied from .eslintrc.js
- error
diff --git a/tools/.eslintrc.yaml b/tools/.eslintrc.yaml
index b98c59a15c1b77..d2fe553393693d 100644
--- a/tools/.eslintrc.yaml
+++ b/tools/.eslintrc.yaml
@@ -8,6 +8,8 @@ rules:
- properties: 'never'
ignoreDestructuring: true
allow: ['child_process']
- no-unused-vars: [error, { args: 'after-used' }]
+ no-unused-vars:
+ - error
+ - args: 'after-used'
prefer-arrow-callback: error
no-var: error
From 0c95dead55f7c5963edfb0777501e74e2c2de780 Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Sun, 19 Sep 2021 12:49:04 -0700
Subject: [PATCH 08/62] doc: update tools .md files for upcoming
lint/formatting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Looks like only one .md file in `tools` needs to be changed.
PR-URL: https://github.com/nodejs/node/pull/40155
Reviewed-By: Antoine du Hamel
Reviewed-By: Michaël Zasso
Reviewed-By: James M Snell
---
tools/icu/README.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/icu/README.md b/tools/icu/README.md
index ab90b760b8c844..544f4bf2152ff0 100644
--- a/tools/icu/README.md
+++ b/tools/icu/README.md
@@ -11,13 +11,14 @@ Both V8 and Node.js use ICU to provide internationalization functionality.
* `icu-generic.gyp` is the build file used for most ICU builds within ICU.
* `icu-system.gyp` is an alternate build file used when `--with-intl=system-icu`
- is invoked. It builds against the `pkg-config` located ICU.
+ is invoked. It builds against the `pkg-config` located ICU.
* `iculslocs.cc` is source for the `iculslocs` utility, invoked by `icutrim.py`
- as part of repackaging. Not used separately. See source for more details.
+ as part of repackaging. Not used separately. See source for more details.
* `no-op.cc` contains an empty function to convince gyp to use a C++ compiler.
* `shrink-icu-src.py` is used during upgrade (see guide below).
Note:
+
> The files in this directory were written for the Node.js v0.12 effort.
> The original intent was to merge the tools such as `icutrim.py` and `iculslocs.cc`
> back into ICU. ICU has gained its own “data slicer” tool.
@@ -27,10 +28,11 @@ Note:
## See Also
* [docs/guides/maintaining-icu.md](../../doc/guides/maintaining-icu.md) for
-information on maintaining ICU in Node.js
+ information on maintaining ICU in Node.js
* [docs/api/intl.md](../../doc/api/intl.md) for information on the
-internationalization-related APIs in Node.js
+ internationalization-related APIs in Node.js
+
* [The ICU Homepage][ICU]
[ICU]: http://icu-project.org
From f4a350da85c101c62a8639b3cf77a05e07c442b0 Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Sun, 19 Sep 2021 13:28:29 -0700
Subject: [PATCH 09/62] doc: prepare markdown file for upcoming
formatting/linting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PR-URL: https://github.com/nodejs/node/pull/40156
Reviewed-By: Antoine du Hamel
Reviewed-By: Michaël Zasso
Reviewed-By: James M Snell
---
test/README.md | 2 +-
test/common/README.md | 283 ++++++++++++++++++++++--------------------
test/wasi/README.md | 1 +
test/wpt/README.md | 2 +
4 files changed, 152 insertions(+), 136 deletions(-)
diff --git a/test/README.md b/test/README.md
index cc3725764da543..470f525ebe1ebc 100644
--- a/test/README.md
+++ b/test/README.md
@@ -17,7 +17,7 @@ For the tests to run on Windows, be sure to clone Node.js source code with the
| ---------------- | ---------- | --------------- |
| `abort` | Yes | Tests that use `--abort-on-uncaught-exception` and other situations where we want to test something but avoid generating a core file. |
| `addons` | Yes | Tests for [addon](https://nodejs.org/api/addons.html) functionality along with some tests that require an addon. |
-| `async-hooks` | Yes | Tests for [async_hooks](https://nodejs.org/api/async_hooks.html) functionality. |
+| `async-hooks` | Yes | Tests for [async\_hooks](https://nodejs.org/api/async\_hooks.html) functionality. |
| `benchmark` | Yes | Test minimal functionality of benchmarks. |
| `cctest` | Yes | C++ tests that are run as part of the build process. |
| `code-cache` | No | Tests for a Node.js binary compiled with V8 code cache. |
diff --git a/test/common/README.md b/test/common/README.md
index 6b42fa1070d015..2352e0497a4378 100644
--- a/test/common/README.md
+++ b/test/common/README.md
@@ -31,10 +31,10 @@ The `benchmark` module is used by tests to run benchmarks.
### `runBenchmark(name, args, env)`
-* `name` [<string>][] Name of benchmark suite to be run.
-* `args` [<Array>][] Array of environment variable key/value pairs (ex:
+* `name` [\][] Name of benchmark suite to be run.
+* `args` [\][] Array of environment variable key/value pairs (ex:
`n=1`) to be applied via `--set`.
-* `env` [<Object>][] Environment variables to be applied during the run.
+* `env` [\