Skip to content

feat(setup): detect npm/yarn workspace monorepos + brief stack fallback#170

Merged
stackbilt-admin merged 1 commit into
mainfrom
feat/ts-monorepo-stack-detection
May 23, 2026
Merged

feat(setup): detect npm/yarn workspace monorepos + brief stack fallback#170
stackbilt-admin merged 1 commit into
mainfrom
feat/ts-monorepo-stack-detection

Conversation

@stackbilt-admin
Copy link
Copy Markdown
Member

Summary

  • loadPackageContexts() now reads npm/yarn workspaces (array and { packages: [...] } object forms) from the root package.json and expands each glob using the existing expandWorkspacePackageJsonGlob helper — workspace packages are included in detection alongside pnpm workspaces
  • detectStack() monorepo flag now also fires when the root package.json carries a workspaces field (catches workspace roots even before sub-packages are loaded)
  • generateBrief() (context.ts) calls detectStack(loadPackageContexts()) as a final fallback when stack remains 'unknown' after config + ADF resolution, so npm/yarn monorepos surface the correct preset automatically

Closes #160.

Test plan

  • loadPackageContexts + detectStack (npm workspaces) > discovers packages listed via npm workspaces array glob
  • loadPackageContexts + detectStack (npm workspaces) > discovers packages via npm workspaces object form { packages: [...] }
  • loadPackageContexts + detectStack (npm workspaces) > sets monorepo=true and detects correct preset for npm workspace repo
  • Full suite: 496 tests pass (pnpm vitest run)

🤖 Generated with Claude Code

…ectStack in brief

Fixes #160. Three gaps closed:
- `loadPackageContexts()` now reads npm/yarn `workspaces` (array and
  object forms) from root package.json and expands each glob via the
  existing `expandWorkspacePackageJsonGlob` helper, so workspace packages
  are included in detection alongside pnpm workspaces.
- `detectStack()` monorepo flag now also fires when the root package.json
  carries a `workspaces` field (catches single-package workspace roots
  before any sub-packages are loaded).
- `generateBrief()` in context.ts now calls `detectStack(loadPackageContexts())`
  as a final fallback when stack remains 'unknown' after config + ADF
  resolution, surfacing the correct preset automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stackbilt-admin stackbilt-admin merged commit 0844601 into main May 23, 2026
3 checks passed
@stackbilt-admin stackbilt-admin deleted the feat/ts-monorepo-stack-detection branch May 23, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(context): stack detection fails for TypeScript monorepos — reports 'unknown'

1 participant