Skip to content

Commit a6bf058

Browse files
authored
chore!: remove unused staticOptions config on uploads (#6378)
Removes the unused `staticOptions` on upload config, it was previously typed to express configuration and is unused anywhere in the codebase
1 parent a4deaf0 commit a6bf058

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

docs/upload/overview.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Every Payload Collection can opt-in to supporting Uploads by specifying the `upl
5252
| **`formatOptions`** | An object with `format` and `options` that are used with the Sharp image library to format the upload file. [More](https://sharp.pixelplumbing.com/api-output#toformat) |
5353
| **`handlers`** | Array of Express request handlers to execute before the built-in Payload static middleware executes. |
5454
| **`imageSizes`** | If specified, image uploads will be automatically resized in accordance to these image sizes. [More](#image-sizes) |
55-
| **`mimeTypes`** | Restrict mimeTypes in the file picker. Array of valid mimetypes or mimetype wildcards [More](#mimetypes) |
56-
| **`staticOptions`** | Set options for `express.static` to use while serving your static files. [More](http://expressjs.com/en/resources/middleware/serve-static.html) |
55+
| **`mimeTypes`** | Restrict mimeTypes in the file picker. Array of valid mimetypes or mimetype wildcards [More](#mimetypes) | |
5756
| **`resizeOptions`** | An object passed to the the Sharp image library to resize the uploaded file. [More](https://sharp.pixelplumbing.com/api-resize) |
5857
| **`filesRequiredOnCreate`** | Mandate file data on creation, default is true. |
5958

packages/payload/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
"@types/asap": "2.0.0",
120120
"@types/body-parser": "1.19.2",
121121
"@types/compression": "1.7.2",
122-
"@types/express": "4.17.17",
123122
"@types/express-fileupload": "1.4.1",
124123
"@types/express-rate-limit": "5.1.3",
125124
"@types/express-serve-static-core": "4.17.35",
@@ -154,7 +153,6 @@
154153
"object.entries": "1.1.6",
155154
"passport-strategy": "1.0.0",
156155
"rimraf": "3.0.2",
157-
"serve-static": "1.15.0",
158156
"sharp": "0.32.6"
159157
},
160158
"peerDependencies": {

packages/payload/src/collections/config/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ const collectionSchema = joi.object().keys({
193193
})
194194
.allow(null),
195195
staticDir: joi.string(),
196-
staticOptions: joi.object(),
197196
tempFileDir: joi.string(),
198197
trimOptions: joi.alternatives().try(
199198
joi.object().keys({

packages/payload/src/uploads/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type express from 'express'
2-
import type serveStatic from 'serve-static'
31
import type { ResizeOptions, Sharp } from 'sharp'
42

53
import type { TypeWithID } from '../collections/config/types.js'
@@ -101,7 +99,6 @@ export type UploadConfig = {
10199
mimeTypes?: string[]
102100
resizeOptions?: ResizeOptions
103101
staticDir?: string
104-
staticOptions?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>
105102
trimOptions?: ImageUploadTrimOptions
106103
}
107104

pnpm-lock.yaml

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)