@@ -13,8 +13,8 @@ import { writeFileSync, mkdirSync } from 'fs';
1313import { join , dirname } from 'path' ;
1414import { fileURLToPath } from 'url' ;
1515
16- import { PACKAGES } from '../src/constants/packages' ;
17- import { fetchDownloads , fetchRegistry , NotFoundError } from '../src/lib/npmApi' ;
16+ import { UNSCOPED_PACKAGES } from '../src/constants/packages' ;
17+ import { fetchDownloads , fetchRegistry , fetchScopedPackages , NotFoundError } from '../src/lib/npmApi' ;
1818import { fetchStars } from '../src/lib/githubApi' ;
1919import {
2020 bucketByMonth ,
@@ -171,8 +171,21 @@ async function main() {
171171 const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
172172 const outPath = join ( __dirname , '../public/data.json' ) ;
173173
174+ // Fetch @bam .tech scoped packages dynamically
175+ console . log ( 'Fetching @bam.tech scoped npm packages...' ) ;
176+ let scopedPackages : string [ ] = [ ] ;
177+ try {
178+ scopedPackages = await fetchScopedPackages ( 'bam.tech' ) ;
179+ console . log ( ` Found ${ scopedPackages . length } scoped npm packages` ) ;
180+ } catch ( err ) {
181+ console . error ( ` npm scope fetch failed: ${ ( err as Error ) . message } ` ) ;
182+ }
183+
184+ // Combine scoped packages with unscoped packages
185+ const npmPackages = [ ...scopedPackages , ...UNSCOPED_PACKAGES ] ;
186+
174187 // Fetch pub.dev package list for bam.tech publisher
175- console . log ( 'Fetching pub.dev packages for bam.tech...' ) ;
188+ console . log ( '\nFetching pub.dev packages for bam.tech...' ) ;
176189 let pubPackages : string [ ] = [ ] ;
177190 try {
178191 pubPackages = await fetchPubPublisherPackages ( 'bam.tech' ) ;
@@ -181,9 +194,9 @@ async function main() {
181194 console . error ( ` pub.dev publisher fetch failed: ${ ( err as Error ) . message } ` ) ;
182195 }
183196
184- console . log ( `\nFetching data for ${ PACKAGES . length } npm packages...` ) ;
197+ console . log ( `\nFetching data for ${ npmPackages . length } npm packages...` ) ;
185198 const npmResults = await Promise . all (
186- PACKAGES . map ( async ( name ) => {
199+ npmPackages . map ( async ( name ) => {
187200 try {
188201 const result = await processNpmPackage ( name ) ;
189202 const status = result . notFound
0 commit comments