Skip to content

Commit 07fef60

Browse files
talentlessguyserhalp
andauthoredMar 10, 2025··
fix(deps): remove pump dependency (#7096)
* fix(deps): remove `pump` dependency * style: fix formatting --------- Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
1 parent 6de973f commit 07fef60

File tree

4 files changed

+4
-36
lines changed

4 files changed

+4
-36
lines changed
 

‎package-lock.json

-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
"parse-github-url": "1.0.3",
144144
"parse-gitignore": "2.0.0",
145145
"prettyjson": "1.2.5",
146-
"pump": "3.0.2",
147146
"raw-body": "3.0.0",
148147
"read-package-up": "11.0.0",
149148
"readdirp": "4.1.2",
@@ -191,7 +190,6 @@
191190
"@types/parse-github-url": "1.0.3",
192191
"@types/parse-gitignore": "1.0.2",
193192
"@types/prettyjson": "0.0.33",
194-
"@types/pump": "1.1.3",
195193
"@types/semver": "7.5.8",
196194
"@types/source-map-support": "0.5.10",
197195
"@types/through2-map": "3.0.4",

‎src/utils/deploy/hash-files.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
import { promisify } from 'util'
1+
import { pipeline } from 'stream/promises'
22

33
import walker from 'folder-walker'
4-
import pumpModule, { type Stream } from 'pump'
54

65
import { fileFilterCtor, fileNormalizerCtor, hasherCtor, manifestCollectorCtor } from './hasher-segments.js'
76

8-
// Explicitly passing type parameter because inference isn't playing nicely with incompatible patterns for typing
9-
// function spread parameters + function overloading
10-
const pump = promisify<Stream[]>(pumpModule)
11-
127
const hashFiles = async ({
138
assetType = 'file',
149
// @ts-expect-error TS(7031) FIXME: Binding element 'concurrentHash' implicitly has an... Remove this comment to see the full error message
@@ -37,7 +32,7 @@ const hashFiles = async ({
3732
const filesShaMap = {}
3833
const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb, assetType })
3934

40-
await pump([fileStream, fileFilter, hasher, fileNormalizer, manifestCollector] as const)
35+
await pipeline([fileStream, fileFilter, hasher, fileNormalizer, manifestCollector])
4136

4237
return { files, filesShaMap }
4338
}

‎src/utils/deploy/hash-fns.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
import { readFile } from 'fs/promises'
22
import path from 'path'
3-
import { promisify } from 'util'
3+
import { pipeline } from 'stream/promises'
44

55
import { zipFunctions, type FunctionResult, type TrafficRules } from '@netlify/zip-it-and-ship-it'
66
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'from... Remove this comment to see the full error message
77
import fromArray from 'from2-array'
8-
import pumpModule, { type Stream } from 'pump'
98

109
import BaseCommand from '../../commands/base-command.js'
1110
import { $TSFixMe } from '../../commands/types.js'
1211
import { INTERNAL_FUNCTIONS_FOLDER } from '../functions/functions.js'
1312

1413
import { hasherCtor, manifestCollectorCtor } from './hasher-segments.js'
1514

16-
// Explicitly passing type parameter because inference isn't playing nicely with incompatible patterns for typing
17-
// function spread parameters + function overloading
18-
const pump = promisify<Stream[]>(pumpModule)
19-
2015
// Maximum age of functions manifest (2 minutes).
2116
const MANIFEST_FILE_TTL = 12e4
2217

@@ -227,7 +222,7 @@ const hashFns = async (
227222
const fnShaMap = {}
228223
const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb, assetType })
229224

230-
await pump([functionStream, hasher, manifestCollector] as const)
225+
await pipeline([functionStream, hasher, manifestCollector])
231226
return { functionSchedules, functions, functionsWithNativeModules, fnShaMap, fnConfig }
232227
}
233228

0 commit comments

Comments
 (0)