feat!: type auto-generation (#6657)
Types are now auto-generated by default.
You can opt-out of this behavior by setting:
```ts
buildConfig({
// Rest of config
typescript: {
autoGenerate: false
},
})
```
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import path from 'path'
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
import { seoPlugin } from '@payloadcms/plugin-seo'
|
||||
import { en } from '@payloadcms/translations/languages/en'
|
||||
import { es } from '@payloadcms/translations/languages/es'
|
||||
@@ -63,4 +67,7 @@ export default buildConfigWithDefaults({
|
||||
uploadsCollection: 'media',
|
||||
}),
|
||||
],
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -87,6 +87,8 @@ export interface Media {
|
||||
filesize?: number | null;
|
||||
width?: number | null;
|
||||
height?: number | null;
|
||||
focalX?: number | null;
|
||||
focalY?: number | null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
|
||||
Reference in New Issue
Block a user