Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
cb3f343c92 | |||
6227e47037 | |||
2730ca4299 | |||
07aae64965 | |||
56841d5bb0 | |||
40301ede35 | |||
70213b04bc | |||
5160aab180 | |||
e8806e548b | |||
fcdaad540e |
16
index.js
16
index.js
@ -167,21 +167,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 () {
|
||||||
@ -202,7 +196,7 @@ var NpmtsTests;
|
|||||||
var done = plugins.q.defer();
|
var done = plugins.q.defer();
|
||||||
var config = configArg;
|
var config = configArg;
|
||||||
var istanbul = function () {
|
var istanbul = function () {
|
||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "index.js")])
|
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")])
|
||||||
.pipe(plugins.g.istanbul())
|
.pipe(plugins.g.istanbul())
|
||||||
.pipe(plugins.g.istanbul.hookRequire());
|
.pipe(plugins.g.istanbul.hookRequire());
|
||||||
return stream;
|
return stream;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "3.0.0",
|
"version": "3.1.0",
|
||||||
"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",
|
||||||
|
4
test/assets/dist/index.d.ts
vendored
4
test/assets/dist/index.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
|
||||||
declare var testplugin: {
|
|
||||||
logSomething: () => void;
|
|
||||||
};
|
|
2
test/assets/dist/index.js
vendored
2
test/assets/dist/index.js
vendored
@ -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 () {
|
||||||
|
@ -8,4 +8,5 @@ describe("testplugins", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=test.js.map
|
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELE9BQU8sQ0FBQyxHQUFHLENBQUMseUJBQXlCLENBQUMsQ0FBQztBQUN2QyxJQUFJLFVBQVUsR0FBRyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQztBQUM3QyxRQUFRLENBQUMsYUFBYSxFQUFDO0lBQ25CLFFBQVEsQ0FBQyxlQUFlLEVBQUM7UUFDckIsRUFBRSxDQUFDLHNCQUFzQixFQUFDO1lBQ3RCLFVBQVUsQ0FBQyxZQUFZLEVBQUUsQ0FBQTtRQUM3QixDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMiLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi90cy90eXBpbmdzL21haW4uZC50c1wiIC8+XG5jb25zb2xlLmxvZyhcIioqKiogc3RhcnRpbmcgdGVzdCAqKioqXCIpO1xudmFyIHRlc3RwbHVnaW4gPSByZXF1aXJlKFwiLi4vZGlzdC9pbmRleC5qc1wiKTtcbmRlc2NyaWJlKFwidGVzdHBsdWdpbnNcIixmdW5jdGlvbigpe1xuICAgIGRlc2NyaWJlKFwiLmxvZ1NvbWV0aGluZ1wiLGZ1bmN0aW9uKCl7XG4gICAgICAgIGl0KFwic2hvdWxkIGxvZyBzb21ldGhpbmdcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgdGVzdHBsdWdpbi5sb2dTb21ldGhpbmcoKVxuICAgICAgICB9KTtcbiAgICB9KTtcbn0pOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
||||||
|
@ -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(){
|
||||||
|
@ -4,7 +4,7 @@ module NpmtsTests {
|
|||||||
var done = plugins.q.defer();
|
var done = plugins.q.defer();
|
||||||
var config = configArg;
|
var config = configArg;
|
||||||
var istanbul = function () {
|
var istanbul = function () {
|
||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"index.js")])
|
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"dist/*.js")])
|
||||||
// Covering files
|
// Covering files
|
||||||
.pipe(plugins.g.istanbul())
|
.pipe(plugins.g.istanbul())
|
||||||
// Force `require` to return covered files
|
// Force `require` to return covered files
|
||||||
|
Reference in New Issue
Block a user