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 type { Block } from 'payload/types'
|
||||
|
||||
import { formBuilderPlugin, fields as formFields } from '@payloadcms/plugin-form-builder'
|
||||
@@ -97,4 +101,7 @@ export default buildConfigWithDefaults({
|
||||
redirectRelationships: ['pages'],
|
||||
}),
|
||||
],
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -231,6 +231,7 @@ export interface FormSubmission {
|
||||
id?: string | null;
|
||||
}[]
|
||||
| null;
|
||||
custom?: string | null;
|
||||
payment?: {
|
||||
field?: string | null;
|
||||
status?: string | null;
|
||||
|
||||
Reference in New Issue
Block a user