Typescript NPM Module Template

This project provides a starting point for a npm module written in typescript

It will handle the following

  1. Testing with Jest
  2. Docs with storybook
  3. React dependency as a webpack external
  4. Building with tsc
  5. Publishing via Github Actions
  6. Linting with ESLint
  7. Formatting with Prettier
  8. .d.ts file generation

Tour

.github This folder contains the release workflow, it will build test and then release the code to NPM based on the version passed in the action parameter

src Contains all source files, to start there is just a basic index file

src/test The test directory contains test sources

Usage

Update package.json

You will need to update the following entries in package.json

  "name": "update-package-name",
  "author": "UPDATE-you@email.com",
  "license": "UPDATE",
  "keywords": [
    "UPDATE"
  ],

NPM_TOKEN

You will then need to add an environment variable named NPM_TOKEN to your github repository secrets

Enjoy!