File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 11import type { BunPlugin } from 'bun'
2- import type { HeadwindConfig } from './types'
2+ import type { HeadwindConfig , HeadwindOptions } from './types'
33import { loadConfig } from 'bunfig'
44import { defaultConfig } from './config'
55import { CSSGenerator } from './generator'
@@ -9,7 +9,7 @@ export interface HeadwindPluginOptions {
99 /**
1010 * Custom config to override default config
1111 */
12- config ?: Partial < HeadwindConfig >
12+ config ?: HeadwindOptions
1313 /**
1414 * Include preflight CSS
1515 * @default true
@@ -42,7 +42,7 @@ export function plugin(options: HeadwindPluginOptions = {}): BunPlugin {
4242 } )
4343
4444 // Merge with provided options
45- const config : HeadwindConfig = {
45+ const config = {
4646 ...loadedConfig ,
4747 ...options . config ,
4848 theme : {
@@ -77,7 +77,7 @@ export function plugin(options: HeadwindPluginOptions = {}): BunPlugin {
7777 ...( loadedConfig . presets || [ ] ) ,
7878 ...( options . config ?. presets || [ ] ) ,
7979 ] ,
80- }
80+ } as HeadwindConfig
8181
8282 const includePreflight = options . includePreflight ?? true
8383
Original file line number Diff line number Diff line change @@ -141,4 +141,8 @@ export interface Preset {
141141 preflights ?: Preflight [ ]
142142}
143143
144- export type HeadwindOptions = Partial < HeadwindConfig >
144+ type DeepPartial < T > = {
145+ [ P in keyof T ] ?: T [ P ] extends object ? DeepPartial < T [ P ] > : T [ P ]
146+ }
147+
148+ export type HeadwindOptions = DeepPartial < HeadwindConfig >
Original file line number Diff line number Diff line change 2323 "verbatimModuleSyntax" : true ,
2424 "skipDefaultLibCheck" : true ,
2525 "skipLibCheck" : true
26- }
26+ },
27+ "exclude" : [
28+ " packages/headwind/examples/**/*"
29+ ]
2730}
You can’t perform that action at this time.
0 commit comments