This is the usual configuration I always end up doing when creating services with nodejs and typescript.
You can also use it for a package.
-
Clone the project:
git clone https://github.com/MarcosNicolau/node-js-typescript-setup ./<YOUR_DIRECTORY>
-
Give permission to the setup script:
sudo chmod +x ./setup.sh
-
Run setup:
yarn setup
This configuration will setup:
- eslint
- prettier
- husky, commitizen and .commitlint
- ts-config paths: added some basic paths in tsconfig.json, make sure you change it to your needs
- jest configuration
- semantic-release: npm (won't publish), changelog, tag, and git
- add some basic github workflows to automate semantic releasing
When running yarn setup
you will be prompt to enter the basic package info and whether you would like to setup docker.
- Creates a Dockerfile
- Creates package scripts to manage docker actions
- Updates release workflow to include docker publish. Pushes the container to the GitHub container registry
If you want to use this project to publish a package, change the package.json private
field to false
.
If you whish to automate publishing for npm, add NPM_TOKEN var to the project secrets. click here to read docs
Commitizen is a cli tool that is a must have to me because it enforces a clear and solid patterns of commits following the commonly used angular guideline.
Whenever you commit your code, run yarn cm
and follow the tool steps.
For more information access their repo here
Yes of course you can, feel free to create any pr.