Skip to content

This project aims to generate library boilerplate (using rollup and typescript) so that I can start building my own libraries right away.

License

Notifications You must be signed in to change notification settings

teixeiravictor/boilerplate-lib

Repository files navigation

Boilerplate Lib - Ligh way to make libs using Typescript and Rollup.

Report a Bug · Request a Feature . Ask a Question

license

Table of Contents

About

Your time should be spent on writing your code, not on doing the setup tasks and configuration. The main advantage of this approach is to decrease the negative time spent on setting up all stack code. Such as like creating your project template from scratch over and over.

However, this template maybe can not be will serve for all your purposes. Be confortable replace the predefined values, then remove unused sections and add your own preferences.

Key features of Template:

  • Travis for continuous integration
  • Semantic Release
  • Git Hooks with Husky and Commitlint
  • Linters (ESLint, Prettier)
  • TDD with Jest
  • Rollup as a bundle tool
  • npm-run-all to run multiple npm-scripts in different environments
  • TypeScript

Built With

Getting Started

Prerequisites

This project was creating using Node.js v16.14.2 and npm 8.7.0.

You can use nvm to install different versions of Node.js. Or use another CLI to manage multiple runtime versions, like asdf.

Usage

  1. Clone this repository.
  2. Run npm install to install all dependencies.
  3. Replace all the markup variables to your desired values
  4. Setup your CI preferences in .travis.yml.
Warning use Yarn 2

Yarn 2+ doesn't support prepare lifecycle script, so husky needs to be installed differently. See Husky Manual for more information.

Commands / npm scripts

Command Description
build Rollup compile main file in chunks inside dist folder
commitmsg Run commitlint
lint Run Eslint
lint:fix Run Eslint with fix option
prettier-format Run fix prettier from all files in project
test Run tests from *.spec.js files
test:coverage Run tests coverage
prepare npm script will execute after 'npm install'
semantic-release Run semantic-release from commits

Contributing

Create bug reports that are:

  • Reproducible. Include steps to reproduce the problem.
  • Specific. Include as much detail as possible: which version, what environment, etc.
  • Unique. Do not duplicate existing opened issues.

License

This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.

See LICENSE for more information.

About

This project aims to generate library boilerplate (using rollup and typescript) so that I can start building my own libraries right away.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published