1- import { join } from "node:path"
2- import { ComponentLibrary , ComponentLibraryElement } from "./_types"
3- import { cwd } from " node:process"
4- import { globSync } from " node:fs"
1+ import type { ComponentLibrary , ComponentLibraryElement } from './_types'
2+ import { globSync } from 'node:fs'
3+ import { join } from ' node:path'
4+ import { cwd } from ' node:process'
55
6- export function get ( library : ComponentLibrary , element : ComponentLibraryElement , glob : string , filter ?: ( path : string ) => boolean ) {
7- const componentsDir = join ( cwd ( ) , 'packages' , `${ library } -components` , element )
6+ export function get ( library : ComponentLibrary , element : ComponentLibraryElement , glob : string , filter ?: ( path : string ) => boolean ) {
7+ const componentsDir = join ( cwd ( ) , 'packages' , `${ library } -components` , element )
88
9- return globSync ( glob , { cwd : componentsDir , exclude : filter } )
9+ return globSync ( glob , { cwd : componentsDir , exclude : filter } )
1010}
1111
1212export function getList ( library : ComponentLibrary , element : ComponentLibraryElement , glob : string , options : { exclude ?: ( path : string ) => boolean , replace : [ RegExp , string ] } ) {
@@ -19,6 +19,6 @@ export function getList(library: ComponentLibrary, element: ComponentLibraryElem
1919 name,
2020 slug : join ( '/' , `${ library } -components` , element , name ) ,
2121 }
22- }
22+ } ,
2323 ) . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
2424}
0 commit comments