From 891f7e91f3b25bfb0fd2d9f06530a61a5f354b70 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 29 Mar 2022 13:32:48 -0700 Subject: [PATCH 1/3] deps: init-package-json@3.0.2 --- .../init-package-json/lib/default-input.js | 34 +++--- .../lib/init-package-json.js | 54 ++++----- .../node_modules/builtins/License | 20 ++++ .../node_modules/builtins/Readme.md | 39 +++++++ .../node_modules/builtins/index.js | 79 +++++++++++++ .../node_modules/builtins/package.json | 20 ++++ .../validate-npm-package-name/LICENSE | 6 + .../validate-npm-package-name/lib/index.js | 107 ++++++++++++++++++ .../validate-npm-package-name/package.json | 64 +++++++++++ node_modules/init-package-json/package.json | 26 +++-- package-lock.json | 67 +++++++++-- package.json | 2 +- 12 files changed, 450 insertions(+), 68 deletions(-) create mode 100644 node_modules/init-package-json/node_modules/builtins/License create mode 100644 node_modules/init-package-json/node_modules/builtins/Readme.md create mode 100644 node_modules/init-package-json/node_modules/builtins/index.js create mode 100644 node_modules/init-package-json/node_modules/builtins/package.json create mode 100644 node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE create mode 100644 node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js create mode 100644 node_modules/init-package-json/node_modules/validate-npm-package-name/package.json diff --git a/node_modules/init-package-json/lib/default-input.js b/node_modules/init-package-json/lib/default-input.js index 0003472975760..fe5abfdd85e45 100644 --- a/node_modules/init-package-json/lib/default-input.js +++ b/node_modules/init-package-json/lib/default-input.js @@ -17,8 +17,8 @@ function niceName (n) { function readDeps (test, excluded) { return function (cb) { - fs.readdir('node_modules', function (er, dir) { - if (er) { + fs.readdir('node_modules', function (readdirErr, dir) { + if (readdirErr) { return cb() } var deps = {} @@ -35,8 +35,8 @@ function readDeps (test, excluded) { } var dp = path.join(dirname, 'node_modules', d, 'package.json') - fs.readFile(dp, 'utf8', function (er, p) { - if (er) { + fs.readFile(dp, 'utf8', function (readFileErr, p) { + if (readFileErr) { return next() } try { @@ -108,11 +108,11 @@ var version = package.version || '1.0.0' exports.version = yes ? version : - prompt('version', version, function (version) { - if (semver.valid(version)) { - return version + prompt('version', version, function (promptedVersion) { + if (semver.valid(promptedVersion)) { + return promptedVersion } - var er = new Error('Invalid version: "' + version + '"') + var er = new Error('Invalid version: "' + promptedVersion + '"') er.notValid = true return er }) @@ -128,8 +128,8 @@ if (!package.main) { f = [] } - f = f.filter(function (f) { - return f.match(/\.js$/) + f = f.filter(function (filtered) { + return filtered.match(/\.js$/) }) if (f.indexOf('index.js') !== -1) { @@ -261,17 +261,17 @@ if (!package.repository) { } if (!package.keywords) { - exports.keywords = yes ? '' : prompt('keywords', function (s) { - if (!s) { + exports.keywords = yes ? '' : prompt('keywords', function (promptedKeywords) { + if (!promptedKeywords) { return undefined } - if (Array.isArray(s)) { - s = s.join(' ') + if (Array.isArray(promptedKeywords)) { + promptedKeywords = promptedKeywords.join(' ') } - if (typeof s !== 'string') { - return s + if (typeof promptedKeywords !== 'string') { + return promptedKeywords } - return s.split(/[\s,]+/) + return promptedKeywords.split(/[\s,]+/) }) } diff --git a/node_modules/init-package-json/lib/init-package-json.js b/node_modules/init-package-json/lib/init-package-json.js index f13a34ce6ff4e..230bcd81747bd 100644 --- a/node_modules/init-package-json/lib/init-package-json.js +++ b/node_modules/init-package-json/lib/init-package-json.js @@ -74,62 +74,62 @@ function init (dir, input, config, cb) { var pz = new PZ(input, ctx) pz.backupFile = def 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] + pz.on('data', function (pzData) { + Object.keys(pzData).forEach(function (k) { + if (pzData[k] !== undefined && pzData[k] !== null) { + pkg[k] = pzData[k] } }) // only do a few of these. // no need for mans or contributors if they're in the files - var es = readJson.extraSet + es = readJson.extraSet readJson.extraSet = es.filter(function (fn) { return fn.name !== 'authors' && fn.name !== 'mans' }) - readJson.extras(packageFile, pkg, function (er, pkg) { - if (er) { - return cb(er, pkg) + readJson.extras(packageFile, pkg, function (extrasErr, pkgWithExtras) { + if (extrasErr) { + return cb(extrasErr, pkgWithExtras) } readJson.extraSet = es - pkg = unParsePeople(pkg) + pkgWithExtras = unParsePeople(pkgWithExtras) // no need for the readme now. - delete pkg.readme - delete pkg.readmeFilename + delete pkgWithExtras.readme + delete pkgWithExtras.readmeFilename // really don't want to have this lying around in the file - delete pkg._id + delete pkgWithExtras._id // ditto - delete pkg.gitHead + delete pkgWithExtras.gitHead // if the repo is empty, remove it. - if (!pkg.repository) { - delete pkg.repository + if (!pkgWithExtras.repository) { + delete pkgWithExtras.repository } // readJson filters out empty descriptions, but init-package-json // traditionally leaves them alone - if (!pkg.description) { - pkg.description = data.description + if (!pkgWithExtras.description) { + pkgWithExtras.description = pzData.description } - var d = JSON.stringify(updateDeps(pkg), null, 2) + '\n' - function write (yes) { - fs.writeFile(packageFile, d, 'utf8', function (er) { - if (!er && yes && !config.get('silent')) { - console.log('Wrote to %s:\n\n%s\n', packageFile, d) + var stringified = JSON.stringify(updateDeps(pkgWithExtras), null, 2) + '\n' + function write (writeYes) { + fs.writeFile(packageFile, stringified, 'utf8', function (writeFileErr) { + if (!writeFileErr && writeYes && !config.get('silent')) { + console.log('Wrote to %s:\n\n%s\n', packageFile, stringified) } - return cb(er, pkg) + return cb(writeFileErr, pkgWithExtras) }) } if (ctx.yes) { 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) { - if (er) { - return cb(er) + console.log('About to write to %s:\n\n%s\n', packageFile, stringified) + read({ prompt: 'Is this OK? ', default: 'yes' }, function (promptErr, ok) { + if (promptErr) { + return cb(promptErr) } if (!ok || ok.toLowerCase().charAt(0) !== 'y') { console.log('Aborted.') diff --git a/node_modules/init-package-json/node_modules/builtins/License b/node_modules/init-package-json/node_modules/builtins/License new file mode 100644 index 0000000000000..b142e5dc08133 --- /dev/null +++ b/node_modules/init-package-json/node_modules/builtins/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/init-package-json/node_modules/builtins/Readme.md b/node_modules/init-package-json/node_modules/builtins/Readme.md new file mode 100644 index 0000000000000..b1c0007d6f5e4 --- /dev/null +++ b/node_modules/init-package-json/node_modules/builtins/Readme.md @@ -0,0 +1,39 @@ +# builtins + +[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml) + +List of node.js [builtin modules](http://nodejs.org/api/). + +## Usage + +```js +const builtins = require('builtins') +``` + +Get list of core modules for current Node.js version: + +```js +assert(builtins().includes('http')) +``` + +Get list of core modules for specific Node.js version: + +```js +assert(builtins({ version: '6.0.0' }).includes('http')) +``` + +Get list of core modules present in one or mode Node.js versions: + +```js +assert(builtins({ version: '*' }).includes('worker_threads')) +``` + +Add experimental modules to the list: + +```js +assert(builtins({ experimental: true }).includes('wasi')) +``` + +## License + +MIT diff --git a/node_modules/init-package-json/node_modules/builtins/index.js b/node_modules/init-package-json/node_modules/builtins/index.js new file mode 100644 index 0000000000000..3c781da735419 --- /dev/null +++ b/node_modules/init-package-json/node_modules/builtins/index.js @@ -0,0 +1,79 @@ +'use strict' + +const semver = require('semver') + +const permanentModules = [ + 'assert', + 'buffer', + 'child_process', + 'cluster', + 'console', + 'constants', + 'crypto', + 'dgram', + 'dns', + 'domain', + 'events', + 'fs', + 'http', + 'https', + 'module', + 'net', + 'os', + 'path', + 'punycode', + 'querystring', + 'readline', + 'repl', + 'stream', + 'string_decoder', + 'sys', + 'timers', + 'tls', + 'tty', + 'url', + 'util', + 'vm', + 'zlib' +] + +const versionLockedModules = { + freelist: '<6.0.0', + v8: '>=1.0.0', + process: '>=1.1.0', + inspector: '>=8.0.0', + async_hooks: '>=8.1.0', + http2: '>=8.4.0', + perf_hooks: '>=8.5.0', + trace_events: '>=10.0.0', + worker_threads: '>=12.0.0' +} + +const experimentalModules = { + worker_threads: '>=10.5.0', + wasi: '>=12.16.0', + diagnostics_channel: '^14.17.0 || >=15.1.0' +} + +module.exports = ({ version = process.version, experimental = false } = {}) => { + const builtins = [...permanentModules] + + for (const [name, semverRange] of Object.entries(versionLockedModules)) { + if (version === '*' || semver.satisfies(version, semverRange)) { + builtins.push(name) + } + } + + if (experimental) { + for (const [name, semverRange] of Object.entries(experimentalModules)) { + if ( + !builtins.includes(name) && + (version === '*' || semver.satisfies(version, semverRange)) + ) { + builtins.push(name) + } + } + } + + return builtins +} diff --git a/node_modules/init-package-json/node_modules/builtins/package.json b/node_modules/init-package-json/node_modules/builtins/package.json new file mode 100644 index 0000000000000..9c6c108d3ff5e --- /dev/null +++ b/node_modules/init-package-json/node_modules/builtins/package.json @@ -0,0 +1,20 @@ +{ + "name": "builtins", + "version": "5.0.0", + "description": "List of node.js builtin modules", + "repository": "juliangruber/builtins", + "license": "MIT", + "main": "index.js", + "files": [], + "scripts": { + "test": "prettier-standard && standard && node test.js" + }, + "dependencies": { + "semver": "^7.0.0" + }, + "devDependencies": { + "node-core-test": "^1.1.1", + "prettier-standard": "^15.0.1", + "standard": "^14.3.4" + } +} diff --git a/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE b/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE new file mode 100644 index 0000000000000..fdcd63b302308 --- /dev/null +++ b/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, 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 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/node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js b/node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js new file mode 100644 index 0000000000000..e7e612bfbdf4d --- /dev/null +++ b/node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js @@ -0,0 +1,107 @@ +'use strict' + +var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') +var builtins = require('builtins') +var blacklist = [ + 'node_modules', + 'favicon.ico', +] + +function validate (name) { + var warnings = [] + var errors = [] + + if (name === null) { + errors.push('name cannot be null') + return done(warnings, errors) + } + + if (name === undefined) { + errors.push('name cannot be undefined') + return done(warnings, errors) + } + + if (typeof name !== 'string') { + errors.push('name must be a string') + return done(warnings, errors) + } + + if (!name.length) { + errors.push('name length must be greater than zero') + } + + if (name.match(/^\./)) { + errors.push('name cannot start with a period') + } + + if (name.match(/^_/)) { + errors.push('name cannot start with an underscore') + } + + if (name.trim() !== name) { + errors.push('name cannot contain leading or trailing spaces') + } + + // No funny business + blacklist.forEach(function (blacklistedName) { + if (name.toLowerCase() === blacklistedName) { + errors.push(blacklistedName + ' is a blacklisted name') + } + }) + + // Generate warnings for stuff that used to be allowed + + // core module names like http, events, util, etc + builtins({ version: '*' }).forEach(function (builtin) { + if (name.toLowerCase() === builtin) { + warnings.push(builtin + ' is a core module name') + } + }) + + if (name.length > 214) { + warnings.push('name can no longer contain more than 214 characters') + } + + // mIxeD CaSe nAMEs + if (name.toLowerCase() !== name) { + warnings.push('name can no longer contain capital letters') + } + + if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { + warnings.push('name can no longer contain special characters ("~\'!()*")') + } + + if (encodeURIComponent(name) !== name) { + // Maybe it's a scoped package name, like @user/package + var nameMatch = name.match(scopedPackagePattern) + if (nameMatch) { + var user = nameMatch[1] + var pkg = nameMatch[2] + if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { + return done(warnings, errors) + } + } + + errors.push('name can only contain URL-friendly characters') + } + + return done(warnings, errors) +} + +var done = function (warnings, errors) { + var result = { + validForNewPackages: errors.length === 0 && warnings.length === 0, + validForOldPackages: errors.length === 0, + warnings: warnings, + errors: errors, + } + if (!result.warnings.length) { + delete result.warnings + } + if (!result.errors.length) { + delete result.errors + } + return result +} + +module.exports = validate diff --git a/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json b/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json new file mode 100644 index 0000000000000..fa9a6920d411f --- /dev/null +++ b/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json @@ -0,0 +1,64 @@ +{ + "name": "validate-npm-package-name", + "version": "4.0.0", + "description": "Give me a string and I'll tell you if it's a valid npm package name", + "main": "lib/", + "directories": { + "test": "test" + }, + "dependencies": { + "builtins": "^5.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.1", + "tap": "^16.0.1" + }, + "scripts": { + "cov:test": "TAP_FLAGS='--cov' npm run test:code", + "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", + "test:style": "standard", + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/validate-npm-package-name.git" + }, + "keywords": [ + "npm", + "package", + "names", + "validation" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/validate-npm-package-name/issues" + }, + "homepage": "https://github.com/npm/validate-npm-package-name", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.1" + }, + "tap": { + "statements": 88, + "branches": 92, + "lines": 88 + } +} diff --git a/node_modules/init-package-json/package.json b/node_modules/init-package-json/package.json index 9219863cb6720..91d4b7a109f08 100644 --- a/node_modules/init-package-json/package.json +++ b/node_modules/init-package-json/package.json @@ -1,18 +1,18 @@ { "name": "init-package-json", - "version": "3.0.1", + "version": "3.0.2", "main": "lib/init-package-json.js", "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "snap": "tap", "posttest": "npm run lint", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", @@ -22,21 +22,22 @@ "license": "ISC", "description": "A node module to get your node module started", "dependencies": { - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "promzard": "^0.3.0", "read": "^1.0.7", "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" }, "devDependencies": { "@npmcli/config": "^4.0.1", - "@npmcli/template-oss": "^2.9.2", - "tap": "^15.1.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.1", + "tap": "^16.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "tap": { "statements": "94", @@ -54,10 +55,11 @@ "start" ], "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.1" } } diff --git a/package-lock.json b/package-lock.json index 5ce8ed996e704..52c63f59c6607 100644 --- a/package-lock.json +++ b/package-lock.json @@ -110,7 +110,7 @@ "graceful-fs": "^4.2.9", "hosted-git-info": "^5.0.0", "ini": "^2.0.0", - "init-package-json": "^3.0.1", + "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", "libnpmaccess": "^6.0.2", @@ -3459,6 +3459,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, "funding": [ { @@ -3473,8 +3475,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { "version": "5.2.0", @@ -3556,20 +3557,42 @@ } }, "node_modules/init-package-json": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz", + "integrity": "sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A==", "inBundle": true, - "license": "ISC", "dependencies": { - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "promzard": "^0.3.0", "read": "^1.0.7", "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/init-package-json/node_modules/builtins": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "inBundle": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/init-package-json/node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "inBundle": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/inline-style-parser": { @@ -11889,6 +11912,8 @@ }, "ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, "ignore": { @@ -11934,15 +11959,35 @@ "version": "2.0.0" }, "init-package-json": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz", + "integrity": "sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A==", "requires": { - "npm-package-arg": "^9.0.0", + "npm-package-arg": "^9.0.1", "promzard": "^0.3.0", "read": "^1.0.7", "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" + }, + "dependencies": { + "builtins": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "requires": { + "semver": "^7.0.0" + } + }, + "validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "requires": { + "builtins": "^5.0.0" + } + } } }, "inline-style-parser": { diff --git a/package.json b/package.json index 193a9d5723685..f082581f5ab90 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "graceful-fs": "^4.2.9", "hosted-git-info": "^5.0.0", "ini": "^2.0.0", - "init-package-json": "^3.0.1", + "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", "libnpmaccess": "^6.0.2", From 777e08e9d00dbedb84fc32f6b7463a98b20f1e81 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 29 Mar 2022 13:34:23 -0700 Subject: [PATCH 2/3] deps: npm-package-arg@9.0.2 --- .../node_modules/builtins/License | 20 ++++ .../node_modules/builtins/Readme.md | 39 +++++++ .../node_modules/builtins/index.js | 79 +++++++++++++ .../node_modules/builtins/package.json | 20 ++++ .../validate-npm-package-name/LICENSE | 6 + .../validate-npm-package-name/lib/index.js | 107 ++++++++++++++++++ .../validate-npm-package-name/package.json | 64 +++++++++++ node_modules/npm-package-arg/package.json | 26 +++-- package-lock.json | 49 +++++++- 9 files changed, 395 insertions(+), 15 deletions(-) create mode 100644 node_modules/npm-package-arg/node_modules/builtins/License create mode 100644 node_modules/npm-package-arg/node_modules/builtins/Readme.md create mode 100644 node_modules/npm-package-arg/node_modules/builtins/index.js create mode 100644 node_modules/npm-package-arg/node_modules/builtins/package.json create mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE create mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js create mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json diff --git a/node_modules/npm-package-arg/node_modules/builtins/License b/node_modules/npm-package-arg/node_modules/builtins/License new file mode 100644 index 0000000000000..b142e5dc08133 --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/builtins/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/npm-package-arg/node_modules/builtins/Readme.md b/node_modules/npm-package-arg/node_modules/builtins/Readme.md new file mode 100644 index 0000000000000..b1c0007d6f5e4 --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/builtins/Readme.md @@ -0,0 +1,39 @@ +# builtins + +[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml) + +List of node.js [builtin modules](http://nodejs.org/api/). + +## Usage + +```js +const builtins = require('builtins') +``` + +Get list of core modules for current Node.js version: + +```js +assert(builtins().includes('http')) +``` + +Get list of core modules for specific Node.js version: + +```js +assert(builtins({ version: '6.0.0' }).includes('http')) +``` + +Get list of core modules present in one or mode Node.js versions: + +```js +assert(builtins({ version: '*' }).includes('worker_threads')) +``` + +Add experimental modules to the list: + +```js +assert(builtins({ experimental: true }).includes('wasi')) +``` + +## License + +MIT diff --git a/node_modules/npm-package-arg/node_modules/builtins/index.js b/node_modules/npm-package-arg/node_modules/builtins/index.js new file mode 100644 index 0000000000000..3c781da735419 --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/builtins/index.js @@ -0,0 +1,79 @@ +'use strict' + +const semver = require('semver') + +const permanentModules = [ + 'assert', + 'buffer', + 'child_process', + 'cluster', + 'console', + 'constants', + 'crypto', + 'dgram', + 'dns', + 'domain', + 'events', + 'fs', + 'http', + 'https', + 'module', + 'net', + 'os', + 'path', + 'punycode', + 'querystring', + 'readline', + 'repl', + 'stream', + 'string_decoder', + 'sys', + 'timers', + 'tls', + 'tty', + 'url', + 'util', + 'vm', + 'zlib' +] + +const versionLockedModules = { + freelist: '<6.0.0', + v8: '>=1.0.0', + process: '>=1.1.0', + inspector: '>=8.0.0', + async_hooks: '>=8.1.0', + http2: '>=8.4.0', + perf_hooks: '>=8.5.0', + trace_events: '>=10.0.0', + worker_threads: '>=12.0.0' +} + +const experimentalModules = { + worker_threads: '>=10.5.0', + wasi: '>=12.16.0', + diagnostics_channel: '^14.17.0 || >=15.1.0' +} + +module.exports = ({ version = process.version, experimental = false } = {}) => { + const builtins = [...permanentModules] + + for (const [name, semverRange] of Object.entries(versionLockedModules)) { + if (version === '*' || semver.satisfies(version, semverRange)) { + builtins.push(name) + } + } + + if (experimental) { + for (const [name, semverRange] of Object.entries(experimentalModules)) { + if ( + !builtins.includes(name) && + (version === '*' || semver.satisfies(version, semverRange)) + ) { + builtins.push(name) + } + } + } + + return builtins +} diff --git a/node_modules/npm-package-arg/node_modules/builtins/package.json b/node_modules/npm-package-arg/node_modules/builtins/package.json new file mode 100644 index 0000000000000..9c6c108d3ff5e --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/builtins/package.json @@ -0,0 +1,20 @@ +{ + "name": "builtins", + "version": "5.0.0", + "description": "List of node.js builtin modules", + "repository": "juliangruber/builtins", + "license": "MIT", + "main": "index.js", + "files": [], + "scripts": { + "test": "prettier-standard && standard && node test.js" + }, + "dependencies": { + "semver": "^7.0.0" + }, + "devDependencies": { + "node-core-test": "^1.1.1", + "prettier-standard": "^15.0.1", + "standard": "^14.3.4" + } +} diff --git a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE new file mode 100644 index 0000000000000..fdcd63b302308 --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, 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 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/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js new file mode 100644 index 0000000000000..e7e612bfbdf4d --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js @@ -0,0 +1,107 @@ +'use strict' + +var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') +var builtins = require('builtins') +var blacklist = [ + 'node_modules', + 'favicon.ico', +] + +function validate (name) { + var warnings = [] + var errors = [] + + if (name === null) { + errors.push('name cannot be null') + return done(warnings, errors) + } + + if (name === undefined) { + errors.push('name cannot be undefined') + return done(warnings, errors) + } + + if (typeof name !== 'string') { + errors.push('name must be a string') + return done(warnings, errors) + } + + if (!name.length) { + errors.push('name length must be greater than zero') + } + + if (name.match(/^\./)) { + errors.push('name cannot start with a period') + } + + if (name.match(/^_/)) { + errors.push('name cannot start with an underscore') + } + + if (name.trim() !== name) { + errors.push('name cannot contain leading or trailing spaces') + } + + // No funny business + blacklist.forEach(function (blacklistedName) { + if (name.toLowerCase() === blacklistedName) { + errors.push(blacklistedName + ' is a blacklisted name') + } + }) + + // Generate warnings for stuff that used to be allowed + + // core module names like http, events, util, etc + builtins({ version: '*' }).forEach(function (builtin) { + if (name.toLowerCase() === builtin) { + warnings.push(builtin + ' is a core module name') + } + }) + + if (name.length > 214) { + warnings.push('name can no longer contain more than 214 characters') + } + + // mIxeD CaSe nAMEs + if (name.toLowerCase() !== name) { + warnings.push('name can no longer contain capital letters') + } + + if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { + warnings.push('name can no longer contain special characters ("~\'!()*")') + } + + if (encodeURIComponent(name) !== name) { + // Maybe it's a scoped package name, like @user/package + var nameMatch = name.match(scopedPackagePattern) + if (nameMatch) { + var user = nameMatch[1] + var pkg = nameMatch[2] + if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { + return done(warnings, errors) + } + } + + errors.push('name can only contain URL-friendly characters') + } + + return done(warnings, errors) +} + +var done = function (warnings, errors) { + var result = { + validForNewPackages: errors.length === 0 && warnings.length === 0, + validForOldPackages: errors.length === 0, + warnings: warnings, + errors: errors, + } + if (!result.warnings.length) { + delete result.warnings + } + if (!result.errors.length) { + delete result.errors + } + return result +} + +module.exports = validate diff --git a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json new file mode 100644 index 0000000000000..fa9a6920d411f --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json @@ -0,0 +1,64 @@ +{ + "name": "validate-npm-package-name", + "version": "4.0.0", + "description": "Give me a string and I'll tell you if it's a valid npm package name", + "main": "lib/", + "directories": { + "test": "test" + }, + "dependencies": { + "builtins": "^5.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.1", + "tap": "^16.0.1" + }, + "scripts": { + "cov:test": "TAP_FLAGS='--cov' npm run test:code", + "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", + "test:style": "standard", + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/validate-npm-package-name.git" + }, + "keywords": [ + "npm", + "package", + "names", + "validation" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/validate-npm-package-name/issues" + }, + "homepage": "https://github.com/npm/validate-npm-package-name", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.1" + }, + "tap": { + "statements": 88, + "branches": 92, + "lines": 88 + } +} diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json index 25356af373982..457f1d8a2f83d 100644 --- a/node_modules/npm-package-arg/package.json +++ b/node_modules/npm-package-arg/package.json @@ -1,23 +1,24 @@ { "name": "npm-package-arg", - "version": "9.0.1", + "version": "9.0.2", "description": "Parse the things that can be arguments to `npm install`", "main": "./lib/npa.js", "directories": { "test": "test" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "dependencies": { "hosted-git-info": "^5.0.0", "semver": "^7.3.5", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", - "tap": "^15.1.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.1", + "tap": "^16.0.1" }, "scripts": { "preversion": "npm test", @@ -26,16 +27,16 @@ "test": "tap", "snap": "tap", "npmclilint": "npmcli-lint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force" + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "https://github.com/npm/npm-package-arg" + "url": "https://github.com/npm/npm-package-arg.git" }, "author": "GitHub Inc.", "license": "ISC", @@ -44,12 +45,13 @@ }, "homepage": "https://github.com/npm/npm-package-arg", "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "tap": { "branches": 97 }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.1" } } diff --git a/package-lock.json b/package-lock.json index 52c63f59c6607..bcac276fecf6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4943,15 +4943,38 @@ }, "node_modules/npm-package-arg": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", + "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", "inBundle": true, "license": "ISC", "dependencies": { "hosted-git-info": "^5.0.0", "semver": "^7.3.5", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/builtins": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "inBundle": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "inBundle": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-packlist": { @@ -12930,10 +12953,30 @@ }, "npm-package-arg": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", + "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", "requires": { "hosted-git-info": "^5.0.0", "semver": "^7.3.5", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" + }, + "dependencies": { + "builtins": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "requires": { + "semver": "^7.0.0" + } + }, + "validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "requires": { + "builtins": "^5.0.0" + } + } } }, "npm-packlist": { From bd4020609d483bb3001426c9b3a5f3215757f44c Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 29 Mar 2022 13:35:34 -0700 Subject: [PATCH 3/3] deps: validate-npm-package-name@4.0.0 * use latest builtins --- node_modules/builtins/History.md | 39 ------ node_modules/builtins/Readme.md | 35 ++++-- node_modules/builtins/builtins.json | 35 ------ .../node_modules => }/builtins/index.js | 0 node_modules/builtins/package.json | 18 ++- node_modules/builtins/test.js | 5 - .../node_modules/builtins/License | 20 ---- .../node_modules/builtins/Readme.md | 39 ------ .../node_modules/builtins/package.json | 20 ---- .../validate-npm-package-name/LICENSE | 6 - .../validate-npm-package-name/package.json | 64 ---------- .../node_modules/builtins/License | 20 ---- .../node_modules/builtins/Readme.md | 39 ------ .../node_modules/builtins/index.js | 79 ------------- .../node_modules/builtins/package.json | 20 ---- .../validate-npm-package-name/LICENSE | 6 - .../validate-npm-package-name/lib/index.js | 107 ----------------- .../validate-npm-package-name/package.json | 64 ---------- .../validate-npm-package-name/index.js | 105 ----------------- .../validate-npm-package-name/lib/index.js | 0 .../validate-npm-package-name/package.json | 44 +++++-- .../validate-npm-package-name/test/index.js | 109 ----------------- package-lock.json | 111 ++++-------------- package.json | 2 +- 24 files changed, 100 insertions(+), 887 deletions(-) delete mode 100644 node_modules/builtins/History.md delete mode 100644 node_modules/builtins/builtins.json rename node_modules/{init-package-json/node_modules => }/builtins/index.js (100%) delete mode 100644 node_modules/builtins/test.js delete mode 100644 node_modules/init-package-json/node_modules/builtins/License delete mode 100644 node_modules/init-package-json/node_modules/builtins/Readme.md delete mode 100644 node_modules/init-package-json/node_modules/builtins/package.json delete mode 100644 node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE delete mode 100644 node_modules/init-package-json/node_modules/validate-npm-package-name/package.json delete mode 100644 node_modules/npm-package-arg/node_modules/builtins/License delete mode 100644 node_modules/npm-package-arg/node_modules/builtins/Readme.md delete mode 100644 node_modules/npm-package-arg/node_modules/builtins/index.js delete mode 100644 node_modules/npm-package-arg/node_modules/builtins/package.json delete mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE delete mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js delete mode 100644 node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json delete mode 100644 node_modules/validate-npm-package-name/index.js rename node_modules/{init-package-json/node_modules => }/validate-npm-package-name/lib/index.js (100%) delete mode 100644 node_modules/validate-npm-package-name/test/index.js diff --git a/node_modules/builtins/History.md b/node_modules/builtins/History.md deleted file mode 100644 index 0eb45c420775e..0000000000000 --- a/node_modules/builtins/History.md +++ /dev/null @@ -1,39 +0,0 @@ - -0.0.7 / 2014-09-01 -================== - - * update .repository - -0.0.6 / 2014-09-01 -================== - - * add travis - * add test script - * add constants - -0.0.5 / 2014-06-27 -================== - - * add module - * publish to public npm - -0.0.4 / 2014-04-25 -================== - - * add timers - -0.0.3 / 2014-02-22 -================== - - * add buffer - -0.0.2 / 2014-02-11 -================== - - * add assert - -0.0.1 / 2014-02-11 -================== - - * add main - * initial commit diff --git a/node_modules/builtins/Readme.md b/node_modules/builtins/Readme.md index 96f4b1f6c4a83..b1c0007d6f5e4 100644 --- a/node_modules/builtins/Readme.md +++ b/node_modules/builtins/Readme.md @@ -1,18 +1,39 @@ - # builtins - List of node.js [builtin modules](http://nodejs.org/api/). +[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml) + +List of node.js [builtin modules](http://nodejs.org/api/). + +## Usage + +```js +const builtins = require('builtins') +``` + +Get list of core modules for current Node.js version: + +```js +assert(builtins().includes('http')) +``` - [![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins) +Get list of core modules for specific Node.js version: + +```js +assert(builtins({ version: '6.0.0' }).includes('http')) +``` -## Example +Get list of core modules present in one or mode Node.js versions: ```js -var builtins = require('builtins'); +assert(builtins({ version: '*' }).includes('worker_threads')) +``` -assert(builtins.indexOf('http') > -1); +Add experimental modules to the list: + +```js +assert(builtins({ experimental: true }).includes('wasi')) ``` ## License - MIT +MIT diff --git a/node_modules/builtins/builtins.json b/node_modules/builtins/builtins.json deleted file mode 100644 index 45c05225644bd..0000000000000 --- a/node_modules/builtins/builtins.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - "assert", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "dns", - "domain", - "events", - "fs", - "http", - "https", - "module", - "net", - "os", - "path", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "string_decoder", - "timers", - "tls", - "tty", - "url", - "util", - "v8", - "vm", - "zlib" -] diff --git a/node_modules/init-package-json/node_modules/builtins/index.js b/node_modules/builtins/index.js similarity index 100% rename from node_modules/init-package-json/node_modules/builtins/index.js rename to node_modules/builtins/index.js diff --git a/node_modules/builtins/package.json b/node_modules/builtins/package.json index 819996532d5ff..9c6c108d3ff5e 100644 --- a/node_modules/builtins/package.json +++ b/node_modules/builtins/package.json @@ -1,14 +1,20 @@ { "name": "builtins", - "version": "1.0.3", + "version": "5.0.0", "description": "List of node.js builtin modules", "repository": "juliangruber/builtins", "license": "MIT", - "main": "builtins.json", - "publishConfig": { - "registry": "https://registry.npmjs.org" - }, + "main": "index.js", + "files": [], "scripts": { - "test": "node test.js" + "test": "prettier-standard && standard && node test.js" + }, + "dependencies": { + "semver": "^7.0.0" + }, + "devDependencies": { + "node-core-test": "^1.1.1", + "prettier-standard": "^15.0.1", + "standard": "^14.3.4" } } diff --git a/node_modules/builtins/test.js b/node_modules/builtins/test.js deleted file mode 100644 index ffbe8389c14d6..0000000000000 --- a/node_modules/builtins/test.js +++ /dev/null @@ -1,5 +0,0 @@ -var builtins = require('./builtins'); - -builtins.forEach(function(name){ - require(name); -}); diff --git a/node_modules/init-package-json/node_modules/builtins/License b/node_modules/init-package-json/node_modules/builtins/License deleted file mode 100644 index b142e5dc08133..0000000000000 --- a/node_modules/init-package-json/node_modules/builtins/License +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2015 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/init-package-json/node_modules/builtins/Readme.md b/node_modules/init-package-json/node_modules/builtins/Readme.md deleted file mode 100644 index b1c0007d6f5e4..0000000000000 --- a/node_modules/init-package-json/node_modules/builtins/Readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# builtins - -[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml) - -List of node.js [builtin modules](http://nodejs.org/api/). - -## Usage - -```js -const builtins = require('builtins') -``` - -Get list of core modules for current Node.js version: - -```js -assert(builtins().includes('http')) -``` - -Get list of core modules for specific Node.js version: - -```js -assert(builtins({ version: '6.0.0' }).includes('http')) -``` - -Get list of core modules present in one or mode Node.js versions: - -```js -assert(builtins({ version: '*' }).includes('worker_threads')) -``` - -Add experimental modules to the list: - -```js -assert(builtins({ experimental: true }).includes('wasi')) -``` - -## License - -MIT diff --git a/node_modules/init-package-json/node_modules/builtins/package.json b/node_modules/init-package-json/node_modules/builtins/package.json deleted file mode 100644 index 9c6c108d3ff5e..0000000000000 --- a/node_modules/init-package-json/node_modules/builtins/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "builtins", - "version": "5.0.0", - "description": "List of node.js builtin modules", - "repository": "juliangruber/builtins", - "license": "MIT", - "main": "index.js", - "files": [], - "scripts": { - "test": "prettier-standard && standard && node test.js" - }, - "dependencies": { - "semver": "^7.0.0" - }, - "devDependencies": { - "node-core-test": "^1.1.1", - "prettier-standard": "^15.0.1", - "standard": "^14.3.4" - } -} diff --git a/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE b/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE deleted file mode 100644 index fdcd63b302308..0000000000000 --- a/node_modules/init-package-json/node_modules/validate-npm-package-name/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, 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 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/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json b/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json deleted file mode 100644 index fa9a6920d411f..0000000000000 --- a/node_modules/init-package-json/node_modules/validate-npm-package-name/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "validate-npm-package-name", - "version": "4.0.0", - "description": "Give me a string and I'll tell you if it's a valid npm package name", - "main": "lib/", - "directories": { - "test": "test" - }, - "dependencies": { - "builtins": "^5.0.0" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.1", - "tap": "^16.0.1" - }, - "scripts": { - "cov:test": "TAP_FLAGS='--cov' npm run test:code", - "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", - "test:style": "standard", - "test": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "snap": "tap", - "posttest": "npm run lint" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/validate-npm-package-name.git" - }, - "keywords": [ - "npm", - "package", - "names", - "validation" - ], - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/validate-npm-package-name/issues" - }, - "homepage": "https://github.com/npm/validate-npm-package-name", - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.1" - }, - "tap": { - "statements": 88, - "branches": 92, - "lines": 88 - } -} diff --git a/node_modules/npm-package-arg/node_modules/builtins/License b/node_modules/npm-package-arg/node_modules/builtins/License deleted file mode 100644 index b142e5dc08133..0000000000000 --- a/node_modules/npm-package-arg/node_modules/builtins/License +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2015 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/npm-package-arg/node_modules/builtins/Readme.md b/node_modules/npm-package-arg/node_modules/builtins/Readme.md deleted file mode 100644 index b1c0007d6f5e4..0000000000000 --- a/node_modules/npm-package-arg/node_modules/builtins/Readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# builtins - -[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml) - -List of node.js [builtin modules](http://nodejs.org/api/). - -## Usage - -```js -const builtins = require('builtins') -``` - -Get list of core modules for current Node.js version: - -```js -assert(builtins().includes('http')) -``` - -Get list of core modules for specific Node.js version: - -```js -assert(builtins({ version: '6.0.0' }).includes('http')) -``` - -Get list of core modules present in one or mode Node.js versions: - -```js -assert(builtins({ version: '*' }).includes('worker_threads')) -``` - -Add experimental modules to the list: - -```js -assert(builtins({ experimental: true }).includes('wasi')) -``` - -## License - -MIT diff --git a/node_modules/npm-package-arg/node_modules/builtins/index.js b/node_modules/npm-package-arg/node_modules/builtins/index.js deleted file mode 100644 index 3c781da735419..0000000000000 --- a/node_modules/npm-package-arg/node_modules/builtins/index.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' - -const semver = require('semver') - -const permanentModules = [ - 'assert', - 'buffer', - 'child_process', - 'cluster', - 'console', - 'constants', - 'crypto', - 'dgram', - 'dns', - 'domain', - 'events', - 'fs', - 'http', - 'https', - 'module', - 'net', - 'os', - 'path', - 'punycode', - 'querystring', - 'readline', - 'repl', - 'stream', - 'string_decoder', - 'sys', - 'timers', - 'tls', - 'tty', - 'url', - 'util', - 'vm', - 'zlib' -] - -const versionLockedModules = { - freelist: '<6.0.0', - v8: '>=1.0.0', - process: '>=1.1.0', - inspector: '>=8.0.0', - async_hooks: '>=8.1.0', - http2: '>=8.4.0', - perf_hooks: '>=8.5.0', - trace_events: '>=10.0.0', - worker_threads: '>=12.0.0' -} - -const experimentalModules = { - worker_threads: '>=10.5.0', - wasi: '>=12.16.0', - diagnostics_channel: '^14.17.0 || >=15.1.0' -} - -module.exports = ({ version = process.version, experimental = false } = {}) => { - const builtins = [...permanentModules] - - for (const [name, semverRange] of Object.entries(versionLockedModules)) { - if (version === '*' || semver.satisfies(version, semverRange)) { - builtins.push(name) - } - } - - if (experimental) { - for (const [name, semverRange] of Object.entries(experimentalModules)) { - if ( - !builtins.includes(name) && - (version === '*' || semver.satisfies(version, semverRange)) - ) { - builtins.push(name) - } - } - } - - return builtins -} diff --git a/node_modules/npm-package-arg/node_modules/builtins/package.json b/node_modules/npm-package-arg/node_modules/builtins/package.json deleted file mode 100644 index 9c6c108d3ff5e..0000000000000 --- a/node_modules/npm-package-arg/node_modules/builtins/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "builtins", - "version": "5.0.0", - "description": "List of node.js builtin modules", - "repository": "juliangruber/builtins", - "license": "MIT", - "main": "index.js", - "files": [], - "scripts": { - "test": "prettier-standard && standard && node test.js" - }, - "dependencies": { - "semver": "^7.0.0" - }, - "devDependencies": { - "node-core-test": "^1.1.1", - "prettier-standard": "^15.0.1", - "standard": "^14.3.4" - } -} diff --git a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE deleted file mode 100644 index fdcd63b302308..0000000000000 --- a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, 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 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/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js deleted file mode 100644 index e7e612bfbdf4d..0000000000000 --- a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' - -var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') -var builtins = require('builtins') -var blacklist = [ - 'node_modules', - 'favicon.ico', -] - -function validate (name) { - var warnings = [] - var errors = [] - - if (name === null) { - errors.push('name cannot be null') - return done(warnings, errors) - } - - if (name === undefined) { - errors.push('name cannot be undefined') - return done(warnings, errors) - } - - if (typeof name !== 'string') { - errors.push('name must be a string') - return done(warnings, errors) - } - - if (!name.length) { - errors.push('name length must be greater than zero') - } - - if (name.match(/^\./)) { - errors.push('name cannot start with a period') - } - - if (name.match(/^_/)) { - errors.push('name cannot start with an underscore') - } - - if (name.trim() !== name) { - errors.push('name cannot contain leading or trailing spaces') - } - - // No funny business - blacklist.forEach(function (blacklistedName) { - if (name.toLowerCase() === blacklistedName) { - errors.push(blacklistedName + ' is a blacklisted name') - } - }) - - // Generate warnings for stuff that used to be allowed - - // core module names like http, events, util, etc - builtins({ version: '*' }).forEach(function (builtin) { - if (name.toLowerCase() === builtin) { - warnings.push(builtin + ' is a core module name') - } - }) - - if (name.length > 214) { - warnings.push('name can no longer contain more than 214 characters') - } - - // mIxeD CaSe nAMEs - if (name.toLowerCase() !== name) { - warnings.push('name can no longer contain capital letters') - } - - if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { - warnings.push('name can no longer contain special characters ("~\'!()*")') - } - - if (encodeURIComponent(name) !== name) { - // Maybe it's a scoped package name, like @user/package - var nameMatch = name.match(scopedPackagePattern) - if (nameMatch) { - var user = nameMatch[1] - var pkg = nameMatch[2] - if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { - return done(warnings, errors) - } - } - - errors.push('name can only contain URL-friendly characters') - } - - return done(warnings, errors) -} - -var done = function (warnings, errors) { - var result = { - validForNewPackages: errors.length === 0 && warnings.length === 0, - validForOldPackages: errors.length === 0, - warnings: warnings, - errors: errors, - } - if (!result.warnings.length) { - delete result.warnings - } - if (!result.errors.length) { - delete result.errors - } - return result -} - -module.exports = validate diff --git a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json b/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json deleted file mode 100644 index fa9a6920d411f..0000000000000 --- a/node_modules/npm-package-arg/node_modules/validate-npm-package-name/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "validate-npm-package-name", - "version": "4.0.0", - "description": "Give me a string and I'll tell you if it's a valid npm package name", - "main": "lib/", - "directories": { - "test": "test" - }, - "dependencies": { - "builtins": "^5.0.0" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.1", - "tap": "^16.0.1" - }, - "scripts": { - "cov:test": "TAP_FLAGS='--cov' npm run test:code", - "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", - "test:style": "standard", - "test": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "snap": "tap", - "posttest": "npm run lint" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/validate-npm-package-name.git" - }, - "keywords": [ - "npm", - "package", - "names", - "validation" - ], - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/validate-npm-package-name/issues" - }, - "homepage": "https://github.com/npm/validate-npm-package-name", - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.1" - }, - "tap": { - "statements": 88, - "branches": 92, - "lines": 88 - } -} diff --git a/node_modules/validate-npm-package-name/index.js b/node_modules/validate-npm-package-name/index.js deleted file mode 100644 index eb43fa25e56ae..0000000000000 --- a/node_modules/validate-npm-package-name/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict' - -var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') -var builtins = require('builtins') -var blacklist = [ - 'node_modules', - 'favicon.ico' -] - -var validate = module.exports = function (name) { - var warnings = [] - var errors = [] - - if (name === null) { - errors.push('name cannot be null') - return done(warnings, errors) - } - - if (name === undefined) { - errors.push('name cannot be undefined') - return done(warnings, errors) - } - - if (typeof name !== 'string') { - errors.push('name must be a string') - return done(warnings, errors) - } - - if (!name.length) { - errors.push('name length must be greater than zero') - } - - if (name.match(/^\./)) { - errors.push('name cannot start with a period') - } - - if (name.match(/^_/)) { - errors.push('name cannot start with an underscore') - } - - if (name.trim() !== name) { - errors.push('name cannot contain leading or trailing spaces') - } - - // No funny business - blacklist.forEach(function (blacklistedName) { - if (name.toLowerCase() === blacklistedName) { - errors.push(blacklistedName + ' is a blacklisted name') - } - }) - - // Generate warnings for stuff that used to be allowed - - // core module names like http, events, util, etc - builtins.forEach(function (builtin) { - if (name.toLowerCase() === builtin) { - warnings.push(builtin + ' is a core module name') - } - }) - - // really-long-package-names-------------------------------such--length-----many---wow - // the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch. - if (name.length > 214) { - warnings.push('name can no longer contain more than 214 characters') - } - - // mIxeD CaSe nAMEs - if (name.toLowerCase() !== name) { - warnings.push('name can no longer contain capital letters') - } - - if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { - warnings.push('name can no longer contain special characters ("~\'!()*")') - } - - if (encodeURIComponent(name) !== name) { - // Maybe it's a scoped package name, like @user/package - var nameMatch = name.match(scopedPackagePattern) - if (nameMatch) { - var user = nameMatch[1] - var pkg = nameMatch[2] - if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { - return done(warnings, errors) - } - } - - errors.push('name can only contain URL-friendly characters') - } - - return done(warnings, errors) -} - -validate.scopedPackagePattern = scopedPackagePattern - -var done = function (warnings, errors) { - var result = { - validForNewPackages: errors.length === 0 && warnings.length === 0, - validForOldPackages: errors.length === 0, - warnings: warnings, - errors: errors - } - if (!result.warnings.length) delete result.warnings - if (!result.errors.length) delete result.errors - return result -} diff --git a/node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js b/node_modules/validate-npm-package-name/lib/index.js similarity index 100% rename from node_modules/init-package-json/node_modules/validate-npm-package-name/lib/index.js rename to node_modules/validate-npm-package-name/lib/index.js diff --git a/node_modules/validate-npm-package-name/package.json b/node_modules/validate-npm-package-name/package.json index b72e9ef03b08c..fa9a6920d411f 100644 --- a/node_modules/validate-npm-package-name/package.json +++ b/node_modules/validate-npm-package-name/package.json @@ -1,27 +1,37 @@ { "name": "validate-npm-package-name", - "version": "3.0.0", + "version": "4.0.0", "description": "Give me a string and I'll tell you if it's a valid npm package name", - "main": "index.js", + "main": "lib/", "directories": { "test": "test" }, "dependencies": { - "builtins": "^1.0.3" + "builtins": "^5.0.0" }, "devDependencies": { - "standard": "^8.6.0", - "tap": "^10.0.0" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.1", + "tap": "^16.0.1" }, "scripts": { "cov:test": "TAP_FLAGS='--cov' npm run test:code", "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", "test:style": "standard", - "test": "npm run test:code && npm run test:style" + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "repository": { "type": "git", - "url": "https://github.com/npm/validate-npm-package-name" + "url": "https://github.com/npm/validate-npm-package-name.git" }, "keywords": [ "npm", @@ -29,10 +39,26 @@ "names", "validation" ], - "author": "zeke", + "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/validate-npm-package-name/issues" }, - "homepage": "https://github.com/npm/validate-npm-package-name" + "homepage": "https://github.com/npm/validate-npm-package-name", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.1" + }, + "tap": { + "statements": 88, + "branches": 92, + "lines": 88 + } } diff --git a/node_modules/validate-npm-package-name/test/index.js b/node_modules/validate-npm-package-name/test/index.js deleted file mode 100644 index 1f0bc61235087..0000000000000 --- a/node_modules/validate-npm-package-name/test/index.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' - -var validate = require('..') -var test = require('tap').test - -test('validate-npm-package-name', function (t) { - // Traditional - - t.deepEqual(validate('some-package'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('example.com'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('under_score'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('period.js'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('123numeric'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('crazy!'), { - validForNewPackages: false, - validForOldPackages: true, - warnings: ['name can no longer contain special characters ("~\'!()*")'] - }) - - // Scoped (npm 2+) - - t.deepEqual(validate('@npm/thingy'), {validForNewPackages: true, validForOldPackages: true}) - t.deepEqual(validate('@npm-zors/money!time.js'), { - validForNewPackages: false, - validForOldPackages: true, - warnings: ['name can no longer contain special characters ("~\'!()*")'] - }) - - // Invalid - - t.deepEqual(validate(''), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name length must be greater than zero']}) - - t.deepEqual(validate(''), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name length must be greater than zero']}) - - t.deepEqual(validate('.start-with-period'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name cannot start with a period']}) - - t.deepEqual(validate('_start-with-underscore'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name cannot start with an underscore']}) - - t.deepEqual(validate('contain:colons'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name can only contain URL-friendly characters']}) - - t.deepEqual(validate(' leading-space'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name cannot contain leading or trailing spaces', 'name can only contain URL-friendly characters']}) - - t.deepEqual(validate('trailing-space '), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name cannot contain leading or trailing spaces', 'name can only contain URL-friendly characters']}) - - t.deepEqual(validate('s/l/a/s/h/e/s'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['name can only contain URL-friendly characters']}) - - t.deepEqual(validate('node_modules'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['node_modules is a blacklisted name']}) - - t.deepEqual(validate('favicon.ico'), { - validForNewPackages: false, - validForOldPackages: false, - errors: ['favicon.ico is a blacklisted name']}) - - // Node/IO Core - - t.deepEqual(validate('http'), { - validForNewPackages: false, - validForOldPackages: true, - warnings: ['http is a core module name']}) - - // Long Package Names - - t.deepEqual(validate('ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou-'), { - validForNewPackages: false, - validForOldPackages: true, - warnings: ['name can no longer contain more than 214 characters'] - }) - - t.deepEqual(validate('ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou'), { - validForNewPackages: true, - validForOldPackages: true - }) - - // Legacy Mixed-Case - - t.deepEqual(validate('CAPITAL-LETTERS'), { - validForNewPackages: false, - validForOldPackages: true, - warnings: ['name can no longer contain capital letters']}) - - t.end() -}) diff --git a/package-lock.json b/package-lock.json index bcac276fecf6e..ea072170dd423 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,7 +156,7 @@ "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", - "validate-npm-package-name": "~3.0.0", + "validate-npm-package-name": "^4.0.0", "which": "^2.0.2", "write-file-atomic": "^4.0.1" }, @@ -1504,9 +1504,13 @@ "license": "MIT" }, "node_modules/builtins": { - "version": "1.0.3", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", "inBundle": true, - "license": "MIT" + "dependencies": { + "semver": "^7.0.0" + } }, "node_modules/cacache": { "version": "16.0.3", @@ -3574,27 +3578,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/init-package-json/node_modules/builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", - "inBundle": true, - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/init-package-json/node_modules/validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "inBundle": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/inline-style-parser": { "version": "0.1.1", "dev": true, @@ -4956,27 +4939,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm-package-arg/node_modules/builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", - "inBundle": true, - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "inBundle": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/npm-packlist": { "version": "4.0.0", "inBundle": true, @@ -9103,11 +9065,15 @@ } }, "node_modules/validate-npm-package-name": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "inBundle": true, - "license": "ISC", "dependencies": { - "builtins": "^1.0.3" + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/verror": { @@ -10702,7 +10668,12 @@ "dev": true }, "builtins": { - "version": "1.0.3" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "requires": { + "semver": "^7.0.0" + } }, "cacache": { "version": "16.0.3", @@ -11993,24 +11964,6 @@ "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^4.0.0" - }, - "dependencies": { - "builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", - "requires": { - "semver": "^7.0.0" - } - }, - "validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "requires": { - "builtins": "^5.0.0" - } - } } }, "inline-style-parser": { @@ -12959,24 +12912,6 @@ "hosted-git-info": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^4.0.0" - }, - "dependencies": { - "builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", - "requires": { - "semver": "^7.0.0" - } - }, - "validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "requires": { - "builtins": "^5.0.0" - } - } } }, "npm-packlist": { @@ -15656,9 +15591,11 @@ } }, "validate-npm-package-name": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "requires": { - "builtins": "^1.0.3" + "builtins": "^5.0.0" } }, "verror": { diff --git a/package.json b/package.json index f082581f5ab90..b86c7e37b7599 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", - "validate-npm-package-name": "~3.0.0", + "validate-npm-package-name": "^4.0.0", "which": "^2.0.2", "write-file-atomic": "^4.0.1" },