Skip to content

fix(deps): remove pump dependency #7096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"parse-github-url": "1.0.3",
"parse-gitignore": "2.0.0",
"prettyjson": "1.2.5",
"pump": "3.0.2",
"raw-body": "3.0.0",
"read-package-up": "11.0.0",
"readdirp": "4.1.2",
Expand Down Expand Up @@ -191,7 +190,6 @@
"@types/parse-github-url": "1.0.3",
"@types/parse-gitignore": "1.0.2",
"@types/prettyjson": "0.0.33",
"@types/pump": "1.1.3",
"@types/semver": "7.5.8",
"@types/source-map-support": "0.5.10",
"@types/through2-map": "3.0.4",
Expand Down
9 changes: 2 additions & 7 deletions src/utils/deploy/hash-files.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { promisify } from 'util'
import { pipeline } from 'stream/promises'

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

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

// Explicitly passing type parameter because inference isn't playing nicely with incompatible patterns for typing
// function spread parameters + function overloading
const pump = promisify<Stream[]>(pumpModule)

const hashFiles = async ({
assetType = 'file',
// @ts-expect-error TS(7031) FIXME: Binding element 'concurrentHash' implicitly has an... Remove this comment to see the full error message
Expand Down Expand Up @@ -37,7 +32,7 @@ const hashFiles = async ({
const filesShaMap = {}
const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb, assetType })

await pump([fileStream, fileFilter, hasher, fileNormalizer, manifestCollector] as const)
await pipeline([fileStream, fileFilter, hasher, fileNormalizer, manifestCollector])

return { files, filesShaMap }
}
Expand Down
9 changes: 2 additions & 7 deletions src/utils/deploy/hash-fns.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { readFile } from 'fs/promises'
import path from 'path'
import { promisify } from 'util'
import { pipeline } from 'stream/promises'

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

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

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

// Explicitly passing type parameter because inference isn't playing nicely with incompatible patterns for typing
// function spread parameters + function overloading
const pump = promisify<Stream[]>(pumpModule)

// Maximum age of functions manifest (2 minutes).
const MANIFEST_FILE_TTL = 12e4

Expand Down Expand Up @@ -227,7 +222,7 @@ const hashFns = async (
const fnShaMap = {}
const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb, assetType })

await pump([functionStream, hasher, manifestCollector] as const)
await pipeline([functionStream, hasher, manifestCollector])
return { functionSchedules, functions, functionsWithNativeModules, fnShaMap, fnConfig }
}

Expand Down
Loading