Skip to content

Commit b00e8e6

Browse files
authored
test: fix tanstack e2e test setup (#457)
1 parent fd8b2cc commit b00e8e6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/vite-plugin-tanstack-start/test/support/netlify-deploy.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { exec as originalExec } from 'node:child_process'
2-
import { writeFile, readFile } from 'node:fs/promises'
2+
import { writeFile, readFile, readdir } from 'node:fs/promises'
33
import { join } from 'node:path'
44
import { URL } from 'node:url'
55
import { 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

Comments
 (0)