File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
scripts/check-dependencies Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ import { cpus } from 'node:os' ;
2+
13const ignore = {
24 'core-js-builder' : [
35 'mkdirp' ,
@@ -14,7 +16,7 @@ const pkgs = await glob([
1416 '@(packages|scripts|tests)/*/package.json' ,
1517] ) ;
1618
17- await Promise . all ( pkgs . map ( async path => {
19+ async function checkPackage ( path ) {
1820 const { name = 'root' , dependencies, devDependencies } = await fs . readJson ( path ) ;
1921 if ( ! dependencies && ! devDependencies ) return ;
2022
@@ -33,6 +35,19 @@ await Promise.all(pkgs.map(async path => {
3335 echo ( chalk . cyan ( `${ name } :` ) ) ;
3436 console . table ( obsolete ) ;
3537 }
38+ }
39+
40+ let i = 0 ;
41+
42+ await Promise . all ( Array ( cpus ( ) . length ) . fill ( ) . map ( async ( ) => {
43+ while ( i < pkgs . length ) {
44+ const path = pkgs [ i ++ ] ;
45+ try {
46+ await checkPackage ( path ) ;
47+ } catch {
48+ echo ( chalk . red ( `${ chalk . cyan ( path ) } check error` ) ) ;
49+ }
50+ }
3651} ) ) ;
3752
3853echo ( chalk . green ( 'dependencies checked' ) ) ;
You can’t perform that action at this time.
0 commit comments