Improve resolveConfig return type: merge themes (#12272)
* Generate types: do not intersect with Config theme type when generating DefaultTheme * Merge default theme in ResolvedConfig * UnwrapResolvables on theme.extend as well * Apply extend to overrides and default theme * Omit extend from DefaultTheme * Relax generic constraints, better generic variable names * Fall back to ThemeConfig if key not in DefaultTheme * Split out ThemeConfigCustomizable to avoid anys in ThemeConfigResolved * Allow custom theme properties * handle TypeScript error * apply prettier formatting * update changelog * change type name --------- Co-authored-by: Nikita Gaidakov <ngaidakov@podfather.com> Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
This commit is contained in:
parent
ac171f02c7
commit
ffadf2ba4b
4 changed files with 28 additions and 8 deletions
|
|
@ -91,9 +91,8 @@ fs.writeFileSync(
|
|||
path.join(process.cwd(), 'types', 'generated', 'default-theme.d.ts'),
|
||||
prettier.format(
|
||||
`
|
||||
import { Config } from '../../types'
|
||||
type CSSDeclarationList = Record<string, string>
|
||||
export type DefaultTheme = Config['theme'] & { ${defaultThemeTypes} }
|
||||
export type DefaultTheme = { ${defaultThemeTypes} }
|
||||
`,
|
||||
{
|
||||
semi: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue