diff --git a/dist/npmts.plugins.d.ts b/dist/npmts.plugins.d.ts index 31c9a23..2059a6d 100644 --- a/dist/npmts.plugins.d.ts +++ b/dist/npmts.plugins.d.ts @@ -2,15 +2,13 @@ import 'typings-global'; import * as beautylog from 'beautylog'; declare let depcheck: any; import * as gulp from 'gulp'; -declare let g: { - babel: any; - istanbul: any; - gFunction: any; - injectModules: any; - mocha: any; - sourcemaps: any; - typedoc: any; -}; +import * as gulpBabel from 'gulp-babel'; +import * as gulpIstanbul from 'gulp-istanbul'; +import * as gulpFunction from 'gulp-function'; +declare let gulpInjectModules: any; +import * as gulpMocha from 'gulp-mocha'; +import * as gulpSourcemaps from 'gulp-sourcemaps'; +declare let gulpTypedoc: any; import * as lodash from 'lodash'; import * as npmextra from 'npmextra'; import * as projectinfo from 'projectinfo'; @@ -26,4 +24,4 @@ import * as smartstream from 'smartstream'; import * as smartstring from 'smartstring'; export declare let sourceMapSupport: any; import * as tsn from 'tsn'; -export { beautylog, depcheck, gulp, g, lodash, npmextra, projectinfo, path, shelljs, smartchok, smartcli, smartcov, smartenv, smartfile, smartpath, smartstream, smartstring, tsn }; +export { beautylog, depcheck, gulp, gulpBabel, gulpFunction, gulpInjectModules, gulpIstanbul, gulpMocha, gulpSourcemaps, gulpTypedoc, lodash, npmextra, projectinfo, path, shelljs, smartchok, smartcli, smartcov, smartenv, smartfile, smartpath, smartstream, smartstring, tsn }; diff --git a/dist/npmts.plugins.js b/dist/npmts.plugins.js index 7d698c5..a6d5168 100644 --- a/dist/npmts.plugins.js +++ b/dist/npmts.plugins.js @@ -6,16 +6,20 @@ let depcheck = require('depcheck'); exports.depcheck = depcheck; const gulp = require("gulp"); exports.gulp = gulp; -let g = { - babel: require('gulp-babel'), - istanbul: require('gulp-istanbul'), - gFunction: require('gulp-function'), - injectModules: require('gulp-inject-modules'), - mocha: require('gulp-mocha'), - sourcemaps: require('gulp-sourcemaps'), - typedoc: require('gulp-typedoc') -}; -exports.g = g; +const gulpBabel = require("gulp-babel"); +exports.gulpBabel = gulpBabel; +const gulpIstanbul = require("gulp-istanbul"); +exports.gulpIstanbul = gulpIstanbul; +const gulpFunction = require("gulp-function"); +exports.gulpFunction = gulpFunction; +let gulpInjectModules = require('gulp-inject-modules'); +exports.gulpInjectModules = gulpInjectModules; +const gulpMocha = require("gulp-mocha"); +exports.gulpMocha = gulpMocha; +const gulpSourcemaps = require("gulp-sourcemaps"); +exports.gulpSourcemaps = gulpSourcemaps; +let gulpTypedoc = require('gulp-typedoc'); +exports.gulpTypedoc = gulpTypedoc; const lodash = require("lodash"); exports.lodash = lodash; const npmextra = require("npmextra"); diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js index 0fd4a63..25ff730 100644 --- a/dist/npmts.tests.js +++ b/dist/npmts.tests.js @@ -12,26 +12,26 @@ let mocha = function (configArg) { npmts_promisechain_1.npmtsOra.end(); // end npmtsOra for tests. let done = q.defer(); plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]) - .pipe(plugins.g.sourcemaps.init()) - .pipe(plugins.g.babel({ + .pipe(plugins.gulpSourcemaps.init()) + .pipe(plugins.gulpBabel({ presets: [ require.resolve('babel-preset-es2015') ] })) - .pipe(plugins.g.istanbul({})) - .pipe(plugins.g.sourcemaps.write()) - .pipe(plugins.g.injectModules()) + .pipe(plugins.gulpIstanbul({})) + .pipe(plugins.gulpSourcemaps.write()) + .pipe(plugins.gulpInjectModules()) .on('finish', function () { let localSmartstream = new plugins.smartstream.Smartstream([ plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), - plugins.g.babel({ + plugins.gulpBabel({ presets: [ require.resolve('babel-preset-es2015') ] }), - plugins.g.injectModules(), - plugins.g.mocha(), - plugins.g.istanbul.writeReports({ + plugins.gulpInjectModules(), + plugins.gulpMocha(), + plugins.gulpIstanbul.writeReports({ dir: plugins.path.join(paths.cwd, './coverage'), reporters: ['lcovonly', 'json', 'text', 'text-summary'] }) diff --git a/dist/npmts.typedoc.js b/dist/npmts.typedoc.js index bc2e94e..87f3986 100644 --- a/dist/npmts.typedoc.js +++ b/dist/npmts.typedoc.js @@ -8,23 +8,29 @@ let genTypeDoc = function (configArg) { let done = q.defer(); npmts_promisechain_1.npmtsOra.text('now generating ' + 'TypeDoc documentation'.yellow); plugins.beautylog.log('TypeDoc Output:'); - plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')) - .pipe(plugins.g.typedoc({ - // TypeScript options (see typescript docs) - module: 'commonjs', - target: 'es6', - includeDeclarations: true, - // Output options (see typedoc docs) - out: paths.pagesApiDir, - json: plugins.path.join(paths.pagesApiDir, 'file.json'), - // TypeDoc options (see typedoc docs) - name: npmts_check_1.projectInfo.name, - readme: plugins.path.join(paths.cwd, 'README.md'), - // theme: "default", - ignoreCompilerErrors: true, - version: true - })) - .pipe(plugins.g.gFunction(done.resolve, 'atEnd')); + let localSmartstream = new plugins.smartstream.Smartstream([ + plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')), + plugins.gulpTypedoc({ + // TypeScript options (see typescript docs) + module: 'commonjs', + target: 'es6', + includeDeclarations: true, + // Output options (see typedoc docs) + out: paths.pagesApiDir, + json: plugins.path.join(paths.pagesApiDir, 'file.json'), + // TypeDoc options (see typedoc docs) + name: npmts_check_1.projectInfo.name, + readme: plugins.path.join(paths.cwd, 'README.md'), + // theme: "default", + version: true + }) + ]); + localSmartstream.run().then(() => { + done.resolve(configArg); + }, (err) => { + console.log(err); + done.resolve(configArg); + }); return done.promise; }; exports.run = function (configArg) { diff --git a/package.json b/package.json index dabf646..b53539f 100644 --- a/package.json +++ b/package.json @@ -35,39 +35,46 @@ "homepage": "https://gitlab.com/pushrocks/npmts#readme", "dependencies": { "@types/gulp": "^3.8.32", + "@types/gulp-babel": "^6.1.29", + "@types/gulp-istanbul": "^0.9.30", + "@types/gulp-mocha": "0.0.29", + "@types/gulp-sourcemaps": "0.0.29", "@types/minimatch": "^2.0.29", "@types/q": "^0.x.x", - "@types/shelljs": "^0.3.31", + "@types/shelljs": "^0.3.32", "babel-preset-es2015": "^6.16.0", - "beautylog": "5.0.23", + "beautylog": "6.0.0", "depcheck": "^0.6.4", "early": "^2.0.35", "gulp": "3.9.1", "gulp-babel": "^6.1.2", - "gulp-function": "^1.3.6", + "gulp-function": "^2.2.0", "gulp-inject-modules": "^1.0.0", "gulp-istanbul": "^1.1.1", "gulp-mocha": "^3.0.1", - "gulp-sourcemaps": "^1.6.0", + "gulp-sourcemaps": "^2.1.1", "gulp-typedoc": "^2.0.0", - "lodash": "^4.16.2", + "lodash": "^4.16.4", "npmextra": "^2.0.3", "projectinfo": "1.0.3", "q": "^1.4.1", "shelljs": "^0.7.4", "smartchok": "^1.0.2", - "smartcli": "1.0.9", + "smartcli": "1.0.10", "smartcov": "1.0.0", "smartenv": "1.2.5", - "smartfile": "4.0.22", - "smartpath": "3.2.2", + "smartfile": "4.0.24", + "smartpath": "3.2.5", "smartstream": "^1.0.5", "smartstring": "^2.0.17", - "source-map-support": "^0.4.3", - "tsn": "^2.0.4", - "typedoc": "^0.4.5", + "source-map-support": "^0.4.5", + "tsn": "^2.0.11", + "typedoc": "^0.5.0", "typescript": "next", "typings-global": "^1.0.14" }, - "devDependencies": {} + "devDependencies": { + "@types/should": "^8.1.30", + "should": "^11.1.1" + } } diff --git a/ts/npmts.plugins.ts b/ts/npmts.plugins.ts index 0db0a9c..26df549 100644 --- a/ts/npmts.plugins.ts +++ b/ts/npmts.plugins.ts @@ -2,15 +2,15 @@ import 'typings-global' import * as beautylog from 'beautylog' let depcheck = require('depcheck') import * as gulp from 'gulp' -let g = { - babel: require('gulp-babel'), - istanbul: require('gulp-istanbul'), - gFunction: require('gulp-function'), - injectModules: require('gulp-inject-modules'), - mocha: require('gulp-mocha'), - sourcemaps: require('gulp-sourcemaps'), - typedoc: require('gulp-typedoc') -} + +import * as gulpBabel from 'gulp-babel' +import * as gulpIstanbul from 'gulp-istanbul' +import * as gulpFunction from 'gulp-function' +let gulpInjectModules = require('gulp-inject-modules') +import * as gulpMocha from 'gulp-mocha' +import * as gulpSourcemaps from 'gulp-sourcemaps' +let gulpTypedoc = require('gulp-typedoc') + import * as lodash from 'lodash' import * as npmextra from 'npmextra' import * as projectinfo from 'projectinfo' @@ -31,7 +31,13 @@ export { beautylog, depcheck, gulp, - g, + gulpBabel, + gulpFunction, + gulpInjectModules, + gulpIstanbul, + gulpMocha, + gulpSourcemaps, + gulpTypedoc, lodash, npmextra, projectinfo, diff --git a/ts/npmts.tests.ts b/ts/npmts.tests.ts index c0049b6..d4fc8ed 100644 --- a/ts/npmts.tests.ts +++ b/ts/npmts.tests.ts @@ -15,27 +15,27 @@ let mocha = function (configArg: INpmtsConfig) { npmtsOra.end() // end npmtsOra for tests. let done = q.defer() plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]) - .pipe(plugins.g.sourcemaps.init()) - .pipe(plugins.g.babel({ + .pipe(plugins.gulpSourcemaps.init()) + .pipe(plugins.gulpBabel({ presets: [ require.resolve('babel-preset-es2015') ] })) - .pipe(plugins.g.istanbul({ + .pipe(plugins.gulpIstanbul({ })) - .pipe(plugins.g.sourcemaps.write()) - .pipe(plugins.g.injectModules()) + .pipe(plugins.gulpSourcemaps.write()) + .pipe(plugins.gulpInjectModules()) .on('finish', function () { let localSmartstream = new plugins.smartstream.Smartstream([ plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), - plugins.g.babel({ + plugins.gulpBabel({ presets: [ require.resolve('babel-preset-es2015') ] }), - plugins.g.injectModules(), - plugins.g.mocha(), - plugins.g.istanbul.writeReports({ + plugins.gulpInjectModules(), + plugins.gulpMocha(), + plugins.gulpIstanbul.writeReports({ dir: plugins.path.join(paths.cwd, './coverage'), reporters: ['lcovonly', 'json', 'text', 'text-summary'] }) diff --git a/ts/npmts.typedoc.ts b/ts/npmts.typedoc.ts index 0598a96..272a1c1 100644 --- a/ts/npmts.typedoc.ts +++ b/ts/npmts.typedoc.ts @@ -10,8 +10,9 @@ let genTypeDoc = function (configArg) { let done = q.defer() npmtsOra.text('now generating ' + 'TypeDoc documentation'.yellow) plugins.beautylog.log('TypeDoc Output:') - plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')) - .pipe(plugins.g.typedoc({ + let localSmartstream = new plugins.smartstream.Smartstream([ + plugins.gulp.src(plugins.path.join(paths.tsDir, '**/*.ts')), + plugins.gulpTypedoc({ // TypeScript options (see typescript docs) module: 'commonjs', target: 'es6', @@ -25,10 +26,18 @@ let genTypeDoc = function (configArg) { name: projectInfo.name, readme: plugins.path.join(paths.cwd, 'README.md'), // theme: "default", - ignoreCompilerErrors: true, version: true - })) - .pipe(plugins.g.gFunction(done.resolve, 'atEnd')) + }) + ]) + localSmartstream.run().then( + () => { + done.resolve(configArg) + }, + (err) => { + console.log(err) + done.resolve(configArg) + } + ) return done.promise }