Follow-up to #87. v0.1.4 resolves Bun's general catalog (workspaces.catalog), but grouped catalogs (workspaces.catalogs.<group>) are still not resolved.
Environment
react-doctor: 0.1.4
- Package manager: Bun
1.3.1
- Monorepo with Bun workspace grouped catalogs
Reproduction
- Root
package.json:
{
"workspaces": {
"packages": ["apps/*"],
"catalogs": {
"react19": {
"react": "19.2.0",
"react-dom": "19.2.0"
}
}
}
}
- App
package.json (e.g. apps/web/package.json):
{
"dependencies": {
"react": "catalog:react19",
"react-dom": "catalog:react19"
}
}
- From the repo root:
Actual behavior
Scanning /repo/apps/web...
Something went wrong. Please check the error below for more details.
No React dependency found in /repo/apps/web/package.json.
Add "react" to dependencies (or peerDependencies) and re-run.
Expected behavior
react-doctor should resolve catalog:<group> references against the root workspaces.catalogs.<group> map and report the concrete React version (19.2.0 here).
Root cause
In dist/index.js (resolveCatalogVersion, ~lines 773–800), only these locations are checked:
packageJson.catalog (top-level)
packageJson.catalogs (top-level)
packageJson.workspaces.catalog (Bun general catalog) ✅
pnpm-workspace.yaml
The Bun grouped location — packageJson.workspaces.catalogs[catalogName] — is never read, so any dep declared as catalog:<group> resolves to null and downstream throws the misleading "No React dependency found" error.
Suggested fix
After the existing workspaces.catalog branch, add a parallel branch for workspaces.catalogs mirroring the top-level packageJson.catalogs handling:
if (workspaces && !Array.isArray(workspaces) && isPlainObject(workspaces.catalogs)) {
const namedCatalog = catalogName ? workspaces.catalogs[catalogName] : undefined;
if (namedCatalog && isPlainObject(namedCatalog)) {
const version = resolveVersionFromCatalog(namedCatalog, packageName);
if (version) return version;
}
for (const catalogEntries of Object.values(workspaces.catalogs)) {
if (isPlainObject(catalogEntries)) {
const version = resolveVersionFromCatalog(catalogEntries, packageName);
if (version) return version;
}
}
}
Reference: https://bun.com/docs/install/catalogs (grouped catalogs are documented under workspaces.catalogs).
Happy to send a PR if useful.
Follow-up to #87. v0.1.4 resolves Bun's general catalog (
workspaces.catalog), but grouped catalogs (workspaces.catalogs.<group>) are still not resolved.Environment
react-doctor:0.1.41.3.1Reproduction
package.json:{ "workspaces": { "packages": ["apps/*"], "catalogs": { "react19": { "react": "19.2.0", "react-dom": "19.2.0" } } } }package.json(e.g.apps/web/package.json):{ "dependencies": { "react": "catalog:react19", "react-dom": "catalog:react19" } }Actual behavior
Expected behavior
react-doctorshould resolvecatalog:<group>references against the rootworkspaces.catalogs.<group>map and report the concrete React version (19.2.0here).Root cause
In
dist/index.js(resolveCatalogVersion, ~lines 773–800), only these locations are checked:packageJson.catalog(top-level)packageJson.catalogs(top-level)packageJson.workspaces.catalog(Bun general catalog) ✅pnpm-workspace.yamlThe Bun grouped location —
packageJson.workspaces.catalogs[catalogName]— is never read, so any dep declared ascatalog:<group>resolves tonulland downstream throws the misleading "No React dependency found" error.Suggested fix
After the existing
workspaces.catalogbranch, add a parallel branch forworkspaces.catalogsmirroring the top-levelpackageJson.catalogshandling:Reference: https://bun.com/docs/install/catalogs (grouped catalogs are documented under
workspaces.catalogs).Happy to send a PR if useful.