Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
36316e63b2 | |||
5c5e88c226 | |||
af968f65df | |||
f0cc2f4cd6 | |||
f167226830 | |||
3e49b365b6 | |||
c833374fdd | |||
778f057d87 | |||
8f57bf4dd5 |
@ -45,17 +45,3 @@ trigger:
|
||||
- tags
|
||||
tags:
|
||||
- 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
|
34
README.md
34
README.md
@ -3,7 +3,6 @@ Write npm modules with TypeScript without hassle.
|
||||
|
||||
## Status
|
||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||
[](https://ci.appveyor.com/project/philkunz/npmts/branch/master)
|
||||
[](https://david-dm.org/pushrocks/npmts)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/npmts)
|
||||
@ -17,7 +16,10 @@ 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/)
|
||||
|
||||
### 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
|
||||
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
|
||||
"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
|
||||
{
|
||||
"mode":"default",
|
||||
"codecov":{
|
||||
"publish":true,
|
||||
"token":"sometoken"
|
||||
},
|
||||
"ts":{
|
||||
"./customdir/*.ts":"./"
|
||||
},
|
||||
"docs": {
|
||||
"publish":true,
|
||||
"destination":"github"
|
||||
},
|
||||
"tsOptions":{
|
||||
"declaration":false,
|
||||
"target":"ES6"
|
||||
},
|
||||
"typings":[
|
||||
"./ts/typings.json",
|
||||
"./subts1/typings.json",
|
||||
"./subts2/typings.json",
|
||||
"./customdir/typings.json"
|
||||
],
|
||||
"typingsInclude":"auto",
|
||||
"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 |
|
||||
| `"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
|
||||
by default npmts looks for `./ts/*.ts` and `./test/test.ts` that will compile to
|
||||
`./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
|
||||
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
|
||||
npmts instrumentalizes (using istanbul) the created JavaScript code to create a coverage report.
|
||||
|
1
dist/npmts.plugins.d.ts
vendored
1
dist/npmts.plugins.d.ts
vendored
@ -7,6 +7,7 @@ export declare let g: {
|
||||
jsdoc3: any;
|
||||
mocha: any;
|
||||
replace: any;
|
||||
sourcemaps: any;
|
||||
};
|
||||
export declare let lodashObject: any;
|
||||
export declare let merge2: any;
|
||||
|
3
dist/npmts.plugins.js
vendored
3
dist/npmts.plugins.js
vendored
@ -7,7 +7,8 @@ exports.g = {
|
||||
istanbul: require("gulp-istanbul"),
|
||||
jsdoc3: require("gulp-jsdoc3"),
|
||||
mocha: require("gulp-mocha"),
|
||||
replace: require("gulp-replace")
|
||||
replace: require("gulp-replace"),
|
||||
sourcemaps: require("gulp-sourcemaps")
|
||||
};
|
||||
exports.lodashObject = require('lodash/fp/object');
|
||||
exports.merge2 = require("merge2");
|
||||
|
2
dist/npmts.tests.js
vendored
2
dist/npmts.tests.js
vendored
@ -11,7 +11,9 @@ var istanbul = function (configArg) {
|
||||
npmts_promisechain_1.npmtsOra.text("Instrumentalizing transpiled JS...");
|
||||
var done = plugins.Q.defer();
|
||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")])
|
||||
.pipe(plugins.g.sourcemaps.init())
|
||||
.pipe(plugins.g.istanbul()) // Covering files
|
||||
.pipe(plugins.g.sourcemaps.write())
|
||||
.pipe(plugins.g.istanbul.hookRequire()) // Force `require` to return covered files
|
||||
.pipe(plugins.g.gFunction(function () {
|
||||
plugins.beautylog.ok("JS has been instrumentalized to get test code coverage!");
|
||||
|
1192
npm-debug.log
1192
npm-debug.log
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "5.3.6",
|
||||
"version": "5.3.9",
|
||||
"description": "write npm modules with TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -12,8 +12,7 @@
|
||||
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
|
||||
"check": "(cd test && node ../dist/index.js)",
|
||||
"checkVersion": "(cd test/ && node ../dist/index.js -v)",
|
||||
"checkNoTest": "(cd test && node ../dist/index.js --notest)",
|
||||
"install": "(mkdir test/)"
|
||||
"checkNoTest": "(cd test && node ../dist/index.js --notest)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -43,6 +42,7 @@
|
||||
"gulp-jsdoc3": "^0.3.0",
|
||||
"gulp-mocha": "^2.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.6.0",
|
||||
"lodash": "^4.13.1",
|
||||
"merge2": "1.0.2",
|
||||
"projectinfo": "1.0.3",
|
||||
@ -56,7 +56,7 @@
|
||||
"smartpath": "3.2.2",
|
||||
"smartstring": "^2.0.10",
|
||||
"source-map-support": "^0.4.1",
|
||||
"tsn": "^1.0.3",
|
||||
"tsn": "^1.0.5",
|
||||
"typescript": "^2.0.0-dev.20160630",
|
||||
"typings-global": "*"
|
||||
},
|
||||
|
@ -6,7 +6,8 @@ export let g = {
|
||||
istanbul: require("gulp-istanbul"),
|
||||
jsdoc3: require("gulp-jsdoc3"),
|
||||
mocha: require("gulp-mocha"),
|
||||
replace: require("gulp-replace")
|
||||
replace: require("gulp-replace"),
|
||||
sourcemaps: require("gulp-sourcemaps")
|
||||
};
|
||||
export let lodashObject = require('lodash/fp/object');
|
||||
export let merge2 = require("merge2");
|
||||
|
@ -11,7 +11,9 @@ let istanbul = function (configArg) {
|
||||
npmtsOra.text("Instrumentalizing transpiled JS...");
|
||||
let done = plugins.Q.defer();
|
||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"dist/*.js")])
|
||||
.pipe(plugins.g.sourcemaps.init())
|
||||
.pipe(plugins.g.istanbul()) // Covering files
|
||||
.pipe(plugins.g.sourcemaps.write())
|
||||
.pipe(plugins.g.istanbul.hookRequire()) // Force `require` to return covered files
|
||||
.pipe(plugins.g.gFunction(function(){
|
||||
plugins.beautylog.ok("JS has been instrumentalized to get test code coverage!");
|
||||
|
Reference in New Issue
Block a user