ts-typesversions
v0.0.4
Published
A library for generating multiple typesVersions for your package for easier downstream consumption
Downloads
9
Readme
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:
- As a CLI to check project compatibility with different Typescript versions
- 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"
}
}