News for hackers. Stuff that matters.
Re:Monorepos in JavaScript and TypeScript by dvt on Thursday June 02, 2022 @02:37PM (#31598855)
When people say stuff like this, I genuinely wonder if they actually used lerna. Lerna is more or less a wrapper around yarn/npm, and still 100% totally sucks. Nor does it solve ANY of the problems GP mentions -- which I've also had -- recognizing code from other modules, live-reloading schemas, don't even get me started on jerry-rigging like 8 different webpack plugins because you need sass, but you also need an SVG loader, and also a JSX loader but oops now you're running into some weird conflict between them, etc. etc.

It's honestly embarrassing that modern web development (an incredibly "dumb" network protocol at its core) doesn't have an easier onboarding/development process.

Re:Monorepos in JavaScript and TypeScript by halfmatthalfcat on Thursday June 02, 2022 @08:45PM (#31602664)
Lerna is more akin to loop than it is to a glorified wrapper around yarn/npm, so I question whether it is you who have actually used lerna.

All of the "linking between projects" is exactly what lerna does with bootstrapping/hoisting, so I'm not sure where you're coming from when you say this doesn't address OP's problem.

Re:Monorepos in JavaScript and TypeScript by dvt on Thursday June 02, 2022 @09:46PM (#31603241)
> glorified wrapper around yarn/npm

This is exactly what it is, and it's not even shy about it. It literally calls npm or yarn under the hood (specified with the `npmClient` setting).

> All of the "linking between projects" is exactly what lerna does with bootstrapping/hoisting, so I'm not sure where you're coming from when you say this doesn't address OP's problem.

Yeah, here's a "super simple" lerna example: https://github.com/dan-kez/lerna-webpack-example

It only has about 7 config files before even adding any "real" code. Fun stuff.

Re:Monorepos in JavaScript and TypeScript by halfmatthalfcat on Friday June 03, 2022 @09:39AM (#31608097)
It only relies on npm to do the actual pulling of packages and if you so choose, let yarn do the hoisting (workspaces) but everything else, I fail to see how it's simply a wrapper...

There's a ton of stuff like versioning, linking, running scripts/commands, etc across the entire project that npm and yarn do not inherently support.

I definitely think lerna has warts but it provides a ton of functionality that you'd have to ducktape together on your own, which it looks like a lot of people are trying to do as evident by this entire thread...