My 'as few deps as possible' monorepo setup

preview_player
Показать описание
Become a TypeScript Wizard with my free beginners TypeScript Course:

Follow Matt on Twitter

Join the Discord:

Рекомендации по теме
Комментарии
Автор

This man’s content is always golden. Unlike theo and prime ranting about the most random crap

AbstruseJoker
Автор

Do you have it somewhere on github working?

kszyh_
Автор

What cannot be overlooked is how you provide types from your libraries to apps. If you do it as an npm package would do, via .d.ts files, you have to always rebuild the library with tsc after any modification, for the changes to be picked up by other parts of the monorepo. If you decide to point to .ts source code, you are able to skip this step, at the cost of tsc analysing your library source code even when type-checking the app, additionally imposing the same „strictness” between the compiler options (the app cannot be stricter than the library it uses).

Endrju
Автор

Super great and to the point. It would be cool if you did a series incrementally adding only the most beneficial packages for a project to have. I believe that would be very informative

Gonzalo-xn
Автор

Matt Pocock is my favorite dev youtuber

gm
Автор

add a `shell.nix` to automatically install turbo and pnpm for you and then your machine only needs one system dependency

jenreiss
Автор

thanks for the video... do you have one where you show how to configure prism with a turborepo ?

if not, would you be willing to make a practical video? please?

Grishopping
Автор

There is the big war on turbo vs nx..
I personally like `nx` but I am not against turbo, I have just not seen any clear reason of why I would switch, so I just stick with what I know.
Though, I do like that we have 6 completely independant apps that interlink externally from, so it's nice to use the `nx` tagging system to say `serve the tag:code-name` apps, or `serve the tag:legacy`

ColinRichardson
Автор

Thank you for this! I have always struggled understanding tsconfig, and setting up a proper mono repo, your videos are gold! One thing I still am not certain of is the composite: true option for monorepo libs. When this is set the tsconfig.tsbuildinfo goes into the dist folder root, which causes the src folder to do the same instead of having all the built js in the root of dist, I’m wondering if this is normal behavior? Or if it’s something that can be avoided with some magic? Thank you again for sharing all of your TS magic!

cryoexn
Автор

Great I’m starting a monorepo for a domain driven project i have in mind and this will help a lot

hugazo
Автор

Hi, great video. This is the exact setup I implmented for our current project at work several months ago. It would be great to see some more details on the Turborepo. The documantation is good but the setup is not trivial

v_r_to_c_n
Автор

@mattpocockuk would you be able to suggest a similar set up with NX? A short video like that one would be great ❤.

syedamz
Автор

What I've come to find has trouble scaling is the "internal" packages you'd build continually with --watch. Monorepo really encourages you to put whatever you can in a separate package and having to build all of these each time you change anything becomes really cumbersome as you scale up. Not to mention stuff like fast-reload, which does become a bit harder to set up. I've started going down the rabbit hole of exporting the main TS file directly in "internal" packages, but that comes with its own set of issues.

To be fair I don't have any answers here. It feels like this area is still not well thought-out.

tichopad
Автор

Matt long time no see, nice to see your news vids

novailoveyou
Автор

this video makes me think i picked the right dependencies thanks for the confidence boost now all i need to do is settle on a js framework

bernardstein
Автор

Using the exact same base setup for close to two years now 😁

joestrkr
Автор

how do you use it for dev/local env where you want to restart the Node automatically whenever either an app or a library code got changed?

nnnikolay
Автор

what would your first choice for testing be in this kind of setup?

prasinar
Автор

How are PRs managed in large monorepos?

For example, I get the idea of using a monorepo for building a design system but when we add something like `/apps` to it; Are we adding "real" apps to the monorepo as well? and if this is the case, if you have 8-10 apps using your design system, how are PRs managed?

tarunpai
Автор

Why use turborepo if the goal is minimize deps? Could just use npm workspaces

Boha