Our great sponsors
-
lerna
:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I use Lerna to manage a monorepo with several TypeScript projects. For those who don't know, Lerna creates symlinks between dependent projects and makes them see each other as normal npm packages. It's kinda awesome, but there is an issue. My project structure looks roughly like this:
I don't think there is a limit on the depth of these paths. I've definitely seen 3+ levels deep imports in other libraries (I think io-ts did something like that).
I meant a pattern that many libraries use, allowing to import things from their submodules. lodash is a utility library I used as an example. Apart from a single import path for everything, it allows to do the following:
If these are libraries, and you aim to publish them, you will have to do some mangling in the prepublish scripts. I actually describe this in a recent issue here: https://github.com/NiGhTTraX/ts-monorepo/issues/53