File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ function hasIslandFiles(dir: string): boolean {
6767 return false ;
6868}
6969
70- export function voidMarkdown ( options ?: MarkdownOptions ) : ReadonlyArray < Plugin > {
70+ export function voidMarkdown ( options ?: MarkdownOptions ) : Array < Plugin > {
7171 let adapter : FrameworkAdapter | null = null ;
7272 let mdPages : ReadonlyArray < MdPage > = [ ] ;
7373 let root = '' ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export type VoidReactOptions = Readonly<{
1515 prefetch ?: PrefetchConfig ;
1616} > ;
1717
18- export function voidReact ( options ?: VoidReactOptions ) : ReadonlyArray < Plugin > {
18+ export function voidReact ( options ?: VoidReactOptions ) : Array < Plugin > {
1919 const pagesDir = join ( process . cwd ( ) , 'pages' ) ;
2020 return [
2121 ...react ( options ?. react ) ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ function configPlugin(): Plugin {
4444 } ;
4545}
4646
47- export function voidSolid ( options ?: VoidSolidOptions ) : ReadonlyArray < Plugin > {
47+ export function voidSolid ( options ?: VoidSolidOptions ) : Array < Plugin > {
4848 const pagesDir = join ( process . cwd ( ) , 'pages' ) ;
4949 return [
5050 configPlugin ( ) ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export type VoidSvelteOptions = Readonly<{
1515 prefetch ?: PrefetchConfig ;
1616} > ;
1717
18- export function voidSvelte ( options ?: VoidSvelteOptions ) : ReadonlyArray < Plugin > {
18+ export function voidSvelte ( options ?: VoidSvelteOptions ) : Array < Plugin > {
1919 const pagesDir = join ( process . cwd ( ) , 'pages' ) ;
2020 return [
2121 ...( svelte ( options ?. svelte ) as ReadonlyArray < Plugin > ) ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export type VoidVueOptions = Readonly<{
99 viewTransitions ?: boolean ;
1010} > ;
1111
12- export function voidVue ( options ?: VoidVueOptions ) : ReadonlyArray < Plugin > {
12+ export function voidVue ( options ?: VoidVueOptions ) : Array < Plugin > {
1313 const pagesDir = join ( process . cwd ( ) , 'pages' ) ;
1414 return [
1515 vue ( options ?. vue ) as Plugin ,
Original file line number Diff line number Diff line change 1+ import type { Plugin , UserConfig } from 'vite' ;
2+ import { describe , expectTypeOf , it } from 'vite-plus/test' ;
3+ import type { voidPlugin } from 'void' ;
4+ import { voidVue } from '../../src/plugin.ts' ;
5+
6+ type VitePlugins = NonNullable < UserConfig [ 'plugins' ] > ;
7+
8+ describe ( 'voidVue plugin types' , ( ) => {
9+ it ( 'returns a mutable plugin array for Vite config compatibility' , ( ) => {
10+ expectTypeOf < ReturnType < typeof voidVue > > ( ) . toEqualTypeOf < Array < Plugin > > ( ) ;
11+ } ) ;
12+
13+ it ( 'supports the scaffolded nested Vite plugins shape' , ( ) => {
14+ expectTypeOf <
15+ [ ReturnType < typeof voidPlugin > , ReturnType < typeof voidVue > ]
16+ > ( ) . toMatchTypeOf < VitePlugins > ( ) ;
17+ } ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments