[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
  • Amplication - open-source Node.js backend code generator
  • Appwrite - The open-source backend cloud platform
  • SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
  • Sonar - Write Clean JavaScript Code. Always.
  • Mergify - Updating dependencies is time-consuming.
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • 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

  • Amplication

    Amplication: open-source Node.js backend code generator. An open-source platform that helps developers build backends without spending time on boilerplate & repetitive coding. Including production-ready GraphQL & REST APIs, DB schema, DTOs, filtering, pagination, RBAC, & more.

  • 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

  • Appwrite

    Appwrite - The open-source backend cloud platform. The open-source backend cloud platform for developing Web, Mobile, and Flutter applications. You can set up your backend faster with real-time APIs for authentication, databases, file storage, cloud functions, and much more!

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