ts

A base template monorepo for Typescript projects, set up to be open sourced under Apache 2.0 license

APACHE-2.0 License

Stars
0
Committers
2

DotMH Typescript Template

Introduction

This is a template project for me to build my other projects from without needing to boiler plate so much. It assumes that you want to make a Typescript project, whether for the browser or node.

Getting Started:

  1. Create a new repo from this
    template in github
  2. Duplicate the template example in libs/template
  3. Connect to a new Codespace
  4. Start building out your project

Optional

Technology

Supported

  • Github Codespaces / Devcontainers
    the repo supports devcontainers to allow easier development where ever they are supported, including
    using Github Codespaces.

Tsconfig

This repo makes use of the DotMH Tsconfig

Smart Builder

[!WARNING] This project includes support for Smart Builder which is pre-release and so may contain bugs or not work as expected. It is also likely to change

This project makes use of the experimental Smart Builder a tool designed to build mono-repo package dependency chains in the correct warning. If you wish to use it, you don't need to do anything just run:

$ pnpm -w build

Dry Run

If you want to see which dependencies and in what order they are going to get built in run

$ pnpm -w build:dry-run

Removing

To remove smart builder is pretty easy

$ pnpm un @dotmh/smart-build

Then update the build and build:dry-run tasks in package.json at the project route

Style

The repo is designed to enforce code styling rules across the repo. It uses the DotMH eslint and prettier configs by default. It also enforces commit styles with commit lint which will enforce conventional commits.

Safety

The repo makes use of secret lint to attempt to guard against secrets between accidentally pushed to git. This however should not be relied on!

Don't commit secrets

CI

Makes use of Github actions, by default this will test and lint the code

Git

When you make a commit the following will happen BEFORE the commit is added to git.

  1. Check your git message conforms to conventional commits - BLOCKING
  2. Checks you haven't commit any secrets - BLOCKING

When you push code up to a remote repository the following will happen BEFORE the code is pushed

  1. Checks you haven't commit any secrets - BLOCKING
  2. Run the code through eslint - BLOCKING
  3. Run the code through prettier - BLOCKING
  4. Run the tests on all packages in the workspace - BLOCKING

This can be changed by changing the pnpm script githook:prepush in the root package.json

License

This repo is set up with an Apache 2.0 license and this will carry over to any projects that are generated from the template unless you remove it.