/monorepo-starter

Another monorepo starter template

Primary LanguageTypeScriptMIT LicenseMIT

Use this template Open in StackBlitz CI CodeQL

🪛 Monorepo starter

tl;dr - it's a boilerplate for starting Node.js projects for nerds

It's recommended to use Docker, VS Code and related extensions for - read more about devcontainers.

Does it work without Docker and Devcontainer?

Of course, these are only recommended tools. You have to comply with the Devcontainer configurations, which you can find in the .devcontainer folder.

Installation

cd ~/Code/GitHub/...
npx degit https://github.com/nandordudas/monorepo-starter
cd monorepo-starter
cp .env.example .env
code . -n # or code . -r

Open folder in Devcontainer, do some setup and enjoy.

git init -b main
git add .
git commit -m "chore: initial commit"
git remote add origin https://github.com/...
npx bumpp major --files */**/package.json --no-{commit,push,tag}
npx bumpp premajor --preid alpha --no-verify --yes

Usage

Run dev on apps

pnpm -F "./apps/**" dev

Run build on packages

pnpm -F "./packages/**" build

Setup shortcuts

Setting up git

Simple config

email=john.doe@email.com
name="John Doe"

git config --global user.email $email
git config --global user.name $name
git config --global core.editor "code --wait"

Adnvanced config - using GPG key

sudo apt update -y && sudo apt upgrade -y
# Recommeneded on WSL
# sudo apt install -y gpg socat && sudo apt autoremove -y

# Windows only
# echo "pinentry-program $(command -v pinentry.exe)" >~/.gnupg/gpg-agent.conf

# start new session - not necessary
bash

chmod 700 ~/.gnupg
chmod 600 ~/.gnupg/*
gpg-connect-agent reloadagent /bye
gpg --default-new-key-algo rsa4096 --gen-key

signing_key=$(
  gpg --list-secret-keys --keyid-format long |
  grep ^sec |
  tail -1 |
  cut -f 2 -d "/" |
  cut -f 1 -d " "
)

git config --global commit.gpgsign true
git config --global tag.forcesignannotated true
git config --global user.signingkey "${signing_key}"

gpg --armor --export "${signing_key}"
#  Windows only
# gpg --armor --export "${signing_key}" | clip.exe
# explorer.exe https://github.com/settings/gpg/new

# close the open session
exit

VS Code settings - if you prefer to commit from VS Code

{
  "git.enableCommitSigning": true
}
Setting up VS Code

More about setup

code --install-extension ms-vscode-remote.remote-containers
# Windows only
# code --install-extension ms-vscode-remote.remote-wsl
# code --remote wsl+Ubuntu