Starter kit with zero-config for building a library in TypeScript, featuring RollupJS, Jest, Prettier, TSLint, Semantic Release, and more!
TypeScript
Switch branches/tags
Nothing to show
Clone or download
greenkeeper[bot] and alexjoverm Update rollup to the latest version ๐Ÿš€ (#217)
## Version **0.59.2** of [rollup](https://github.com/rollup/rollup) was just published.

<table>
  <tr>
    <th align=left>
      Dependency
    </th>
    <td>
      <code>rollup</code>
    </td>
  </tr>
  <tr>
    <th align=left>
      Current Version
    </th>
    <td>
      0.58.2
    </td>
  </tr>
  <tr>
    <th align=left>
      Type
    </th>
    <td>
      devDependency
    </td>
  </tr>
</table>

The version **0.59.2** is **not covered** by your **current version range**.

If you donโ€™t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

It might be worth looking into these changes and trying to get this project onto the latest version of rollup.

If you have a solid test suite and good coverage, a passing build is a strong indicator that you can take advantage of these changes directly by merging the proposed change into your project. If the build fails or you donโ€™t have such unconditional trust in your tests, this branch is a great starting point for you to work on the update.


---


<details>
<summary>Commits</summary>
<p>The new version differs by 79 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/c464db81b53a3f9acd1edc4f24666e85bdbf7a24"><code>c464db8</code></a> <code>0.59.2</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/b97f0c2d899139579e37933fb40614123ac8c322"><code>b97f0c2</code></a> <code>Update changelog</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/4783eefc5f0c4cf46165e7e34c388ae52e41f7ed"><code>4783eef</code></a> <code>Reassign for-in loop variable; resolves #2199</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/6fdc7445218e3fa632fe6a760bd88534c74e918c"><code>6fdc744</code></a> <code>0.59.1</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/d0de715ab5b27657c13a36122bf38664e9ccf17f"><code>d0de715</code></a> <code>Merge branch 'missing-space'</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/a8a9800c219f4156094101b9c5aeac145b26ab75"><code>a8a9800</code></a> <code>Merge branch 'circular-get-value'</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/4e8435cbb2f8269e3f7b1f04869faf01fba57684"><code>4e8435c</code></a> <code>Resolve #2191: Add spaces after return and yield if necessary</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/e69fbf2a4932f5764d99dd6a64821b6141867806"><code>e69fbf2</code></a> <code>Add circularity prevention to getLiteralValueAtPath</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/60653880da906482f4a5b2874560e1cf2b7b0cf0"><code>6065388</code></a> <code>Fix code style</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/8840dc2a5ea18f455e0ffe5dada7434cf8fe27ff"><code>8840dc2</code></a> <code>0.59.0</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/652be15a2881064a6f590710ceb8b465f0854d52"><code>652be15</code></a> <code>Add release date</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/4fbdd1d212a3bfab92b860e38b84f11635ab31b3"><code>4fbdd1d</code></a> <code>Merge branch 'chunk-export-mode-fix'</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/32913d0cc21352860d1e5b7a612d60d711ef8cf7"><code>32913d0</code></a> <code>early exportMode detection, remove default indirection</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/c084d4a2b5d503e6f1c148d1643cb4bb17c6de9b"><code>c084d4a</code></a> <code>handle namedExportsMode switch on entrypoint dependencies</code></li>
<li><a href="https://urls.greenkeeper.io/rollup/rollup/commit/4b0b32b65d4ec5e168e70d981dc9c49c2e1fb6cb"><code>4b0b32b</code></a> <code>add failing test for default import exportMode check</code></li>
</ul>
<p>There are 79 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/rollup/rollup/compare/d21b9359fe1b8845abb5801dbce27a16f3a67aed...c464db81b53a3f9acd1edc4f24666e85bdbf7a24">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those donโ€™t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot ๐ŸŒด
Latest commit 7b887bb Jul 18, 2018

README.md

TypeScript library starter

styled with prettier Greenkeeper badge Travis Coveralls Dev Dependencies Donate

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

Usage

git clone https://github.com/alexjoverm/typescript-library-starter.git YOURFOLDERNAME
cd YOURFOLDERNAME

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

Start coding! package.json and entry files are already set up for you, so don't worry about linking to your main file, typings, etc. Just keep those files with the same name.

Features

Importing library

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

import myLib from 'mylib'

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

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

NPM scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't ๐Ÿ˜‰)

Excluding peerDependencies

On library development, one might want to set some peer dependencies, and thus remove those from the final bundle. You can see in Rollup docs how to do that.

Good news: the setup is here for you, you must only include the dependency name in external property within rollup.config.js. For example, if you want to exclude lodash, just write there external: ['lodash'].

Automatic releases

Prerequisites: you need to create/login accounts and add your project to:

Prerequisite for Windows: Semantic-release uses node-gyp so you will need to install Microsoft's windows-build-tools using this command:

npm install --global --production windows-build-tools

Setup steps

Follow the console instructions to install semantic release and run it (answer NO to "Do you want a .travis.yml file with semantic-release setup?").

Note: make sure you've setup repository.url in your package.json file

npm install -g semantic-release-cli
semantic-release-cli setup
# IMPORTANT!! Answer NO to "Do you want a `.travis.yml` file with semantic-release setup?" question. It is already prepared for you :P

From now on, you'll need to use npm run commit, which is a convenient way to create conventional commits.

Automatic releases are possible thanks to semantic release, which publishes your code automatically on github and npm, plus generates automatically a changelog. This setup is highly influenced by Kent C. Dodds course on egghead.io

Git Hooks

There is already set a precommit hook for formatting your code with Prettier ๐Ÿ’…

By default, there are two disabled git hooks. They're set up when you run the npm run semantic-release-prepare script. They make sure:

This makes more sense in combination with automatic releases

FAQ

Array.prototype.from, Promise, Map... is undefined?

TypeScript or Babel only provides down-emits on syntactical features (class, let, async/await...), but not on functional features (Array.prototype.find, Set, Promise...), . For that, you need Polyfills, such as core-js or babel-polyfill (which extends core-js).

For a library, core-js plays very nicely, since you can import just the polyfills you need:

import "core-js/fn/array/find"
import "core-js/fn/string/includes"
import "core-js/fn/promise"
...

What is npm install doing on first run?

It runs the script tools/init which sets up everything for you. In short, it:

  • Configures RollupJS for the build, which creates the bundles
  • Configures package.json (typings file, main file, etc)
  • Renames main src and test files

What if I don't want git-hooks, automatic releases or semantic-release?

Then you may want to:

  • Remove commitmsg, postinstall scripts from package.json. That will not use those git hooks to make sure you make a conventional commit
  • Remove npm run semantic-release from .travis.yml

What if I don't want to use coveralls or report my coverage?

Remove npm run report-coverage from .travis.yml

Resources

Projects using typescript-library-starter

Here are some projects that use typescript-library-starter:

Credits

Made with โค๏ธ by @alexjoverm and all these wonderful contributors (emoji key):


Ciro

๐Ÿ’ป ๐Ÿ”ง

Marius Schulz

๐Ÿ“–

Alexander Odell

๐Ÿ“–

Ryan Ham

๐Ÿ’ป

Chi

๐Ÿ’ป ๐Ÿ”ง ๐Ÿ“–

Matt Mazzola

๐Ÿ’ป ๐Ÿ”ง

Sergii Lischuk

๐Ÿ’ป

Steve Lee

๐Ÿ”ง

Flavio Corpa

๐Ÿ’ป

Dom

๐Ÿ”ง

Alex Coles

๐Ÿ“–

David Khourshid

๐Ÿ”ง

Aarรณn Garcรญa Hervรกs

๐Ÿ“–

Jonathan Hart

๐Ÿ’ป

Sanjiv Lobo

๐Ÿ“–

Stefan Aleksovski

๐Ÿ’ป

dev.peerapong

๐Ÿ’ป

Aaron Groome

๐Ÿ“–

Aaron Reisman

๐Ÿ’ป

kid-sk

๐Ÿ“–

Andrea Gottardi

๐Ÿ“–

Yogendra Sharma

๐Ÿ“–

Rayan Salhab

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind are welcome!