From 18b42a46abdbc26a28f2e16ea74a1812d8de4c4d Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 29 May 2024 07:15:31 -0700 Subject: [PATCH] deps: glob@10.4.1 --- node_modules/glob/dist/commonjs/glob.js | 42 +-- node_modules/glob/dist/commonjs/ignore.js | 69 ++-- node_modules/glob/dist/commonjs/index.js | 20 +- node_modules/glob/dist/commonjs/pattern.js | 22 +- node_modules/glob/dist/commonjs/processor.js | 9 +- node_modules/glob/dist/commonjs/walker.js | 35 ++- node_modules/glob/dist/esm/bin.mjs | 12 +- node_modules/glob/dist/esm/glob.js | 42 +-- node_modules/glob/dist/esm/ignore.js | 69 ++-- node_modules/glob/dist/esm/index.js | 9 +- node_modules/glob/dist/esm/pattern.js | 22 +- node_modules/glob/dist/esm/processor.js | 9 +- node_modules/glob/dist/esm/walker.js | 35 ++- node_modules/glob/package.json | 25 +- node_modules/jackspeak/dist/commonjs/index.js | 296 ++++++++++++------ .../jackspeak/dist/commonjs/package.json | 4 +- node_modules/jackspeak/dist/esm/index.js | 296 ++++++++++++------ node_modules/jackspeak/dist/esm/package.json | 4 +- node_modules/jackspeak/dist/esm/parse-args.js | 4 +- node_modules/jackspeak/package.json | 9 +- .../minipass/dist/commonjs/package.json | 4 +- node_modules/minipass/dist/esm/package.json | 4 +- node_modules/minipass/package.json | 10 +- package-lock.json | 54 +++- package.json | 2 +- 25 files changed, 695 insertions(+), 412 deletions(-) diff --git a/node_modules/glob/dist/commonjs/glob.js b/node_modules/glob/dist/commonjs/glob.js index 7734487d38052..e1339bbbcf57f 100644 --- a/node_modules/glob/dist/commonjs/glob.js +++ b/node_modules/glob/dist/commonjs/glob.js @@ -2,16 +2,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Glob = void 0; const minimatch_1 = require("minimatch"); -const path_scurry_1 = require("path-scurry"); const node_url_1 = require("node:url"); +const path_scurry_1 = require("path-scurry"); const pattern_js_1 = require("./pattern.js"); const walker_js_1 = require("./walker.js"); // if no process global, just call it linux. // so we default to case-sensitive, / separators -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * An object that can perform glob pattern traversals. @@ -41,6 +41,7 @@ class Glob { signal; windowsPathsNoEscape; withFileTypes; + includeChildMatches; /** * The options provided to the constructor. */ @@ -86,6 +87,7 @@ class Glob { this.noext = !!opts.noext; this.realpath = !!opts.realpath; this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; this.noglobstar = !!opts.noglobstar; this.matchBase = !!opts.matchBase; this.maxDepth = @@ -100,7 +102,8 @@ class Glob { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || - opts.allowWindowsEscape === false; + opts.allowWindowsEscape === + false; if (this.windowsPathsNoEscape) { pattern = pattern.map(p => p.replace(/\\/g, '/')); } @@ -121,12 +124,9 @@ class Glob { } } else { - const Scurry = opts.platform === 'win32' - ? path_scurry_1.PathScurryWin32 - : opts.platform === 'darwin' - ? path_scurry_1.PathScurryDarwin - : opts.platform - ? path_scurry_1.PathScurryPosix + const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32 + : opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin + : opts.platform ? path_scurry_1.PathScurryPosix : path_scurry_1.PathScurry; this.scurry = new Scurry(this.cwd, { nocase: opts.nocase, @@ -178,11 +178,12 @@ class Glob { return [ ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walk()), ]; } @@ -190,32 +191,35 @@ class Glob { return [ ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walkSync(), ]; } stream() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).stream(); } streamSync() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).streamSync(); } /** diff --git a/node_modules/glob/dist/commonjs/ignore.js b/node_modules/glob/dist/commonjs/ignore.js index 3c0daeff86ff8..5f1fde0680dea 100644 --- a/node_modules/glob/dist/commonjs/ignore.js +++ b/node_modules/glob/dist/commonjs/ignore.js @@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Ignore = void 0; const minimatch_1 = require("minimatch"); const pattern_js_1 = require("./pattern.js"); -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * Class used to process ignored patterns @@ -20,12 +20,15 @@ class Ignore { relativeChildren; absolute; absoluteChildren; + platform; + mmopts; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - const mmopts = { + this.platform = platform; + this.mmopts = { dot: true, nobrace, nocase, @@ -36,6 +39,10 @@ class Ignore { nocomment: true, nonegate: true, }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at @@ -48,36 +55,34 @@ class Ignore { // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. - for (const ign of ignored) { - const mm = new minimatch_1.Minimatch(ign, mmopts); - for (let i = 0; i < mm.set.length; i++) { - const parsed = mm.set[i]; - const globParts = mm.globParts[i]; - /* c8 ignore start */ - if (!parsed || !globParts) { - throw new Error('invalid pattern object'); - } - // strip off leading ./ portions - // https://github.com/isaacs/node-glob/issues/570 - while (parsed[0] === '.' && globParts[0] === '.') { - parsed.shift(); - globParts.shift(); - } - /* c8 ignore stop */ - const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform); - const m = new minimatch_1.Minimatch(p.globString(), mmopts); - const children = globParts[globParts.length - 1] === '**'; - const absolute = p.isAbsolute(); + const mm = new minimatch_1.Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); + const m = new minimatch_1.Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { if (absolute) - this.absolute.push(m); + this.absoluteChildren.push(m); else - this.relative.push(m); - if (children) { - if (absolute) - this.absoluteChildren.push(m); - else - this.relativeChildren.push(m); - } + this.relativeChildren.push(m); } } } diff --git a/node_modules/glob/dist/commonjs/index.js b/node_modules/glob/dist/commonjs/index.js index 71c31c03dd339..31da9dfd53c6a 100644 --- a/node_modules/glob/dist/commonjs/index.js +++ b/node_modules/glob/dist/commonjs/index.js @@ -1,9 +1,18 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.glob = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = void 0; +exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0; const minimatch_1 = require("minimatch"); const glob_js_1 = require("./glob.js"); const has_magic_js_1 = require("./has-magic.js"); +var minimatch_2 = require("minimatch"); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); +Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); +var glob_js_2 = require("./glob.js"); +Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); +var has_magic_js_2 = require("./has-magic.js"); +Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); +var ignore_js_1 = require("./ignore.js"); +Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } }); function globStreamSync(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).streamSync(); } @@ -38,15 +47,6 @@ exports.sync = Object.assign(globSync, { stream: globStreamSync, iterate: globIterateSync, }); -/* c8 ignore start */ -var minimatch_2 = require("minimatch"); -Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); -Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); -var glob_js_2 = require("./glob.js"); -Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); -var has_magic_js_2 = require("./has-magic.js"); -Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); -/* c8 ignore stop */ exports.glob = Object.assign(glob_, { glob: glob_, globSync, diff --git a/node_modules/glob/dist/commonjs/pattern.js b/node_modules/glob/dist/commonjs/pattern.js index 181371293d860..f0de35fb5bed9 100644 --- a/node_modules/glob/dist/commonjs/pattern.js +++ b/node_modules/glob/dist/commonjs/pattern.js @@ -110,9 +110,9 @@ class Pattern { globString() { return (this.#globString = this.#globString || - (this.#index === 0 - ? this.isAbsolute() - ? this.#globList[0] + this.#globList.slice(1).join('/') + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') : this.#globList.join('/') : this.#globList.slice(this.#index).join('/'))); } @@ -141,8 +141,8 @@ class Pattern { */ isUNC() { const pl = this.#patternList; - return this.#isUNC !== undefined - ? this.#isUNC + return this.#isUNC !== undefined ? + this.#isUNC : (this.#isUNC = this.#platform === 'win32' && this.#index === 0 && @@ -163,8 +163,8 @@ class Pattern { */ isDrive() { const pl = this.#patternList; - return this.#isDrive !== undefined - ? this.#isDrive + return this.#isDrive !== undefined ? + this.#isDrive : (this.#isDrive = this.#platform === 'win32' && this.#index === 0 && @@ -180,8 +180,8 @@ class Pattern { */ isAbsolute() { const pl = this.#patternList; - return this.#isAbsolute !== undefined - ? this.#isAbsolute + return this.#isAbsolute !== undefined ? + this.#isAbsolute : (this.#isAbsolute = (pl[0] === '' && pl.length > 1) || this.isDrive() || @@ -192,8 +192,8 @@ class Pattern { */ root() { const p = this.#patternList[0]; - return typeof p === 'string' && this.isAbsolute() && this.#index === 0 - ? p + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p : ''; } /** diff --git a/node_modules/glob/dist/commonjs/processor.js b/node_modules/glob/dist/commonjs/processor.js index 7d30a3b665000..ee3bb4397e0b2 100644 --- a/node_modules/glob/dist/commonjs/processor.js +++ b/node_modules/glob/dist/commonjs/processor.js @@ -103,9 +103,8 @@ class Processor { this.opts = opts; this.follow = !!opts.follow; this.dot = !!opts.dot; - this.hasWalkedCache = hasWalkedCache - ? hasWalkedCache.copy() - : new HasWalkedCache(); + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); } processPatterns(target, patterns) { this.patterns = patterns; @@ -118,8 +117,8 @@ class Processor { const absolute = pattern.isAbsolute() && this.opts.absolute !== false; // start absolute patterns at root if (root) { - t = t.resolve(root === '/' && this.opts.root !== undefined - ? this.opts.root + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root : root); const rest = pattern.rest(); if (!rest) { diff --git a/node_modules/glob/dist/commonjs/walker.js b/node_modules/glob/dist/commonjs/walker.js index 20cec70fdf95f..cb15946d9a852 100644 --- a/node_modules/glob/dist/commonjs/walker.js +++ b/node_modules/glob/dist/commonjs/walker.js @@ -10,10 +10,8 @@ exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; const minipass_1 = require("minipass"); const ignore_js_1 = require("./ignore.js"); const processor_js_1 = require("./processor.js"); -const makeIgnore = (ignore, opts) => typeof ignore === 'string' - ? new ignore_js_1.Ignore([ignore], opts) - : Array.isArray(ignore) - ? new ignore_js_1.Ignore(ignore, opts) +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts) + : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; /** * basic walking utilities that all the glob walker types use @@ -30,13 +28,20 @@ class GlobUtil { #sep; signal; maxDepth; + includeChildMatches; constructor(patterns, path, opts) { this.patterns = patterns; this.path = path; this.opts = opts; this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; - if (opts.ignore) { - this.#ignore = makeIgnore(opts.ignore, opts); + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } } // ignore, always set with maxDepth, but it's optional on the // GlobOptions type @@ -108,7 +113,7 @@ class GlobUtil { return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { - return e && + return (e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && @@ -116,8 +121,8 @@ class GlobUtil { !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && - !this.#ignored(e) - ? e + !this.#ignored(e)) ? + e : undefined; } matchCheckSync(e, ifDir) { @@ -143,6 +148,11 @@ class GlobUtil { matchFinish(e, absolute) { if (this.#ignored(e)) return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; this.seen.add(e); const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; @@ -156,8 +166,8 @@ class GlobUtil { } else { const rel = this.opts.posix ? e.relativePosix() : e.relative(); - const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) - ? '.' + this.#sep + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep : ''; this.matchEmit(!rel ? '.' + mark : pre + rel + mark); } @@ -297,10 +307,9 @@ class GlobUtil { } exports.GlobUtil = GlobUtil; class GlobWalker extends GlobUtil { - matches; + matches = new Set(); constructor(patterns, path, opts) { super(patterns, path, opts); - this.matches = new Set(); } matchEmit(e) { this.matches.add(e); diff --git a/node_modules/glob/dist/esm/bin.mjs b/node_modules/glob/dist/esm/bin.mjs index 9d57d4a943b26..4bf17c5efd61c 100755 --- a/node_modules/glob/dist/esm/bin.mjs +++ b/node_modules/glob/dist/esm/bin.mjs @@ -185,7 +185,7 @@ const j = jack({ description: `Defaults to the value of 'process.platform' if available, or 'linux' if not. Setting --platform=win32 on non-Windows systems may cause strange behavior!`, - validate: v => new Set([ + validOptions: [ 'aix', 'android', 'darwin', @@ -197,7 +197,7 @@ const j = jack({ 'win32', 'cygwin', 'netbsd', - ]).has(v), + ], }, }) .optList({ @@ -229,11 +229,9 @@ try { throw 'No patterns provided'; if (positionals.length === 0 && values.default) positionals.push(values.default); - const patterns = values.all - ? positionals - : positionals.filter(p => !existsSync(p)); - const matches = values.all - ? [] + const patterns = values.all ? positionals : positionals.filter(p => !existsSync(p)); + const matches = values.all ? + [] : positionals.filter(p => existsSync(p)).map(p => join(p)); const stream = globStream(patterns, { absolute: values.absolute, diff --git a/node_modules/glob/dist/esm/glob.js b/node_modules/glob/dist/esm/glob.js index 0b9384e19f88f..c9ff3b0036d94 100644 --- a/node_modules/glob/dist/esm/glob.js +++ b/node_modules/glob/dist/esm/glob.js @@ -1,14 +1,14 @@ import { Minimatch } from 'minimatch'; -import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; import { fileURLToPath } from 'node:url'; +import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; import { Pattern } from './pattern.js'; import { GlobStream, GlobWalker } from './walker.js'; // if no process global, just call it linux. // so we default to case-sensitive, / separators -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * An object that can perform glob pattern traversals. @@ -38,6 +38,7 @@ export class Glob { signal; windowsPathsNoEscape; withFileTypes; + includeChildMatches; /** * The options provided to the constructor. */ @@ -83,6 +84,7 @@ export class Glob { this.noext = !!opts.noext; this.realpath = !!opts.realpath; this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; this.noglobstar = !!opts.noglobstar; this.matchBase = !!opts.matchBase; this.maxDepth = @@ -97,7 +99,8 @@ export class Glob { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || - opts.allowWindowsEscape === false; + opts.allowWindowsEscape === + false; if (this.windowsPathsNoEscape) { pattern = pattern.map(p => p.replace(/\\/g, '/')); } @@ -118,12 +121,9 @@ export class Glob { } } else { - const Scurry = opts.platform === 'win32' - ? PathScurryWin32 - : opts.platform === 'darwin' - ? PathScurryDarwin - : opts.platform - ? PathScurryPosix + const Scurry = opts.platform === 'win32' ? PathScurryWin32 + : opts.platform === 'darwin' ? PathScurryDarwin + : opts.platform ? PathScurryPosix : PathScurry; this.scurry = new Scurry(this.cwd, { nocase: opts.nocase, @@ -175,11 +175,12 @@ export class Glob { return [ ...(await new GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walk()), ]; } @@ -187,32 +188,35 @@ export class Glob { return [ ...new GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walkSync(), ]; } stream() { return new GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).stream(); } streamSync() { return new GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).streamSync(); } /** diff --git a/node_modules/glob/dist/esm/ignore.js b/node_modules/glob/dist/esm/ignore.js index 2b2808d0dfe0f..539c4a4fdebc4 100644 --- a/node_modules/glob/dist/esm/ignore.js +++ b/node_modules/glob/dist/esm/ignore.js @@ -4,10 +4,10 @@ // Ignores are always parsed in dot:true mode import { Minimatch } from 'minimatch'; import { Pattern } from './pattern.js'; -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * Class used to process ignored patterns @@ -17,12 +17,15 @@ export class Ignore { relativeChildren; absolute; absoluteChildren; + platform; + mmopts; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - const mmopts = { + this.platform = platform; + this.mmopts = { dot: true, nobrace, nocase, @@ -33,6 +36,10 @@ export class Ignore { nocomment: true, nonegate: true, }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at @@ -45,36 +52,34 @@ export class Ignore { // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. - for (const ign of ignored) { - const mm = new Minimatch(ign, mmopts); - for (let i = 0; i < mm.set.length; i++) { - const parsed = mm.set[i]; - const globParts = mm.globParts[i]; - /* c8 ignore start */ - if (!parsed || !globParts) { - throw new Error('invalid pattern object'); - } - // strip off leading ./ portions - // https://github.com/isaacs/node-glob/issues/570 - while (parsed[0] === '.' && globParts[0] === '.') { - parsed.shift(); - globParts.shift(); - } - /* c8 ignore stop */ - const p = new Pattern(parsed, globParts, 0, platform); - const m = new Minimatch(p.globString(), mmopts); - const children = globParts[globParts.length - 1] === '**'; - const absolute = p.isAbsolute(); + const mm = new Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new Pattern(parsed, globParts, 0, this.platform); + const m = new Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { if (absolute) - this.absolute.push(m); + this.absoluteChildren.push(m); else - this.relative.push(m); - if (children) { - if (absolute) - this.absoluteChildren.push(m); - else - this.relativeChildren.push(m); - } + this.relativeChildren.push(m); } } } diff --git a/node_modules/glob/dist/esm/index.js b/node_modules/glob/dist/esm/index.js index 7b270117e740a..e15c1f9c4cb03 100644 --- a/node_modules/glob/dist/esm/index.js +++ b/node_modules/glob/dist/esm/index.js @@ -1,6 +1,10 @@ import { escape, unescape } from 'minimatch'; import { Glob } from './glob.js'; import { hasMagic } from './has-magic.js'; +export { escape, unescape } from 'minimatch'; +export { Glob } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; export function globStreamSync(pattern, options = {}) { return new Glob(pattern, options).streamSync(); } @@ -30,11 +34,6 @@ export const sync = Object.assign(globSync, { stream: globStreamSync, iterate: globIterateSync, }); -/* c8 ignore start */ -export { escape, unescape } from 'minimatch'; -export { Glob } from './glob.js'; -export { hasMagic } from './has-magic.js'; -/* c8 ignore stop */ export const glob = Object.assign(glob_, { glob: glob_, globSync, diff --git a/node_modules/glob/dist/esm/pattern.js b/node_modules/glob/dist/esm/pattern.js index 60aa415d92fd1..b41defa10c6a3 100644 --- a/node_modules/glob/dist/esm/pattern.js +++ b/node_modules/glob/dist/esm/pattern.js @@ -107,9 +107,9 @@ export class Pattern { globString() { return (this.#globString = this.#globString || - (this.#index === 0 - ? this.isAbsolute() - ? this.#globList[0] + this.#globList.slice(1).join('/') + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') : this.#globList.join('/') : this.#globList.slice(this.#index).join('/'))); } @@ -138,8 +138,8 @@ export class Pattern { */ isUNC() { const pl = this.#patternList; - return this.#isUNC !== undefined - ? this.#isUNC + return this.#isUNC !== undefined ? + this.#isUNC : (this.#isUNC = this.#platform === 'win32' && this.#index === 0 && @@ -160,8 +160,8 @@ export class Pattern { */ isDrive() { const pl = this.#patternList; - return this.#isDrive !== undefined - ? this.#isDrive + return this.#isDrive !== undefined ? + this.#isDrive : (this.#isDrive = this.#platform === 'win32' && this.#index === 0 && @@ -177,8 +177,8 @@ export class Pattern { */ isAbsolute() { const pl = this.#patternList; - return this.#isAbsolute !== undefined - ? this.#isAbsolute + return this.#isAbsolute !== undefined ? + this.#isAbsolute : (this.#isAbsolute = (pl[0] === '' && pl.length > 1) || this.isDrive() || @@ -189,8 +189,8 @@ export class Pattern { */ root() { const p = this.#patternList[0]; - return typeof p === 'string' && this.isAbsolute() && this.#index === 0 - ? p + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p : ''; } /** diff --git a/node_modules/glob/dist/esm/processor.js b/node_modules/glob/dist/esm/processor.js index b5b2de2d314ca..f874892ffed0c 100644 --- a/node_modules/glob/dist/esm/processor.js +++ b/node_modules/glob/dist/esm/processor.js @@ -97,9 +97,8 @@ export class Processor { this.opts = opts; this.follow = !!opts.follow; this.dot = !!opts.dot; - this.hasWalkedCache = hasWalkedCache - ? hasWalkedCache.copy() - : new HasWalkedCache(); + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); } processPatterns(target, patterns) { this.patterns = patterns; @@ -112,8 +111,8 @@ export class Processor { const absolute = pattern.isAbsolute() && this.opts.absolute !== false; // start absolute patterns at root if (root) { - t = t.resolve(root === '/' && this.opts.root !== undefined - ? this.opts.root + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root : root); const rest = pattern.rest(); if (!rest) { diff --git a/node_modules/glob/dist/esm/walker.js b/node_modules/glob/dist/esm/walker.js index b58472e9de4fb..3d68196c4f175 100644 --- a/node_modules/glob/dist/esm/walker.js +++ b/node_modules/glob/dist/esm/walker.js @@ -7,10 +7,8 @@ import { Minipass } from 'minipass'; import { Ignore } from './ignore.js'; import { Processor } from './processor.js'; -const makeIgnore = (ignore, opts) => typeof ignore === 'string' - ? new Ignore([ignore], opts) - : Array.isArray(ignore) - ? new Ignore(ignore, opts) +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts) + : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore; /** * basic walking utilities that all the glob walker types use @@ -27,13 +25,20 @@ export class GlobUtil { #sep; signal; maxDepth; + includeChildMatches; constructor(patterns, path, opts) { this.patterns = patterns; this.path = path; this.opts = opts; this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; - if (opts.ignore) { - this.#ignore = makeIgnore(opts.ignore, opts); + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } } // ignore, always set with maxDepth, but it's optional on the // GlobOptions type @@ -105,7 +110,7 @@ export class GlobUtil { return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { - return e && + return (e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && @@ -113,8 +118,8 @@ export class GlobUtil { !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && - !this.#ignored(e) - ? e + !this.#ignored(e)) ? + e : undefined; } matchCheckSync(e, ifDir) { @@ -140,6 +145,11 @@ export class GlobUtil { matchFinish(e, absolute) { if (this.#ignored(e)) return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; this.seen.add(e); const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; @@ -153,8 +163,8 @@ export class GlobUtil { } else { const rel = this.opts.posix ? e.relativePosix() : e.relative(); - const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) - ? '.' + this.#sep + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep : ''; this.matchEmit(!rel ? '.' + mark : pre + rel + mark); } @@ -293,10 +303,9 @@ export class GlobUtil { } } export class GlobWalker extends GlobUtil { - matches; + matches = new Set(); constructor(patterns, path, opts) { super(patterns, path, opts); - this.matches = new Set(); } matchEmit(e) { this.matches.add(e); diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index 6d93c9f9787dd..f6f7eb4e8b059 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -2,7 +2,7 @@ "author": "Isaac Z. Schlueter (https://blog.izs.me/)", "name": "glob", "description": "the most correct and second fastest glob implementation in JavaScript", - "version": "10.3.15", + "version": "10.4.1", "type": "module", "tshy": { "main": true, @@ -43,7 +43,7 @@ "presnap": "npm run prepare", "test": "tap", "snap": "tap", - "format": "prettier --write . --loglevel warn", + "format": "prettier --write . --log-level warn", "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", @@ -55,6 +55,7 @@ "benchclean": "node benchclean.cjs" }, "prettier": { + "experimentalTernaries": true, "semi": false, "printWidth": 75, "tabWidth": 2, @@ -67,23 +68,21 @@ }, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "devDependencies": { "@types/node": "^20.11.30", "memfs": "^3.4.13", "mkdirp": "^3.0.1", - "prettier": "^2.8.3", - "rimraf": "^5.0.1", + "prettier": "^3.2.5", + "rimraf": "^5.0.7", "sync-content": "^1.0.2", - "tap": "^18.7.2", - "ts-node": "^10.9.2", - "tshy": "^1.12.0", - "typedoc": "^0.25.12", - "typescript": "^5.2.2" + "tap": "^19.0.0", + "tshy": "^1.14.0", + "typedoc": "^0.25.12" }, "tap": { "before": "test/00-setup.ts" diff --git a/node_modules/jackspeak/dist/commonjs/index.js b/node_modules/jackspeak/dist/commonjs/index.js index 956d6a275c363..a66dde30a9dd6 100644 --- a/node_modules/jackspeak/dist/commonjs/index.js +++ b/node_modules/jackspeak/dist/commonjs/index.js @@ -21,51 +21,41 @@ const toEnvKey = (pref, key) => { .replace(/ /g, '_'); }; const toEnvVal = (value, delim = '\n') => { - const str = typeof value === 'string' - ? value - : typeof value === 'boolean' - ? value - ? '1' + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' : '0' - : typeof value === 'number' - ? String(value) - : Array.isArray(value) - ? value - .map((v) => toEnvVal(v)) - .join(delim) - : /* c8 ignore start */ - undefined; + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; if (typeof str !== 'string') { throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); } /* c8 ignore stop */ return str; }; -const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env - ? env.split(delim).map(v => fromEnvVal(v, type, false)) +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) : [] - : type === 'string' - ? env - : type === 'boolean' - ? env === '1' + : type === 'string' ? env + : type === 'boolean' ? env === '1' : +env.trim()); const isConfigType = (t) => typeof t === 'string' && (t === 'string' || t === 'number' || t === 'boolean'); exports.isConfigType = isConfigType; const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); // print the value type, for error message reporting -const valueType = (v) => typeof v === 'string' - ? 'string' - : typeof v === 'boolean' - ? 'boolean' - : typeof v === 'number' - ? 'number' - : Array.isArray(v) - ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' - ? types[0] +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { @@ -85,80 +75,140 @@ const isConfigOption = (o, type, multi) => !!o && undefOrType(o.description, 'string') && undefOrType(o.hint, 'string') && undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && (o.default === undefined || isValidValue(o.default, type, multi)) && !!o.multiple === multi; exports.isConfigOption = isConfigOption; function num(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: false, }; } function numList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: true, }; } function opt(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: false, }; } function optList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: true, }; } function flag(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', false)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag'); @@ -173,11 +223,12 @@ function flag(o = {}) { } function flagList(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', true)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag list'); @@ -210,8 +261,8 @@ const toParseArgsOptionsConfig = (options) => { c[longOption] = { type: 'string', multiple: false, - default: config.default === undefined - ? undefined + default: config.default === undefined ? + undefined : String(config.default), }; } @@ -219,7 +270,7 @@ const toParseArgsOptionsConfig = (options) => { const conf = config; c[longOption] = { type: conf.type, - multiple: conf.multiple, + multiple: !!conf.multiple, default: conf.default, }; } @@ -277,14 +328,25 @@ class Jack { this.validate(values); } catch (er) { - throw Object.assign(er, source ? { source } : {}); + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; } for (const [field, value] of Object.entries(values)) { const my = this.#configSet[field]; // already validated, just for TS's benefit /* c8 ignore start */ if (!my) { - throw new Error('unexpected field in config set: ' + field); + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); } /* c8 ignore stop */ my.default = value; @@ -355,18 +417,27 @@ class Jack { throw new Error(`Unknown option '${token.rawName}'. ` + `To specify a positional argument starting with a '-', ` + `place it at the end of the command after '--', as in ` + - `'-- ${token.rawName}'`); + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); } if (value === undefined) { if (token.value === undefined) { if (my.type !== 'boolean') { - throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`); + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); } value = true; } else { if (my.type === 'boolean') { - throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`); + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); } if (my.type === 'string') { value = token.value; @@ -375,7 +446,13 @@ class Jack { value = +token.value; if (value !== value) { throw new Error(`Invalid value '${token.value}' provided for ` + - `'${token.rawName}' option, expected number`); + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); } } } @@ -400,8 +477,16 @@ class Jack { } for (const [field, value] of Object.entries(p.values)) { const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } if (valid && !valid(value)) { - throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); } } this.#writeEnv(p); @@ -418,7 +503,7 @@ class Jack { // recurse so we get the core config key we care about. this.#noNoFields(yes, val, s); if (this.#configSet[yes]?.type === 'boolean') { - throw new Error(`do not set '${s}', instead set '${yes}' as desired.`); + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); } } /** @@ -427,22 +512,48 @@ class Jack { */ validate(o) { if (!o || typeof o !== 'object') { - throw new Error('Invalid config: not an object'); + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); } + const opts = o; for (const field in o) { - this.#noNoFields(field, o[field]); + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); const config = this.#configSet[field]; if (!config) { - throw new Error(`Unknown config option: ${field}`); + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); } - if (!isValidValue(o[field], config.type, !!config.multiple)) { - throw Object.assign(new Error(`Invalid value ${valueType(o[field])} for ${field}, expected ${valueType(config)}`), { - field, - value: o[field], + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, }); } - if (config.validate && !config.validate(o[field])) { - throw new Error(`Invalid config value for ${field}: ${o[field]}`); + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); } } } @@ -753,21 +864,21 @@ class Jack { const { value } = field; const desc = value.description || ''; const mult = value.multiple ? 'Can be set multiple times' : ''; - const dmDelim = mult && (desc.includes('\n') ? '\n\n' : '\n'); - const text = normalize(desc + dmDelim + mult); + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); const hint = value.hint || - (value.type === 'number' - ? 'n' - : value.type === 'string' - ? field.name + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name : undefined); - const short = !value.short - ? '' - : value.type === 'boolean' - ? `-${value.short} ` + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` : `-${value.short}<${hint}> `; - const left = value.type === 'boolean' - ? `${short}--${field.name}` + const left = value.type === 'boolean' ? + `${short}--${field.name}` : `${short}--${field.name}=<${hint}>`; const row = { text, left, type: 'config' }; if (text.length > width - maxMax) { @@ -795,10 +906,11 @@ class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description - ? { description: normalize(def.description) } + ...(def.description ? + { description: normalize(def.description) } : {}), ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, ])); @@ -813,12 +925,12 @@ class Jack { exports.Jack = Jack; // Unwrap and un-indent, so we can wrap description // strings however makes them look nice in the code. -const normalize = (s, pre = false) => pre - ? // prepend a ZWSP to each line so cliui doesn't strip it. - s - .split('\n') - .map(l => `\u200b${l}`) - .join('\n') +const normalize = (s, pre = false) => pre ? + // prepend a ZWSP to each line so cliui doesn't strip it. + s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n') : s // remove single line breaks, except for lists .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) @@ -832,8 +944,8 @@ const normalize = (s, pre = false) => pre // normalize for markdown printing, remove leading spaces on lines const normalizeMarkdown = (s, pre = false) => { const n = normalize(s, pre).replace(/\\/g, '\\\\'); - return pre - ? `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` : n.replace(/\n +/g, '\n').trim(); }; const normalizeOneLine = (s, pre = false) => { diff --git a/node_modules/jackspeak/dist/commonjs/package.json b/node_modules/jackspeak/dist/commonjs/package.json index 0292b9956f2e4..5bbefffbabee3 100644 --- a/node_modules/jackspeak/dist/commonjs/package.json +++ b/node_modules/jackspeak/dist/commonjs/package.json @@ -1 +1,3 @@ -{"type":"commonjs"} \ No newline at end of file +{ + "type": "commonjs" +} diff --git a/node_modules/jackspeak/dist/esm/index.js b/node_modules/jackspeak/dist/esm/index.js index 9914049f89026..6c4882b4e06bc 100644 --- a/node_modules/jackspeak/dist/esm/index.js +++ b/node_modules/jackspeak/dist/esm/index.js @@ -15,50 +15,40 @@ const toEnvKey = (pref, key) => { .replace(/ /g, '_'); }; const toEnvVal = (value, delim = '\n') => { - const str = typeof value === 'string' - ? value - : typeof value === 'boolean' - ? value - ? '1' + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' : '0' - : typeof value === 'number' - ? String(value) - : Array.isArray(value) - ? value - .map((v) => toEnvVal(v)) - .join(delim) - : /* c8 ignore start */ - undefined; + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; if (typeof str !== 'string') { throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); } /* c8 ignore stop */ return str; }; -const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env - ? env.split(delim).map(v => fromEnvVal(v, type, false)) +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) : [] - : type === 'string' - ? env - : type === 'boolean' - ? env === '1' + : type === 'string' ? env + : type === 'boolean' ? env === '1' : +env.trim()); export const isConfigType = (t) => typeof t === 'string' && (t === 'string' || t === 'number' || t === 'boolean'); const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); // print the value type, for error message reporting -const valueType = (v) => typeof v === 'string' - ? 'string' - : typeof v === 'boolean' - ? 'boolean' - : typeof v === 'number' - ? 'number' - : Array.isArray(v) - ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' - ? types[0] +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { @@ -78,79 +68,139 @@ export const isConfigOption = (o, type, multi) => !!o && undefOrType(o.description, 'string') && undefOrType(o.hint, 'string') && undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && (o.default === undefined || isValidValue(o.default, type, multi)) && !!o.multiple === multi; function num(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: false, }; } function numList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: true, }; } function opt(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: false, }; } function optList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: true, }; } function flag(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', false)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag'); @@ -165,11 +215,12 @@ function flag(o = {}) { } function flagList(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', true)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag list'); @@ -202,8 +253,8 @@ const toParseArgsOptionsConfig = (options) => { c[longOption] = { type: 'string', multiple: false, - default: config.default === undefined - ? undefined + default: config.default === undefined ? + undefined : String(config.default), }; } @@ -211,7 +262,7 @@ const toParseArgsOptionsConfig = (options) => { const conf = config; c[longOption] = { type: conf.type, - multiple: conf.multiple, + multiple: !!conf.multiple, default: conf.default, }; } @@ -269,14 +320,25 @@ export class Jack { this.validate(values); } catch (er) { - throw Object.assign(er, source ? { source } : {}); + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; } for (const [field, value] of Object.entries(values)) { const my = this.#configSet[field]; // already validated, just for TS's benefit /* c8 ignore start */ if (!my) { - throw new Error('unexpected field in config set: ' + field); + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); } /* c8 ignore stop */ my.default = value; @@ -347,18 +409,27 @@ export class Jack { throw new Error(`Unknown option '${token.rawName}'. ` + `To specify a positional argument starting with a '-', ` + `place it at the end of the command after '--', as in ` + - `'-- ${token.rawName}'`); + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); } if (value === undefined) { if (token.value === undefined) { if (my.type !== 'boolean') { - throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`); + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); } value = true; } else { if (my.type === 'boolean') { - throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`); + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); } if (my.type === 'string') { value = token.value; @@ -367,7 +438,13 @@ export class Jack { value = +token.value; if (value !== value) { throw new Error(`Invalid value '${token.value}' provided for ` + - `'${token.rawName}' option, expected number`); + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); } } } @@ -392,8 +469,16 @@ export class Jack { } for (const [field, value] of Object.entries(p.values)) { const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } if (valid && !valid(value)) { - throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); } } this.#writeEnv(p); @@ -410,7 +495,7 @@ export class Jack { // recurse so we get the core config key we care about. this.#noNoFields(yes, val, s); if (this.#configSet[yes]?.type === 'boolean') { - throw new Error(`do not set '${s}', instead set '${yes}' as desired.`); + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); } } /** @@ -419,22 +504,48 @@ export class Jack { */ validate(o) { if (!o || typeof o !== 'object') { - throw new Error('Invalid config: not an object'); + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); } + const opts = o; for (const field in o) { - this.#noNoFields(field, o[field]); + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); const config = this.#configSet[field]; if (!config) { - throw new Error(`Unknown config option: ${field}`); + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); } - if (!isValidValue(o[field], config.type, !!config.multiple)) { - throw Object.assign(new Error(`Invalid value ${valueType(o[field])} for ${field}, expected ${valueType(config)}`), { - field, - value: o[field], + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, }); } - if (config.validate && !config.validate(o[field])) { - throw new Error(`Invalid config value for ${field}: ${o[field]}`); + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); } } } @@ -745,21 +856,21 @@ export class Jack { const { value } = field; const desc = value.description || ''; const mult = value.multiple ? 'Can be set multiple times' : ''; - const dmDelim = mult && (desc.includes('\n') ? '\n\n' : '\n'); - const text = normalize(desc + dmDelim + mult); + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); const hint = value.hint || - (value.type === 'number' - ? 'n' - : value.type === 'string' - ? field.name + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name : undefined); - const short = !value.short - ? '' - : value.type === 'boolean' - ? `-${value.short} ` + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` : `-${value.short}<${hint}> `; - const left = value.type === 'boolean' - ? `${short}--${field.name}` + const left = value.type === 'boolean' ? + `${short}--${field.name}` : `${short}--${field.name}=<${hint}>`; const row = { text, left, type: 'config' }; if (text.length > width - maxMax) { @@ -787,10 +898,11 @@ export class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description - ? { description: normalize(def.description) } + ...(def.description ? + { description: normalize(def.description) } : {}), ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, ])); @@ -804,12 +916,12 @@ export class Jack { } // Unwrap and un-indent, so we can wrap description // strings however makes them look nice in the code. -const normalize = (s, pre = false) => pre - ? // prepend a ZWSP to each line so cliui doesn't strip it. - s - .split('\n') - .map(l => `\u200b${l}`) - .join('\n') +const normalize = (s, pre = false) => pre ? + // prepend a ZWSP to each line so cliui doesn't strip it. + s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n') : s // remove single line breaks, except for lists .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) @@ -823,8 +935,8 @@ const normalize = (s, pre = false) => pre // normalize for markdown printing, remove leading spaces on lines const normalizeMarkdown = (s, pre = false) => { const n = normalize(s, pre).replace(/\\/g, '\\\\'); - return pre - ? `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` : n.replace(/\n +/g, '\n').trim(); }; const normalizeOneLine = (s, pre = false) => { diff --git a/node_modules/jackspeak/dist/esm/package.json b/node_modules/jackspeak/dist/esm/package.json index 7c34deb5837d8..3dbc1ca591c05 100644 --- a/node_modules/jackspeak/dist/esm/package.json +++ b/node_modules/jackspeak/dist/esm/package.json @@ -1 +1,3 @@ -{"type":"module"} \ No newline at end of file +{ + "type": "module" +} diff --git a/node_modules/jackspeak/dist/esm/parse-args.js b/node_modules/jackspeak/dist/esm/parse-args.js index 6dbb4d813ceeb..23389a5ddee00 100644 --- a/node_modules/jackspeak/dist/esm/parse-args.js +++ b/node_modules/jackspeak/dist/esm/parse-args.js @@ -12,15 +12,15 @@ const pvs = pv const [major = 0, minor = 0] = pvs; /* c8 ignore stop */ let { parseArgs: pa, } = util; -/* c8 ignore start */ +/* c8 ignore start - version specific */ if (!pa || major < 16 || (major === 18 && minor < 11) || (major === 16 && minor < 19)) { - /* c8 ignore stop */ // Ignore because we will clobber it for commonjs //@ts-ignore pa = (await import('@pkgjs/parseargs')).parseArgs; } +/* c8 ignore stop */ export const parseArgs = pa; //# sourceMappingURL=parse-args.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/package.json b/node_modules/jackspeak/package.json index e5e4752ae6636..1e2b441f688a2 100644 --- a/node_modules/jackspeak/package.json +++ b/node_modules/jackspeak/package.json @@ -1,6 +1,6 @@ { "name": "jackspeak", - "version": "2.3.6", + "version": "3.1.2", "description": "A very strict and proper argument parser.", "tshy": { "main": true, @@ -43,6 +43,7 @@ }, "license": "BlueOak-1.0.0", "prettier": { + "experimentalTernaries": true, "semi": false, "printWidth": 75, "tabWidth": 2, @@ -56,9 +57,9 @@ "devDependencies": { "@types/node": "^20.7.0", "@types/pkgjs__parseargs": "^0.10.1", - "prettier": "^2.8.6", - "tap": "^18.1.4", - "tshy": "^1.2.2", + "prettier": "^3.2.5", + "tap": "^18.8.0", + "tshy": "^1.14.0", "typedoc": "^0.25.1", "typescript": "^5.2.2" }, diff --git a/node_modules/minipass/dist/commonjs/package.json b/node_modules/minipass/dist/commonjs/package.json index 0292b9956f2e4..5bbefffbabee3 100644 --- a/node_modules/minipass/dist/commonjs/package.json +++ b/node_modules/minipass/dist/commonjs/package.json @@ -1 +1,3 @@ -{"type":"commonjs"} \ No newline at end of file +{ + "type": "commonjs" +} diff --git a/node_modules/minipass/dist/esm/package.json b/node_modules/minipass/dist/esm/package.json index 7c34deb5837d8..3dbc1ca591c05 100644 --- a/node_modules/minipass/dist/esm/package.json +++ b/node_modules/minipass/dist/esm/package.json @@ -1 +1,3 @@ -{"type":"module"} \ No newline at end of file +{ + "type": "module" +} diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json index f8b39b5259490..771969b028546 100644 --- a/node_modules/minipass/package.json +++ b/node_modules/minipass/package.json @@ -1,11 +1,12 @@ { "name": "minipass", - "version": "7.1.1", + "version": "7.1.2", "description": "minimal implementation of a PassThrough stream", "main": "./dist/commonjs/index.js", "types": "./dist/commonjs/index.d.ts", "type": "module", "tshy": { + "selfLink": false, "main": true, "exports": { "./package.json": "./package.json", @@ -57,11 +58,10 @@ "end-of-stream": "^1.4.0", "node-abort-controller": "^3.1.1", "prettier": "^2.6.2", - "tap": "^18.3.0", + "tap": "^19.0.0", "through2": "^2.0.3", - "tshy": "^1.2.2", - "typedoc": "^0.25.1", - "typescript": "^5.2.2" + "tshy": "^1.14.0", + "typedoc": "^0.25.1" }, "repository": "https://github.com/isaacs/minipass", "keywords": [ diff --git a/package-lock.json b/package-lock.json index b5cc68d502f1b..12aadafc5ed5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "cli-columns": "^4.0.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.15", + "glob": "^10.4.1", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.2", "ini": "^4.1.3", @@ -1231,6 +1231,7 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "inBundle": true, + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -1248,6 +1249,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "inBundle": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -1259,13 +1261,15 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "inBundle": true + "inBundle": true, + "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "inBundle": true, + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -1283,6 +1287,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "inBundle": true, + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -1974,6 +1979,7 @@ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "inBundle": true, + "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -2326,6 +2332,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "inBundle": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -4064,7 +4071,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "inBundle": true + "inBundle": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { "version": "1.4.767", @@ -5468,16 +5476,17 @@ "dev": true }, "node_modules/glob": { - "version": "10.3.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", - "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", "inBundle": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -6793,10 +6802,11 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "inBundle": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -8397,10 +8407,11 @@ } }, "node_modules/minipass": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", - "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "inBundle": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -11161,6 +11172,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "inBundle": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -11254,6 +11266,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "inBundle": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -14515,6 +14528,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "inBundle": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -14533,6 +14547,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "inBundle": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -14550,6 +14565,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "inBundle": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14565,6 +14581,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "inBundle": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -14576,13 +14593,15 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "inBundle": true + "inBundle": true, + "license": "MIT" }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "inBundle": true, + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -14600,6 +14619,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "inBundle": true, + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, diff --git a/package.json b/package.json index 3e7c9eddc302a..71a29c3139501 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "cli-columns": "^4.0.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.15", + "glob": "^10.4.1", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.2", "ini": "^4.1.3",