Skip to content

Commit 01fe837

Browse files
author
vakrilov
committed
Clean deifinitions slcript
1 parent ad1b659 commit 01fe837

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ nativescript-angular/**/*.d.ts
1010
nativescript-angular/**/*.js
1111
!nativescript-angular/postinstall.js
1212
!nativescript-angular/hooks/**/*.js
13+
!nativescript-angular/gulpfile.js
1314

1415
.tscache
1516
.nvm

Diff for: nativescript-angular/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
tsconfig.json
99
global.d.ts
1010
.npmignore
11+
gulpfile.js

Diff for: nativescript-angular/gulpfile.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var gulp = require('gulp');
2+
var del = require('del');
3+
var glob = require('glob');
4+
5+
gulp.task('clean-defs', function() {
6+
var files = [...glob.sync("*.ts"), ...glob.sync("!(node_modules)/*.ts")]
7+
.map(function(file) {
8+
return file.replace(/.ts$/, '.d.ts');
9+
});
10+
11+
return del(files).then(paths => {
12+
console.log('Definition files cleaned:')
13+
console.log(paths.join('\n'));
14+
});
15+
});

Diff for: nativescript-angular/package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"scripts": {
1616
"postinstall": "node postinstall.js",
17-
"prepublish": "tsc"
17+
"prepublish": "tsc",
18+
"postpublish": "gulp clean-defs"
1819
},
1920
"dependencies": {
2021
"nativescript-intl": "^0.0.2",
@@ -34,11 +35,14 @@
3435
"url": "0.10.3"
3536
},
3637
"devDependencies": {
38+
"del": "^2.2.0",
39+
"glob": "^7.0.3",
40+
"gulp": "^3.9.1",
3741
"tns-core-modules": ">=2.0.0 || >=2.1.0-2016 || >=2.0.0-angular-7",
3842
"typescript": "^1.8.10"
3943
},
4044
"peerDependencies": {
4145
"tns-core-modules": ">=2.0.0 || >=2.1.0-2016 || >=2.0.0-angular-7"
4246
},
4347
"nativescript": {}
44-
}
48+
}

0 commit comments

Comments
 (0)