It’s a Node.js Express server that exposes two routes that invoke isEven and isOdd. package/server: Depends on both packages/is-odd and packages/is-even.It includes a CLI script and a test file. It’s a Node.js module that exposes an isOdd function that tells if the input number is odd (by invoking isEven and checking if it’s false). package/is-odd: Depends on packages/is-even.The CLI script runs using esbuild-runner, which uses esbuild to compile it on the fly. It includes a CLI script that invokes the function from your terminal, and a test file, both written in TypeScript. It’s a Node.js module that exposes an isEven function that tells if the input number is even. packages/is-even: The simplest workspace - it doesn’t depend on any other worskpace.Tangerine monorepo includes five workspaces: Uses esbuild + nodemon to reload the server in development mode (even when workspace dependencies are changed).Uses a shareable ESLint config and Jest config to provide an extensible linting and testing setup.Uses Yarn workspaces to make it easy to work within the monorepo.Uses esbuild-runner to run scripts on the fly.No need to keep TypeScript’s Project References up-to-date. Uses tsc CLI to type-check the codebase without emitting the compiled files (since they’re handled by esbuild). Uses Turborepo as a build system to run scripts from the package root.Uses esbuild to compile your TypeScript codebase, tests, and scripts.Uses TypeScript to write code, tests, and scripts.So I created my own template: □ tangerine-monorepo, a “minimal” TypeScript-based Node.js monorepo setup fully powered by esbuild.įeb 3rd 2022 update: Tangerine monorepo now uses Turborepo for an even snappier developer experience □ Features While learning esbuild, I haven’t found many examples of how to integrate it within TypeScript monorepos. I’ve been using esbuilt for a couple of TypeScript projects and have been surprised by how well it performs. While the native TypeScript compiler is not that slow (IMHO), it’s still something you need to take into account if you’re planning to build a large codebase.īut what if there was a way to speed up the TypeScript compilation by using a different compiler?Įnter esbuild: a fast JavaScript bundler that claims to be >10x faster than similar projects (webpack, rollup + terser, parcel 2). And using a monorepo helps in scaling your project(s).Ĭompared to plain JavaScript, however, TypeScript adds an additional compilation layer to your project, which may slow down the developer experience. TypeScript improves the developer experience by adding type-checking and a deep IDE integration. TypeScript monorepos are a great way to organize medium-to-big size projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |