diff --git a/node_modules/glob/dist/cjs/package.json b/node_modules/glob/dist/cjs/package.json deleted file mode 100644 index c15df94a3582b..0000000000000 --- a/node_modules/glob/dist/cjs/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": "10.3.3", - "type": "commonjs" -} diff --git a/node_modules/glob/dist/cjs/src/glob.js b/node_modules/glob/dist/commonjs/glob.js similarity index 96% rename from node_modules/glob/dist/cjs/src/glob.js rename to node_modules/glob/dist/commonjs/glob.js index eb37c6b9a6601..5e37335c4426f 100644 --- a/node_modules/glob/dist/cjs/src/glob.js +++ b/node_modules/glob/dist/commonjs/glob.js @@ -162,7 +162,12 @@ class Glob { return set; }, [[], []]); this.patterns = matchSet.map((set, i) => { - return new pattern_js_1.Pattern(set, globParts[i], 0, this.platform); + const g = globParts[i]; + /* c8 ignore start */ + if (!g) + throw new Error('invalid pattern object'); + /* c8 ignore stop */ + return new pattern_js_1.Pattern(set, g, 0, this.platform); }); } async walk() { diff --git a/node_modules/glob/dist/cjs/src/has-magic.js b/node_modules/glob/dist/commonjs/has-magic.js similarity index 100% rename from node_modules/glob/dist/cjs/src/has-magic.js rename to node_modules/glob/dist/commonjs/has-magic.js diff --git a/node_modules/glob/dist/cjs/src/ignore.js b/node_modules/glob/dist/commonjs/ignore.js similarity index 94% rename from node_modules/glob/dist/cjs/src/ignore.js rename to node_modules/glob/dist/commonjs/ignore.js index 0cbcca335e1cc..6cffb49f8ed27 100644 --- a/node_modules/glob/dist/cjs/src/ignore.js +++ b/node_modules/glob/dist/commonjs/ignore.js @@ -53,6 +53,11 @@ class Ignore { 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'); + } + /* 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] === '**'; @@ -94,7 +99,7 @@ class Ignore { } for (const m of this.absoluteChildren) { if (m.match(fullpath)) - true; + return true; } return false; } diff --git a/node_modules/glob/dist/cjs/src/index.js b/node_modules/glob/dist/commonjs/index.js similarity index 100% rename from node_modules/glob/dist/cjs/src/index.js rename to node_modules/glob/dist/commonjs/index.js diff --git a/node_modules/glob/dist/commonjs/package.json b/node_modules/glob/dist/commonjs/package.json new file mode 100644 index 0000000000000..0292b9956f2e4 --- /dev/null +++ b/node_modules/glob/dist/commonjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/node_modules/glob/dist/cjs/src/pattern.js b/node_modules/glob/dist/commonjs/pattern.js similarity index 100% rename from node_modules/glob/dist/cjs/src/pattern.js rename to node_modules/glob/dist/commonjs/pattern.js diff --git a/node_modules/glob/dist/cjs/src/processor.js b/node_modules/glob/dist/commonjs/processor.js similarity index 95% rename from node_modules/glob/dist/cjs/src/processor.js rename to node_modules/glob/dist/commonjs/processor.js index bd067e9b9033d..7d30a3b665000 100644 --- a/node_modules/glob/dist/cjs/src/processor.js +++ b/node_modules/glob/dist/commonjs/processor.js @@ -138,9 +138,6 @@ class Processor { while (typeof (p = pattern.pattern()) === 'string' && (rest = pattern.rest())) { const c = t.resolve(p); - // we can be reasonably sure that .. is a readable dir - if (c.isUnknown() && p !== '..') - break; t = c; pattern = rest; changed = true; @@ -156,14 +153,10 @@ class Processor { // more strings for an unknown entry, // or a pattern starting with magic, mounted on t. if (typeof p === 'string') { - // must be final entry - if (!rest) { - const ifDir = p === '..' || p === '' || p === '.'; - this.matches.add(t.resolve(p), absolute, ifDir); - } - else { - this.subwalks.add(t, pattern); - } + // must not be final entry, otherwise we would have + // concatenated it earlier. + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); continue; } else if (p === minimatch_1.GLOBSTAR) { diff --git a/node_modules/glob/dist/cjs/src/walker.js b/node_modules/glob/dist/commonjs/walker.js similarity index 100% rename from node_modules/glob/dist/cjs/src/walker.js rename to node_modules/glob/dist/commonjs/walker.js diff --git a/node_modules/glob/dist/esm/bin.d.mts b/node_modules/glob/dist/esm/bin.d.mts new file mode 100644 index 0000000000000..77298e4770817 --- /dev/null +++ b/node_modules/glob/dist/esm/bin.d.mts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=bin.d.mts.map \ No newline at end of file diff --git a/node_modules/glob/dist/cjs/src/bin.js b/node_modules/glob/dist/esm/bin.mjs similarity index 91% rename from node_modules/glob/dist/cjs/src/bin.js rename to node_modules/glob/dist/esm/bin.mjs index 4a8a88f2734d2..9d57d4a943b26 100755 --- a/node_modules/glob/dist/cjs/src/bin.js +++ b/node_modules/glob/dist/esm/bin.mjs @@ -1,16 +1,19 @@ #!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const foreground_child_1 = require("foreground-child"); -const fs_1 = require("fs"); -const jackspeak_1 = require("jackspeak"); -const package_json_1 = require("../package.json"); -const index_js_1 = require("./index.js"); -const j = (0, jackspeak_1.jack)({ +import { foregroundChild } from 'foreground-child'; +import { existsSync } from 'fs'; +import { readFile } from 'fs/promises'; +import { jack } from 'jackspeak'; +import { join } from 'path'; +import { fileURLToPath } from 'url'; +import { globStream } from './index.js'; +/* c8 ignore start */ +const { version } = JSON.parse(await readFile(fileURLToPath(new URL('../../package.json', import.meta.url)), 'utf8').catch(() => readFile(fileURLToPath(new URL('../../package.json', import.meta.url)), 'utf8'))); +/* c8 ignore stop */ +const j = jack({ usage: 'glob [options] [ [ ...]]', }) .description(` - Glob v${package_json_1.version} + Glob v${version} Expand the positional glob expression arguments into any matching file system paths found. @@ -228,9 +231,11 @@ try { positionals.push(values.default); const patterns = values.all ? positionals - : positionals.filter(p => !(0, fs_1.existsSync)(p)); - const matches = values.all ? [] : positionals.filter(p => (0, fs_1.existsSync)(p)); - const stream = (0, index_js_1.globStream)(patterns, { + : 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, cwd: values.cwd, dot: values.dot, @@ -259,7 +264,7 @@ try { } else { stream.on('data', f => matches.push(f)); - stream.on('end', () => (0, foreground_child_1.foregroundChild)(cmd, matches, { shell: true })); + stream.on('end', () => foregroundChild(cmd, matches, { shell: true })); } } catch (e) { @@ -267,4 +272,4 @@ catch (e) { console.error(e instanceof Error ? e.message : String(e)); process.exit(1); } -//# sourceMappingURL=bin.js.map \ No newline at end of file +//# sourceMappingURL=bin.mjs.map \ No newline at end of file diff --git a/node_modules/glob/dist/mjs/glob.js b/node_modules/glob/dist/esm/glob.js similarity index 97% rename from node_modules/glob/dist/mjs/glob.js rename to node_modules/glob/dist/esm/glob.js index 8ff26154427be..2a2b15d3685b8 100644 --- a/node_modules/glob/dist/mjs/glob.js +++ b/node_modules/glob/dist/esm/glob.js @@ -159,7 +159,12 @@ export class Glob { return set; }, [[], []]); this.patterns = matchSet.map((set, i) => { - return new Pattern(set, globParts[i], 0, this.platform); + const g = globParts[i]; + /* c8 ignore start */ + if (!g) + throw new Error('invalid pattern object'); + /* c8 ignore stop */ + return new Pattern(set, g, 0, this.platform); }); } async walk() { diff --git a/node_modules/glob/dist/mjs/has-magic.js b/node_modules/glob/dist/esm/has-magic.js similarity index 100% rename from node_modules/glob/dist/mjs/has-magic.js rename to node_modules/glob/dist/esm/has-magic.js diff --git a/node_modules/glob/dist/mjs/ignore.js b/node_modules/glob/dist/esm/ignore.js similarity index 93% rename from node_modules/glob/dist/mjs/ignore.js rename to node_modules/glob/dist/esm/ignore.js index 2dbaa16a11460..e8cbaf96b3a80 100644 --- a/node_modules/glob/dist/mjs/ignore.js +++ b/node_modules/glob/dist/esm/ignore.js @@ -50,6 +50,11 @@ export class Ignore { 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'); + } + /* c8 ignore stop */ const p = new Pattern(parsed, globParts, 0, platform); const m = new Minimatch(p.globString(), mmopts); const children = globParts[globParts.length - 1] === '**'; @@ -91,7 +96,7 @@ export class Ignore { } for (const m of this.absoluteChildren) { if (m.match(fullpath)) - true; + return true; } return false; } diff --git a/node_modules/glob/dist/mjs/index.js b/node_modules/glob/dist/esm/index.js similarity index 100% rename from node_modules/glob/dist/mjs/index.js rename to node_modules/glob/dist/esm/index.js diff --git a/node_modules/glob/dist/esm/package.json b/node_modules/glob/dist/esm/package.json new file mode 100644 index 0000000000000..7c34deb5837d8 --- /dev/null +++ b/node_modules/glob/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/node_modules/glob/dist/mjs/pattern.js b/node_modules/glob/dist/esm/pattern.js similarity index 100% rename from node_modules/glob/dist/mjs/pattern.js rename to node_modules/glob/dist/esm/pattern.js diff --git a/node_modules/glob/dist/mjs/processor.js b/node_modules/glob/dist/esm/processor.js similarity index 95% rename from node_modules/glob/dist/mjs/processor.js rename to node_modules/glob/dist/esm/processor.js index dd2228ad6761a..b5b2de2d314ca 100644 --- a/node_modules/glob/dist/mjs/processor.js +++ b/node_modules/glob/dist/esm/processor.js @@ -132,9 +132,6 @@ export class Processor { while (typeof (p = pattern.pattern()) === 'string' && (rest = pattern.rest())) { const c = t.resolve(p); - // we can be reasonably sure that .. is a readable dir - if (c.isUnknown() && p !== '..') - break; t = c; pattern = rest; changed = true; @@ -150,14 +147,10 @@ export class Processor { // more strings for an unknown entry, // or a pattern starting with magic, mounted on t. if (typeof p === 'string') { - // must be final entry - if (!rest) { - const ifDir = p === '..' || p === '' || p === '.'; - this.matches.add(t.resolve(p), absolute, ifDir); - } - else { - this.subwalks.add(t, pattern); - } + // must not be final entry, otherwise we would have + // concatenated it earlier. + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); continue; } else if (p === GLOBSTAR) { diff --git a/node_modules/glob/dist/mjs/walker.js b/node_modules/glob/dist/esm/walker.js similarity index 100% rename from node_modules/glob/dist/mjs/walker.js rename to node_modules/glob/dist/esm/walker.js diff --git a/node_modules/glob/dist/mjs/package.json b/node_modules/glob/dist/mjs/package.json deleted file mode 100644 index 5cc80943d565b..0000000000000 --- a/node_modules/glob/dist/mjs/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": "10.3.3", - "type": "module" -} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index 2d25985d2bbb5..ae0dfae17460b 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -2,27 +2,35 @@ "author": "Isaac Z. Schlueter (https://blog.izs.me/)", "name": "glob", "description": "the most correct and second fastest glob implementation in JavaScript", - "version": "10.3.3", - "bin": "./dist/cjs/src/bin.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" + "version": "10.3.10", + "type": "module", + "tshy": { + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } }, - "main": "./dist/cjs/src/index.js", - "module": "./dist/mjs/index.js", - "types": "./dist/mjs/index.d.ts", + "bin": "./dist/esm/bin.mjs", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", "exports": { + "./package.json": "./package.json", ".": { "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" }, "require": { - "types": "./dist/cjs/src/index.d.ts", - "default": "./dist/cjs/src/index.js" + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" } } }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, "files": [ "dist" ], @@ -30,14 +38,13 @@ "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash fixup.sh", + "prepare": "tshy", "pretest": "npm run prepare", "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", + "test": "tap", + "snap": "tap", "format": "prettier --write . --loglevel warn", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts", @@ -45,7 +52,7 @@ "bench": "bash benchmark.sh", "preprof": "npm run prepare", "prof": "bash prof.sh", - "benchclean": "node benchclean.js" + "benchclean": "node benchclean.cjs" }, "prettier": { "semi": false, @@ -60,33 +67,25 @@ }, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "path-scurry": "^1.10.1" }, "devDependencies": { "@types/node": "^20.3.2", - "@types/tap": "^15.0.7", - "c8": "^7.12.0", "memfs": "^3.4.13", - "mkdirp": "^2.1.4", + "mkdirp": "^3.0.1", "prettier": "^2.8.3", - "rimraf": "^4.1.3", - "tap": "^16.3.4", - "ts-node": "^10.9.1", - "typedoc": "^0.23.24", - "typescript": "^4.9.4" + "rimraf": "^5.0.1", + "sync-content": "^1.0.2", + "tap": "^18.1.4", + "tshy": "^1.2.2", + "typedoc": "^0.25.1", + "typescript": "^5.2.2" }, "tap": { - "before": "test/00-setup.ts", - "coverage": false, - "node-arg": [ - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false + "before": "test/00-setup.ts" }, "license": "ISC", "funding": { diff --git a/node_modules/jackspeak/dist/cjs/package.json b/node_modules/jackspeak/dist/cjs/package.json deleted file mode 100644 index 5bbefffbabee3..0000000000000 --- a/node_modules/jackspeak/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/jackspeak/dist/cjs/index.js b/node_modules/jackspeak/dist/commonjs/index.js similarity index 81% rename from node_modules/jackspeak/dist/cjs/index.js rename to node_modules/jackspeak/dist/commonjs/index.js index f268e40e05afa..956d6a275c363 100644 --- a/node_modules/jackspeak/dist/cjs/index.js +++ b/node_modules/jackspeak/dist/commonjs/index.js @@ -42,7 +42,9 @@ const toEnvVal = (value, delim = '\n') => { return str; }; const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env.split(delim).map(v => fromEnvVal(v, type, false)) + ? env + ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] : type === 'string' ? env : type === 'boolean' @@ -62,7 +64,9 @@ const valueType = (v) => typeof v === 'string' : Array.isArray(v) ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 ? types[0] : `(${types.join('|')})`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' + ? types[0] + : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { if (!Array.isArray(v)) @@ -190,6 +194,11 @@ const toParseArgsOptionsConfig = (options) => { const c = {}; for (const longOption in options) { const config = options[longOption]; + /* c8 ignore start */ + if (!config) { + throw new Error('config must be an object: ' + longOption); + } + /* c8 ignore start */ if ((0, exports.isConfigOption)(config, 'number', true)) { c[longOption] = { type: 'string', @@ -214,8 +223,9 @@ const toParseArgsOptionsConfig = (options) => { default: conf.default, }; } + const clo = c[longOption]; if (typeof config.short === 'string') { - c[longOption].short = config.short; + clo.short = config.short; } if (config.type === 'boolean' && !longOption.startsWith('no-') && @@ -243,6 +253,7 @@ class Jack { #envPrefix; #allowPositionals; #usage; + #usageMarkdown; constructor(options = {}) { this.#options = options; this.#allowPositionals = options.allowPositionals !== false; @@ -270,6 +281,12 @@ class Jack { } 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); + } + /* c8 ignore stop */ my.default = value; } return this; @@ -365,8 +382,9 @@ class Jack { } if (my.multiple) { const pv = p.values; - pv[token.name] = pv[token.name] ?? []; - pv[token.name].push(value); + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); } else { const pv = p.values; @@ -381,7 +399,7 @@ class Jack { } } for (const [field, value] of Object.entries(p.values)) { - const valid = this.#configSet[field].validate; + const valid = this.#configSet[field]?.validate; if (valid && !valid(value)) { throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); } @@ -389,6 +407,20 @@ class Jack { this.#writeEnv(p); return p; } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // 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.`); + } + } /** * Validate that any arbitrary object is a valid configuration `values` * object. Useful when loading config files or other sources. @@ -398,6 +430,7 @@ class Jack { throw new Error('Invalid config: not an object'); } for (const field in o) { + this.#noNoFields(field, o[field]); const config = this.#configSet[field]; if (!config) { throw new Error(`Unknown config option: ${field}`); @@ -418,17 +451,17 @@ class Jack { return; for (const [field, value] of Object.entries(p.values)) { const my = this.#configSet[field]; - this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my.delim); + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); } } /** * Add a heading to the usage output banner */ - heading(text, level) { + heading(text, level, { pre = false } = {}) { if (level === undefined) { level = this.#fields.some(r => isHeading(r)) ? 2 : 1; } - this.#fields.push({ type: 'heading', text, level }); + this.#fields.push({ type: 'heading', text, level, pre }); return this; } /** @@ -555,7 +588,7 @@ class Jack { }); } else { - const cmd = (0, node_path_1.basename)(process.argv[1]); + const cmd = (0, node_path_1.basename)(String(process.argv[1])); const shortFlags = []; const shorts = []; const flags = []; @@ -586,12 +619,122 @@ class Jack { } ui.div({ padding: [0, 0, 0, 0], text: '' }); const maybeDesc = this.#fields[start]; - if (isDescription(maybeDesc)) { + if (maybeDesc && isDescription(maybeDesc)) { const print = normalize(maybeDesc.text, maybeDesc.pre); start++; ui.div({ padding: [0, 0, 0, 0], text: print }); ui.div({ padding: [0, 0, 0, 0], text: '' }); } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = (0, node_path_1.basename)(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { // turn each config type into a row, and figure out the width of the // left hand indentation for the option descriptions. let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); @@ -639,43 +782,7 @@ class Jack { } rows.push(row); } - // every heading/description after the first gets indented by 2 - // extra spaces. - for (const row of rows) { - if (row.left) { - // If the row is too long, don't wrap it - // Bump the right-hand side down a line to make room - const configIndent = indent(Math.max(headingLevel, 2)); - if (row.left.length > maxWidth - 2) { - ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); - ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); - } - else { - ui.div({ - text: row.left, - padding: [0, 1, 0, configIndent], - width: maxWidth, - }, { padding: [0, 0, 0, 0], text: row.text }); - } - if (row.skipLine) { - ui.div({ padding: [0, 0, 0, 0], text: '' }); - } - } - else { - if (isHeading(row)) { - const { level } = row; - headingLevel = level; - // only h1 and h2 have bottom padding - // h3-h6 do not - const b = level <= 2 ? 1 : 0; - ui.div({ ...row, padding: [0, 0, b, indent(level)] }); - } - else { - ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); - } - } - } - return (this.#usage = ui.toString()); + return { rows, maxWidth }; } /** * Return the configuration options as a plain object @@ -688,7 +795,9 @@ class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description ? { description: def.description } : {}), + ...(def.description + ? { description: normalize(def.description) } + : {}), ...(def.validate ? { validate: def.validate } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, @@ -705,8 +814,11 @@ 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') + ? // 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}`) @@ -714,7 +826,22 @@ const normalize = (s, pre = false) => pre .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') // two line breaks are enough .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim(); +// 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\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') .trim(); + return pre ? `\`${n}\`` : n; +}; /** * Main entry point. Create and return a {@link Jack} object. */ diff --git a/node_modules/jackspeak/dist/commonjs/package.json b/node_modules/jackspeak/dist/commonjs/package.json new file mode 100644 index 0000000000000..0292b9956f2e4 --- /dev/null +++ b/node_modules/jackspeak/dist/commonjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/cjs/parse-args.js b/node_modules/jackspeak/dist/commonjs/parse-args.js similarity index 84% rename from node_modules/jackspeak/dist/cjs/parse-args.js rename to node_modules/jackspeak/dist/commonjs/parse-args.js index 471b4d97dc996..ab628be8c9d5c 100644 --- a/node_modules/jackspeak/dist/cjs/parse-args.js +++ b/node_modules/jackspeak/dist/commonjs/parse-args.js @@ -34,9 +34,17 @@ const pvs = pv .replace(/^v/, '') .split('.') .map(s => parseInt(s, 10)); +/* c8 ignore start */ +const [major = 0, minor = 0] = pvs; +/* c8 ignore stop */ let { parseArgs: pa } = util; -if (!pa || pvs[0] > 18 || pvs[1] < 11) { +/* c8 ignore start */ +if (!pa || + major < 16 || + (major === 18 && minor < 11) || + (major === 16 && minor < 19)) { + /* c8 ignore stop */ pa = require('@pkgjs/parseargs').parseArgs; } exports.parseArgs = pa; -//# sourceMappingURL=parse-args-cjs.js.map \ No newline at end of file +//# sourceMappingURL=parse-args-cjs.cjs.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/mjs/index.js b/node_modules/jackspeak/dist/esm/index.js similarity index 81% rename from node_modules/jackspeak/dist/mjs/index.js rename to node_modules/jackspeak/dist/esm/index.js index a3e2b6bab7cbb..9914049f89026 100644 --- a/node_modules/jackspeak/dist/mjs/index.js +++ b/node_modules/jackspeak/dist/esm/index.js @@ -36,7 +36,9 @@ const toEnvVal = (value, delim = '\n') => { return str; }; const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env.split(delim).map(v => fromEnvVal(v, type, false)) + ? env + ? env.split(delim).map(v => fromEnvVal(v, type, false)) + : [] : type === 'string' ? env : type === 'boolean' @@ -55,7 +57,9 @@ const valueType = (v) => typeof v === 'string' : Array.isArray(v) ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 ? types[0] : `(${types.join('|')})`; +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' + ? types[0] + : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { if (!Array.isArray(v)) @@ -182,6 +186,11 @@ const toParseArgsOptionsConfig = (options) => { const c = {}; for (const longOption in options) { const config = options[longOption]; + /* c8 ignore start */ + if (!config) { + throw new Error('config must be an object: ' + longOption); + } + /* c8 ignore start */ if (isConfigOption(config, 'number', true)) { c[longOption] = { type: 'string', @@ -206,8 +215,9 @@ const toParseArgsOptionsConfig = (options) => { default: conf.default, }; } + const clo = c[longOption]; if (typeof config.short === 'string') { - c[longOption].short = config.short; + clo.short = config.short; } if (config.type === 'boolean' && !longOption.startsWith('no-') && @@ -235,6 +245,7 @@ export class Jack { #envPrefix; #allowPositionals; #usage; + #usageMarkdown; constructor(options = {}) { this.#options = options; this.#allowPositionals = options.allowPositionals !== false; @@ -262,6 +273,12 @@ export class Jack { } 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); + } + /* c8 ignore stop */ my.default = value; } return this; @@ -357,8 +374,9 @@ export class Jack { } if (my.multiple) { const pv = p.values; - pv[token.name] = pv[token.name] ?? []; - pv[token.name].push(value); + const tn = pv[token.name] ?? []; + pv[token.name] = tn; + tn.push(value); } else { const pv = p.values; @@ -373,7 +391,7 @@ export class Jack { } } for (const [field, value] of Object.entries(p.values)) { - const valid = this.#configSet[field].validate; + const valid = this.#configSet[field]?.validate; if (valid && !valid(value)) { throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); } @@ -381,6 +399,20 @@ export class Jack { this.#writeEnv(p); return p; } + /** + * do not set fields as 'no-foo' if 'foo' exists and both are bools + * just set foo. + */ + #noNoFields(f, val, s = f) { + if (!f.startsWith('no-') || typeof val !== 'boolean') + return; + const yes = f.substring('no-'.length); + // 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.`); + } + } /** * Validate that any arbitrary object is a valid configuration `values` * object. Useful when loading config files or other sources. @@ -390,6 +422,7 @@ export class Jack { throw new Error('Invalid config: not an object'); } for (const field in o) { + this.#noNoFields(field, o[field]); const config = this.#configSet[field]; if (!config) { throw new Error(`Unknown config option: ${field}`); @@ -410,17 +443,17 @@ export class Jack { return; for (const [field, value] of Object.entries(p.values)) { const my = this.#configSet[field]; - this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my.delim); + this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim); } } /** * Add a heading to the usage output banner */ - heading(text, level) { + heading(text, level, { pre = false } = {}) { if (level === undefined) { level = this.#fields.some(r => isHeading(r)) ? 2 : 1; } - this.#fields.push({ type: 'heading', text, level }); + this.#fields.push({ type: 'heading', text, level, pre }); return this; } /** @@ -547,7 +580,7 @@ export class Jack { }); } else { - const cmd = basename(process.argv[1]); + const cmd = basename(String(process.argv[1])); const shortFlags = []; const shorts = []; const flags = []; @@ -578,12 +611,122 @@ export class Jack { } ui.div({ padding: [0, 0, 0, 0], text: '' }); const maybeDesc = this.#fields[start]; - if (isDescription(maybeDesc)) { + if (maybeDesc && isDescription(maybeDesc)) { const print = normalize(maybeDesc.text, maybeDesc.pre); start++; ui.div({ padding: [0, 0, 0, 0], text: print }); ui.div({ padding: [0, 0, 0, 0], text: '' }); } + const { rows, maxWidth } = this.#usageRows(start); + // every heading/description after the first gets indented by 2 + // extra spaces. + for (const row of rows) { + if (row.left) { + // If the row is too long, don't wrap it + // Bump the right-hand side down a line to make room + const configIndent = indent(Math.max(headingLevel, 2)); + if (row.left.length > maxWidth - 3) { + ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); + ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); + } + else { + ui.div({ + text: row.left, + padding: [0, 1, 0, configIndent], + width: maxWidth, + }, { padding: [0, 0, 0, 0], text: row.text }); + } + if (row.skipLine) { + ui.div({ padding: [0, 0, 0, 0], text: '' }); + } + } + else { + if (isHeading(row)) { + const { level } = row; + headingLevel = level; + // only h1 and h2 have bottom padding + // h3-h6 do not + const b = level <= 2 ? 1 : 0; + ui.div({ ...row, padding: [0, 0, b, indent(level)] }); + } + else { + ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); + } + } + } + return (this.#usage = ui.toString()); + } + /** + * Return the usage banner markdown for the given configuration + */ + usageMarkdown() { + if (this.#usageMarkdown) + return this.#usageMarkdown; + const out = []; + let headingLevel = 1; + const first = this.#fields[0]; + let start = first?.type === 'heading' ? 1 : 0; + if (first?.type === 'heading') { + out.push(`# ${normalizeOneLine(first.text)}`); + } + out.push('Usage:'); + if (this.#options.usage) { + out.push(normalizeMarkdown(this.#options.usage, true)); + } + else { + const cmd = basename(String(process.argv[1])); + const shortFlags = []; + const shorts = []; + const flags = []; + const opts = []; + for (const [field, config] of Object.entries(this.#configSet)) { + if (config.short) { + if (config.type === 'boolean') + shortFlags.push(config.short); + else + shorts.push([config.short, config.hint || field]); + } + else { + if (config.type === 'boolean') + flags.push(field); + else + opts.push([field, config.hint || field]); + } + } + const sf = shortFlags.length ? ' -' + shortFlags.join('') : ''; + const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const lf = flags.map(k => ` --${k}`).join(''); + const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join(''); + const usage = `${cmd}${sf}${so}${lf}${lo}`.trim(); + out.push(normalizeMarkdown(usage, true)); + } + const maybeDesc = this.#fields[start]; + if (maybeDesc && isDescription(maybeDesc)) { + out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre)); + start++; + } + const { rows } = this.#usageRows(start); + // heading level in markdown is number of # ahead of text + for (const row of rows) { + if (row.left) { + out.push('#'.repeat(headingLevel + 1) + + ' ' + + normalizeOneLine(row.left, true)); + if (row.text) + out.push(normalizeMarkdown(row.text)); + } + else if (isHeading(row)) { + const { level } = row; + headingLevel = level; + out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`); + } + else { + out.push(normalizeMarkdown(row.text, !!row.pre)); + } + } + return (this.#usageMarkdown = out.join('\n\n') + '\n'); + } + #usageRows(start) { // turn each config type into a row, and figure out the width of the // left hand indentation for the option descriptions. let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3))); @@ -631,43 +774,7 @@ export class Jack { } rows.push(row); } - // every heading/description after the first gets indented by 2 - // extra spaces. - for (const row of rows) { - if (row.left) { - // If the row is too long, don't wrap it - // Bump the right-hand side down a line to make room - const configIndent = indent(Math.max(headingLevel, 2)); - if (row.left.length > maxWidth - 2) { - ui.div({ text: row.left, padding: [0, 0, 0, configIndent] }); - ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] }); - } - else { - ui.div({ - text: row.left, - padding: [0, 1, 0, configIndent], - width: maxWidth, - }, { padding: [0, 0, 0, 0], text: row.text }); - } - if (row.skipLine) { - ui.div({ padding: [0, 0, 0, 0], text: '' }); - } - } - else { - if (isHeading(row)) { - const { level } = row; - headingLevel = level; - // only h1 and h2 have bottom padding - // h3-h6 do not - const b = level <= 2 ? 1 : 0; - ui.div({ ...row, padding: [0, 0, b, indent(level)] }); - } - else { - ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] }); - } - } - } - return (this.#usage = ui.toString()); + return { rows, maxWidth }; } /** * Return the configuration options as a plain object @@ -680,7 +787,9 @@ export class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description ? { description: def.description } : {}), + ...(def.description + ? { description: normalize(def.description) } + : {}), ...(def.validate ? { validate: def.validate } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, @@ -696,8 +805,11 @@ 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') + ? // 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}`) @@ -705,7 +817,22 @@ const normalize = (s, pre = false) => pre .replace(/([^\n])[ \t]+([^\n])/g, '$1 $2') // two line breaks are enough .replace(/\n{3,}/g, '\n\n') + // remove any spaces at the start of a line + .replace(/\n[ \t]+/g, '\n') + .trim(); +// 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\`\`\`` + : n.replace(/\n +/g, '\n').trim(); +}; +const normalizeOneLine = (s, pre = false) => { + const n = normalize(s, pre) + .replace(/[\s\u200b]+/g, ' ') .trim(); + return pre ? `\`${n}\`` : n; +}; /** * Main entry point. Create and return a {@link Jack} object. */ diff --git a/node_modules/jackspeak/dist/esm/package.json b/node_modules/jackspeak/dist/esm/package.json new file mode 100644 index 0000000000000..7c34deb5837d8 --- /dev/null +++ b/node_modules/jackspeak/dist/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/node_modules/jackspeak/dist/esm/parse-args.js b/node_modules/jackspeak/dist/esm/parse-args.js new file mode 100644 index 0000000000000..6dbb4d813ceeb --- /dev/null +++ b/node_modules/jackspeak/dist/esm/parse-args.js @@ -0,0 +1,26 @@ +import * as util from 'util'; +const pv = typeof process === 'object' && + !!process && + typeof process.version === 'string' + ? process.version + : 'v0.0.0'; +const pvs = pv + .replace(/^v/, '') + .split('.') + .map(s => parseInt(s, 10)); +/* c8 ignore start */ +const [major = 0, minor = 0] = pvs; +/* c8 ignore stop */ +let { parseArgs: pa, } = util; +/* c8 ignore start */ +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; +} +export const parseArgs = pa; +//# sourceMappingURL=parse-args.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/dist/mjs/package.json b/node_modules/jackspeak/dist/mjs/package.json deleted file mode 100644 index 3dbc1ca591c05..0000000000000 --- a/node_modules/jackspeak/dist/mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/node_modules/jackspeak/dist/mjs/parse-args.js b/node_modules/jackspeak/dist/mjs/parse-args.js deleted file mode 100644 index 24ec319d38199..0000000000000 --- a/node_modules/jackspeak/dist/mjs/parse-args.js +++ /dev/null @@ -1,19 +0,0 @@ -// polyfill that overwrites parse-args.ts in the mjs build -import { createRequire } from 'module'; -import * as util from 'util'; -const pv = typeof process === 'object' && - !!process && - typeof process.version === 'string' - ? process.version - : 'v0.0.0'; -const pvs = pv - .replace(/^v/, '') - .split('.') - .map(s => parseInt(s, 10)); -let { parseArgs: pa } = util; -if (!pa || pvs[0] > 18 || pvs[1] < 11) { - const require = createRequire(import.meta.url); - pa = require('@pkgjs/parseargs').parseArgs; -} -export const parseArgs = pa; -//# sourceMappingURL=parse-args-esm.js.map \ No newline at end of file diff --git a/node_modules/jackspeak/package.json b/node_modules/jackspeak/package.json index afaa43e20ae4a..e5e4752ae6636 100644 --- a/node_modules/jackspeak/package.json +++ b/node_modules/jackspeak/package.json @@ -1,19 +1,27 @@ { "name": "jackspeak", - "version": "2.2.1", + "version": "2.3.6", "description": "A very strict and proper argument parser.", - "main": "./dist/cjs/index.js", - "module": "./dist/mjs/index.js", - "types": "./dist/mjs/index.js", + "tshy": { + "main": true, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.js" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", "exports": { + "./package.json": "./package.json", ".": { "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" }, "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" } } }, @@ -25,13 +33,13 @@ "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh", + "prepare": "tshy", "pretest": "npm run prepare", "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", + "test": "tap", + "snap": "tap", "format": "prettier --write . --loglevel warn", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" }, "license": "BlueOak-1.0.0", "prettier": { @@ -45,26 +53,14 @@ "arrowParens": "avoid", "endOfLine": "lf" }, - "tap": { - "coverage": false, - "node-arg": [ - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false - }, "devDependencies": { - "@types/node": "^18.15.11", - "@types/pkgjs__parseargs": "^0.10.0", - "@types/tap": "^15.0.8", - "c8": "^7.13.0", - "eslint-config-prettier": "^8.8.0", + "@types/node": "^20.7.0", + "@types/pkgjs__parseargs": "^0.10.1", "prettier": "^2.8.6", - "tap": "^16.3.4", - "ts-node": "^10.9.1", - "typedoc": "^0.23.28", - "typescript": "^5.0.2" + "tap": "^18.1.4", + "tshy": "^1.2.2", + "typedoc": "^0.25.1", + "typescript": "^5.2.2" }, "dependencies": { "@isaacs/cliui": "^8.0.2" diff --git a/package-lock.json b/package-lock.json index cdc10006ddd6b..12bc433f3c7a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -108,7 +108,7 @@ "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.3", + "glob": "^10.3.10", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.0", "ini": "^4.1.1", @@ -6685,19 +6685,19 @@ "dev": true }, "node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "inBundle": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "path-scurry": "^1.10.1" }, "bin": { - "glob": "dist/cjs/src/bin.js" + "glob": "dist/esm/bin.mjs" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -7911,9 +7911,9 @@ } }, "node_modules/jackspeak": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "inBundle": true, "dependencies": { "@isaacs/cliui": "^8.0.2" diff --git a/package.json b/package.json index 824161a790795..ca843c76dbe42 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.3", + "glob": "^10.3.10", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.0", "ini": "^4.1.1",