How do you import from "dist" directory of a Lerna package?

This page summarizes the projects mentioned and recommended in the original post on /r/node

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • lerna

    :dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.

  • 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:

  • io-ts

    Runtime type system for IO decoding/encoding

  • 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).

  • 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.

    SurveyJS logo
  • lodash

    A modern JavaScript utility library delivering modularity, performance, & extras.

  • 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:

  • ts-monorepo

    Template for setting up a TypeScript monorepo

  • 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

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts