# rollup-ts-library-boilerplate

> A library template writing by ts

Latest version **1.0.3** (published 2021-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install rollup-ts-library-boilerplate
pnpm add rollup-ts-library-boilerplate
yarn add rollup-ts-library-boilerplate
bun add rollup-ts-library-boilerplate
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-12-18 |
| First published | 2021-12-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | x-cold |
| Maintainers | x-cold |
| Keywords | rollup, typescript, library, boilerplate |

## Links

- npm: https://www.npmjs.com/package/rollup-ts-library-boilerplate
- Repository: https://github.com/x-cold/rollup-ts-library-boilerplate
- Homepage: https://github.com/x-cold/rollup-ts-library-boilerplate#readme
- Issues: https://github.com/x-cold/rollup-ts-library-boilerplate/issues
- npm.io page: https://npm.io/package/rollup-ts-library-boilerplate

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-12-18
- 1.0.2 — 2021-12-18
- 1.0.1 — 2021-12-18
- 0.0.2 — 2021-12-05
- 0.0.1 — 2021-12-05

## README

Rollup Ts Library Boilerplate
---

[![NPM version][npm-image]][npm-url]
[![build status][gitflow-image]][gitflow-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/rollup-ts-library-boilerplate.svg?style=flat-square
[npm-url]: https://npmjs.org/package/rollup-ts-library-boilerplate
[gitflow-image]: https://github.com/x-cold/rollup-ts-library-boilerplate/actions/workflows/test.yml/badge.svg?branch=master
[gitflow-url]: https://github.com/x-cold/rollup-ts-library-boilerplate/actions/workflows/test.yml
[codecov-image]: https://codecov.io/gh/x-cold/rollup-ts-library-boilerplate/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/x-cold/rollup-ts-library-boilerplate
[download-image]: https://badgen.net/npmnpm/dt/rollup-ts-library-boilerplate
[download-url]: https://npmjs.org/package/rollup-ts-library-boilerplate

A starter project that makes creating a TypeScript library extremely easy.

### Usage

> The version of your node.js should be greater than v12

```bash
git clone git@github.com:x-cold/rollup-ts-library-boilerplate.git YOURFOLDERNAME
cd YOURFOLDERNAME

# Run npm install and write your library name when asked. That's all!
npm install
```

### Features

 - Zero-setup. After running `npm install` things will setup for you :wink:
 - **[RollupJS](https://rollupjs.org/)** for multiple optimized bundles following the [standard convention](http://2ality.com/2017/04/setting-up-multi-platform-packages.html) and [Tree-shaking](https://alexjoverm.github.io/2017/03/06/Tree-shaking-with-Webpack-2-TypeScript-and-Babel/)
 - Tests, coverage and interactive watch mode using **[Jest](http://facebook.github.io/jest/)**
 - **Docs automatic generation and deployment** to `gh-pages`, using **[TypeDoc](http://typedoc.org/)**
 - Automatic types `(*.d.ts)` file generation
 - (Optional) **Automatic releases and changelog**, using [standard-version](https://github.com/conventional-changelog/standard-version#readme), [Commitizen](https://github.com/commitizen/cz-cli), [Conventional changelog](https://github.com/conventional-changelog/conventional-changelog) and [Husky](https://github.com/typicode/husky) (for the git hooks)
 - Deploy your docs to github pages via gh-pages branch

### Importing library

You can import the generated bundle to use the whole library generated by this starter:

```javascript
import myLib from 'mylib'
```

Additionally, you can import the transpiled modules from `dist/lib` in case you have a modular library:

```javascript
import something from 'mylib/dist/lib/something'
```

### NPM scripts

 - `npm lint`: Eslint code
 - `npm lint:fix`: Eslint code and try to fix problems
 - `npm start`: Realtime complie code
 - `npm run docs`: Generate type documents
 - `npm run build`: Build ths dist products
 - `npm run release`: The same as `npm run release:patch`
 - `npm run release:patch`: Automatically upgrade patch versioin and update CHANGELOG.md
 - `npm run release:minor`: Automatically upgrade minor versioin and update CHANGELOG.md
 - `npm run release:major`: Automatically upgrade major versioin and update CHANGELOG.md
 - `npm run test`: Run test suite via jest with code coverage
 - `npm run test:watch`: Run test suite in [interactive watch mode](http://facebook.github.io/jest/docs/cli.html#watch)
 - `npm run test:prod`: Run linting and generate coverage
 - `npm run deploy`: Clean docs directory and rebuild docs pages

### Git Hooks

There is already set a `precommit` hook for formatting your code with Eslint and Commitlint :nail_care:

By default, there are two disabled git hooks. They're set up when you run the `npm i` script. They make sure:
 - You follow a [conventional commit message](https://github.com/conventional-changelog/conventional-changelog)

---
_Source: https://npm.io/package/rollup-ts-library-boilerplate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
