Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
8104609306 | |||
a3077f7800 | |||
c947121243 | |||
4b3f0649fa | |||
523c62530f | |||
aa57617fc7 | |||
ef89a33dfc | |||
474a730a09 | |||
e3b029c240 | |||
290824190d | |||
923d78caab | |||
6587b74a23 | |||
aa0a35f258 | |||
09b8809ede |
37
README.md
37
README.md
@ -36,29 +36,28 @@ Then add it to your package.json's script section to trigger a build:
|
||||
|
||||
### Default task execution order
|
||||
|
||||
1. Check config in ./npmts.json
|
||||
1. Check config in ./npmextra.json (Check out [npmextra](https://www.npmjs.com/package/npmextra))
|
||||
1. Clean up from any previous builds (old js files)
|
||||
1. Install typings
|
||||
1. Transpile TypeScript with **inline sourcemaps** and **declaration files**
|
||||
1. Create EsDoc Documentation
|
||||
1. Instrumentalize created JavaScript files with istanbul
|
||||
1. Run Tests
|
||||
1. Create Coverage report
|
||||
1. Transpile TypeScript with **inline sourcemaps** and **declaration files** to ES6
|
||||
1. Create TypeDoc Documentation from TypeScript files
|
||||
1. Instrumentalize transpiled ES6 JavaScript with istanbul and run tests with Mocha
|
||||
|
||||
#### npmts.json
|
||||
the npmts.json is the main config file. You can use it to customize the behaviour of NPMTS.
|
||||
#### npmtsextra.json
|
||||
the npmts section in npmtsextra.json can be used to configure npmts.
|
||||
|
||||
```json
|
||||
{
|
||||
"mode":"default",
|
||||
"ts":{
|
||||
"./customdir/*.ts":"./"
|
||||
},
|
||||
"tsOptions":{
|
||||
"declaration":false,
|
||||
"target":"ES6"
|
||||
},
|
||||
"cli":true
|
||||
"npmts":{
|
||||
"mode":"default",
|
||||
"ts":{
|
||||
"./customdir/*.ts":"./"
|
||||
},
|
||||
"tsOptions":{
|
||||
"declaration":false,
|
||||
"target":"ES6"
|
||||
},
|
||||
"cli":true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -111,7 +110,7 @@ thanks to autogenerated source maps.
|
||||
## Tips and tricks:
|
||||
|
||||
* Use [npmts-g](https://www.npmjs.com/package/npmts-g) to use globally installed npmts and install npmts locally if no global npmts is available.
|
||||
* Use [npmpage](https://www.npmjs.com/package/npmtspage) to create a webpage from coverage reports and EsDocs for the module
|
||||
* Use [npmpage](https://www.npmjs.com/package/npmtspage) to create a webpage from coverage reports and TypeDoc for the module
|
||||
* Use [hosttoday/ht-docker-node:npmts](https://hub.docker.com/r/hosttoday/ht-docker-node/) for speedy CI builds
|
||||
|
||||
## About the authors:
|
||||
|
1
dist/npmts.cli.d.ts
vendored
1
dist/npmts.cli.d.ts
vendored
@ -1 +0,0 @@
|
||||
import "typings-global";
|
2
dist/npmts.cli.js
vendored
2
dist/npmts.cli.js
vendored
@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
2
dist/npmts.compile.js
vendored
2
dist/npmts.compile.js
vendored
@ -9,7 +9,7 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
var done = plugins.Q.defer();
|
||||
var tsOptionsDefault = {
|
||||
declaration: true,
|
||||
target: "ES5",
|
||||
target: "ES6",
|
||||
module: "commonjs"
|
||||
};
|
||||
/**
|
||||
|
3
dist/npmts.plugins.d.ts
vendored
3
dist/npmts.plugins.d.ts
vendored
@ -3,7 +3,7 @@ export import beautylog = require("beautylog");
|
||||
export declare let gulp: any;
|
||||
export declare let g: {
|
||||
babel: any;
|
||||
babelIstanbul: any;
|
||||
istanbul: any;
|
||||
gFunction: any;
|
||||
injectModules: any;
|
||||
mocha: any;
|
||||
@ -12,7 +12,6 @@ export declare let g: {
|
||||
typedoc: any;
|
||||
};
|
||||
export declare let lodashObject: any;
|
||||
export declare let merge2: any;
|
||||
export import projectinfo = require("projectinfo");
|
||||
export import path = require("path");
|
||||
export import Q = require("q");
|
||||
|
3
dist/npmts.plugins.js
vendored
3
dist/npmts.plugins.js
vendored
@ -4,7 +4,7 @@ exports.beautylog = require("beautylog");
|
||||
exports.gulp = require("gulp");
|
||||
exports.g = {
|
||||
babel: require("gulp-babel"),
|
||||
babelIstanbul: require("gulp-babel-istanbul"),
|
||||
istanbul: require("gulp-istanbul"),
|
||||
gFunction: require("gulp-function"),
|
||||
injectModules: require("gulp-inject-modules"),
|
||||
mocha: require("gulp-mocha"),
|
||||
@ -13,7 +13,6 @@ exports.g = {
|
||||
typedoc: require("gulp-typedoc")
|
||||
};
|
||||
exports.lodashObject = require('lodash/fp/object');
|
||||
exports.merge2 = require("merge2");
|
||||
exports.projectinfo = require("projectinfo");
|
||||
exports.path = require("path");
|
||||
exports.Q = require("q");
|
||||
|
22
dist/npmts.tests.js
vendored
22
dist/npmts.tests.js
vendored
@ -13,15 +13,27 @@ var mocha = function (configArg) {
|
||||
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.babelIstanbul())
|
||||
.pipe(plugins.g.babelIstanbul.hookRequire())
|
||||
.pipe(plugins.g.babel({
|
||||
presets: [
|
||||
require.resolve("babel-preset-es2015")
|
||||
]
|
||||
}))
|
||||
.pipe(plugins.g.istanbul({}))
|
||||
.pipe(plugins.g.sourcemaps.write())
|
||||
.pipe(plugins.g.injectModules())
|
||||
.on("finish", function () {
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")])
|
||||
.pipe(plugins.g.babel())
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd, "test/test.js")])
|
||||
.pipe(plugins.g.babel({
|
||||
presets: [
|
||||
plugins.path.join(paths.npmtsPackageRoot, "node_modules/babel-preset-es2015/index.js")
|
||||
]
|
||||
}))
|
||||
.pipe(plugins.g.injectModules())
|
||||
.pipe(plugins.g.mocha())
|
||||
.pipe(plugins.g.babelIstanbul.writeReports())
|
||||
.pipe(plugins.g.istanbul.writeReports({
|
||||
dir: './coverage',
|
||||
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
||||
}))
|
||||
.pipe(plugins.g.gFunction(function () {
|
||||
plugins.beautylog.ok("Tested!");
|
||||
done.resolve(configArg);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "5.3.14",
|
||||
"version": "5.3.21",
|
||||
"description": "write npm modules with TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -32,22 +32,21 @@
|
||||
"@types/minimatch": "*",
|
||||
"@types/q": "*",
|
||||
"@types/shelljs": "*",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"beautylog": "5.0.14",
|
||||
"early": "^2.0.13",
|
||||
"esdoc": "^0.4.7",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-babel-istanbul": "^1.4.0",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-function": "^1.3.6",
|
||||
"gulp-if": "^2.0.1",
|
||||
"gulp-inject-modules": "^1.0.0",
|
||||
"gulp-istanbul": "^1.0.0",
|
||||
"gulp-mocha": "^2.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.6.0",
|
||||
"gulp-typedoc": "^2.0.0",
|
||||
"lodash": "^4.13.1",
|
||||
"merge2": "1.0.2",
|
||||
"projectinfo": "1.0.3",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.7.0",
|
||||
|
@ -1 +0,0 @@
|
||||
import "typings-global";
|
@ -10,7 +10,7 @@ let compileTs = (tsFileArrayArg:string[],tsOptionsArg = {}) => {
|
||||
|
||||
let tsOptionsDefault = {
|
||||
declaration: true,
|
||||
target: "ES5",
|
||||
target: "ES6",
|
||||
module: "commonjs"
|
||||
};
|
||||
|
||||
|
@ -3,7 +3,7 @@ export import beautylog = require("beautylog");
|
||||
export let gulp = require("gulp");
|
||||
export let g = {
|
||||
babel: require("gulp-babel"),
|
||||
babelIstanbul: require("gulp-babel-istanbul"),
|
||||
istanbul: require("gulp-istanbul"),
|
||||
gFunction: require("gulp-function"),
|
||||
injectModules: require("gulp-inject-modules"),
|
||||
mocha: require("gulp-mocha"),
|
||||
@ -12,7 +12,6 @@ export let g = {
|
||||
typedoc: require("gulp-typedoc")
|
||||
};
|
||||
export let lodashObject = require('lodash/fp/object');
|
||||
export let merge2 = require("merge2");
|
||||
export import projectinfo = require("projectinfo");
|
||||
export import path = require("path");
|
||||
export import Q = require("q");
|
||||
|
@ -13,15 +13,28 @@ let mocha = function (configArg) {
|
||||
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.babelIstanbul())
|
||||
.pipe(plugins.g.babelIstanbul.hookRequire())
|
||||
.pipe(plugins.g.babel({
|
||||
presets: [
|
||||
require.resolve("babel-preset-es2015")
|
||||
]
|
||||
}))
|
||||
.pipe(plugins.g.istanbul({
|
||||
}))
|
||||
.pipe(plugins.g.sourcemaps.write())
|
||||
.pipe(plugins.g.injectModules())
|
||||
.on("finish",function(){
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd,"dist/*.js")])
|
||||
.pipe(plugins.g.babel())
|
||||
plugins.gulp.src([plugins.path.join(paths.cwd,"test/test.js")])
|
||||
.pipe(plugins.g.babel({
|
||||
presets: [
|
||||
plugins.path.join(paths.npmtsPackageRoot,"node_modules/babel-preset-es2015/index.js")
|
||||
]
|
||||
}))
|
||||
.pipe(plugins.g.injectModules())
|
||||
.pipe(plugins.g.mocha())
|
||||
.pipe(plugins.g.babelIstanbul.writeReports())
|
||||
.pipe(plugins.g.istanbul.writeReports({
|
||||
dir: './coverage',
|
||||
reporters: [ 'lcovonly', 'json', 'text', 'text-summary']
|
||||
}))
|
||||
.pipe(plugins.g.gFunction(function(){
|
||||
plugins.beautylog.ok("Tested!");
|
||||
done.resolve(configArg);
|
||||
|
Reference in New Issue
Block a user