From 485dfb0867c168e35bfac7f6c5093a7f643d7ff4 Mon Sep 17 00:00:00 2001 From: Alex Parish Date: Sun, 13 Oct 2024 16:05:24 +0100 Subject: [PATCH] Remove unnecessary fs-extra dependency --- packages/get-uri/package.json | 3 +- packages/get-uri/src/file.ts | 10 +-- pnpm-lock.yaml | 137 +++++++++++++++++++--------------- 3 files changed, 82 insertions(+), 68 deletions(-) diff --git a/packages/get-uri/package.json b/packages/get-uri/package.json index ff904b6e..a946ea4f 100644 --- a/packages/get-uri/package.json +++ b/packages/get-uri/package.json @@ -51,8 +51,7 @@ "dependencies": { "basic-ftp": "^5.0.2", "data-uri-to-buffer": "^6.0.2", - "debug": "^4.3.4", - "fs-extra": "^11.2.0" + "debug": "^4.3.4" }, "engines": { "node": ">= 14" diff --git a/packages/get-uri/src/file.ts b/packages/get-uri/src/file.ts index 292c3fe0..ebb62988 100644 --- a/packages/get-uri/src/file.ts +++ b/packages/get-uri/src/file.ts @@ -1,7 +1,6 @@ import { Readable } from 'stream'; import createDebug from 'debug'; -import { Stats, createReadStream } from 'fs'; -import { fstat, open } from 'fs-extra'; +import { Stats, createReadStream, promises as fsPromises } from 'fs'; import { GetUriProtocol } from './'; import NotFoundError from './notfound'; import NotModifiedError from './notmodified'; @@ -42,11 +41,10 @@ export const file: GetUriProtocol = async ( // `open()` first to get a file descriptor and ensure that the file // exists. - const fd = await open(filepath, flags, mode); + const fd = await fsPromises.open(filepath, flags, mode); - // Now `fstat()` to check the `mtime` and store the stat object for - // the cache. - const stat = await fstat(fd); + // Store the stat object for the cache. + const stat = await fd.stat(); // if a `cache` was provided, check if the file has not been modified if (cache && cache.stat && stat && isNotModified(cache.stat, stat)) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89f1af96..516d0266 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: .: @@ -9,10 +13,10 @@ importers: version: 2.26.2 '@typescript-eslint/eslint-plugin': specifier: ^5.59.1 - version: 5.60.1(@typescript-eslint/parser@5.60.1)(eslint@7.32.0) + version: 5.60.1(@typescript-eslint/parser@5.60.1)(eslint@7.32.0)(typescript@5.1.6) '@typescript-eslint/parser': specifier: ^5.59.1 - version: 5.60.1(eslint@7.32.0) + version: 5.60.1(eslint@7.32.0)(typescript@5.1.6) eslint: specifier: ^7.32.0 version: 7.32.0 @@ -58,7 +62,7 @@ importers: version: 29.5.0(@types/node@14.18.45) ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -82,7 +86,7 @@ importers: version: 29.5.0(@types/node@14.18.45) ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -122,7 +126,7 @@ importers: version: 29.5.0(@types/node@14.18.52) ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.1.6) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.1.6) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -141,9 +145,6 @@ importers: debug: specifier: ^4.3.4 version: 4.3.4 - fs-extra: - specifier: ^11.2.0 - version: 11.2.0 devDependencies: '@types/debug': specifier: ^4.1.7 @@ -174,7 +175,7 @@ importers: version: 1.2.2 ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.21.4)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -211,7 +212,7 @@ importers: version: link:../proxy ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -254,7 +255,7 @@ importers: version: link:../proxy ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -312,7 +313,7 @@ importers: version: 0.0.6 ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -346,7 +347,7 @@ importers: version: 29.5.0(@types/node@14.18.52) ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.1.6) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.1.6) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -386,7 +387,7 @@ importers: version: 29.5.0(@types/node@14.18.45) ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -453,7 +454,7 @@ importers: version: github.com/TooTallNate/socksv5/d937368b28e929396166d77a06d387a4a902bd51 ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -514,7 +515,7 @@ importers: version: github.com/TooTallNate/socksv5/d937368b28e929396166d77a06d387a4a902bd51 ts-jest: specifier: ^29.1.0 - version: 29.1.0(jest@29.5.0)(typescript@5.0.4) + version: 29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4) tsconfig: specifier: workspace:* version: link:../tsconfig @@ -1983,7 +1984,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.60.1)(eslint@7.32.0): + /@typescript-eslint/eslint-plugin@5.60.1(@typescript-eslint/parser@5.60.1)(eslint@7.32.0)(typescript@5.1.6): resolution: {integrity: sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1995,22 +1996,23 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.60.1(eslint@7.32.0) + '@typescript-eslint/parser': 5.60.1(eslint@7.32.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.60.1 - '@typescript-eslint/type-utils': 5.60.1(eslint@7.32.0) - '@typescript-eslint/utils': 5.60.1(eslint@7.32.0) + '@typescript-eslint/type-utils': 5.60.1(eslint@7.32.0)(typescript@5.1.6) + '@typescript-eslint/utils': 5.60.1(eslint@7.32.0)(typescript@5.1.6) debug: 4.3.4 eslint: 7.32.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 semver: 7.5.3 - tsutils: 3.21.0 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.60.1(eslint@7.32.0): + /@typescript-eslint/parser@5.60.1(eslint@7.32.0)(typescript@5.1.6): resolution: {integrity: sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2022,9 +2024,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.60.1 '@typescript-eslint/types': 5.60.1 - '@typescript-eslint/typescript-estree': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.6) debug: 4.3.4 eslint: 7.32.0 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -2037,7 +2040,7 @@ packages: '@typescript-eslint/visitor-keys': 5.60.1 dev: true - /@typescript-eslint/type-utils@5.60.1(eslint@7.32.0): + /@typescript-eslint/type-utils@5.60.1(eslint@7.32.0)(typescript@5.1.6): resolution: {integrity: sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2047,11 +2050,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.60.1 - '@typescript-eslint/utils': 5.60.1(eslint@7.32.0) + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.6) + '@typescript-eslint/utils': 5.60.1(eslint@7.32.0)(typescript@5.1.6) debug: 4.3.4 eslint: 7.32.0 - tsutils: 3.21.0 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -2061,7 +2065,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.60.1: + /@typescript-eslint/typescript-estree@5.60.1(typescript@5.1.6): resolution: {integrity: sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2076,12 +2080,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.3 - tsutils: 3.21.0 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.60.1(eslint@7.32.0): + /@typescript-eslint/utils@5.60.1(eslint@7.32.0)(typescript@5.1.6): resolution: {integrity: sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2092,7 +2097,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.60.1 '@typescript-eslint/types': 5.60.1 - '@typescript-eslint/typescript-estree': 5.60.1 + '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.1.6) eslint: 7.32.0 eslint-scope: 5.1.1 semver: 7.5.3 @@ -3212,15 +3217,6 @@ packages: signal-exit: 4.0.1 dev: true - /fs-extra@11.2.0: - resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} - engines: {node: '>=14.14'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - dev: false - /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -3386,6 +3382,7 @@ packages: /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} @@ -4322,14 +4319,6 @@ packages: graceful-fs: 4.2.11 dev: true - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - dev: false - /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -5416,7 +5405,41 @@ packages: engines: {node: '>=8'} dev: true - /ts-jest@29.1.0(jest@29.5.0)(typescript@5.0.4): + /ts-jest@29.1.0(@babel/core@7.21.4)(jest@29.5.0)(typescript@5.0.4): + resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.21.4 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.5.0(@types/node@14.18.45) + jest-util: 29.5.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.5.0 + typescript: 5.0.4 + yargs-parser: 21.1.1 + dev: true + + /ts-jest@29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.0.4): resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5437,6 +5460,7 @@ packages: esbuild: optional: true dependencies: + '@babel/core': 7.22.5 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.5.0(@types/node@14.18.45) @@ -5449,7 +5473,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-jest@29.1.0(jest@29.5.0)(typescript@5.1.6): + /ts-jest@29.1.0(@babel/core@7.22.5)(jest@29.5.0)(typescript@5.1.6): resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5470,6 +5494,7 @@ packages: esbuild: optional: true dependencies: + '@babel/core': 7.22.5 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.5.0(@types/node@14.18.52) @@ -5490,13 +5515,14 @@ packages: resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==} dev: false - /tsutils@3.21.0: + /tsutils@3.21.0(typescript@5.1.6): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 + typescript: 5.1.6 dev: true /tty-table@4.2.1: @@ -5645,11 +5671,6 @@ packages: engines: {node: '>= 4.0.0'} dev: true - /universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - dev: false - /update-browserslist-db@1.0.11(browserslist@4.21.5): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -5944,7 +5965,3 @@ packages: dev: true bundledDependencies: - ipv6 - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false