refactor: create more types to simplify TuonoConfig management (#699)

This commit is contained in:
Marco Pasqualetti
2025-04-03 08:53:06 +02:00
committed by GitHub
parent b24466fb11
commit 0fa83fb1a2
3 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import type { TuonoConfig } from '../config'
import type { TuonoConfig, TuonoConfigServer } from '../config'
export interface InternalTuonoConfig extends Omit<TuonoConfig, 'server'> {
server: Required<NonNullable<TuonoConfig['server']>>
server: TuonoConfigServer
}
+1 -1
View File
@@ -1 +1 @@
export type { TuonoConfig } from './types'
export type { TuonoConfig, TuonoConfigServer } from './types'
+7 -5
View File
@@ -5,15 +5,17 @@ import type {
CSSOptions,
} from 'vite'
export interface TuonoConfigServer {
host: string
origin: string | null
port: number
}
/**
* @see http://tuono.dev/documentation/configuration
*/
export interface TuonoConfig {
server?: {
host?: string
origin?: string | null
port?: number
}
server?: Partial<TuonoConfigServer>
vite?: {
alias?: AliasOptions
css?: CSSOptions