mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
fix: styledComponents schema (#69230)
## Why? Both the `topLevelImportPaths` and `meaninglessFilenames` should not need a minimal of 1 item in their arrays. - Fixes https://github.com/vercel/next.js/issues/68573
This commit is contained in:
@@ -200,10 +200,10 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
|
||||
z.boolean().optional(),
|
||||
z.object({
|
||||
displayName: z.boolean().optional(),
|
||||
topLevelImportPaths: z.array(z.string()).min(1).optional(),
|
||||
topLevelImportPaths: z.array(z.string()).optional(),
|
||||
ssr: z.boolean().optional(),
|
||||
fileName: z.boolean().optional(),
|
||||
meaninglessFileNames: z.array(z.string()).min(1).optional(),
|
||||
meaninglessFileNames: z.array(z.string()).optional(),
|
||||
minify: z.boolean().optional(),
|
||||
transpileTemplateLiterals: z.boolean().optional(),
|
||||
namespace: z.string().min(1).optional(),
|
||||
|
||||
@@ -39,6 +39,17 @@ describe('next.config.js validation', () => {
|
||||
`Unrecognized key(s) in object: 'anotherNonExistent' at "experimental"`,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'invalid config array lengths',
|
||||
configContent: `
|
||||
module.exports = {
|
||||
pageExtensions: []
|
||||
}
|
||||
`,
|
||||
outputs: [
|
||||
'Array must contain at least 1 element(s) at "pageExtensions"',
|
||||
],
|
||||
},
|
||||
])(
|
||||
'it should validate correctly for $name',
|
||||
async ({ outputs, configContent }) => {
|
||||
|
||||
Reference in New Issue
Block a user