Skip to content

fix(deps): remove stream utils #7120

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 15 commits into from
Apr 15, 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
150 changes: 0 additions & 150 deletions package-lock.json

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

6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@
"fastest-levenshtein": "1.0.16",
"fastify": "4.29.0",
"find-up": "7.0.0",
"flush-write-stream": "2.0.0",
"folder-walker": "3.2.0",
"from2-array": "0.0.4",
"fuzzy": "0.1.3",
"get-port": "5.1.1",
"gh-release-fetch": "4.0.3",
Expand Down Expand Up @@ -148,8 +146,6 @@
"strip-ansi-control-characters": "2.0.0",
"tempy": "3.1.0",
"terminal-link": "4.0.0",
"through2-filter": "4.0.0",
"through2-map": "4.0.0",
"toml": "3.0.0",
"tomlify-j0.4": "3.0.0",
"ulid": "2.3.0",
Expand All @@ -173,7 +169,6 @@
"@types/envinfo": "7.8.4",
"@types/eslint-config-prettier": "^6.11.3",
"@types/etag": "1.8.3",
"@types/flush-write-stream": "1.0.2",
"@types/folder-walker": "3.2.4",
"@types/gitconfiglocal": "2.0.3",
"@types/inquirer": "9.0.7",
Expand All @@ -191,7 +186,6 @@
"@types/semver": "7.7.0",
"@types/serialize-javascript": "^5.0.4",
"@types/source-map-support": "0.5.10",
"@types/through2-map": "3.0.4",
"@types/write-file-atomic": "4.0.3",
"@types/ws": "8.18.1",
"@vitest/coverage-v8": "3.1.1",
Expand Down
11 changes: 3 additions & 8 deletions src/utils/deploy/deploy-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import hashFiles from './hash-files.js'
import hashFns from './hash-fns.js'
import uploadFiles from './upload-files.js'
import { getUploadList, waitForDeploy, waitForDiff } from './util.js'
import type { DeployEvent } from './status-cb.js'

export type { DeployEvent }

const buildStatsString = (possibleParts: (string | false | undefined)[]) => {
const parts = possibleParts.filter(Boolean)
Expand All @@ -28,13 +31,6 @@ const buildStatsString = (possibleParts: (string | false | undefined)[]) => {
return parts.length > 1 ? `${message} and ${parts[parts.length - 1]}` : message
}

// TODO(serhalp): This is alternatingly called "event", "status", and "progress". Standardize.
export interface DeployEvent {
type: string
msg: string
phase: 'start' | 'progress' | 'error' | 'stop'
}

export const deploySite = async (
command: BaseCommand,
api: $TSFixMe,
Expand Down Expand Up @@ -115,7 +111,6 @@ export const deploySite = async (
concurrentHash,
hashAlgorithm,
statusCb,
assetType,
manifestPath,
skipFunctionsCache,
rootDir: siteRoot,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/deploy/hash-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const hashFiles = async ({
const files = {}
// hash: [fileObj, fileObj, fileObj]
const filesShaMap = {}
const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb, assetType })
const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb })

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

Expand Down
10 changes: 3 additions & 7 deletions src/utils/deploy/hash-fns.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { readFile } from 'fs/promises'
import path from 'path'
import { pipeline } from 'stream/promises'
import { Readable } from 'stream'

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 BaseCommand from '../../commands/base-command.js'
import { $TSFixMe } from '../../commands/types.js'
Expand Down Expand Up @@ -109,8 +108,6 @@ const hashFns = async (
command: BaseCommand,
directories: string[],
config: {
/** @default 'function' */
assetType?: string
concurrentHash?: number
functionsConfig: $TSFixMe
/** @default 'sha256' */
Expand All @@ -123,7 +120,6 @@ const hashFns = async (
},
): Promise<$TSFixMe> => {
const {
assetType = 'function',
concurrentHash,
functionsConfig,
hashAlgorithm = 'sha256',
Expand Down Expand Up @@ -211,7 +207,7 @@ const hashFns = async (
({ nativeNodeModules }) => nativeNodeModules !== undefined && Object.keys(nativeNodeModules).length !== 0,
)

const functionStream = fromArray.obj(fileObjs)
const functionStream = Readable.from(fileObjs)

const hasher = hasherCtor({ concurrentHash, hashAlgorithm })

Expand All @@ -220,7 +216,7 @@ const hashFns = async (
const functions = {}
// hash: [fileObj, fileObj, fileObj]
const fnShaMap = {}
const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb, assetType })
const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb })

await pipeline([functionStream, hasher, manifestCollector])
return { functionSchedules, functions, functionsWithNativeModules, fnShaMap, fnConfig }
Expand Down
Loading
Loading