Skip to content
/ ts Public template

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

License

Notifications You must be signed in to change notification settings

dotmh/ts

Repository files navigation

DotMH

DotMH Typescript Template

TypeScript NodeJS PNPM Vitest Visual Studio Code Conventional Commits ESLint Prettier GitHub Actions

License Contributor Covenant

Quality gate

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

  • Typescript language
  • PNPM for package managing, also set up as a workspace
  • Tests are been done on VITEST
  • Code Coverage is done with Istanbul and will output HTML and JSON, as well as Text on the command line
  • CI / CD is been handled by github actions

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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published