From 7fbb55944f11a1b2d950de479992c2cf3c49a574 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:04:38 -0800 Subject: [PATCH] fix: reduce number of dependencies (#455) This removes 5 dependencies from the dependency tree --- package-lock.json | 91 +++++++++++++++++++++++++++--------------- package.json | 4 +- src/node-file-trace.ts | 2 +- 3 files changed, 61 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index c9402bd0..8c305b7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,8 +18,8 @@ "estree-walker": "2.0.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "micromatch": "^4.0.8", "node-gyp-build": "^4.2.2", + "picomatch": "^4.0.2", "resolve-from": "^5.0.0" }, "bin": { @@ -39,8 +39,8 @@ "@types/estree": "^0.0.47", "@types/glob": "^7.1.2", "@types/graceful-fs": "^4.1.5", - "@types/micromatch": "^4.0.1", "@types/node": "^14.14.37", + "@types/picomatch": "^3.0.1", "@vercel/git-hooks": "^1.0.0", "@vercel/style-guide": "^5.2.0", "analytics-node": "^3.4.0-beta.1", @@ -4089,18 +4089,6 @@ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "license": "MIT" }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rushstack/eslint-patch": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz", @@ -4745,12 +4733,6 @@ "@types/node": "*" } }, - "node_modules/@types/braces": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/braces/-/braces-3.0.4.tgz", - "integrity": "sha512-0WR3b8eaISjEW7RpZnclONaLFDf7buaowRHdqLp4vLj54AsSAYWfh3DRbfiYJY9XDxMgx1B4sE1Afw2PGpuHOA==", - "dev": true - }, "node_modules/@types/bson": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.5.tgz", @@ -4975,15 +4957,6 @@ "@types/unist": "^2" } }, - "node_modules/@types/micromatch": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.6.tgz", - "integrity": "sha512-2eulCHWqjEpk9/vyic4tBhI8a9qQEl6DaK2n/sF7TweX9YESlypgKyhXMDGt4DAOy/jhLPvVrZc8pTDAMsplJA==", - "dev": true, - "dependencies": { - "@types/braces": "*" - } - }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -5024,6 +4997,13 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, + "node_modules/@types/picomatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-3.0.1.tgz", + "integrity": "sha512-1MRgzpzY0hOp9pW/kLRxeQhUWwil6gnrUYd3oEpeYBqp/FexhaCPv3F8LsYr47gtUU45fO2cm1dbwkSrHEo8Uw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", @@ -5932,6 +5912,19 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/apollo-cache-control": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.15.0.tgz", @@ -7759,6 +7752,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -13673,6 +13667,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -17028,6 +17023,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -18219,6 +18215,19 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-util/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/jest-validate": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", @@ -20931,6 +20940,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -20939,6 +20949,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/microtime": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.1.1.tgz", @@ -23765,11 +23788,12 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -29698,6 +29722,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, diff --git a/package.json b/package.json index 528df083..0fd54a05 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "estree-walker": "2.0.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "micromatch": "^4.0.8", "node-gyp-build": "^4.2.2", + "picomatch": "^4.0.2", "resolve-from": "^5.0.0" }, "devDependencies": { @@ -49,8 +49,8 @@ "@types/estree": "^0.0.47", "@types/glob": "^7.1.2", "@types/graceful-fs": "^4.1.5", - "@types/micromatch": "^4.0.1", "@types/node": "^14.14.37", + "@types/picomatch": "^3.0.1", "@vercel/git-hooks": "^1.0.0", "@vercel/style-guide": "^5.2.0", "analytics-node": "^3.4.0-beta.1", diff --git a/src/node-file-trace.ts b/src/node-file-trace.ts index 597cbffd..fae94c9f 100644 --- a/src/node-file-trace.ts +++ b/src/node-file-trace.ts @@ -7,7 +7,7 @@ import { import { basename, dirname, extname, join, relative, resolve, sep } from 'path'; import analyze, { AnalyzeResult } from './analyze'; import resolveDependency, { NotFoundError } from './resolve-dependency'; -import { isMatch } from 'micromatch'; +import { isMatch } from 'picomatch'; import { sharedLibEmit } from './utils/sharedlib-emit'; import { CachedFileSystem } from './fs';