remove babel and instead use typescript

This commit is contained in:
Philipp Kunz 2017-01-15 20:01:10 +01:00
parent aca85d2ff3
commit 78d77c003c
6 changed files with 50 additions and 35 deletions

32
dist/mod02/index.js vendored
View File

@ -1,4 +1,12 @@
"use strict"; "use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
/* ------------------------------------------ /* ------------------------------------------
* This module tests the compiled TypeScript files * This module tests the compiled TypeScript files
* -------------------------------------------- */ * -------------------------------------------- */
@ -15,15 +23,19 @@ let mocha = function (configArg) {
npmts_log_1.npmtsOra.end(); // end npmtsOra for tests. npmts_log_1.npmtsOra.end(); // end npmtsOra for tests.
let done = q.defer(); let done = q.defer();
let coverageSmartstream = new plugins.smartstream.Smartstream([ let coverageSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]), plugins.gulp.src([plugins.path.join(paths.cwd, './ts/**/*.ts')]),
plugins.gulpSourcemaps.init(), plugins.gulpSourcemaps.init(),
plugins.gulpBabel({ plugins.gulpTypeScript({
presets: [ target: 'ES5',
require.resolve('babel-preset-es2015') emitDecoratorMetadata: true,
] experimentalDecorators: true
}), }),
plugins.gulpIstanbul({}), plugins.gulpIstanbul({}),
plugins.gulpSourcemaps.write(), plugins.gulpSourcemaps.write(),
plugins.gulpFunction.forEach((file) => __awaiter(this, void 0, void 0, function* () {
file.path = file.path.replace(paths.tsDir, paths.distDir);
console.log(file.path);
})),
plugins.gulpInjectModules(), plugins.gulpInjectModules(),
plugins.through2.obj((file, enc, cb) => { plugins.through2.obj((file, enc, cb) => {
cb(); cb();
@ -32,11 +44,11 @@ let mocha = function (configArg) {
}) })
]); ]);
let localSmartstream = new plugins.smartstream.Smartstream([ let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.ts')]),
plugins.gulpBabel({ plugins.gulpTypeScript({
presets: [ target: 'ES5',
require.resolve('babel-preset-es2015') emitDecoratorMetadata: true,
] experimentalDecorators: true
}), }),
plugins.gulpInjectModules(), plugins.gulpInjectModules(),
plugins.gulpMocha(), plugins.gulpMocha(),

View File

@ -1,9 +1,9 @@
export * from '../npmts.plugins'; export * from '../npmts.plugins';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as gulpBabel from 'gulp-babel';
import * as gulpIstanbul from 'gulp-istanbul';
import * as gulpFunction from 'gulp-function'; import * as gulpFunction from 'gulp-function';
import * as gulpIstanbul from 'gulp-istanbul';
declare let gulpInjectModules: any; declare let gulpInjectModules: any;
import * as gulpMocha from 'gulp-mocha'; import * as gulpMocha from 'gulp-mocha';
import * as gulpSourcemaps from 'gulp-sourcemaps'; import * as gulpSourcemaps from 'gulp-sourcemaps';
export { gulp, gulpBabel, gulpIstanbul, gulpFunction, gulpInjectModules, gulpMocha, gulpSourcemaps }; import * as gulpTypeScript from 'gulp-typescript';
export { gulp, gulpFunction, gulpIstanbul, gulpInjectModules, gulpMocha, gulpSourcemaps, gulpTypeScript };

View File

@ -5,15 +5,15 @@ function __export(m) {
__export(require("../npmts.plugins")); __export(require("../npmts.plugins"));
const gulp = require("gulp"); const gulp = require("gulp");
exports.gulp = gulp; exports.gulp = gulp;
const gulpBabel = require("gulp-babel");
exports.gulpBabel = gulpBabel;
const gulpIstanbul = require("gulp-istanbul");
exports.gulpIstanbul = gulpIstanbul;
const gulpFunction = require("gulp-function"); const gulpFunction = require("gulp-function");
exports.gulpFunction = gulpFunction; exports.gulpFunction = gulpFunction;
const gulpIstanbul = require("gulp-istanbul");
exports.gulpIstanbul = gulpIstanbul;
let gulpInjectModules = require('gulp-inject-modules'); let gulpInjectModules = require('gulp-inject-modules');
exports.gulpInjectModules = gulpInjectModules; exports.gulpInjectModules = gulpInjectModules;
const gulpMocha = require("gulp-mocha"); const gulpMocha = require("gulp-mocha");
exports.gulpMocha = gulpMocha; exports.gulpMocha = gulpMocha;
const gulpSourcemaps = require("gulp-sourcemaps"); const gulpSourcemaps = require("gulp-sourcemaps");
exports.gulpSourcemaps = gulpSourcemaps; exports.gulpSourcemaps = gulpSourcemaps;
const gulpTypeScript = require("gulp-typescript");
exports.gulpTypeScript = gulpTypeScript;

View File

@ -35,25 +35,24 @@
"homepage": "https://gitlab.com/pushrocks/npmts#readme", "homepage": "https://gitlab.com/pushrocks/npmts#readme",
"dependencies": { "dependencies": {
"@types/gulp": "^3.8.32", "@types/gulp": "^3.8.32",
"@types/gulp-babel": "^6.1.29",
"@types/gulp-istanbul": "^0.9.30", "@types/gulp-istanbul": "^0.9.30",
"@types/gulp-mocha": "0.0.29", "@types/gulp-mocha": "0.0.29",
"@types/gulp-rename": "0.0.31",
"@types/gulp-sourcemaps": "0.0.29", "@types/gulp-sourcemaps": "0.0.29",
"@types/minimatch": "^2.0.29", "@types/minimatch": "^2.0.29",
"@types/q": "^0.x.x", "@types/q": "^0.x.x",
"@types/shelljs": "^0.3.33", "@types/shelljs": "^0.3.33",
"@types/through2": "^2.0.32", "@types/through2": "^2.0.32",
"babel-preset-es2015": "^6.18.0",
"beautylog": "6.0.0", "beautylog": "6.0.0",
"depcheck": "^0.6.7", "depcheck": "^0.6.7",
"early": "^2.0.35", "early": "^2.0.35",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-babel": "^6.1.2",
"gulp-function": "^2.2.3", "gulp-function": "^2.2.3",
"gulp-inject-modules": "^1.0.0", "gulp-inject-modules": "^1.0.0",
"gulp-istanbul": "^1.1.1", "gulp-istanbul": "^1.1.1",
"gulp-mocha": "^3.0.1", "gulp-mocha": "^3.0.1",
"gulp-sourcemaps": "^2.4.0", "gulp-sourcemaps": "^2.4.0",
"gulp-typescript": "^3.1.4",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"npmextra": "^2.0.3", "npmextra": "^2.0.3",
"projectinfo": "3.0.1", "projectinfo": "3.0.1",

View File

@ -19,16 +19,20 @@ let mocha = function (configArg: INpmtsConfig) {
let done = q.defer() let done = q.defer()
let coverageSmartstream = new plugins.smartstream.Smartstream([ let coverageSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]), plugins.gulp.src([plugins.path.join(paths.cwd, './ts/**/*.ts')]),
plugins.gulpSourcemaps.init(), plugins.gulpSourcemaps.init(),
plugins.gulpBabel({ plugins.gulpTypeScript({
presets: [ target: 'ES5',
require.resolve('babel-preset-es2015') emitDecoratorMetadata: true,
] experimentalDecorators: true
}), }),
plugins.gulpIstanbul({ plugins.gulpIstanbul({
}), }),
plugins.gulpSourcemaps.write(), plugins.gulpSourcemaps.write(),
plugins.gulpFunction.forEach(async file => {
file.path = file.path.replace(paths.tsDir, paths.distDir)
console.log(file.path)
}),
plugins.gulpInjectModules(), plugins.gulpInjectModules(),
plugins.through2.obj( plugins.through2.obj(
(file, enc, cb) => { (file, enc, cb) => {
@ -41,11 +45,11 @@ let mocha = function (configArg: INpmtsConfig) {
]) ])
let localSmartstream = new plugins.smartstream.Smartstream([ let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.ts')]),
plugins.gulpBabel({ plugins.gulpTypeScript({
presets: [ target: 'ES5',
require.resolve('babel-preset-es2015') emitDecoratorMetadata: true,
] experimentalDecorators: true
}), }),
plugins.gulpInjectModules(), plugins.gulpInjectModules(),
plugins.gulpMocha(), plugins.gulpMocha(),

View File

@ -1,19 +1,19 @@
export * from '../npmts.plugins' export * from '../npmts.plugins'
import * as gulp from 'gulp' import * as gulp from 'gulp'
import * as gulpBabel from 'gulp-babel'
import * as gulpIstanbul from 'gulp-istanbul'
import * as gulpFunction from 'gulp-function' import * as gulpFunction from 'gulp-function'
import * as gulpIstanbul from 'gulp-istanbul'
let gulpInjectModules = require('gulp-inject-modules') let gulpInjectModules = require('gulp-inject-modules')
import * as gulpMocha from 'gulp-mocha' import * as gulpMocha from 'gulp-mocha'
import * as gulpSourcemaps from 'gulp-sourcemaps' import * as gulpSourcemaps from 'gulp-sourcemaps'
import * as gulpTypeScript from 'gulp-typescript'
export { export {
gulp, gulp,
gulpBabel,
gulpIstanbul,
gulpFunction, gulpFunction,
gulpIstanbul,
gulpInjectModules, gulpInjectModules,
gulpMocha, gulpMocha,
gulpSourcemaps gulpSourcemaps,
gulpTypeScript
} }