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.
- Create a new repo from this template in github
- Duplicate the
template
example in libs/template - Connect to a new Codespace
- Start building out your project
Optional
- Add new packages to pnpm-workspace.yaml such as
apps
,bins
etc.
- 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
- Github Codespaces / Devcontainers the repo supports devcontainers to allow easier development where ever they are supported, including using Github Codespaces.
This repo makes use of the DotMH Tsconfig
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
If you want to see which dependencies and in what order they are going to get built in run
$ pnpm -w build:dry-run
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
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.
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
Makes use of Github actions, by default this will test and lint the code
When you make a commit the following will happen BEFORE the commit is added to git.
- Check your git message conforms to conventional commits - BLOCKING
- Checks you haven't commit any secrets - BLOCKING
- You can edit 1. in .husky/commit-msg
- You can edit 2. by editing the script
githook:precommit
the root package.json
When you push code up to a remote repository the following will happen BEFORE the code is pushed
- Checks you haven't commit any secrets - BLOCKING
- Run the code through eslint - BLOCKING
- Run the code through prettier - BLOCKING
- 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
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.