DEV Community

loading...

Discussion on: Exploring the Monorepo #2: Workspaces (npm, pnpm)

Collapse
zkochan profile image
Zoltan Kochan

In the pnpm monorepo we also use project references.

I created this helper package to generate the tsconfig files: github.com/pnpm/meta-updater

Here's how we use it: github.com/pnpm/pnpm/blob/main/uti...

Collapse
jonlauridsen profile image
Jon Lauridsen Author • Edited

That looks good Zoltan, thanks for the links!

Very interesting to browse the pnpm monorepo, I'm left wondering if pnpm decided on using project references knowing things like "strict" doesn't work across projects, or if it was a case of "good enough" and you don't actually hit that problem…🤔

At this point I'm more confused about how Typescript intends their References feature should be used than when I began these articles, I'm not at all sure how tsconfig options get merged, if they do at all. Am I the only person who was expecting projects to be truly separate?

I see all your packages make use of "outDir" and "rootDir" and I think those settings only get used when running tsc -b or equivalent to build to source, which I assume you run before publishing the packages. My only concern is the runtime though and in that context I'm hitting the strict-failure, and when I can't clearly read why from the documentation I start dreaming about a world without Typescript 😄.

I've noted meta-updater for later research, I think it's exactly what I'll be looking for to help script away the downsides I ended up on in attempt 3.