[AskJS] Is there a silver bullet for consuming Typescript libraries in a Monorepo?

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

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

    Template for setting up a TypeScript monorepo

  • 1. Linking libs with tsconfig paths. This approach involves setting a tsconfig.json paths object which maps the package name, to the local filesystem location. Eg. "paths": {"@org/lib":"../libs/lib"} - Nx uses this approach for their Integrated Monorepo configuration https://nx.dev/tutorials/integrated-repo-tutorial https://github.com/NiGhTTraX/ts-monorepo.

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • tsc compiles .ts node_modules libs even when `skipLibCheck` is set to `true`. This can cause other libs/apps builds to fail if there are inconsistencies. https://github.com/microsoft/TypeScript/issues/41883

  • 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
  • npm-ts-workspaces-example

    Monorepos example project using npm workspaces and TypeScript project references

  • 5. NPM/Yarn/PNMP workspaces with packaged libs and tsconfig project references. This approach is similar to option 2 with the addition of tsconfig project references to facilitate IDE support https://github.com/Quramy/npm-ts-workspaces-example.

  • lerna

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

  • I mean I don't know what your monorepo looks like, but for example infernojs (actually written with typescript) uses lerna, and lerna seems simpler than typescript references

  • inferno

    :fire: An extremely fast, React-like JavaScript library for building modern user interfaces

  • I mean I don't know what your monorepo looks like, but for example infernojs (actually written with typescript) uses lerna, and lerna seems simpler than typescript references

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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