mpellegrini / fullstack-typescript-monorepo-starter

1 stars 1 forks source link

Fullstack Typescript Monorepo Starter

Overview

Folder Description
packages packages for shared code libraries
apps packages for web applications
toolchain packages supporting the shared toolchain (eslint, vitest, typescript)

Prerequisites

Folder Description
Node.js check node version in engines section of package.json for latest minimum version
PNPM Fast, disk space efficient package manager (PNpm)
(best to install via corepack)
# corepack enable pnpm

Useful Monorepo Operations

Setup

Install the dependencies for all workspaces in the monorepo

pnpm install

Clean

Remove all generated build artifacts for all workspaces in the monorepo

pnpm run -w clean

Build

Produce final generated artifacts for deployment for all relevant workspaces in the monorepo

[!NOTE] Not all workspaces in the monorepo have or need buildtasks

pnpm run -w build

Test

Run unit tests for all workspaces in the monorepo

pnpm run -w test

Lint

Run unit tests for all workspaces in the monorepo

pnpm run -w lint

Type Check

Run TypeScript type checks for all workspaces in the monorepo

pnpm run -w typecheck

Building Docker Image

docker build . -t sveltekit-example-app --build-arg="APP_NAME=sveltekit-example-app"
docker run --rm --name=sveltekit-example-app -p 8080:3000 sveltekit-example-app

Conventional Commits Best Practices

Commit messages must adhere to Conventional Commits best practices. The format proposed by this convention leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.

Default

<type>(<optional scope>): <subject>
empty separator line
<optional body>
empty separator line
<optional footer>

Types

feat Features A new feature
fix Bug Fixes A bug fix
docs Documentation Documentation only changes
style Styles Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor Code refactoring A code change that neither fixes a bug nor adds a feature
perf Performance Improvements A code change that improves performance
test Tests Adding missing tests or correcting existing tests
build Builds Changes that affect the build system or external dependencies (example scopes: turborepo, pnpm)
ci Continuous Integrations Changes to our CI config­uration files and scripts (example scopes: gh-actions)
chore Chores Other changes that don't modify source or test files
revert Reverts Reverts a previous commit

Scopes

The scope provides additional contextual information.

Subject

The subject contains a succinct description of the change.

Body

The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference Issues that this commit refers to.

Examples