diff options
Diffstat (limited to 'node_modules/@npmcli')
63 files changed, 79 insertions, 4653 deletions
diff --git a/node_modules/@npmcli/arborist/node_modules/.bin/mkdirp b/node_modules/@npmcli/arborist/node_modules/.bin/mkdirp deleted file mode 120000 index 017896ceb..000000000 --- a/node_modules/@npmcli/arborist/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js
\ No newline at end of file diff --git a/node_modules/@npmcli/arborist/node_modules/.bin/rimraf b/node_modules/@npmcli/arborist/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49d..000000000 --- a/node_modules/@npmcli/arborist/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js
\ No newline at end of file diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/CHANGELOG.md b/node_modules/@npmcli/arborist/node_modules/bin-links/CHANGELOG.md deleted file mode 100644 index 0531b01ca..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/CHANGELOG.md +++ /dev/null @@ -1,89 +0,0 @@ -# Change Log - -## 2.0.0 - -* Rewrite to promisify and remove dependence on gentle-fs - -<a name="1.1.7"></a> -## [1.1.7](https://github.com/npm/bin-links/compare/v1.1.6...v1.1.7) (2019-12-26) - - -### Bug Fixes - -* resolve folder that is passed in ([0bbd303](https://github.com/npm/bin-links/commit/0bbd303)) - - - -<a name="1.1.6"></a> -## [1.1.6](https://github.com/npm/bin-links/compare/v1.1.5...v1.1.6) (2019-12-11) - - -### Bug Fixes - -* prevent improper clobbering of man/bin links ([642cd18](https://github.com/npm/bin-links/commit/642cd18)), closes [#11](https://github.com/npm/bin-links/issues/11) [#12](https://github.com/npm/bin-links/issues/12) - - - -<a name="1.1.5"></a> -## [1.1.5](https://github.com/npm/bin-links/compare/v1.1.4...v1.1.5) (2019-12-10) - - -### Bug Fixes - -* don't filter out ./ man references ([b3cfd2e](https://github.com/npm/bin-links/commit/b3cfd2e)) - - - -<a name="1.1.4"></a> -## [1.1.4](https://github.com/npm/bin-links/compare/v1.1.3...v1.1.4) (2019-12-09) - - -### Bug Fixes - -* sanitize and validate bin and man link targets ([25a34f9](https://github.com/npm/bin-links/commit/25a34f9)) - - - -<a name="1.1.3"></a> -## [1.1.3](https://github.com/npm/bin-links/compare/v1.1.2...v1.1.3) (2019-08-14) - - - -<a name="1.1.2"></a> -## [1.1.2](https://github.com/npm/bin-links/compare/v1.1.1...v1.1.2) (2018-03-22) - - -### Bug Fixes - -* **linkMans:** return the promise! ([5eccc7f](https://github.com/npm/bin-links/commit/5eccc7f)) - - - -<a name="1.1.1"></a> -## [1.1.1](https://github.com/npm/bin-links/compare/v1.1.0...v1.1.1) (2018-03-07) - - -### Bug Fixes - -* **shebangs:** only convert CR when doing CRLF -> LF ([#2](https://github.com/npm/bin-links/issues/2)) ([43bf857](https://github.com/npm/bin-links/commit/43bf857)) - - - -<a name="1.1.0"></a> -# [1.1.0](https://github.com/npm/bin-links/compare/v1.0.0...v1.1.0) (2017-11-20) - - -### Features - -* **dos2unix:** Log the fact line endings are being changed upon install. ([e9f8a6f](https://github.com/npm/bin-links/commit/e9f8a6f)) - - - -<a name="1.0.0"></a> -# 1.0.0 (2017-10-07) - - -### Features - -* **import:** initial extraction from npm ([6ed0bfb](https://github.com/npm/bin-links/commit/6ed0bfb)) -* **initial commit:** README ([3fc9cf0](https://github.com/npm/bin-links/commit/3fc9cf0)) diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/LICENSE b/node_modules/@npmcli/arborist/node_modules/bin-links/LICENSE deleted file mode 100644 index 19cec97b1..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 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/@npmcli/arborist/node_modules/bin-links/README.md b/node_modules/@npmcli/arborist/node_modules/bin-links/README.md deleted file mode 100644 index 4e3a8b407..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# bin-links [![npm version](https://img.shields.io/npm/v/bin-links.svg)](https://npm.im/bin-links) [![license](https://img.shields.io/npm/l/bin-links.svg)](https://npm.im/bin-links) [![Travis](https://img.shields.io/travis/npm/bin-links.svg)](https://travis-ci.org/npm/bin-links) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/bin-links?svg=true)](https://ci.appveyor.com/project/npm/bin-links) [![Coverage Status](https://coveralls.io/repos/github/npm/bin-links/badge.svg?branch=latest)](https://coveralls.io/github/npm/bin-links?branch=latest) - -[`bin-links`](https://github.com/npm/bin-links) is a standalone library that links -binaries and man pages for Javascript packages - -## Install - -`$ npm install bin-links` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * [`binLinks`](#binLinks) - * [`binLinks.getPaths()`](#getPaths) - -### Example - -```javascript -const binLinks = require('bin-links') -const readPackageJson = require('read-package-json-fast') -binLinks({ - path: '/path/to/node_modules/some-package', - pkg: readPackageJson('/path/to/node_modules/some-package/package.json'), - - // true if it's a global install, false for local. default: false - global: true, - - // true if it's the top level package being installed, false otherwise - top: true, - - // true if you'd like to recklessly overwrite files. - force: true, -}) -``` - -### Features - -* Links bin files listed under the `bin` property of pkg to the - `node_modules/.bin` directory of the installing environment. (Or - `${prefix}/bin` for top level global packages on unix, and `${prefix}` - for top level global packages on Windows.) -* Links man files listed under the `man` property of pkg to the share/man - directory. (This is only done for top-level global packages on Unix - systems.) - -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -### API - -#### <a name="binLinks"></a> `> binLinks({path, pkg, force, global, top})` - -Returns a Promise that resolves when the requisite things have been linked. - -#### <a name="getPaths"></a> `> binLinks.getPaths({path, pkg, global, top })` - -Returns an array of all the paths of links and shims that _might_ be -created (assuming that they exist!) for the package at the specified path. - -Does not touch the filesystem. - -##### Example - -```javascript -binLinks({path, pkg, force, global, top}).then(() => console.log('bins linked!')) -``` diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/index.js b/node_modules/@npmcli/arborist/node_modules/bin-links/index.js deleted file mode 100644 index 51cc410af..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/index.js +++ /dev/null @@ -1,30 +0,0 @@ -const linkBins = require('./lib/link-bins.js') -const linkMans = require('./lib/link-mans.js') - -const binLinks = opts => { - const { path, pkg, force, global, top } = opts - // global top pkgs on windows get bins installed in {prefix}, and no mans - // - // unix global top pkgs get their bins installed in {prefix}/bin, - // and mans in {prefix}/share/man - // - // non-top pkgs get their bins installed in {prefix}/node_modules/.bin, - // and do not install mans - // - // non-global top pkgs don't have any bins or mans linked. From here on - // out, if it's top, we know that it's global, so no need to pass that - // option further down the stack. - if (top && !global) - return Promise.resolve() - - return Promise.all([ - // allow clobbering within the local node_modules/.bin folder. - // only global bins are protected in this way, or else it is - // yet another vector for excessive dependency conflicts. - linkBins({path, pkg, top, force: force || !top}), - linkMans({path, pkg, top, force}), - ]) -} - -binLinks.getPaths = require('./lib/get-paths.js') -module.exports = binLinks diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/bin-target.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/bin-target.js deleted file mode 100644 index 7ea0c2a96..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/bin-target.js +++ /dev/null @@ -1,9 +0,0 @@ -const isWindows = require('./is-windows.js') -const getPrefix = require('./get-prefix.js') -const getNodeModules = require('./get-node-modules.js') -const {dirname} = require('path') - -module.exports = ({top, path}) => - !top ? getNodeModules(path) + '/.bin' - : isWindows ? getPrefix(path) - : dirname(getPrefix(path)) + '/bin' diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/fix-bin.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/fix-bin.js deleted file mode 100644 index 0f4d5fa02..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/fix-bin.js +++ /dev/null @@ -1,44 +0,0 @@ -// make sure that bins are executable, and that they don't have -// windows line-endings on the hashbang line. -const fs = require('fs') -const { promisify } = require('util') - -const execMode = 0o777 & (~process.umask()) - -const writeFileAtomic = promisify(require('write-file-atomic')) -const open = promisify(fs.open) -const close = promisify(fs.close) -const read = promisify(fs.read) -const chmod = promisify(fs.chmod) -const readFile = promisify(fs.readFile) - -const isWindowsHashBang = buf => - buf[0] === '#'.charCodeAt(0) && - buf[1] === '!'.charCodeAt(0) && - /^#![^\n]+\r\n/.test(buf.toString()) - -const isWindowsHashbangFile = file => { - const FALSE = () => false - return open(file, 'r').then(fd => { - const buf = Buffer.alloc(2048) - return read(fd, buf, 0, 2048, 0) - .then( - () => { - const isWHB = isWindowsHashBang(buf) - return close(fd).then(() => isWHB, () => isWHB) - }, - // don't leak FD if read() fails - () => close(fd).then(FALSE, FALSE) - ) - }, FALSE) -} - -const dos2Unix = file => - readFile(file, 'utf8').then(content => - writeFileAtomic(file, content.replace(/^(#![^\n]+)\r\n/, '$1\n'))) - -const fixBin = file => chmod(file, execMode) - .then(() => isWindowsHashbangFile(file)) - .then(isWHB => isWHB ? dos2Unix(file) : null) - -module.exports = fixBin diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-node-modules.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-node-modules.js deleted file mode 100644 index b67c198ef..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-node-modules.js +++ /dev/null @@ -1,18 +0,0 @@ -// we know it's global and/or not top, so the path has to be -// {prefix}/node_modules/{name}. Can't rely on pkg.name, because -// it might be installed as an alias. - -const {dirname, basename} = require('path') -// this gets called a lot and can't change, so memoize it -const memo = new Map() -module.exports = path => { - if (memo.has(path)) - return memo.get(path) - - const scopeOrNm = dirname(path) - const nm = basename(scopeOrNm) === 'node_modules' ? scopeOrNm - : dirname(scopeOrNm) - - memo.set(path, nm) - return nm -} diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-paths.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-paths.js deleted file mode 100644 index 614c85652..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-paths.js +++ /dev/null @@ -1,48 +0,0 @@ -// get all the paths that are (or might be) installed for a given pkg -// There's no guarantee that all of these will be installed, but if they -// are present, then we can assume that they're associated. -const binTarget = require('./bin-target.js') -const manTarget = require('./man-target.js') -const {resolve, basename} = require('path') -const isWindows = require('./is-windows.js') -module.exports = ({path, pkg, global, top}) => { - if (top && !global) - return [] - - const binSet = [] - const binTarg = binTarget({path, top}) - if (pkg.bin) { - for (const bin of Object.keys(pkg.bin)) { - const b = resolve(binTarg, bin) - binSet.push(b) - if (isWindows) { - binSet.push(b + '.cmd') - binSet.push(b + '.ps1') - } - } - } - - const manTarg = manTarget({path, top}) - const manSet = [] - if (manTarg && pkg.man && Array.isArray(pkg.man) && pkg.man.length) { - for (const man of pkg.man) { - const parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - // invalid entries invalidate the entire man set - if (!parseMan) - return binSet - - const stem = parseMan[1] - const sxn = parseMan[2] - const base = basename(stem) - const absFrom = resolve(path, man) - - /* istanbul ignore if - should be impossible */ - if (absFrom.indexOf(path) !== 0) - return binSet - - manSet.push(resolve(manTarg, 'man' + sxn, base)) - } - } - - return manSet.length ? [...binSet, ...manSet] : binSet -} diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-prefix.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-prefix.js deleted file mode 100644 index 96112bf0a..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/get-prefix.js +++ /dev/null @@ -1,3 +0,0 @@ -const {dirname} = require('path') -const getNodeModules = require('./get-node-modules.js') -module.exports = path => dirname(getNodeModules(path)) diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/is-windows.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/is-windows.js deleted file mode 100644 index da3b2fb22..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/is-windows.js +++ /dev/null @@ -1,2 +0,0 @@ -const platform = process.env.__TESTING_BIN_LINKS_PLATFORM__ || process.platform -module.exports = platform === 'win32' diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bin.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bin.js deleted file mode 100644 index 4c0bde489..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bin.js +++ /dev/null @@ -1,9 +0,0 @@ -const linkGently = require('./link-gently.js') -const fixBin = require('./fix-bin.js') - -// linking bins is simple. just symlink, and if we linked it, fix the bin up -const linkBin = ({path, to, from, absFrom, force}) => - linkGently({path, to, from, absFrom, force}) - .then(linked => linked && fixBin(absFrom)) - -module.exports = linkBin diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bins.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bins.js deleted file mode 100644 index 6a1086b92..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-bins.js +++ /dev/null @@ -1,22 +0,0 @@ -const isWindows = require('./is-windows.js') -const binTarget = require('./bin-target.js') -const { dirname, resolve, relative } = require('path') -const linkBin = isWindows ? require('./shim-bin.js') : require('./link-bin.js') -const normalize = require('npm-normalize-package-bin') - -const linkBins = ({path, pkg, top, force}) => { - pkg = normalize(pkg) - if (!pkg.bin) - return Promise.resolve([]) - const promises = [] - const target = binTarget({path, top}) - for (const [key, val] of Object.entries(pkg.bin)) { - const to = resolve(target, key) - const absFrom = resolve(path, val) - const from = relative(dirname(to), absFrom) - promises.push(linkBin({path, from, to, absFrom, force})) - } - return Promise.all(promises) -} - -module.exports = linkBins diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-gently.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-gently.js deleted file mode 100644 index 75b157618..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-gently.js +++ /dev/null @@ -1,57 +0,0 @@ -// if the thing isn't there, skip it -// if there's a non-symlink there already, eexist -// if there's a symlink already, pointing somewhere else, eexist -// if there's a symlink already, pointing into our pkg, remove it first -// then create the symlink - -const { promisify } = require('util') -const { resolve, dirname } = require('path') -const mkdirp = require('mkdirp-infer-owner') -const fs = require('fs') -const symlink = promisify(fs.symlink) -const readlink = promisify(fs.readlink) -const lstat = promisify(fs.lstat) -const throwNonEnoent = er => { if (er.code !== 'ENOENT') throw er } - -// disable glob in our rimraf calls -const rimraf = promisify(require('rimraf')) -const rm = path => rimraf(path, { glob: false }) - -const SKIP = Symbol('skip - missing or already installed') - -const linkGently = ({path, to, from, absFrom, force}) => { - // if the script or manpage isn't there, just ignore it. - // this arguably *should* be an install error of some sort, - // or at least a warning, but npm has always behaved this - // way in the past, so it'd be a breaking change - return Promise.all([ - lstat(absFrom).catch(throwNonEnoent), - lstat(to).catch(throwNonEnoent), - ]).then(([stFrom, stTo]) => { - // not present in package, skip it - if (!stFrom) - return SKIP - - // exists! maybe clobber if we can - if (stTo) { - if (!stTo.isSymbolicLink()) - return force ? rm(to) : Promise.resolve() - - return readlink(to).then(target => { - if (target === from) - return SKIP // skip it, already set up like we want it. - - target = resolve(dirname(to), target) - if (target.indexOf(path) === 0 || force) - return rm(to) - }) - } else { - // doesn't exist, dir might not either - return mkdirp(dirname(to)) - } - }) - // this will fail if we didn't remove it - .then(skip => skip !== SKIP && symlink(from, to, 'file').then(() => true)) -} - -module.exports = linkGently diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-mans.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-mans.js deleted file mode 100644 index 6fb167e48..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/link-mans.js +++ /dev/null @@ -1,51 +0,0 @@ -const { dirname, relative, join, resolve, basename } = require('path') -const linkGently = require('./link-gently.js') -const manTarget = require('./man-target.js') - -const linkMans = ({path, pkg, top, force}) => { - const target = manTarget({path, top}) - if (!target || !pkg.man || !Array.isArray(pkg.man) || !pkg.man.length) - return Promise.resolve([]) - - // break any links to c:\\blah or /foo/blah or ../blah - // and filter out duplicates - const set = [...new Set(pkg.man.map(man => - man ? join('/', man).replace(/\\|:/g, '/').substr(1) : null) - .filter(man => typeof man === 'string'))] - - return Promise.all(set.map(man => { - const parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - if (!parseMan) { - return Promise.reject(Object.assign(new Error('invalid man entry name\n' + - 'Man files must end with a number, ' + - 'and optionally a .gz suffix if they are compressed.' - ), { - code: 'EBADMAN', - path, - pkgid: pkg._id, - man, - })) - } - - const stem = parseMan[1] - const sxn = parseMan[2] - const base = basename(stem) - const absFrom = resolve(path, man) - /* istanbul ignore if - that unpossible */ - if (absFrom.indexOf(path) !== 0) { - return Promise.reject(Object.assign(new Error('invalid man entry'), { - code: 'EBADMAN', - path, - pkgid: pkg._id, - man, - })) - } - - const to = resolve(target, 'man' + sxn, base) - const from = relative(dirname(to), absFrom) - - return linkGently({from, to, path, absFrom, force}) - })) -} - -module.exports = linkMans diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/man-target.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/man-target.js deleted file mode 100644 index 832d2ea35..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/man-target.js +++ /dev/null @@ -1,6 +0,0 @@ -const isWindows = require('./is-windows.js') -const getPrefix = require('./get-prefix.js') -const {dirname} = require('path') - -module.exports = ({top, path}) => !top || isWindows ? null - : dirname(getPrefix(path)) + '/share/man' diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/shim-bin.js b/node_modules/@npmcli/arborist/node_modules/bin-links/lib/shim-bin.js deleted file mode 100644 index ff7c99a90..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/lib/shim-bin.js +++ /dev/null @@ -1,64 +0,0 @@ -const { promisify } = require('util') -const { resolve, dirname } = require('path') -const fs = require('fs') -const lstat = promisify(fs.lstat) -const throwNonEnoent = er => { if (er.code !== 'ENOENT') throw er } - -const cmdShim = require('cmd-shim') -const readCmdShim = require('read-cmd-shim') - -const fixBin = require('./fix-bin.js') - -const failEEXIST = ({path, to, from}) => - Promise.reject(Object.assign(new Error('EEXIST: file already exists'), { - path: to, - dest: from, - code: 'EEXIST', - })) - -const handleReadCmdShimError = ({er, from, to}) => - er.code === 'ENOENT' ? null - : er.code === 'ENOTASHIM' ? failEEXIST({from, to}) - : Promise.reject(er) - -const SKIP = Symbol('skip - missing or already installed') -const shimBin = ({path, to, from, absFrom, force}) => { - const shims = [ - to, - to + '.cmd', - to + '.ps1', - ] - return Promise.all([ - ...shims, - absFrom, - ].map(f => lstat(f).catch(throwNonEnoent))).then((stats) => { - const [ - stToBase, - stToCmd, - stToPs1, - stFrom, - ] = stats - if (!stFrom) - return SKIP - - if (force) - return - - return Promise.all(shims.map((s, i) => [s, stats[i]]).map(([s, st]) => { - if (!st) - return - return readCmdShim(s) - .then(target => { - target = resolve(dirname(to), target) - if (target.indexOf(resolve(path)) !== 0) - return failEEXIST({from, to, path}) - }, er => handleReadCmdShimError({er, from, to})) - })) - }) - .then(skip => skip !== SKIP && doShim(absFrom, to)) -} - -const doShim = (absFrom, to) => - cmdShim(absFrom, to).then(() => fixBin(absFrom)) - -module.exports = shimBin diff --git a/node_modules/@npmcli/arborist/node_modules/bin-links/package.json b/node_modules/@npmcli/arborist/node_modules/bin-links/package.json deleted file mode 100644 index 012269f13..000000000 --- a/node_modules/@npmcli/arborist/node_modules/bin-links/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "bin-links@^2.1.2", - "_id": "bin-links@2.1.2", - "_inBundle": false, - "_integrity": "sha512-mtspzc/umzMiZkIRIVm93WgyT7fFVXX302qswWwlHErBVM8BgAVvB0EVOdzmtrNzs1zIKEE0dE4RR5PwtBfy7g==", - "_location": "/@npmcli/arborist/bin-links", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "bin-links@^2.1.2", - "name": "bin-links", - "escapedName": "bin-links", - "rawSpec": "^2.1.2", - "saveSpec": null, - "fetchSpec": "^2.1.2" - }, - "_requiredBy": [ - "/@npmcli/arborist" - ], - "_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-2.1.2.tgz", - "_shasum": "110f82e5563caf66c4483c1eb5d84043ef571660", - "_spec": "bin-links@^2.1.2", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist", - "bugs": { - "url": "https://github.com/npm/bin-links/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cmd-shim": "^4.0.1", - "mkdirp": "^1.0.3", - "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", - "rimraf": "^3.0.0", - "write-file-atomic": "^2.3.0" - }, - "deprecated": false, - "description": "JavaScript package binary linker", - "devDependencies": { - "require-inject": "^1.4.4", - "tap": "^14.10.6" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js", - "lib/*.js" - ], - "homepage": "https://github.com/npm/bin-links#readme", - "keywords": [ - "npm", - "link", - "bins" - ], - "license": "ISC", - "main": "index.js", - "name": "bin-links", - "repository": { - "type": "git", - "url": "git://github.com/npm/bin-links.git" - }, - "scripts": { - "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", - "preversion": "npm t", - "snap": "tap", - "test": "tap" - }, - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, - "version": "2.1.2" -} diff --git a/node_modules/@npmcli/arborist/node_modules/cmd-shim/LICENSE b/node_modules/@npmcli/arborist/node_modules/cmd-shim/LICENSE deleted file mode 100644 index 20a476254..000000000 --- a/node_modules/@npmcli/arborist/node_modules/cmd-shim/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) npm, Inc. and Contributors - -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/@npmcli/arborist/node_modules/cmd-shim/README.md b/node_modules/@npmcli/arborist/node_modules/cmd-shim/README.md deleted file mode 100644 index 60e6625f3..000000000 --- a/node_modules/@npmcli/arborist/node_modules/cmd-shim/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# cmd-shim - -The cmd-shim used in npm to create executable scripts on Windows, -since symlinks are not suitable for this purpose there. - -On Unix systems, you should use a symbolic link instead. - -[![Build Status](https://img.shields.io/travis/npm/cmd-shim/master.svg)](https://travis-ci.org/npm/cmd-shim) -[![Dependency Status](https://img.shields.io/david/npm/cmd-shim.svg)](https://david-dm.org/npm/cmd-shim) -[![npm version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim) - -## Installation - -``` -npm install cmd-shim -``` - -## API - -### cmdShim(from, to) -> Promise - -Create a cmd shim at `to` for the command line program at `from`. -e.g. - -```javascript -var cmdShim = require('cmd-shim'); -cmdShim(__dirname + '/cli.js', '/usr/bin/command-name').then(() => { - // shims are created! -}) -``` - -### cmdShim.ifExists(from, to) -> Promise - -The same as above, but will just continue if the file does not exist. diff --git a/node_modules/@npmcli/arborist/node_modules/cmd-shim/index.js b/node_modules/@npmcli/arborist/node_modules/cmd-shim/index.js deleted file mode 100644 index 8b2e6d295..000000000 --- a/node_modules/@npmcli/arborist/node_modules/cmd-shim/index.js +++ /dev/null @@ -1,233 +0,0 @@ -// On windows, create a .cmd file. -// Read the #! in the file to see what it uses. The vast majority -// of the time, this will be either: -// "#!/usr/bin/env <prog> <args...>" -// or: -// "#!<prog> <args...>" -// -// Write a binroot/pkg.bin + ".cmd" file that has this line in it: -// @<prog> <args...> %dp0%<target> %* - -const {promisify} = require('util') -const fs = require('fs') -const writeFile = promisify(fs.writeFile) -const readFile = promisify(fs.readFile) -const chmod = promisify(fs.chmod) -const stat = promisify(fs.stat) -const unlink = promisify(fs.unlink) - -const {dirname, relative} = require('path') -const mkdir = require('mkdirp-infer-owner') -const toBatchSyntax = require('./lib/to-batch-syntax') -const shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+=[^ \t]+\s+)*\s*([^ \t]+)(.*)$/ - -const cmdShimIfExists = (from, to) => - stat(from).then(() => cmdShim(from, to), () => {}) - -// Try to unlink, but ignore errors. -// Any problems will surface later. -const rm = path => unlink(path).catch(() => {}) - -const cmdShim = (from, to) => - stat(from).then(() => cmdShim_(from, to)) - -const cmdShim_ = (from, to) => Promise.all([ - rm(to), - rm(to + '.cmd'), - rm(to + '.ps1'), -]).then(() => writeShim(from, to)) - -const writeShim = (from, to) => - // make a cmd file and a sh script - // First, check if the bin is a #! of some sort. - // If not, then assume it's something that'll be compiled, or some other - // sort of script, and just call it directly. - mkdir(dirname(to)) - .then(() => readFile(from, 'utf8')) - .then(data => { - const firstLine = data.trim().split(/\r*\n/)[0] - const shebang = firstLine.match(shebangExpr) - if (!shebang) return writeShim_(from, to) - const vars = shebang[1] || '' - const prog = shebang[2] - const args = shebang[3] || '' - return writeShim_(from, to, prog, args, vars) - }, er => writeShim_(from, to)) - - -const writeShim_ = (from, to, prog, args, variables) => { - let shTarget = relative(dirname(to), from) - let target = shTarget.split('/').join('\\') - let longProg - let shProg = prog && prog.split('\\').join('/') - let shLongProg - let pwshProg = shProg && `"${shProg}$exe"` - let pwshLongProg - shTarget = shTarget.split('\\').join('/') - args = args || '' - variables = variables || '' - if (!prog) { - prog = `"%dp0%\\${target}"` - shProg = `"$basedir/${shTarget}"` - pwshProg = shProg - args = '' - target = '' - shTarget = '' - } else { - longProg = `"%dp0%\\${prog}.exe"` - shLongProg = `"$basedir/${prog}"` - pwshLongProg = `"$basedir/${prog}$exe"` - target = `"%dp0%\\${target}"` - shTarget = `"$basedir/${shTarget}"` - } - - // @SETLOCAL - // @CALL :find_dp0 - // - // @IF EXIST "%dp0%\node.exe" ( - // @SET "_prog=%dp0%\node.exe" - // ) ELSE ( - // @SET "_prog=node" - // @SET PATHEXT=%PATHEXT:;.JS;=;% - // ) - // - // "%_prog%" "%dp0%\.\node_modules\npm\bin\npm-cli.js" %* - // @ENDLOCAL - // @EXIT /b %errorlevel% - // - // :find_dp0 - // SET dp0=%~dp0 - // EXIT /b - // - // Subroutine trick to fix https://github.com/npm/cmd-shim/issues/10 - const head = '@ECHO off\r\n' + - 'SETLOCAL\r\n' + - 'CALL :find_dp0\r\n' - const foot = 'ENDLOCAL\r\n' + - 'EXIT /b %errorlevel%\r\n' + - ':find_dp0\r\n' + - 'SET dp0=%~dp0\r\n' + - 'EXIT /b\r\n' - - let cmd - if (longProg) { - shLongProg = shLongProg.trim(); - args = args.trim(); - const variablesBatch = toBatchSyntax.convertToSetCommands(variables) - cmd = head - + variablesBatch - + '\r\n' - + `IF EXIST ${longProg} (\r\n` - + ` SET "_prog=${longProg.replace(/(^")|("$)/g, '')}"\r\n` - + ') ELSE (\r\n' - + ` SET "_prog=${prog.replace(/(^")|("$)/g, '')}"\r\n` - + ' SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' - + ')\r\n' - + '\r\n' - + `"%_prog%" ${args} ${target} %*\r\n` - + foot - } else { - cmd = `${head}${prog} ${args} ${target} %*\r\n${foot}` - } - - // #!/bin/sh - // basedir=`dirname "$0"` - // - // case `uname` in - // *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; - // esac - // - // if [ -x "$basedir/node.exe" ]; then - // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // else - // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" - // ret=$? - // fi - // exit $ret - - let sh = "#!/bin/sh\n" - - sh = sh - + `basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")\n` - + '\n' - + 'case `uname` in\n' - + ' *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;\n' - + 'esac\n' - + '\n' - - if (shLongProg) { - sh = sh - + `if [ -x ${shLongProg} ]; then\n` - + ` ${variables}${shLongProg} ${args} ${shTarget} "$@"\n` - + ' ret=$?\n' - + 'else \n' - + ` ${variables}${shProg} ${args} ${shTarget} "$@"\n` - + ' ret=$?\n' - + 'fi\n' - + 'exit $ret\n' - } else { - sh = sh - + `${shProg} ${args} ${shTarget} "$@"\n` - + 'exit $?\n' - } - - // #!/usr/bin/env pwsh - // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - // - // $ret=0 - // $exe = "" - // if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - // # Fix case when both the Windows and Linux builds of Node - // # are installed in the same directory - // $exe = ".exe" - // } - // if (Test-Path "$basedir/node") { - // & "$basedir/node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args - // $ret=$LASTEXITCODE - // } else { - // & "node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args - // $ret=$LASTEXITCODE - // } - // exit $ret - let pwsh = '#!/usr/bin/env pwsh\n' - + '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' - + '\n' - + '$exe=""\n' - + 'if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n' - + ' # Fix case when both the Windows and Linux builds of Node\n' - + ' # are installed in the same directory\n' - + ' $exe=".exe"\n' - + '}\n' - if (shLongProg) { - pwsh = pwsh - + '$ret=0\n' - + `if (Test-Path ${pwshLongProg}) {\n` - + ` & ${pwshLongProg} ${args} ${shTarget} $args\n` - + ' $ret=$LASTEXITCODE\n' - + '} else {\n' - + ` & ${pwshProg} ${args} ${shTarget} $args\n` - + ' $ret=$LASTEXITCODE\n' - + '}\n' - + 'exit $ret\n' - } else { - pwsh = pwsh - + `& ${pwshProg} ${args} ${shTarget} $args\n` - + 'exit $LASTEXITCODE\n' - } - - return Promise.all([ - writeFile(to + '.ps1', pwsh, 'utf8'), - writeFile(to + '.cmd', cmd, 'utf8'), - writeFile(to, sh, 'utf8'), - ]).then(() => chmodShim(to)) -} - -const chmodShim = to => Promise.all([ - chmod(to, 0o755), - chmod(to + '.cmd', 0o755), - chmod(to + '.ps1', 0o755), -]) - -module.exports = cmdShim -cmdShim.ifExists = cmdShimIfExists diff --git a/node_modules/@npmcli/arborist/node_modules/cmd-shim/lib/to-batch-syntax.js b/node_modules/@npmcli/arborist/node_modules/cmd-shim/lib/to-batch-syntax.js deleted file mode 100644 index f3f5ffa63..000000000 --- a/node_modules/@npmcli/arborist/node_modules/cmd-shim/lib/to-batch-syntax.js +++ /dev/null @@ -1,51 +0,0 @@ -exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
-exports.convertToSetCommand = convertToSetCommand
-exports.convertToSetCommands = convertToSetCommands
-
-function convertToSetCommand(key, value) {
- var line = ""
- key = key || ""
- key = key.trim()
- value = value || ""
- value = value.trim()
- if(key && value && value.length > 0) {
- line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
- }
- return line
-}
-
-function extractVariableValuePairs(declarations) {
- var pairs = {}
- declarations.map(function(declaration) {
- var split = declaration.split("=")
- pairs[split[0]]=split[1]
- })
- return pairs
-}
-
-function convertToSetCommands(variableString) {
- var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
- var variableDeclarationsAsBatch = ""
- Object.keys(variableValuePairs).forEach(function (key) {
- variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
- })
- return variableDeclarationsAsBatch
-}
-
-function replaceDollarWithPercentPair(value) {
- var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
- var result = ""
- var startIndex = 0
- do {
- var match = dollarExpressions.exec(value)
- if(match) {
- var betweenMatches = value.substring(startIndex, match.index) || ""
- result += betweenMatches + "%" + match[1] + "%"
- startIndex = dollarExpressions.lastIndex
- }
- } while (dollarExpressions.lastIndex > 0)
- result += value.substr(startIndex)
- return result
-}
-
-
diff --git a/node_modules/@npmcli/arborist/node_modules/cmd-shim/package.json b/node_modules/@npmcli/arborist/node_modules/cmd-shim/package.json deleted file mode 100644 index 6dd9b4b7e..000000000 --- a/node_modules/@npmcli/arborist/node_modules/cmd-shim/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "cmd-shim@^4.0.1", - "_id": "cmd-shim@4.0.2", - "_inBundle": false, - "_integrity": "sha512-yuOHOon6oFX6kcxVl2jIkvPJsQ/yiKp9fd2dnuoBRZB9GEJ3USWAFCIqfB4xmFou93C3MjjhAprcDwrw+O29VA==", - "_location": "/@npmcli/arborist/cmd-shim", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cmd-shim@^4.0.1", - "name": "cmd-shim", - "escapedName": "cmd-shim", - "rawSpec": "^4.0.1", - "saveSpec": null, - "fetchSpec": "^4.0.1" - }, - "_requiredBy": [ - "/@npmcli/arborist/bin-links" - ], - "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.0.2.tgz", - "_shasum": "600c8b5962eea0cfd8cb809826b9584a59380c01", - "_spec": "cmd-shim@^4.0.1", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/@npmcli/arborist/node_modules/bin-links", - "bugs": { - "url": "https://github.com/npm/cmd-shim/issues" - }, - "bundleDependencies": false, - "dependencies": { - "graceful-fs": "^4.1.2", - "mkdirp-infer-owner": "^2.0.0" - }, - "deprecated": false, - "description": "Used in npm for command line application support", - "devDependencies": { - "rimraf": "~2.2.8", - "tap": "^14.10.6" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/npm/cmd-shim#readme", - "license": "ISC", - "name": "cmd-shim", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/cmd-shim.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "tap", - "test": "tap" - }, - "tap": { - "before": "test/00-setup.js", - "after": "test/zz-cleanup.js", - "check-coverage": true - }, - "version": "4.0.2" -} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/CHANGELOG.md b/node_modules/@npmcli/arborist/node_modules/mkdirp/CHANGELOG.md deleted file mode 100644 index 81458380b..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changers Lorgs! - -## 1.0 - -Full rewrite. Essentially a brand new module. - -- Return a promise instead of taking a callback. -- Use native `fs.mkdir(path, { recursive: true })` when available. -- Drop support for outdated Node.js versions. (Technically still works on - Node.js v8, but only 10 and above are officially supported.) - -## 0.x - -Original and most widely used recursive directory creation implementation -in JavaScript, dating back to 2010. diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/LICENSE b/node_modules/@npmcli/arborist/node_modules/mkdirp/LICENSE deleted file mode 100644 index 13fcd15f0..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) - -This project is free software released under the MIT license: - -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/@npmcli/arborist/node_modules/mkdirp/bin/cmd.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/bin/cmd.js deleted file mode 100755 index 6e0aa8dc4..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/bin/cmd.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const usage = () => ` -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories - that don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m<mode> If a directory needs to be created, set the mode as an octal - --mode=<mode> permission string. - - -v --version Print the mkdirp version number - - -h --help Print this helpful banner - - -p --print Print the first directories created for each path provided - - --manual Use manual implementation, even if native is available -` - -const dirs = [] -const opts = {} -let print = false -let dashdash = false -let manual = false -for (const arg of process.argv.slice(2)) { - if (dashdash) - dirs.push(arg) - else if (arg === '--') - dashdash = true - else if (arg === '--manual') - manual = true - else if (/^-h/.test(arg) || /^--help/.test(arg)) { - console.log(usage()) - process.exit(0) - } else if (arg === '-v' || arg === '--version') { - console.log(require('../package.json').version) - process.exit(0) - } else if (arg === '-p' || arg === '--print') { - print = true - } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) { - const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8) - if (isNaN(mode)) { - console.error(`invalid mode argument: ${arg}\nMust be an octal number.`) - process.exit(1) - } - opts.mode = mode - } else - dirs.push(arg) -} - -const mkdirp = require('../') -const impl = manual ? mkdirp.manual : mkdirp -if (dirs.length === 0) - console.error(usage()) - -Promise.all(dirs.map(dir => impl(dir, opts))) - .then(made => print ? made.forEach(m => m && console.log(m)) : null) - .catch(er => { - console.error(er.message) - if (er.code) - console.error(' code: ' + er.code) - process.exit(1) - }) diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/index.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/index.js deleted file mode 100644 index ad7a16c9f..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/index.js +++ /dev/null @@ -1,31 +0,0 @@ -const optsArg = require('./lib/opts-arg.js') -const pathArg = require('./lib/path-arg.js') - -const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js') -const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js') -const {useNative, useNativeSync} = require('./lib/use-native.js') - - -const mkdirp = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNative(opts) - ? mkdirpNative(path, opts) - : mkdirpManual(path, opts) -} - -const mkdirpSync = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNativeSync(opts) - ? mkdirpNativeSync(path, opts) - : mkdirpManualSync(path, opts) -} - -mkdirp.sync = mkdirpSync -mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) -mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) -mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) -mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) - -module.exports = mkdirp diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/find-made.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/find-made.js deleted file mode 100644 index 022e492c0..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/find-made.js +++ /dev/null @@ -1,29 +0,0 @@ -const {dirname} = require('path') - -const findMade = (opts, parent, path = undefined) => { - // we never want the 'made' return value to be a root directory - if (path === parent) - return Promise.resolve() - - return opts.statAsync(parent).then( - st => st.isDirectory() ? path : undefined, // will fail later - er => er.code === 'ENOENT' - ? findMade(opts, dirname(parent), parent) - : undefined - ) -} - -const findMadeSync = (opts, parent, path = undefined) => { - if (path === parent) - return undefined - - try { - return opts.statSync(parent).isDirectory() ? path : undefined - } catch (er) { - return er.code === 'ENOENT' - ? findMadeSync(opts, dirname(parent), parent) - : undefined - } -} - -module.exports = {findMade, findMadeSync} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-manual.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-manual.js deleted file mode 100644 index 2eb18cd64..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-manual.js +++ /dev/null @@ -1,64 +0,0 @@ -const {dirname} = require('path') - -const mkdirpManual = (path, opts, made) => { - opts.recursive = false - const parent = dirname(path) - if (parent === path) { - return opts.mkdirAsync(path, opts).catch(er => { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - }) - } - - return opts.mkdirAsync(path, opts).then(() => made || path, er => { - if (er.code === 'ENOENT') - return mkdirpManual(parent, opts) - .then(made => mkdirpManual(path, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - return opts.statAsync(path).then(st => { - if (st.isDirectory()) - return made - else - throw er - }, () => { throw er }) - }) -} - -const mkdirpManualSync = (path, opts, made) => { - const parent = dirname(path) - opts.recursive = false - - if (parent === path) { - try { - return opts.mkdirSync(path, opts) - } catch (er) { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - else - return - } - } - - try { - opts.mkdirSync(path, opts) - return made || path - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - try { - if (!opts.statSync(path).isDirectory()) - throw er - } catch (_) { - throw er - } - } -} - -module.exports = {mkdirpManual, mkdirpManualSync} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-native.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-native.js deleted file mode 100644 index c7a6b6980..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/mkdirp-native.js +++ /dev/null @@ -1,39 +0,0 @@ -const {dirname} = require('path') -const {findMade, findMadeSync} = require('./find-made.js') -const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js') - -const mkdirpNative = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirAsync(path, opts) - - return findMade(opts, path).then(made => - opts.mkdirAsync(path, opts).then(() => made) - .catch(er => { - if (er.code === 'ENOENT') - return mkdirpManual(path, opts) - else - throw er - })) -} - -const mkdirpNativeSync = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirSync(path, opts) - - const made = findMadeSync(opts, path) - try { - opts.mkdirSync(path, opts) - return made - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts) - else - throw er - } -} - -module.exports = {mkdirpNative, mkdirpNativeSync} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/opts-arg.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/opts-arg.js deleted file mode 100644 index 2fa4833fa..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/opts-arg.js +++ /dev/null @@ -1,23 +0,0 @@ -const { promisify } = require('util') -const fs = require('fs') -const optsArg = opts => { - if (!opts) - opts = { mode: 0o777, fs } - else if (typeof opts === 'object') - opts = { mode: 0o777, fs, ...opts } - else if (typeof opts === 'number') - opts = { mode: opts, fs } - else if (typeof opts === 'string') - opts = { mode: parseInt(opts, 8), fs } - else - throw new TypeError('invalid options argument') - - opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir - opts.mkdirAsync = promisify(opts.mkdir) - opts.stat = opts.stat || opts.fs.stat || fs.stat - opts.statAsync = promisify(opts.stat) - opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync - opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync - return opts -} -module.exports = optsArg diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/path-arg.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/path-arg.js deleted file mode 100644 index cc07de5a6..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/path-arg.js +++ /dev/null @@ -1,29 +0,0 @@ -const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform -const { resolve, parse } = require('path') -const pathArg = path => { - if (/\0/.test(path)) { - // simulate same failure that node raises - throw Object.assign( - new TypeError('path must be a string without null bytes'), - { - path, - code: 'ERR_INVALID_ARG_VALUE', - } - ) - } - - path = resolve(path) - if (platform === 'win32') { - const badWinChars = /[*|"<>?:]/ - const {root} = parse(path) - if (badWinChars.test(path.substr(root.length))) { - throw Object.assign(new Error('Illegal characters in path.'), { - path, - code: 'EINVAL', - }) - } - } - - return path -} -module.exports = pathArg diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/use-native.js b/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/use-native.js deleted file mode 100644 index 079361de1..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/lib/use-native.js +++ /dev/null @@ -1,10 +0,0 @@ -const fs = require('fs') - -const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version -const versArr = version.replace(/^v/, '').split('.') -const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 - -const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir -const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync - -module.exports = {useNative, useNativeSync} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/package.json b/node_modules/@npmcli/arborist/node_modules/mkdirp/package.json deleted file mode 100644 index 49be2d3e7..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "mkdirp@^1.0.3", - "_id": "mkdirp@1.0.4", - "_inBundle": false, - "_integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "_location": "/@npmcli/arborist/mkdirp", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mkdirp@^1.0.3", - "name": "mkdirp", - "escapedName": "mkdirp", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/@npmcli/arborist/bin-links" - ], - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "_shasum": "3eb5ed62622756d79a5f0e2a221dfebad75c2f7e", - "_spec": "mkdirp@^1.0.3", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist/node_modules/bin-links", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/isaacs/node-mkdirp/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Recursively mkdir, like `mkdir -p`", - "devDependencies": { - "require-inject": "^1.4.4", - "tap": "^14.10.7" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "bin", - "lib", - "index.js" - ], - "homepage": "https://github.com/isaacs/node-mkdirp#readme", - "keywords": [ - "mkdir", - "directory", - "make dir", - "make", - "dir", - "recursive", - "native" - ], - "license": "MIT", - "main": "index.js", - "name": "mkdirp", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-mkdirp.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "tap", - "test": "tap" - }, - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, - "version": "1.0.4" -} diff --git a/node_modules/@npmcli/arborist/node_modules/mkdirp/readme.markdown b/node_modules/@npmcli/arborist/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 827de5905..000000000 --- a/node_modules/@npmcli/arborist/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,266 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in Node.js! - -Now with a modern API and no\* bugs! - -<small>\* may contain some bugs</small> - -# example - -## pow.js - -```js -const mkdirp = require('mkdirp') - -// return value is a Promise resolving to the first directory created -mkdirp('/tmp/foo/bar/baz').then(made => - console.log(`made directories, starting with ${made}`)) -``` - -Output (where `/tmp/foo` already exists) - -``` -made directories, starting with /tmp/foo/bar -``` - -Or, if you don't have time to wait around for promises: - -```js -const mkdirp = require('mkdirp') - -// return value is the first directory created -const made = mkdirp.sync('/tmp/foo/bar/baz') -console.log(`made directories, starting with ${made}`) -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -const mkdirp = require('mkdirp') -``` - -## mkdirp(dir, [opts]) -> Promise<String | undefined> - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a string or number, it will be -treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0o777 & -(~process.umask())`. - -Promise resolves to first directory `made` that had to be created, or -`undefined` if everything already exists. Promise rejects if any errors -are encountered. Note that, in the case of promise rejection, some -directories _may_ have been created, as recursive directory creation is not -an atomic operation. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, opts, cb)` -and `opts.fs.stat(path, cb)`. - -You can also override just one or the other of `mkdir` and `stat` by -passing in `opts.stat` or `opts.mkdir`, or providing an `fs` option that -only overrides one of these. - -## mkdirp.sync(dir, opts) -> String|null - -Synchronously create a new directory and any necessary subdirectories at -`dir` with octal permission string `opts.mode`. If `opts` is a string or -number, it will be treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0o777 & -(~process.umask())`. - -Returns the first directory that had to be created, or undefined if -everything already exists. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` -and `opts.fs.statSync(path)`. - -You can also override just one or the other of `mkdirSync` and `statSync` -by passing in `opts.statSync` or `opts.mkdirSync`, or providing an `fs` -option that only overrides one of these. - -## mkdirp.manual, mkdirp.manualSync - -Use the manual implementation (not the native one). This is the default -when the native implementation is not available or the stat/mkdir -implementation is overridden. - -## mkdirp.native, mkdirp.nativeSync - -Use the native implementation (not the manual one). This is the default -when the native implementation is available and stat/mkdir are not -overridden. - -# implementation - -On Node.js v10.12.0 and above, use the native `fs.mkdir(p, -{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has been -overridden by an option. - -## native implementation - -- If the path is a root directory, then pass it to the underlying - implementation and return the result/error. (In this case, it'll either - succeed or fail, but we aren't actually creating any dirs.) -- Walk up the path statting each directory, to find the first path that - will be created, `made`. -- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`) -- If error, raise it to the caller. -- Return `made`. - -## manual implementation - -- Call underlying `fs.mkdir` implementation, with `recursive: false` -- If error: - - If path is a root directory, raise to the caller and do not handle it - - If ENOENT, mkdirp parent dir, store result as `made` - - stat(path) - - If error, raise original `mkdir` error - - If directory, return `made` - - Else, raise original `mkdir` error -- else - - return `undefined` if a root dir, or `made` if set, or `path` - -## windows vs unix caveat - -On Windows file systems, attempts to create a root directory (ie, a drive -letter or root UNC path) will fail. If the root directory exists, then it -will fail with `EPERM`. If the root directory does not exist, then it will -fail with `ENOENT`. - -On posix file systems, attempts to create a root directory (in recursive -mode) will succeed silently, as it is treated like just another directory -that already exists. (In non-recursive mode, of course, it fails with -`EEXIST`.) - -In order to preserve this system-specific behavior (and because it's not as -if we can create the parent of a root directory anyway), attempts to create -a root directory are passed directly to the `fs` implementation, and any -errors encountered are not handled. - -## native error caveat - -The native implementation (as of at least Node.js v13.4.0) does not provide -appropriate errors in some cases (see -[nodejs/node#31481](https://github.com/nodejs/node/issues/31481) and -[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)). - -In order to work around this issue, the native implementation will fall -back to the manual implementation if an `ENOENT` error is encountered. - -# choosing a recursive mkdir implementation - -There are a few to choose from! Use the one that suits your needs best :D - -## use `fs.mkdir(path, {recursive: true}, cb)` if: - -- You wish to optimize performance even at the expense of other factors. -- You don't need to know the first dir created. -- You are ok with getting `ENOENT` as the error when some other problem is - the actual cause. -- You can limit your platforms to Node.js v10.12 and above. -- You're ok with using callbacks instead of promises. -- You don't need/want a CLI. -- You don't need to override the `fs` methods in use. - -## use this module (mkdirp 1.x) if: - -- You need to know the first directory that was created. -- You wish to use the native implementation if available, but fall back - when it's not. -- You prefer promise-returning APIs to callback-taking APIs. -- You want more useful error messages than the native recursive mkdir - provides (at least as of Node.js v13.4), and are ok with re-trying on - `ENOENT` to achieve this. -- You need (or at least, are ok with) a CLI. -- You need to override the `fs` methods in use. - -## use [`make-dir`](http://npm.im/make-dir) if: - -- You do not need to know the first dir created (and wish to save a few - `stat` calls when using the native implementation for this reason). -- You wish to use the native implementation if available, but fall back - when it's not. -- You prefer promise-returning APIs to callback-taking APIs. -- You are ok with occasionally getting `ENOENT` errors for failures that - are actually related to something other than a missing file system entry. -- You don't need/want a CLI. -- You need to override the `fs` methods in use. - -## use mkdirp 0.x if: - -- You need to know the first directory that was created. -- You need (or at least, are ok with) a CLI. -- You need to override the `fs` methods in use. -- You're ok with using callbacks instead of promises. -- You are not running on Windows, where the root-level ENOENT errors can - lead to infinite regress. -- You think vinyl just sounds warmer and richer for some weird reason. -- You are supporting truly ancient Node.js versions, before even the advent - of a `Promise` language primitive. (Please don't. You deserve better.) - -# cli - -This package also ships with a `mkdirp` command. - -``` -$ mkdirp -h - -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories - that don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m<mode> If a directory needs to be created, set the mode as an octal - --mode=<mode> permission string. - - -v --version Print the mkdirp version number - - -h --help Print this helpful banner - - -p --print Print the first directories created for each path provided - - --manual Use manual implementation, even if native is available -``` - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -to get the library locally, or - -``` -npm install -g mkdirp -``` - -to get the command everywhere, or - -``` -npx mkdirp ... -``` - -to run the command without installing it globally. - -# platform support - -This module works on node v8, but only v10 and above are officially -supported, as Node v8 reached its LTS end of life 2020-01-01, which is in -the past, as of this writing. - -# license - -MIT diff --git a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/LICENSE b/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/LICENSE deleted file mode 100644 index f4be44d88..000000000 --- a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2015, Rebecca Turner <me@re-becca.org> - -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/@npmcli/arborist/node_modules/read-cmd-shim/README.md b/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/README.md deleted file mode 100644 index 457e36e35..000000000 --- a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# read-cmd-shim - -Figure out what a [`cmd-shim`](https://github.com/ForbesLindesay/cmd-shim) -is pointing at. This acts as the equivalent of -[`fs.readlink`](https://nodejs.org/api/fs.html#fs_fs_readlink_path_callback). - -### Usage - -``` -const readCmdShim = require('read-cmd-shim') - -readCmdShim('/path/to/shim.cmd').then(destination => { - … -}) - -const destination = readCmdShim.sync('/path/to/shim.cmd') -``` - -### readCmdShim(path) -> Promise - -Reads the `cmd-shim` located at `path` and resolves with the _relative_ -path that the shim points at. Consider this as roughly the equivalent of -`fs.readlink`. - -This can read both `.cmd` style that are run by the Windows Command Prompt -and Powershell, and the kind without any extension that are used by Cygwin. - -This can return errors that `fs.readFile` returns, except that they'll -include a stack trace from where `readCmdShim` was called. Plus it can -return a special `ENOTASHIM` exception, when it can't find a cmd-shim in the -file referenced by `path`. This should only happen if you pass in a -non-command shim. - -### readCmdShim.sync(path) - -Same as above but synchronous. Errors are thrown. diff --git a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/index.js b/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/index.js deleted file mode 100644 index 4ac050fc3..000000000 --- a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/index.js +++ /dev/null @@ -1,69 +0,0 @@ -const fs = require('fs') -const {promisify} = require('util') -const {readFileSync} = fs -const readFile = promisify(fs.readFile) - -const extractPath = (path, cmdshimContents) => { - if (/[.]cmd$/.test(path)) { - return extractPathFromCmd(cmdshimContents) - } else if (/[.]ps1$/.test(path)) { - return extractPathFromPowershell(cmdshimContents) - } else { - return extractPathFromCygwin(cmdshimContents) - } -} - -const extractPathFromPowershell = cmdshimContents => { - const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+[$]args/) - return matches && matches[1] -} - -const extractPathFromCmd = cmdshimContents => { - const matches = cmdshimContents.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/) - return matches && matches[1] -} - -const extractPathFromCygwin = cmdshimContents => { - const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/) - return matches && matches[1] -} - -const wrapError = (thrown, newError) => { - newError.message = thrown.message - newError.code = thrown.code - newError.path = thrown.path - return newError -} - -const notaShim = (path, er) => { - if (!er) { - er = new Error() - Error.captureStackTrace(er, notaShim) - } - er.code = 'ENOTASHIM' - er.message = `Can't read shim path from '${path}', ` + - `it doesn't appear to be a cmd-shim` - return er -} - -const readCmdShim = path => { - // create a new error to capture the stack trace from this point, - // instead of getting some opaque stack into node's internals - const er = new Error() - Error.captureStackTrace(er, readCmdShim) - return readFile(path).then(contents => { - const destination = extractPath(path, contents.toString()) - if (destination) return destination - return Promise.reject(notaShim(path, er)) - }, readFileEr => Promise.reject(wrapError(readFileEr, er))) -} - -const readCmdShimSync = path => { - const contents = readFileSync(path) - const destination = extractPath(path, contents.toString()) - if (!destination) throw notaShim(path) - return destination -} - -readCmdShim.sync = readCmdShimSync -module.exports = readCmdShim diff --git a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/package.json b/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/package.json deleted file mode 100644 index 5e4c57213..000000000 --- a/node_modules/@npmcli/arborist/node_modules/read-cmd-shim/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "read-cmd-shim@^2.0.0", - "_id": "read-cmd-shim@2.0.0", - "_inBundle": false, - "_integrity": "sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw==", - "_location": "/@npmcli/arborist/read-cmd-shim", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "read-cmd-shim@^2.0.0", - "name": "read-cmd-shim", - "escapedName": "read-cmd-shim", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/@npmcli/arborist/bin-links" - ], - "_resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz", - "_shasum": "4a50a71d6f0965364938e9038476f7eede3928d9", - "_spec": "read-cmd-shim@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/@npmcli/arborist/node_modules/bin-links", - "bugs": { - "url": "https://github.com/npm/read-cmd-shim/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", - "devDependencies": { - "cmd-shim": "^4.0.0", - "rimraf": "^3.0.0", - "tap": "^14.10.6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/read-cmd-shim#readme", - "license": "ISC", - "main": "index.js", - "name": "read-cmd-shim", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/read-cmd-shim.git" - }, - "scripts": { - "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", - "preversion": "npm t", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "2.0.0" -} diff --git a/node_modules/@npmcli/arborist/node_modules/rimraf/CHANGELOG.md b/node_modules/@npmcli/arborist/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f1414..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/node_modules/@npmcli/arborist/node_modules/rimraf/LICENSE b/node_modules/@npmcli/arborist/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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/@npmcli/arborist/node_modules/rimraf/README.md b/node_modules/@npmcli/arborist/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf85..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf <path> [<path> ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/@npmcli/arborist/node_modules/rimraf/bin.js b/node_modules/@npmcli/arborist/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc9..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf <path> [<path> ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/node_modules/@npmcli/arborist/node_modules/rimraf/package.json b/node_modules/@npmcli/arborist/node_modules/rimraf/package.json deleted file mode 100644 index 420890958..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "rimraf@^3.0.0", - "_id": "rimraf@3.0.2", - "_inBundle": false, - "_integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "_location": "/@npmcli/arborist/rimraf", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "rimraf@^3.0.0", - "name": "rimraf", - "escapedName": "rimraf", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/@npmcli/arborist/bin-links" - ], - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "_shasum": "f1a5402ba6220ad52cc1282bac1ae3aa49fd061a", - "_spec": "rimraf@^3.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist/node_modules/bin-links", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bin": { - "rimraf": "bin.js" - }, - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "bundleDependencies": false, - "dependencies": { - "glob": "^7.1.3" - }, - "deprecated": false, - "description": "A deep deletion module for node (like `rm -rf`)", - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "homepage": "https://github.com/isaacs/rimraf#readme", - "license": "ISC", - "main": "rimraf.js", - "name": "rimraf", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js" - }, - "version": "3.0.2" -} diff --git a/node_modules/@npmcli/arborist/node_modules/rimraf/rimraf.js b/node_modules/@npmcli/arborist/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171d..000000000 --- a/node_modules/@npmcli/arborist/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/@npmcli/arborist/package.json b/node_modules/@npmcli/arborist/package.json index 342747721..42d8e54e2 100644 --- a/node_modules/@npmcli/arborist/package.json +++ b/node_modules/@npmcli/arborist/package.json @@ -1,28 +1,29 @@ { - "_from": "@npmcli/arborist@latest", + "_from": "@npmcli/arborist@0.0.1", "_id": "@npmcli/arborist@0.0.1", "_inBundle": false, "_integrity": "sha512-i/ir1MAzc4dHLMwWCoyszanE2wMMes36iYxf8BeoTFnO+NSwNrznwPD/yNcXO3JaH89h/nzvM9SMrmrOCPOYmQ==", "_location": "/@npmcli/arborist", + "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "@npmcli/arborist@latest", + "raw": "@npmcli/arborist@0.0.1", "name": "@npmcli/arborist", "escapedName": "@npmcli%2farborist", "scope": "@npmcli", - "rawSpec": "latest", + "rawSpec": "0.0.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "0.0.1" }, "_requiredBy": [ - "#USER", - "/" + "/", + "/libnpmfund" ], "_resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-0.0.1.tgz", "_shasum": "6b05fa7dd4207fbf5f592c66e3e06a429f5ccffd", - "_spec": "@npmcli/arborist@latest", - "_where": "/Users/ruyadorno/Documents/workspace/cli", + "_spec": "@npmcli/arborist@0.0.1", + "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", diff --git a/node_modules/@npmcli/ci-detect/README.md b/node_modules/@npmcli/ci-detect/README.md index 64f15f689..45f9a01c2 100644 --- a/node_modules/@npmcli/ci-detect/README.md +++ b/node_modules/@npmcli/ci-detect/README.md @@ -34,6 +34,22 @@ at the appropriate environment variables. * `'now-github'` Zeit.co's Now for GitHub deployment service * `'now-bitbucket'` Zeit.co's Now for BitBucket deployment service * `'now-gitlab'` Zeit.co's Now for GitLab deployment service +* `'now'` Zeit.co's Now service, but not GitHub/BitBucket/GitLab +* `'azure-pipelines'` Azure Pipelines +* `'bitrise'` Bitrise +* `'buddy'` Buddy +* `'buildkite'` Buildkite +* `'cirrus'` Cirrus CI +* `'dsari'` dsari CI +* `'strider'` Strider CI +* `'taskcluster'` Mozilla Taskcluster +* `'hudson'` Hudson CI +* `'magnum'` Magnum CI +* `'nevercode'` Nevercode +* `'render'` Render CI +* `'sail'` Sail CI +* `'shippable'` Shippable +* `'heroku'` Heroku * `'codeship'` CodeShip * Anything that sets the `CI_NAME` environment variable will return the value as the result. (This is how CodeShip is detected.) diff --git a/node_modules/@npmcli/ci-detect/index.js b/node_modules/@npmcli/ci-detect/index.js index a84c5b642..6a60606ff 100644 --- a/node_modules/@npmcli/ci-detect/index.js +++ b/node_modules/@npmcli/ci-detect/index.js @@ -1,22 +1,39 @@ module.exports = () => process.env.GERRIT_PROJECT ? 'gerrit' + : process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI ? 'azure-pipelines' + : process.env.BITRISE_IO ? 'bitrise' + : process.env.BUDDY_WORKSPACE_ID ? 'buddy' + : process.env.BUILDKITE ? 'buildkite' + : process.env.CIRRUS_CI ? 'cirrus' : process.env.GITLAB_CI ? 'gitlab' : process.env.APPVEYOR ? 'appveyor' : process.env.CIRCLECI ? 'circle-ci' : process.env.SEMAPHORE ? 'semaphore' : process.env.DRONE ? 'drone' + : process.env.DSARI ? 'dsari' : process.env.GITHUB_ACTION ? 'github-actions' : process.env.TDDIUM ? 'tddium' + : process.env.STRIDER ? 'strider' + : process.env.TASKCLUSTER_ROOT_URL ? 'taskcluster' : process.env.JENKINS_URL ? 'jenkins' : process.env['bamboo.buildKey'] ? 'bamboo' : process.env.GO_PIPELINE_NAME ? 'gocd' + : process.env.HUDSON_URL ? 'hudson' : process.env.WERCKER ? 'wercker' : process.env.NETLIFY ? 'netlify' : process.env.NOW_GITHUB_DEPLOYMENT ? 'now-github' : process.env.GITLAB_DEPLOYMENT ? 'now-gitlab' : process.env.BITBUCKET_DEPLOYMENT ? 'now-bitbucket' + : process.env.NOW_BUILDER ? 'now' + : process.env.MAGNUM ? 'magnum' + : process.env.NEVERCODE ? 'nevercode' + : process.env.RENDER ? 'render' + : process.env.SAIL_CI ? 'sail' + : process.env.SHIPPABLE ? 'shippable' // codeship and a few others : process.env.CI_NAME ? process.env.CI_NAME + // heroku doesn't set envs other than node in a heroku-specific location + : /\/\.heroku\/node\/bin\/node$/.test(process.env.NODE || '') ? 'heroku' // test travis after the others, since several CI systems mimic it : process.env.TRAVIS ? 'travis-ci' // aws CodeBuild/CodePipeline diff --git a/node_modules/@npmcli/ci-detect/package.json b/node_modules/@npmcli/ci-detect/package.json index 9e5269f46..c77847087 100644 --- a/node_modules/@npmcli/ci-detect/package.json +++ b/node_modules/@npmcli/ci-detect/package.json @@ -1,29 +1,28 @@ { - "_from": "@npmcli/ci-detect", - "_id": "@npmcli/ci-detect@1.2.0", + "_from": "@npmcli/ci-detect@^1.2.0", + "_id": "@npmcli/ci-detect@1.3.0", "_inBundle": false, - "_integrity": "sha512-JtktVH7ASBVIWsQTFlFpeOzhBJskvoBCTfeeRhhZy7ybATcUvwiwotZ8j5rkqUUyB69lIy/AvboiiiGBjYBKBA==", + "_integrity": "sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q==", "_location": "/@npmcli/ci-detect", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "range", "registry": true, - "raw": "@npmcli/ci-detect", + "raw": "@npmcli/ci-detect@^1.2.0", "name": "@npmcli/ci-detect", "escapedName": "@npmcli%2fci-detect", "scope": "@npmcli", - "rawSpec": "", + "rawSpec": "^1.2.0", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "^1.2.0" }, "_requiredBy": [ - "#USER", "/", "/npm-registry-fetch" ], - "_resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.2.0.tgz", - "_shasum": "0df142a1ac3bba6cbf2e9da1a6994cd898e32c95", - "_spec": "@npmcli/ci-detect", + "_resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.3.0.tgz", + "_shasum": "6c1d2c625fb6ef1b9dea85ad0a5afcbef85ef22a", + "_spec": "@npmcli/ci-detect@^1.2.0", "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Isaac Z. Schlueter", @@ -58,5 +57,5 @@ "tap": { "check-coverage": true }, - "version": "1.2.0" + "version": "1.3.0" } diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index ab992de13..ea97ba747 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,31 +1,29 @@ { - "_from": "@npmcli/git@latest", + "_from": "@npmcli/git@^2.0.1", "_id": "@npmcli/git@2.0.3", "_inBundle": false, "_integrity": "sha512-c/ODsV5ppjB12VDXKc6hzVNgg6ZJX/etILUn3WgF5NLAYBhQLJ3fBq6uB2jQD4OwqOzJdPT1/xA3Xh3aaWGk5w==", "_location": "/@npmcli/git", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "range", "registry": true, - "raw": "@npmcli/git@latest", + "raw": "@npmcli/git@^2.0.1", "name": "@npmcli/git", "escapedName": "@npmcli%2fgit", "scope": "@npmcli", - "rawSpec": "latest", + "rawSpec": "^2.0.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "^2.0.1" }, "_requiredBy": [ - "#USER", - "/", "/libnpmversion", "/pacote" ], "_resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.3.tgz", "_shasum": "41a13cc698d257c7e38a287e233dafe7354dd4ab", - "_spec": "@npmcli/git@latest", - "_where": "/Users/isaacs/dev/npm/cli", + "_spec": "@npmcli/git@^2.0.1", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/pacote", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", diff --git a/node_modules/@npmcli/installed-package-contents/package.json b/node_modules/@npmcli/installed-package-contents/package.json index 1b89d044e..009cf2add 100644 --- a/node_modules/@npmcli/installed-package-contents/package.json +++ b/node_modules/@npmcli/installed-package-contents/package.json @@ -17,12 +17,13 @@ "fetchSpec": "^1.0.5" }, "_requiredBy": [ + "/@npmcli/arborist", "/pacote" ], "_resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.5.tgz", "_shasum": "cc78565e55d9f14d46acf46a96f70934e516fa3d", "_spec": "@npmcli/installed-package-contents@^1.0.5", - "_where": "/Users/claudiahdz/npm/cli/node_modules/pacote", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/LICENSE b/node_modules/@npmcli/map-workspaces/node_modules/glob/LICENSE deleted file mode 100644 index 42ca266df..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. - -## Glob Logo - -Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed -under a Creative Commons Attribution-ShareAlike 4.0 International License -https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/README.md b/node_modules/@npmcli/map-workspaces/node_modules/glob/README.md deleted file mode 100644 index 0916a4825..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/README.md +++ /dev/null @@ -1,375 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](logo/glob.png) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array<String>}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array<String>}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array<String>}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Glob Logo -Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). - -The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` - -![](oh-my-glob.gif) diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/changelog.md b/node_modules/@npmcli/map-workspaces/node_modules/glob/changelog.md deleted file mode 100644 index 41636771e..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/changelog.md +++ /dev/null @@ -1,67 +0,0 @@ -## 7.0 - -- Raise error if `options.cwd` is specified, and not a directory - -## 6.0 - -- Remove comment and negation pattern support -- Ignore patterns are always in `dot:true` mode - -## 5.0 - -- Deprecate comment and negation patterns -- Fix regression in `mark` and `nodir` options from making all cache - keys absolute path. -- Abort if `fs.readdir` returns an error that's unexpected -- Don't emit `match` events for ignored items -- Treat ENOTSUP like ENOTDIR in readdir - -## 4.5 - -- Add `options.follow` to always follow directory symlinks in globstar -- Add `options.realpath` to call `fs.realpath` on all results -- Always cache based on absolute path - -## 4.4 - -- Add `options.ignore` -- Fix handling of broken symlinks - -## 4.3 - -- Bump minimatch to 2.x -- Pass all tests on Windows - -## 4.2 - -- Add `glob.hasMagic` function -- Add `options.nodir` flag - -## 4.1 - -- Refactor sync and async implementations for performance -- Throw if callback provided to sync glob function -- Treat symbolic links in globstar results the same as Bash 4.3 - -## 4.0 - -- Use `^` for dependency versions (bumped major because this breaks - older npm versions) -- Ensure callbacks are only ever called once -- switch to ISC license - -## 3.x - -- Rewrite in JavaScript -- Add support for setting root, cwd, and windows support -- Cache many fs calls -- Add globstar support -- emit match events - -## 2.x - -- Use `glob.h` and `fnmatch.h` from NetBSD - -## 1.x - -- `glob.h` static binding. diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/common.js b/node_modules/@npmcli/map-workspaces/node_modules/glob/common.js deleted file mode 100644 index 66651bb3a..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/common.js +++ /dev/null @@ -1,240 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/glob.js b/node_modules/@npmcli/map-workspaces/node_modules/glob/glob.js deleted file mode 100644 index 58dec0f6c..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {<filename>: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/package.json b/node_modules/@npmcli/map-workspaces/node_modules/glob/package.json deleted file mode 100644 index 586f70070..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "glob@^7.1.6", - "_id": "glob@7.1.6", - "_inBundle": false, - "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "_location": "/@npmcli/map-workspaces/glob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "glob@^7.1.6", - "name": "glob", - "escapedName": "glob", - "rawSpec": "^7.1.6", - "saveSpec": null, - "fetchSpec": "^7.1.6" - }, - "_requiredBy": [ - "/@npmcli/map-workspaces" - ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "_shasum": "141f33b81a7c2492e125594307480c46679278a6", - "_spec": "glob@^7.1.6", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/map-workspaces", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "bundleDependencies": false, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "deprecated": false, - "description": "a little globber", - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^12.0.1", - "tick": "0.0.6" - }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "name": "glob", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", - "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" - }, - "version": "7.1.6" -} diff --git a/node_modules/@npmcli/map-workspaces/node_modules/glob/sync.js b/node_modules/@npmcli/map-workspaces/node_modules/glob/sync.js deleted file mode 100644 index c952134ba..000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/node_modules/@npmcli/map-workspaces/package.json b/node_modules/@npmcli/map-workspaces/package.json index 3ee1fac64..3fb3b6e32 100644 --- a/node_modules/@npmcli/map-workspaces/package.json +++ b/node_modules/@npmcli/map-workspaces/package.json @@ -4,14 +4,7 @@ "_inBundle": false, "_integrity": "sha512-IovEVdr17hW/Stt0kpPjz1r0ZxRX3RGah7ww3tQpi5NtyOapJwbUffWuWETyQkOjud5soC45mnjOOBtfTggtng==", "_location": "/@npmcli/map-workspaces", - "_phantomChildren": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.4", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - }, + "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, diff --git a/node_modules/@npmcli/name-from-folder/package.json b/node_modules/@npmcli/name-from-folder/package.json index c61d05ae5..34a000bf3 100644 --- a/node_modules/@npmcli/name-from-folder/package.json +++ b/node_modules/@npmcli/name-from-folder/package.json @@ -17,7 +17,8 @@ "fetchSpec": "^1.0.1" }, "_requiredBy": [ - "/@npmcli/arborist" + "/@npmcli/arborist", + "/@npmcli/map-workspaces" ], "_resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", "_shasum": "77ecd0a4fcb772ba6fe927e2e2e155fbec2e6b1a", diff --git a/node_modules/@npmcli/promise-spawn/package.json b/node_modules/@npmcli/promise-spawn/package.json index 8aa966a15..640c01e34 100644 --- a/node_modules/@npmcli/promise-spawn/package.json +++ b/node_modules/@npmcli/promise-spawn/package.json @@ -1,5 +1,5 @@ { - "_from": "@npmcli/promise-spawn@^1.1.0", + "_from": "@npmcli/promise-spawn@^1.2.0", "_id": "@npmcli/promise-spawn@1.2.0", "_inBundle": false, "_integrity": "sha512-nFtqjVETliApiRdjbYwKwhlSHx2ZMagyj5b9YbNt0BWeeOVxJd47ZVE2u16vxDHyTOZvk+YLV7INwfAE9a2uow==", @@ -8,22 +8,23 @@ "_requested": { "type": "range", "registry": true, - "raw": "@npmcli/promise-spawn@^1.1.0", + "raw": "@npmcli/promise-spawn@^1.2.0", "name": "@npmcli/promise-spawn", "escapedName": "@npmcli%2fpromise-spawn", "scope": "@npmcli", - "rawSpec": "^1.1.0", + "rawSpec": "^1.2.0", "saveSpec": null, - "fetchSpec": "^1.1.0" + "fetchSpec": "^1.2.0" }, "_requiredBy": [ "/@npmcli/git", + "/@npmcli/run-script", "/pacote" ], "_resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.2.0.tgz", "_shasum": "167d70b926f771c8bd8b9183bfc8b5aec29d7e45", - "_spec": "@npmcli/promise-spawn@^1.1.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/git", + "_spec": "@npmcli/promise-spawn@^1.2.0", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/run-script", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index 83f039062..fa2f2463e 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,23 +1,22 @@ { - "_from": "@npmcli/run-script@latest", + "_from": "@npmcli/run-script@^1.3.1", "_id": "@npmcli/run-script@1.3.1", "_inBundle": false, "_integrity": "sha512-9Ea57XJjNLtBFRAaiKqqdoqRrL2QkM0vvCbMjPecljhog5IHupStPtZULbl0CoGN00N3lhLWJ4PaIEC0MGjqJw==", "_location": "/@npmcli/run-script", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "range", "registry": true, - "raw": "@npmcli/run-script@latest", + "raw": "@npmcli/run-script@^1.3.1", "name": "@npmcli/run-script", "escapedName": "@npmcli%2frun-script", "scope": "@npmcli", - "rawSpec": "latest", + "rawSpec": "^1.3.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "^1.3.1" }, "_requiredBy": [ - "#USER", "/", "/@npmcli/arborist", "/libnpmpack", @@ -26,7 +25,7 @@ ], "_resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.3.1.tgz", "_shasum": "dc8934646634338b99898614ce083dabcd14edf3", - "_spec": "@npmcli/run-script@latest", + "_spec": "@npmcli/run-script@^1.3.1", "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Isaac Z. Schlueter", |