diff options
9 files changed, 395 insertions, 15 deletions
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 000000000..b142e5dc0 --- /dev/null +++ b/node_modules/npm-package-arg/node_modules/builtins/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 Julian Gruber <julian@juliangruber.com> + +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 000000000..b1c0007d6 --- /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 000000000..3c781da73 --- /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 000000000..9c6c108d3 --- /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 000000000..fdcd63b30 --- /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 000000000..e7e612bfb --- /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 000000000..fa9a6920d --- /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 25356af37..457f1d8a2 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 0e410ed66..3d196fc31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4944,15 +4944,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": { @@ -12933,10 +12956,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": { |