question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infer project references from common monorepo patterns / tools

See original GitHub issue

Genesis: see section “Repetitive configuration” in https://github.com/Microsoft/TypeScript/issues/3469#issuecomment-400439520

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)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:183
  • Comments:55 (22 by maintainers)

github_iconTop GitHub Comments

141reactions
evocateurcommented, Aug 30, 2018

I’m in the process of writing an apology to the community (for a number of things) accompanying a revert of the license changes. I have been suffering a low-grade anxiety attack almost all day long. I appreciate your patience.

67reactions
RyanCavanaughcommented, Aug 30, 2018

Due to the most common monorepo tool effectively blocking our use of it [1], I don’t think we’ll be able to do any work here without inviting potential legal problems.

FYI @satyanadella

[1] https://github.com/lerna/lerna/pull/1616

Edit: We’re back; see below.

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 Great Tools for a Monorepo in 2021 | Bits and Pieces
Best tools to build a monorepo. Develop, build, and publish packages, and scale development. Discover Lerna, Nx, Rush, Bit, Yarn Workspaces, and more....
Read more >
Typescript-monorepo-toolkit NPM | npm.io
typescript-monorepo-toolkit. CLI tool to automatically setup typescript project references for yarn workspaces monorepos and other tasks.
Read more >
How to set up a TypeScript monorepo and make Go ... - Medium
`references` are not inherited in `tsconfig. · NiGhTTraX/ts-monorepo · Infer project references from common monorepo patterns / tools · Issue # ...
Read more >
The Ultimate Guide to TypeScript Monorepos
TypeScript project references have chiefly been developed to help address the ... monorepo have taken advantage of common JavaScript tools, ...
Read more >
Search: Project infer - Sudo null
https://www.microsoft.com/en-us/research/project/infernet/. Infer.NET is a . ... Infer project references from common monorepo patterns / tools.
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found