From 7857c80c795c2e970fe84fc4025ca863107532c4 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Tue, 19 Mar 2024 01:46:28 -0400 Subject: [PATCH] chore: move getFileByPath to payload/uploads --- packages/payload/src/exports/uploads.ts | 1 + packages/payload/src/exports/utilities.ts | 1 - test/_community/config.ts | 2 +- test/fields/seed.ts | 2 +- test/live-preview/int.spec.ts | 2 +- test/plugin-seo/e2e.spec.ts | 2 +- test/plugin-seo/int.spec.ts | 2 +- test/plugin-seo/seed/index.ts | 2 +- test/uploads/config.ts | 2 +- test/uploads/int.spec.ts | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 packages/payload/src/exports/uploads.ts diff --git a/packages/payload/src/exports/uploads.ts b/packages/payload/src/exports/uploads.ts new file mode 100644 index 000000000..7e3331164 --- /dev/null +++ b/packages/payload/src/exports/uploads.ts @@ -0,0 +1 @@ +export { default as getFileByPath } from '../uploads/getFileByPath.js' diff --git a/packages/payload/src/exports/utilities.ts b/packages/payload/src/exports/utilities.ts index 809d4d1d7..3b50ac14e 100644 --- a/packages/payload/src/exports/utilities.ts +++ b/packages/payload/src/exports/utilities.ts @@ -6,7 +6,6 @@ export { extractTranslations } from '../translations/extractTranslations.js' export { formatFilesize } from '../uploads/formatFilesize.js' -export { default as getFileByPath } from '../uploads/getFileByPath.js' export { default as isImage } from '../uploads/isImage.js' export { combineMerge } from '../utilities/combineMerge.js' diff --git a/test/_community/config.ts b/test/_community/config.ts index 9d78f6d11..cec8837f5 100644 --- a/test/_community/config.ts +++ b/test/_community/config.ts @@ -1,5 +1,5 @@ import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js' import { devUser } from '../credentials.js' diff --git a/test/fields/seed.ts b/test/fields/seed.ts index e42199b6e..642b26c6c 100644 --- a/test/fields/seed.ts +++ b/test/fields/seed.ts @@ -1,6 +1,6 @@ import path from 'path' import { type Payload } from 'payload' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { fileURLToPath } from 'url' import { devUser } from '../credentials.js' diff --git a/test/live-preview/int.spec.ts b/test/live-preview/int.spec.ts index dd6854afa..d1fd71c60 100644 --- a/test/live-preview/int.spec.ts +++ b/test/live-preview/int.spec.ts @@ -1,7 +1,7 @@ import type { Payload } from 'payload' import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { fileURLToPath } from 'url' import type { NextRESTClient } from '../helpers/NextRESTClient.js' diff --git a/test/plugin-seo/e2e.spec.ts b/test/plugin-seo/e2e.spec.ts index bd8b44b63..3aa1a8034 100644 --- a/test/plugin-seo/e2e.spec.ts +++ b/test/plugin-seo/e2e.spec.ts @@ -3,7 +3,7 @@ import type { Payload } from 'payload/types' import { expect, test } from '@playwright/test' import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { fileURLToPath } from 'url' import type { Page as PayloadPage } from './payload-types.js' diff --git a/test/plugin-seo/int.spec.ts b/test/plugin-seo/int.spec.ts index c57dc9bd6..10f819a42 100644 --- a/test/plugin-seo/int.spec.ts +++ b/test/plugin-seo/int.spec.ts @@ -1,7 +1,7 @@ import type { Payload } from 'payload' import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { fileURLToPath } from 'url' import { initPayloadInt } from '../helpers/initPayloadInt.js' diff --git a/test/plugin-seo/seed/index.ts b/test/plugin-seo/seed/index.ts index 11f1e1b27..66ca30edf 100644 --- a/test/plugin-seo/seed/index.ts +++ b/test/plugin-seo/seed/index.ts @@ -2,7 +2,7 @@ import type { Payload } from 'payload' import type { PayloadRequest } from 'payload/types' import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { mediaSlug } from '../shared.js' diff --git a/test/uploads/config.ts b/test/uploads/config.ts index 2ec42b3db..2360c8b25 100644 --- a/test/uploads/config.ts +++ b/test/uploads/config.ts @@ -1,5 +1,5 @@ import path from 'path' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js' import { devUser } from '../credentials.js' diff --git a/test/uploads/int.spec.ts b/test/uploads/int.spec.ts index 62cbdc99b..621475446 100644 --- a/test/uploads/int.spec.ts +++ b/test/uploads/int.spec.ts @@ -5,7 +5,7 @@ import NodeFormData from 'form-data' import fs from 'fs' import path from 'path' import { getPayload } from 'payload' -import { getFileByPath } from 'payload/utilities' +import { getFileByPath } from 'payload/uploads' import { fileURLToPath } from 'url' import { promisify } from 'util'