Skip to content

Template for developing a NodeJS app using tpyescript, rollup and esbuild

License

Notifications You must be signed in to change notification settings

matteosacchetto/ts-rollup-esbuild-node-template

Repository files navigation

@matteosacchetto/ts-rollup-esbuild-node-template

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.

conventional commit semantic versioning

Commit messages should follow the Angular commit convention format.

Settings

typescript

Runs with

  • node: >=18.19.0 || >= 20.6.0
  • npm: >=9.6.5

It uses

  • rollup: for its plugin ecosystem
  • esbuild: for transpilation speed
  • biome: for linting and formatting
  • tsx: (esbuild under the hood) as ts to esm loader
  • node:test for testing
  • c8: for coverage reporting

It also provides some env variables which will be replaced during transpilation

  • process.env.PKG_NAME: contains package name
  • process.env.PKG_VERSION: contains the package version
  • process.env.PKG_DESCRIPTION: contains package description
  • process.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 file
  • pr-linter: enforces conventional commit in PR
  • ci: runs npm run test and npm run build. If it is a PR it also runs npm run style:check
  • release: it uses release-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.

About

Template for developing a NodeJS app using tpyescript, rollup and esbuild

Topics

Resources

License

Stars

Watchers

Forks