Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Latest commit

 

History

History
97 lines (73 loc) · 3.28 KB

CONTRIBUTING.md

File metadata and controls

97 lines (73 loc) · 3.28 KB

Development zen

This starter includes a watch task which makes development faster and more interactive. It's particularly helpful for TDD/BDD workflows.

To start working, install Yarn and run:

yarn watch

View test coverage

To generate and view test coverage, run:

yarn cov

This will create an HTML report of test coverage – source-mapped back to Typescript – and open it in your default browser.

source-mapped typescript test coverage example

Generate your API docs

The src folder is analyzed and documentation is automatically generated using typedoc.

yarn docs

This command generates API documentation for your library in HTML format.

Since types are tracked by Typescript, there's no need to indicate types in JSDoc format. For more information, see the typedoc documentation.

typedoc documentation example

For more advanced documentation generation, you can provide your own typedoc theme, or build your own documentation using the JSON typedoc export:

yarn docs:json

Generate/update changelog & release

This project is tooled for Conventional Changelog to make managing releases easier. See the standard-version documentation for more information on the workflow, or CHANGELOG.md for an example.

# bump package.json version, update CHANGELOG.md, git tag the release
yarn release
# Release without bumping package.json version
yarn release -- --first-release
# PGP sign the release
yarn release -- --sign

All package scripts

You can run the info script for information on each available package script.

yarn run info

  info:
    Display information about the scripts
  build:
    (Trash and re)build the library
  lint:
    Lint all typescript source files
  unit:
    Run unit tests
  test:
    Lint and test the library
  watch:
    Watch source files, rebuild library on changes, rerun relevant tests
  watch:build:
    Watch source files, rebuild library on changes
  watch:unit:
    Watch the build, rerun relevant tests on changes
  cov:
    Run tests, generate the HTML coverage report, and open it in a browser
  html-coverage:
    Output HTML test coverage report
  send-coverage:
    Output lcov test coverage report and send it to codecov
  docs:
    Generate API documentation and open it in a browser
  docs:json:
    Generate API documentation in typedoc JSON format
  release:
    Bump package.json version, update CHANGELOG.md, tag a release

Based on https://github.com/bitjson/typescript-starter