Skip to content

Commit 75f8a87

Browse files
authored
Revert "fix: clean up blob directories in pre-dev (#5600)"
This reverts commit 788e1ad.
1 parent 18d76f4 commit 75f8a87

File tree

23 files changed

+7
-181
lines changed

23 files changed

+7
-181
lines changed

Diff for: .gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ packages/*/lib/
2626
!**/fixtures/**/plugins_cache*/.netlify
2727
!**/fixtures/**/pin_*/.netlify
2828
!**/fixtures/with_preexisting_blobs/**/.netlify
29-
!**/fixtures/with-blobs/**/.netlify
30-
!**/fixtures/with-legacy-blobs/**/.netlify
31-
!**/fixtures/with-leftover-functions/**/.netlify
3229
!**/fixtures/**/functions_*/.netlify
3330
!**/fixtures/**/functions_*/.netlify/edge-functions/manifest.json
3431
!**/fixtures/**/monorepo/**/.netlify

Diff for: packages/build/src/plugins_core/pre_dev_cleanup/index.ts

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { rm, stat } from 'node:fs/promises'
2-
import { join, resolve } from 'node:path'
2+
import { resolve } from 'node:path'
33

44
import { listFrameworks } from '@netlify/framework-info'
55

66
import { log } from '../../log/logger.js'
7-
import { DEPLOY_CONFIG_BLOBS_PATH, LEGACY_BLOBS_PATH } from '../../utils/blobs.js'
87
import { CoreStep, CoreStepCondition, CoreStepFunction, CoreStepFunctionArgs } from '../types.js'
98

109
const dirExists = async (path: string): Promise<boolean> => {
@@ -19,27 +18,18 @@ const dirExists = async (path: string): Promise<boolean> => {
1918
const getDirtyDirs = async function ({
2019
buildDir,
2120
constants: { INTERNAL_EDGE_FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC },
22-
packagePath,
2321
}: CoreStepFunctionArgs): Promise<string[]> {
24-
const directories: string[] = []
22+
const dirs: string[] = []
2523

2624
if (INTERNAL_FUNCTIONS_SRC && (await dirExists(resolve(buildDir, INTERNAL_FUNCTIONS_SRC)))) {
27-
directories.push(INTERNAL_FUNCTIONS_SRC)
25+
dirs.push(INTERNAL_FUNCTIONS_SRC)
2826
}
2927

3028
if (INTERNAL_EDGE_FUNCTIONS_SRC && (await dirExists(resolve(buildDir, INTERNAL_EDGE_FUNCTIONS_SRC)))) {
31-
directories.push(INTERNAL_EDGE_FUNCTIONS_SRC)
29+
dirs.push(INTERNAL_EDGE_FUNCTIONS_SRC)
3230
}
3331

34-
if (await dirExists(resolve(buildDir, packagePath || '', LEGACY_BLOBS_PATH))) {
35-
directories.push(join(packagePath || '', LEGACY_BLOBS_PATH))
36-
}
37-
38-
if (await dirExists(resolve(buildDir, packagePath || '', DEPLOY_CONFIG_BLOBS_PATH))) {
39-
directories.push(join(packagePath || '', DEPLOY_CONFIG_BLOBS_PATH))
40-
}
41-
42-
return directories
32+
return dirs
4333
}
4434

4535
const coreStep: CoreStepFunction = async (input) => {

Diff for: packages/build/src/utils/blobs.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import path from 'node:path'
33

44
import { fdir } from 'fdir'
55

6-
export const LEGACY_BLOBS_PATH = '.netlify/blobs/deploy'
7-
export const DEPLOY_CONFIG_BLOBS_PATH = '.netlify/deploy/v1/blobs/deploy'
6+
const LEGACY_BLOBS_PATH = '.netlify/blobs/deploy'
7+
const DEPLOY_CONFIG_BLOBS_PATH = '.netlify/deploy/v1/blobs/deploy'
88

99
/** Retrieve the absolute path of the deploy scoped internal blob directories */
1010
export const getBlobsDirs = (buildDir: string, packagePath?: string) => [

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-blobs/.netlify/deploy/v1/blobs/deploy/foo.txt

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-blobs/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-blobs/package.json

-6
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-leftover-functions/.netlify/edge-functions/leftover.mjs

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-leftover-functions/.netlify/functions-internal/leftover.mjs

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-leftover-functions/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-leftover-functions/package.json

-6
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-legacy-blobs/.netlify/blobs/deploy/foo.txt

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-legacy-blobs/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/apps/with-legacy-blobs/package.json

-6
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/package.json

-4
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/monorepo/pnpm-workspace.yaml

-2
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-blobs/.netlify/deploy/v1/blobs/deploy/foo.txt

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-blobs/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-leftover-functions/.netlify/edge-functions/leftover.mjs

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-leftover-functions/.netlify/functions-internal/leftover.mjs

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-leftover-functions/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-legacy-blobs/.netlify/blobs/deploy/foo.txt

-1
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/fixtures/with-legacy-blobs/netlify.toml

-3
This file was deleted.

Diff for: packages/build/tests/pre_dev_cleanup/tests.js

-111
This file was deleted.

0 commit comments

Comments
 (0)