Skip to content

Commit 41501ec

Browse files
committed
Merge pull request #16 from KarlDirck/master
Add tsd "rebundle" command support
2 parents 98c1057 + 8a9bb64 commit 41501ec

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

Changes

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Revision history for gulp-tsd
22

3+
0.1.1 2016-03-03T12:55:02X
4+
5+
- Add "rebundle" command which calls API.updateBundle similarly to how
6+
CLI.rebundle works.
7+
38
0.1.0 2016-01-13T13:58:55Z
49

510
- Allow configurable debugging by using `debug` module (@goldcaddy77)

lib/tsd.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,22 @@ function getRunner(logger) {
4646
return api.reinstall(opts);
4747
});
4848
}
49+
50+
function rebundle(setting) {
51+
logger.log('execute command: rebundle');
52+
53+
var api = getAPI(setting);
54+
return api.readConfig(setting.config, true).then(function () {
55+
logger.log('running...');
56+
return api.updateBundle(api.context.config.bundle, true);
57+
});
58+
}
4959

5060
return {
5161
getAPI: getAPI,
5262
commands: {
53-
reinstall: reinstall
63+
reinstall: reinstall,
64+
rebundle: rebundle
5465
}
5566
};
5667
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gulp-tsd",
33
"author": "moznion <[email protected]>",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"description": "Gulp plugin to automate TSD and TypeScript definition related tasks",
66
"main": "index.js",
77
"scripts": {

test/gulpfile.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ gulp.task('default', function () {
1818
'clean',
1919
'reinstall',
2020
'reinstall-no-src',
21-
'reinstall-test'
21+
'reinstall-test',
22+
'rebundle-test'
2223
);
2324
});
2425

@@ -66,6 +67,13 @@ gulp.task('reinstall-test', function () {
6667
]);
6768
});
6869

70+
gulp.task('rebundle-test', function (callback) {
71+
tsd({
72+
command: 'rebundle',
73+
config: './tsd.json',
74+
}, callback);
75+
});
76+
6977
function expectDifferencesBetweenBothFiles(description, diffTargets) {
7078
var testNum = 0;
7179
try {

0 commit comments

Comments
 (0)