Merge branch 'master' of gitlab.com:pushrocks/npmts
This commit is contained in:
commit
4d8a7a4202
@ -45,17 +45,3 @@ trigger:
|
|||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
pages:
|
|
||||||
stage: page
|
|
||||||
script:
|
|
||||||
- npmci test lts
|
|
||||||
- mkdir .public
|
|
||||||
- cp -r test/assets/docs/ .public
|
|
||||||
- cp -r test/assets/coverage/ .public
|
|
||||||
- mv .public public
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
only:
|
|
||||||
- tags
|
|
37
README.md
37
README.md
@ -3,7 +3,6 @@ Write npm modules with TypeScript without hassle.
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
[![build status](https://gitlab.com/pushrocks/npmts/badges/master/build.svg)](https://gitlab.com/pushrocks/npmts/commits/master)
|
[![build status](https://gitlab.com/pushrocks/npmts/badges/master/build.svg)](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/22fuqa0uv21rcjh4/branch/master?svg=true)](https://ci.appveyor.com/project/philkunz/npmts/branch/master)
|
|
||||||
[![Dependency Status](https://david-dm.org/pushrocks/npmts.svg)](https://david-dm.org/pushrocks/npmts)
|
[![Dependency Status](https://david-dm.org/pushrocks/npmts.svg)](https://david-dm.org/pushrocks/npmts)
|
||||||
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmts/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmts/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
||||||
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmts/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmts)
|
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmts/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmts)
|
||||||
@ -14,10 +13,13 @@ NPMTS is your friend when it comes to write, test, publish and document NPM modu
|
|||||||
By default NPMTS will **bundle declaration files**. As a result npm module **code completion in editors like Visual Studio Code** works.
|
By default NPMTS will **bundle declaration files**. As a result npm module **code completion in editors like Visual Studio Code** works.
|
||||||
|
|
||||||
There is a docker image available that includes npmts to make CI a breeze:
|
There is a docker image available that includes npmts to make CI a breeze:
|
||||||
[hosttoday/ht-docker-npmg on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-npmg/)
|
[hosttoday/ht-docker-node:npmts on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-node/)
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
First install npmts globally, then install the npmts checker:
|
First install npmts globally, then install the npmts-g locally.
|
||||||
|
|
||||||
|
> **npmts-g* checks if the global version of npmts suffices the modules requirements.
|
||||||
|
If not it installs npmts locally in the right version during npm install.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install npmts -g # installs npmts globally
|
npm install npmts -g # installs npmts globally
|
||||||
@ -28,7 +30,7 @@ Then add it to your package.json's script section to trigger a build:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npmts"
|
"test": "(npmts)"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -49,28 +51,13 @@ the npmts.json is the main config file. You can use it to customize the behaviou
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mode":"default",
|
"mode":"default",
|
||||||
"codecov":{
|
|
||||||
"publish":true,
|
|
||||||
"token":"sometoken"
|
|
||||||
},
|
|
||||||
"ts":{
|
"ts":{
|
||||||
"./customdir/*.ts":"./"
|
"./customdir/*.ts":"./"
|
||||||
},
|
},
|
||||||
"docs": {
|
|
||||||
"publish":true,
|
|
||||||
"destination":"github"
|
|
||||||
},
|
|
||||||
"tsOptions":{
|
"tsOptions":{
|
||||||
"declaration":false,
|
"declaration":false,
|
||||||
"target":"ES6"
|
"target":"ES6"
|
||||||
},
|
},
|
||||||
"typings":[
|
|
||||||
"./ts/typings.json",
|
|
||||||
"./subts1/typings.json",
|
|
||||||
"./subts2/typings.json",
|
|
||||||
"./customdir/typings.json"
|
|
||||||
],
|
|
||||||
"typingsInclude":"auto",
|
|
||||||
"cli":true
|
"cli":true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -84,14 +71,6 @@ the npmts.json is the main config file. You can use it to customize the behaviou
|
|||||||
| `"typings"` | `["./ts/typings.json"]` | allows you to specify multiple locations for typings.json to install. This is needed for modules that do not yet bundle typings |
|
| `"typings"` | `["./ts/typings.json"]` | allows you to specify multiple locations for typings.json to install. This is needed for modules that do not yet bundle typings |
|
||||||
| `"cli"` | "false" | some modules are designed to be used from cli. If set to true NPMTS will create a cli.js that wires you dist files up for cli use. |
|
| `"cli"` | "false" | some modules are designed to be used from cli. If set to true NPMTS will create a cli.js that wires you dist files up for cli use. |
|
||||||
|
|
||||||
#### Typings
|
|
||||||
**npmts** looks for `./ts/typings.json` by default and installs any defined typings to `.ts/typings/`.
|
|
||||||
|
|
||||||
> Note: You can reference the typings files in any of your TypeScript code with a
|
|
||||||
`/// <reference path="/some/path/main.d.ts">`
|
|
||||||
We are currently working on a "typingsInclude" option, that will autoload any typings during compilation.
|
|
||||||
tsconfig is NOT supported, since it would render this module useless
|
|
||||||
|
|
||||||
#### TypeScript
|
#### TypeScript
|
||||||
by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to
|
by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to
|
||||||
`./dist/*.js` and `./test/test.js`
|
`./dist/*.js` and `./test/test.js`
|
||||||
@ -111,7 +90,8 @@ This is in line with the latest TypeScript best practices.
|
|||||||
You can then import plugins via the TypeScript `import` Syntax
|
You can then import plugins via the TypeScript `import` Syntax
|
||||||
and tsc will pick up the declaration file automatically.
|
and tsc will pick up the declaration file automatically.
|
||||||
|
|
||||||
> Note: If you don't want declaration files, set tsOptions.declaration to false in npmts.json
|
#### Typings for third party modules that do not bundle declaration files
|
||||||
|
NPMTS does no longer supports typings.json. Instead use the new TypeScript 2.x approach to typings using the @types/ npm scope.
|
||||||
|
|
||||||
#### Instrumentalize Code
|
#### Instrumentalize Code
|
||||||
npmts instrumentalizes (using istanbul) the created JavaScript code to create a coverage report.
|
npmts instrumentalizes (using istanbul) the created JavaScript code to create a coverage report.
|
||||||
@ -124,7 +104,6 @@ Any errors will be shown with reference to their originating source in TypeScrip
|
|||||||
thanks to autogenerated source maps.
|
thanks to autogenerated source maps.
|
||||||
|
|
||||||
## Example Usage in modules:
|
## Example Usage in modules:
|
||||||
* [gulp-typings](https://www.npmjs.com/package/gulp-typings)
|
|
||||||
* [gulp-browser](https://www.npmjs.com/package/gulp-typings)
|
* [gulp-browser](https://www.npmjs.com/package/gulp-typings)
|
||||||
|
|
||||||
> We will add more options over time.
|
> We will add more options over time.
|
||||||
|
Loading…
Reference in New Issue
Block a user