Skip to content
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

fix(deps): remove stream utils #7120

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
167 changes: 0 additions & 167 deletions package-lock.json

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

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,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": "7.1.0",
"gh-release-fetch": "4.0.3",
Expand All @@ -119,7 +117,6 @@
"inquirer-autocomplete-prompt": "1.4.0",
"ipx": "2.1.0",
"is-docker": "3.0.0",
"is-stream": "4.0.1",
"is-wsl": "3.1.0",
"isexe": "3.1.1",
"jsonwebtoken": "9.0.2",
Expand Down Expand Up @@ -151,8 +148,6 @@
"strip-ansi-control-characters": "2.0.0",
"tempy": "3.1.0",
"terminal-link": "3.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 @@ -177,7 +172,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 @@ -194,7 +188,6 @@
"@types/semver": "7.5.8",
"@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.5.14",
"@vitest/coverage-v8": "1.6.1",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/functions/runtimes/js/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { createServer } from 'net'
import process from 'process'
import { isMainThread, workerData, parentPort } from 'worker_threads'

import { isStream } from 'is-stream'
import lambdaLocal from 'lambda-local'
import sourceMapSupport from 'source-map-support'

import { isStream } from '../../../../utils/is-stream.js'

if (isMainThread) {
throw new Error(`Do not import "${import.meta.url}" in the main thread.`)
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/functions/synchronous.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Buffer } from 'buffer'

import { isStream } from 'is-stream'

import { chalk, logPadded, NETLIFYDEVERR } from '../../utils/command-helpers.js'
import { isStream } from '../../utils/is-stream.js'
import renderErrorTemplate from '../render-error-template.js'

import { detectAwsSdkError } from './utils.js'
Expand Down
7 changes: 3 additions & 4 deletions src/utils/deploy/hash-fns.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { readFile } from 'fs/promises'
import path from 'path'
import * as path from 'path'
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 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'
import { Readable } from 'stream'

// Maximum age of functions manifest (2 minutes).
const MANIFEST_FILE_TTL = 12e4
Expand Down Expand Up @@ -211,7 +210,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 Down
Loading
Loading