Skip to content

Commit 78be83a

Browse files
committed
chore: resolve typecheck
chore: wip
1 parent afca37b commit 78be83a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

packages/headwind/src/plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { BunPlugin } from 'bun'
2-
import type { HeadwindConfig } from './types'
2+
import type { HeadwindConfig, HeadwindOptions } from './types'
33
import { loadConfig } from 'bunfig'
44
import { defaultConfig } from './config'
55
import { 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

packages/headwind/src/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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>

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@
2323
"verbatimModuleSyntax": true,
2424
"skipDefaultLibCheck": true,
2525
"skipLibCheck": true
26-
}
26+
},
27+
"exclude": [
28+
"packages/headwind/examples/**/*"
29+
]
2730
}

0 commit comments

Comments
 (0)