Skip to content
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
1 change: 0 additions & 1 deletion package-lock.json

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

1 change: 0 additions & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"map-obj": "^5.0.0",
"memoize-one": "^6.0.0",
"minimatch": "^9.0.4",
"node-fetch": "^3.3.2",
"os-name": "^6.0.0",
"p-event": "^6.0.0",
"p-every": "^2.0.0",
Expand Down
9 changes: 0 additions & 9 deletions packages/build/src/plugins_core/blobs_upload/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { version as nodeVersion } from 'node:process'

import { getDeployStore } from '@netlify/blobs'
import pMap from 'p-map'
import semver from 'semver'

import { DEFAULT_API_HOST } from '../../core/normalize_flags.js'
import { logError } from '../../log/logger.js'
Expand Down Expand Up @@ -32,12 +29,6 @@ const coreStep: CoreStepFunction = async function ({
apiURL: `https://${apiHost}`,
}

// If we don't have native `fetch` in the global scope, add a polyfill.
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = (await import('node-fetch')).default as unknown as typeof fetch
storeOpts.fetch = nodeFetch
}

const blobs = await scanForBlobs(buildDir, packagePath)

// We checked earlier, but let's be extra safe
Expand Down
9 changes: 0 additions & 9 deletions packages/build/src/plugins_core/dev_blobs_upload/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { version as nodeVersion } from 'node:process'

import { getDeployStore } from '@netlify/blobs'
import pMap from 'p-map'
import semver from 'semver'

import { log, logError } from '../../log/logger.js'
import { getFileWithMetadata, getKeysToUpload, scanForBlobs } from '../../utils/blobs.js'
Expand Down Expand Up @@ -32,12 +29,6 @@ const coreStep: CoreStepFunction = async function ({
apiURL: `https://${apiHost}`,
}

// If we don't have native `fetch` in the global scope, add a polyfill.
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = (await import('node-fetch')).default as unknown as typeof fetch
storeOpts.fetch = nodeFetch
}

const blobs = await scanForBlobs(buildDir, packagePath)

// We checked earlier, but let's be extra safe
Expand Down
20 changes: 0 additions & 20 deletions packages/build/tests/blobs_upload/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ test.serial('Blobs upload step uploads files to deploy store (legacy API)', asyn
t.is(defaultRegionRequests.length, 3)

const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = await import('node-fetch')
storeOpts.fetch = nodeFetch.default
}

const store = getDeployStore(storeOpts)

const blob1 = await store.getWithMetadata('something.txt')
Expand Down Expand Up @@ -134,11 +129,6 @@ test.serial('Blobs upload step uploads files to deploy store (legacy deploy conf
t.is(regionAutoRequests.length, 3)

const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = await import('node-fetch')
storeOpts.fetch = nodeFetch.default
}

const store = getDeployStore(storeOpts)

const blob1 = await store.getWithMetadata('something.txt')
Expand Down Expand Up @@ -175,11 +165,6 @@ test.serial('Blobs upload step uploads files to deploy store', async (t) => {
t.is(regionAutoRequests.length, 3)

const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = await import('node-fetch')
storeOpts.fetch = nodeFetch.default
}

const store = getDeployStore(storeOpts)

const blob1 = await store.getWithMetadata('something.txt')
Expand Down Expand Up @@ -222,11 +207,6 @@ if (semver.gte(nodeVersion, '18.19.0')) {
t.is(t.context.blobRequests.set.length, 6)

const storeOpts = { deployID: 'abc123', siteID: 'test', token: TOKEN }
if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = await import('node-fetch')
storeOpts.fetch = nodeFetch.default
}

const store = getDeployStore(storeOpts)

const blob1 = await store.getWithMetadata('something.txt')
Expand Down
8 changes: 0 additions & 8 deletions packages/build/tests/plugins/fixtures/blobs_read/plugin.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { version as nodeVersion } from "process"

import { getDeployStore } from '@netlify/blobs'
import semver from 'semver'

export const onPreBuild = async function ({netlifyConfig}) {
const storeOptions = {}

if (semver.lt(nodeVersion, '18.0.0')) {
const nodeFetch = await import('node-fetch')
storeOptions.fetch = nodeFetch.default
}

const store = getDeployStore(storeOptions)
const value = await store.get("my-key")

Expand Down
Loading