A quick way of bootstrapping a new mono-repo for a Web Application

Overview
marp theme class author
true
gaia
lead
invert
Matteo ronchi [email protected]

Mono-repo Starter

https://github.com/cef62/monorepo-template


What is a mono-repo?

What problem space does it try to solve?


bg fit


Mono-repo tools


This repository is a quick way of bootstrapping a new mono-repo for a Web Application.


Tech stack


Used to run the examples:


Mono-repo Goals

The repository focuses on creating one or more applications sharing and consuming multiple utilities. You have

  • one application: playground
  • two components collections-cool-components and other-components-
  • and a tool: esbuild-plugins

Coding style and Formatting conventions

  • An editor config file defines basic rules for the coding style.
  • Prettier and eslint automatically format the code for you.

Linting and Static type-checking

  • eslint ensures standard best practices on how to write Javascript code.
  • Typescript offers static type-checking and a better DX.

Automation and git hooks

husky and lint-staged allows for automation driven by git hooks.

A pre-commit hook will format your code before committing it. This automation will guarantee consistency on your codebase no matter who's writing the code.

You can easily add other automation to validate your code before pushing it to Github or refreshing the local artifacts after fetching new code.


PNPM

Out of many tools helping you build a mono-repo, pnpm is my choice of preference.

It's not full-featured as nx or rush and not quite famous as yarn or lerna, but it's by far the more effective tool for my needs.


PNPM Configuration

pnpm offers outstanding defaults out-of-the-box.

A few tweaks I usually apply are:

  • exact dependencies, no versioning ranges allowed
  • strict peer dependencies, ensuring everything run as expected
  • shell emulator, for better cross-platform scripting

PNPM Workspace dependencies

One of the things I like the most about pnpm is that workspace dependencies are 1st class citizens.


Esbuild and Chokidar

Those two tools enable you to develop and consume multiple libraries from one application with zero downtime.

  • esbuild compiles a medium-size library in a tenth of seconds or less
  • chockidar is a smart watcher over your code

Vite JS

vite has been a game-changer for me. webpack is excellent, and I still use it in many projects, but the speed and simplicity of vite are unparalleled.


NodeJS exports

Node had exports map for a long time. Nowadays, most transpiler and bundler tools support the feature.

The most significant issue for me is that typescript doesn't support the features natively yet.

Luckily, there's an easy workaround :)


@cef62 - Twitter

@cef62 - Github

You might also like...

This is email scheduler made using MERN. This repo contains server code, client repo is linked in readme.

Email Scheduler Client This is an email scheduler server (client in different repository). It is made using node.js/express.js. Overview User can sign

Dec 3, 2022

Analyzify's open-source guide & codes on Shopify Pixels & Customer Events. Follow this repo to stay up-to-date with the new pixels.

Analyzify's open-source guide & codes on Shopify Pixels & Customer Events. Follow this repo to stay up-to-date with the new pixels.

Shopify Customer Events & Shopify Pixels Shopify has announced yet another phenomenal feature: Shopify Customer Events also known as Shopify Pixels. O

Dec 8, 2022

Catalogist is the easy way to catalog and make your software and (micro)services visible to your organization in a lightweight and developer-friendly way.

Catalogist is the easy way to catalog and make your software and (micro)services visible to your organization in a lightweight and developer-friendly way.

catalogist 📚 📓 📒 📖 🔖 The easy way to catalog and make your software and (micro)services visible to your organization through an API You were a pe

Dec 13, 2022

🎨 Beautify your github profile with this amazing tool, creating the readme your way in a simple and fast way 🚀 The best profile readme generator you will find ⚡

🎨 Beautify your github profile with this amazing tool, creating the readme your way in a simple and fast way 🚀 The best profile readme generator you will find ⚡

Demo Profile Readme Generator The best profile readme generator you will find! About | Technologies | Requirements | Starting | Contributing 🎯 About

Jan 1, 2023

A new way to share your readings with friends. Hope you like it!

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Sep 9, 2022

MySQL meets Jupyter notebooks. Grasp provides a new way to learn and write SQL, by providing a coding-notebook style with runnable blocks, markdown documentation, and shareable notebooks. ✨

MySQL meets Jupyter notebooks. Grasp provides a new way to learn and write SQL, by providing a coding-notebook style with runnable blocks, markdown documentation, and shareable notebooks. ✨

A New Way to Write & Learn SQL Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Prerequisites Installation

Sep 1, 2022

🔒 The new way to do types in typescript.

Nominal The right way to do types in typescript. Installation npm install nominal-types yarn install nominal-types pnpm install nominal-types Usage

Dec 24, 2022

⚡️ Lightning Time: a new way to measure time

Lightning Time ⚡️ Lightning Time ⚡️ is a new way to measure time. It's a spin on hexadecimal time: the day is split into 16 parts over and over. The f

Nov 22, 2022

An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web

An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web

Feel free to contribute! Where? http://www.jstherightway.org Why? Today we have a bunch of websites running JavaScript. I think we need a place to put

Jan 1, 2023
Owner
Matteo Ronchi
Matteo Ronchi
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
The beam mono repo. maintainer = [@anddddrew]

Beam Jump to: ?? Infrastructure ?? Contributing ?? Contributors ✅ Code of Conduct ?? Designs ?? Packages ?? Infrastructure You can checkout our docume

Beam 10 Oct 31, 2022
mono-repo for lit-app and dependencies

Lit-Apps CAUTION: THIS IS VERY EARLY SOFTWARE - DO NOT USE IN PRODUCTION - VERY LIKELY TO CHANGE Lit-apps an ecosystem of lit-based applications. I

null 16 Dec 18, 2022
Git Frameworker is a CLI tool for quickly bootstrapping custom framework configurations.

Git Frameworker Git Frameworker is a tool that allows you to quickly bootstrap a project using a framework from GitHub. If the repository you clone co

Guilherme Marcondes 6 May 3, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Quick way to start a new TypeScript/Next.js/Firebase web app 😼

create-crash-app Template repo to quickly set up an opinionated, strict config, typesafe Next.js project. Get started with create-crash-app by running

Diego Dorantes-Ferreira 5 Oct 28, 2022
Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.

Obsidian daily notes opener This plugin adds a command for opening daily notes in a new pane (so that a keyboard shortcut could be used!) and gives ex

Xiao Meng 16 Dec 26, 2022
This app offers users a quick way to check the current temperature and humidity of any location in the world.

Pretty Weather App This app offers users a quick way to check weather data for any location in the world. The specific data provided by the app includ

Benjamin Semah 3 Jun 7, 2022
🎯 Wallet Lite is a Quick and Simple way to use your Tokens of Lunes Blockchain in a light Chrome extension

Lunes Wallet Lite Offered by: Lunes Installing Web store: Lunes Lite will be available on Chrome Web Store Build: Requisites NodeJS (16 or higher) Git

Lunes Platform 10 Oct 25, 2022