fix: better tsconfig extends for monorepos.#101
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances tsconfig extends support for monorepo setups by expanding the allowed workspace boundary beyond just the project root to include parent and grandparent directories. This enables packages in a monorepo to extend a shared base tsconfig located at the workspace root.
Key Changes:
- Introduced workspace boundary concept with three allowed roots: package root, parent root, and workspace root
- Replaced project root validation with workspace-relative path handling that supports multiple allowed roots
- Updated error messages from "project root" to "allowed workspace boundary" for better clarity
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/duel.js |
Core implementation: removed normalize import, added allowedConfigRoots logic with helper functions (isInAllowedRoots, toWorkspaceRelative, requireWorkspaceRelative), updated path resolution throughout to use workspace-relative paths instead of project-relative paths |
test/integration.js |
Added test fixture paths for monorepo-extends scenario, new test case validating monorepo tsconfig extends behavior, updated error message assertion |
test/__fixtures__/monorepo-extends/tsconfig.base.json |
Base TypeScript configuration for monorepo fixture |
test/__fixtures__/monorepo-extends/packages/a/tsconfig.json |
Package-level config extending the base config |
test/__fixtures__/monorepo-extends/packages/a/src/index.ts |
Sample TypeScript source for testing |
test/__fixtures__/monorepo-extends/packages/a/package.json |
Package manifest for monorepo test fixture |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
==========================================
- Coverage 94.33% 93.48% -0.86%
==========================================
Files 4 4
Lines 2031 2071 +40
==========================================
+ Hits 1916 1936 +20
- Misses 115 135 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.