@@ -18,29 +18,27 @@ export const extractPackageApiEffect = ({
1818 maxDepth = 5 ,
1919 bunPath = "bun" ,
2020} : ExtractPackageApiOptions ) =>
21- Effect . scoped (
22- Effect . gen ( function * ( _ ) {
23- const startTime = performance . now ( ) ;
24- const pkgName = yield * _ ( packageName ( pkg ) ) ;
25- const { path : cwd } = yield * _ ( workDir ) ;
26- const packages = yield * _ ( installPackage ( { pkg, cwd, bunPath } ) ) ;
27- const pkgDir = join ( cwd , "node_modules" , pkgName ) ;
28- const pkgJson = yield * _ ( packageJson ( pkgDir ) ) ;
29- const types = yield * _ ( packageTypes ( pkgJson , subpath ) ) ;
30- const indexFilePath = join ( pkgDir , types ) ;
31- const { project, indexFile } = yield * _ ( createProject ( { indexFilePath, cwd } ) ) ;
32- const overview = packageOverview ( indexFile ) ;
33- const declarations = yield * _ ( packageDeclarations ( { pkgName, project, indexFile, maxDepth } ) ) ;
34- return {
35- name : pkgJson . name ,
36- version : pkgJson . version ,
37- subpath,
38- types,
39- overview,
40- declarations,
41- packages,
42- analyzedAt : new Date ( ) . toISOString ( ) ,
43- analyzedIn : Math . round ( performance . now ( ) - startTime ) ,
44- } satisfies PackageApi ;
45- } ) ,
46- ) ;
21+ Effect . gen ( function * ( _ ) {
22+ const startTime = performance . now ( ) ;
23+ const pkgName = yield * _ ( packageName ( pkg ) ) ;
24+ const { path : cwd } = yield * _ ( workDir ) ;
25+ const packages = yield * _ ( installPackage ( { pkg, cwd, bunPath } ) ) ;
26+ const pkgDir = join ( cwd , "node_modules" , pkgName ) ;
27+ const pkgJson = yield * _ ( packageJson ( pkgDir ) ) ;
28+ const types = yield * _ ( packageTypes ( pkgJson , subpath ) ) ;
29+ const indexFilePath = join ( pkgDir , types ) ;
30+ const { project, indexFile } = yield * _ ( createProject ( { indexFilePath, cwd } ) ) ;
31+ const overview = packageOverview ( indexFile ) ;
32+ const declarations = yield * _ ( packageDeclarations ( { pkgName, project, indexFile, maxDepth } ) ) ;
33+ return {
34+ name : pkgJson . name ,
35+ version : pkgJson . version ,
36+ subpath,
37+ types,
38+ overview,
39+ declarations,
40+ packages,
41+ analyzedAt : new Date ( ) . toISOString ( ) ,
42+ analyzedIn : Math . round ( performance . now ( ) - startTime ) ,
43+ } satisfies PackageApi ;
44+ } ) ;
0 commit comments