-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
In DiscussionNot yet reached consensusNot yet reached consensusScenario: Monorepos & Cross-Project ReferencesRelates to composite projects (a.k.a references between "medium sized projects")Relates to composite projects (a.k.a references between "medium sized projects")SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Genesis: see section "Repetitive configuration" in #3469 (comment)
Search Terms
monorepo infer project references automatically yarn lerna workspace package.json
Suggestion
For common monorepo managers, we should natively understand cross-project references declared in package.json
as if they were declared in tsconfig.json
Open questions:
- Which formats (lerna, yarn, pnpm, etc) would be supported? Can all of them be consistently detected, or would you need to opt in to a specific "monorepo format" to enable a specific resolution algorithm?
- How do we find the
tsconfig.json
file? This data is actually not present in the current (non-tsconfig) dependency graph. We could assume it to be in the package root; what if it's elsewhere? - Would you need to opt in? Would there be a way to opt out? What should that look like?
Use Cases
- Monorepos of all (supportable) flavors
Examples
https://github.com/RyanCavanaugh/learn-a
This repo has a fair bit of duplication where projects need to write down their dependencies in package.json and as references (with different syntax) in tsconfig.json
.
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)
yortus, spion, axefrog, akosyakov, friflo and 187 moreniieani, abirmingham, tmtron, molszanski, geoyws and 13 moregeoyws, guilhermetelles, andreialecu, chrismohr, HIMISOCOOL and 11 moregeoyws, guilhermetelles, andreialecu, twavv, NickHeiner and 5 moretherealparmesh, iilei, molszanski, guilhermetelles, andreialecu and 3 more
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusScenario: Monorepos & Cross-Project ReferencesRelates to composite projects (a.k.a references between "medium sized projects")Relates to composite projects (a.k.a references between "medium sized projects")SuggestionAn idea for TypeScriptAn idea for TypeScript