0.0.4 • Published 6 years ago

ts-typesversions v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

ts-typesversions

A library for Typescript package authors to:

  • publish multiple type declaration files using the new typesVersions feature available in Typescript 3.1
  • determine the minimum Typescript version that a package is compatible with

Install

yarn add -D ts-typesversions

Usage

There are two primary intended uses for this project:

  1. As a CLI to check project compatibility with different Typescript versions
  2. Programmatically as part of an npm/yarn release process

CLI

yarn run ts-typesversions

This will invoke an interactive CLI where you can opt to (1) just check compilation compatibility with different versions of Typescript or (2) generate declaration files for different TS versions

As Part of a Release Step

We suggest that you add yarn run ts-typesversions --declarations as part of the prepublishOnly step of the package publish lifecycle.

For example:

{
    "scripts": {
        "prepublishOnly": "rm -rf dist && tsc && yarn run ts-typesversions --declarations"
    }
}