Compare commits

...

9 Commits

Author SHA1 Message Date
2035045aef 3.1.2 2016-02-19 01:38:24 +01:00
de0f8cfb8b add gulp-header as dev-dependency 2016-02-19 01:37:39 +01:00
fe7d2f1024 3.1.1 2016-02-19 01:29:52 +01:00
9f0343b01c add new test files 2016-02-19 01:29:45 +01:00
04a02f6b96 fix obsolete old dependency 2016-02-19 01:28:57 +01:00
cb3f343c92 3.1.0 2016-02-19 01:24:46 +01:00
6227e47037 straighten up ts compilation 2016-02-19 01:24:25 +01:00
2730ca4299 3.0.3 2016-02-18 22:43:50 +01:00
07aae64965 fix sourcemaps 2016-02-18 22:43:40 +01:00
8 changed files with 13 additions and 34 deletions

2
index.d.ts vendored
View File

@ -6,7 +6,6 @@ declare module NpmtsPlugins {
gulp: any; gulp: any;
g: { g: {
coveralls: any; coveralls: any;
header: any;
istanbul: any; istanbul: any;
mocha: any; mocha: any;
sourcemaps: any; sourcemaps: any;
@ -45,7 +44,6 @@ declare var plugins: {
gulp: any; gulp: any;
g: { g: {
coveralls: any; coveralls: any;
header: any;
istanbul: any; istanbul: any;
mocha: any; mocha: any;
sourcemaps: any; sourcemaps: any;

View File

@ -10,7 +10,6 @@ var NpmtsPlugins;
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
header: require("gulp-header"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"), mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"), sourcemaps: require("gulp-sourcemaps"),
@ -167,21 +166,15 @@ var NpmtsCompile;
return plugins.path.join(paths.cwd, config.ts[key]); return plugins.path.join(paths.cwd, config.ts[key]);
} }
})(); })();
var tsStream = plugins.gulp.src([plugins.path.join(paths.cwd, key), "!**/typings/**"]) var stream = plugins.gulp.src([plugins.path.join(paths.cwd, key), "!**/typings/**"])
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated .pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({ .pipe(plugins.g.typescript({
out: outputName, out: outputName,
declaration: true,
target: "ES5", target: "ES5",
module: "commonjs" module: "commonjs"
})); }))
var stream = plugins.mergeStream([ .pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
//tsStream.dts.pipe(plugins.gulp.dest(outputDir)), .pipe(plugins.gulp.dest(outputDir));
tsStream.js
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(outputDir))
]);
moduleStream.add(stream); moduleStream.add(stream);
} }
moduleStream.on("queueDrain", function () { moduleStream.on("queueDrain", function () {

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "3.0.2", "version": "3.1.2",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "index.js", "main": "index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
@ -30,7 +30,6 @@
"fs-extra": "^0.26.5", "fs-extra": "^0.26.5",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-coveralls": "^0.1.4", "gulp-coveralls": "^0.1.4",
"gulp-header": "^1.7.1",
"gulp-istanbul": "^0.10.3", "gulp-istanbul": "^0.10.3",
"gulp-mocha": "^2.2.0", "gulp-mocha": "^2.2.0",
"gulp-sourcemaps": "^1.6.0", "gulp-sourcemaps": "^1.6.0",
@ -42,5 +41,8 @@
"smartfile": "0.0.11", "smartfile": "0.0.11",
"source-map-support": "^0.4.0", "source-map-support": "^0.4.0",
"typings": "^0.6.8" "typings": "^0.6.8"
},
"devDependencies": {
"gulp-header": "^1.7.1"
} }
} }

View File

@ -1,4 +0,0 @@
/// <reference path="typings/main.d.ts" />
declare var testplugin: {
logSomething: () => void;
};

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
var testplugin = { var testplugin = {
logSomething: function () { logSomething: function () {

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="../ts/typings/main.d.ts" /> /// <reference path="../ts/typings/main.d.ts" />
console.log("**** starting test ****"); console.log("**** starting test ****");
var testplugin = require("../dist/index.js"); var testplugin = require("../dist/index.js");

View File

@ -67,21 +67,16 @@ module NpmtsCompile {
} }
})(); })();
var tsStream = plugins.gulp.src([plugins.path.join(paths.cwd,key),"!**/typings/**"]) var stream = plugins.gulp.src([plugins.path.join(paths.cwd,key),"!**/typings/**"])
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated .pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({ .pipe(plugins.g.typescript({
out: outputName, out: outputName,
declaration: true,
target: "ES5", target: "ES5",
module: "commonjs" module: "commonjs"
})); }))
var stream = plugins.mergeStream([ .pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
//tsStream.dts.pipe(plugins.gulp.dest(outputDir)), //.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
tsStream.js .pipe(plugins.gulp.dest(outputDir));
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(outputDir))
]);
moduleStream.add(stream); moduleStream.add(stream);
} }
moduleStream.on("queueDrain",function(){ moduleStream.on("queueDrain",function(){

View File

@ -7,7 +7,6 @@ module NpmtsPlugins {
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
header: require("gulp-header"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"), mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"), sourcemaps: require("gulp-sourcemaps"),