11import { exec as originalExec } from 'node:child_process'
2- import { writeFile , readFile } from 'node:fs/promises'
2+ import { writeFile , readFile , readdir } from 'node:fs/promises'
33import { join } from 'node:path'
44import { URL } from 'node:url'
55import { promisify } from 'node:util'
@@ -17,13 +17,15 @@ export interface Deploy {
1717 logs : string
1818}
1919
20- // TODO(serhalp): List all monorepo packages dynamically? It gets super confusing when you
21- // have changes to some transitive package and it fails in a weird way...
22- const packages = [
23- { name : '@netlify/dev-utils' , dirName : 'dev-utils' } ,
24- { name : '@netlify/vite-plugin' , dirName : 'vite-plugin' } ,
25- { name : '@netlify/vite-plugin-tanstack-start' , dirName : 'vite-plugin-tanstack-start' } ,
26- ]
20+ const packagesRootDir = join ( import . meta. dirname , '../../../' )
21+ const packageDirs = await readdir ( packagesRootDir )
22+ const packages = await Promise . all (
23+ packageDirs . map ( async ( dirName ) => {
24+ const packageJsonPath = join ( packagesRootDir , dirName , 'package.json' )
25+ const packageJson = JSON . parse ( await readFile ( packageJsonPath , 'utf-8' ) ) as Package
26+ return { name : packageJson . name , dirName }
27+ } ) ,
28+ )
2729
2830/**
2931 * Inject the current revision of this repo's packages into the fixture.
0 commit comments