Template for developing a NodeJS app using tpyescript, rollup and esbuild
This repository follows the conventional commit v1.0.0 specification and the semantic versioning v2.0.0 specification.
Commit messages should follow the Angular commit convention format.
Runs with
node
:>=18.19.0 || >= 20.6.0
npm
:>=9.6.5
It uses
rollup
: for its plugin ecosystemesbuild
: for transpilation speedbiome
: for linting and formattingtsx
: (esbuild under the hood) as ts to esm loadernode:test
for testingc8
: for coverage reporting
It also provides some env variables which will be replaced during transpilation
process.env.PKG_NAME
: contains package nameprocess.env.PKG_VERSION
: contains the package versionprocess.env.PKG_DESCRIPTION
: contains package descriptionprocess.env.BUILD_NODE_ENV
: allows to perform threeshaking of code you do not want to have after the production build step
Note
If you are using this template for a CLI add #!/usr/bin/env node
to the top of the src/index.ts
file
It contains already a bunch of github actions configured
sync-labels
: allows you to synch the github labels accoring to the.github/labels.yml
filepr-linter
: enforces conventional commit in PRci
: runsnpm run test
andnpm run build
. If it is a PR it also runsnpm run style:check
release
: it usesrelease-please
to create github releases- To allow this to run you need to set "Allow GitHub Actions to create and approve pull requests" under repository Settings > Actions > General.