From 601caba3bf98b4a03c0cd25dcb44f4a6485e6e51 Mon Sep 17 00:00:00 2001 From: Andrew Twydell Date: Mon, 23 Feb 2026 16:40:07 +0000 Subject: [PATCH] update minimatch dependency to v10 Signed-off-by: Andrew Twydell --- package-lock.json | 156 ++++++++++++++++------------------------------ package.json | 3 +- src/package.ts | 12 ++-- 3 files changed, 59 insertions(+), 112 deletions(-) diff --git a/package-lock.json b/package-lock.json index 352773b0..99f38a8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "leven": "^3.1.0", "markdown-it": "^14.1.0", "mime": "^1.3.4", - "minimatch": "^3.0.3", + "minimatch": "^10.2.2", "parse-semver": "^1.1.1", "read": "^1.0.7", "secretlint": "^10.1.2", @@ -49,7 +49,6 @@ "@types/hosted-git-info": "^3.0.2", "@types/markdown-it": "^0.0.2", "@types/mime": "^1", - "@types/minimatch": "^3.0.3", "@types/mocha": "^7.0.2", "@types/node": "^16.11.7", "@types/read": "^0.0.28", @@ -322,25 +321,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", - "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1024,12 +1004,6 @@ "integrity": "sha1-LPQpctCTHBBgx9X6Zif85r2Hby8= sha512-rek8twk9C58gHYqIrUlJsx8NQMhlxqHzln9Z9ODqiNgv3/s+ZwIrfr+djqzsnVM12xe9hL98iJ20lj2RvCBv6A==", "dev": true }, - "node_modules/@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0= sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, "node_modules/@types/mocha": { "version": "7.0.2", "resolved": "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz", @@ -1040,7 +1014,8 @@ "version": "16.18.96", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.96.tgz", "integrity": "sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", @@ -1432,7 +1407,8 @@ "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -1501,13 +1477,24 @@ "license": "BSD-2-Clause" }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/braces": { @@ -1754,11 +1741,6 @@ "node": ">=18" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -2429,20 +2411,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", - "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", - "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/globby": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", @@ -3163,14 +3131,18 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", + "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^5.0.2" }, "engines": { - "node": "*" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -4691,6 +4663,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5250,19 +5223,6 @@ "@jridgewell/trace-mapping": "0.3.9" } }, - "@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==" - }, - "@isaacs/brace-expansion": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", - "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", - "requires": { - "@isaacs/balanced-match": "^4.0.1" - } - }, "@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -5800,12 +5760,6 @@ "integrity": "sha1-LPQpctCTHBBgx9X6Zif85r2Hby8= sha512-rek8twk9C58gHYqIrUlJsx8NQMhlxqHzln9Z9ODqiNgv3/s+ZwIrfr+djqzsnVM12xe9hL98iJ20lj2RvCBv6A==", "dev": true }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0= sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, "@types/mocha": { "version": "7.0.2", "resolved": "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz", @@ -5816,7 +5770,8 @@ "version": "16.18.96", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.96.tgz", "integrity": "sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ==", - "dev": true + "dev": true, + "peer": true }, "@types/normalize-package-data": { "version": "2.4.4", @@ -6099,7 +6054,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base64-js": { "version": "1.5.1", @@ -6143,12 +6099,18 @@ "integrity": "sha512-rJKn5ooC9u8q13IMCrW0RSp31pxBCHE3y9V/tp3TdWSLf8Em3p6Di4NBpfzbJge9YjjFEsD0RtFEjtvHL5VyEA==" }, "brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^4.0.2" + }, + "dependencies": { + "balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==" + } } }, "braces": { @@ -6314,11 +6276,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==" }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -6780,16 +6737,6 @@ "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^2.0.0" - }, - "dependencies": { - "minimatch": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", - "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", - "requires": { - "@isaacs/brace-expansion": "^5.0.0" - } - } } }, "glob-parent": { @@ -7317,11 +7264,11 @@ "optional": true }, "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", + "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^5.0.2" } }, "minimist": { @@ -8370,7 +8317,8 @@ "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", - "dev": true + "dev": true, + "peer": true }, "uc.micro": { "version": "2.1.0", diff --git a/package.json b/package.json index 197209d9..04ff2445 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "leven": "^3.1.0", "markdown-it": "^14.1.0", "mime": "^1.3.4", - "minimatch": "^3.0.3", + "minimatch": "^10.2.2", "parse-semver": "^1.1.1", "read": "^1.0.7", "secretlint": "^10.1.2", @@ -76,7 +76,6 @@ "@types/hosted-git-info": "^3.0.2", "@types/markdown-it": "^0.0.2", "@types/mime": "^1", - "@types/minimatch": "^3.0.3", "@types/mocha": "^7.0.2", "@types/node": "^16.11.7", "@types/read": "^0.0.28", diff --git a/src/package.ts b/src/package.ts index 2aad8818..a3bc4867 100644 --- a/src/package.ts +++ b/src/package.ts @@ -7,7 +7,7 @@ import { ExtensionKind, ManifestPackage, UnverifiedManifest } from './manifest'; import { ITranslations, patchNLS } from './nls'; import * as util from './util'; import { glob } from 'glob'; -import minimatch from 'minimatch'; +import { minimatch, MinimatchOptions } from 'minimatch'; import markdownit from 'markdown-it'; import * as cheerio from 'cheerio'; import * as url from 'url'; @@ -30,7 +30,7 @@ import * as jsonc from 'jsonc-parser'; import * as vsceSign from '@vscode/vsce-sign'; import { getRuleNameFromRuleId, lintFiles, lintText, prettyPrintLintResult } from './secretLint'; -const MinimatchOptions: minimatch.IOptions = { dot: true }; +const minimatchOptions: MinimatchOptions = { dot: true }; export interface IInMemoryFile { path: string; @@ -1758,8 +1758,8 @@ function collectFiles( .then(({ ignore, negate }) => files.filter( f => - !ignore.some(i => minimatch(f, i, MinimatchOptions)) || - negate.some(i => minimatch(f, i.substr(1), MinimatchOptions)) + !ignore.some(i => minimatch(f, i, minimatchOptions)) || + negate.some(i => minimatch(f, i.substr(1), minimatchOptions)) ) ) ); @@ -2097,13 +2097,13 @@ export async function printAndValidatePackagedFiles(files: IFile[], cwd: string, const unusedIncludePatterns = filesIncludePatterns.filter(includePattern => { let absoluteIncludePattern = includePattern.absolute; // Check if the pattern provided by the user matches any file in the package - if (localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, MinimatchOptions))) { + if (localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, minimatchOptions))) { return false; } // Check if the pattern provided by the user matches any folder in the package if (!/(^|\/)[^/]*\*[^/]*$/.test(absoluteIncludePattern)) { absoluteIncludePattern = (/\/$/.test(absoluteIncludePattern) ? `${absoluteIncludePattern}**` : `${absoluteIncludePattern}/**`); - return !localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, MinimatchOptions)); + return !localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, minimatchOptions)); } // Pattern does not match any file or folder return true;