updated compile process

This commit is contained in:
Phil Kunz 2015-12-20 23:22:38 +01:00
parent 6ae05de2b1
commit 2adf0e2bd3
5 changed files with 45 additions and 35 deletions

View File

@ -1,11 +1,8 @@
language: node_js language: node_js
node_js:
- "4.1"
before_install: before_install:
- nvm install stable - npm install -g tsd
- node -v
- npm -v
- npm install -g gulp
- npm install gulp
- npm install gulp-typescript
deploy: deploy:
provider: npm provider: npm
email: npm@smart-coordination.com email: npm@smart-coordination.com

View File

@ -4,8 +4,13 @@
"description": "beautiful logging", "description": "beautiful logging",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "(cd ts/compile && gulp) && (node test.js)", "test": "(cd ts/compile && node compile.js) && (node ./test.js)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)" "gitsetup": "(git config push.followTags true)",
"push": "(git push origin master && git push origin release && git push --follow-tags)",
"reinstall": "(rm -r node_modules && npm install)",
"release": "(npm test) && (git pull origin master && npm version patch && git checkout release && git merge master && git checkout master && npm run push)",
"update": "(git checkout master && git pull origin master) && (npm install)",
"upgrade": "(npm run update) && (ncu upgradeAll && npm install)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,5 +32,10 @@
"cli-color": "^1.1.0", "cli-color": "^1.1.0",
"cli-table2": "^0.1.9", "cli-table2": "^0.1.9",
"colors": "1.1.2" "colors": "1.1.2"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-typescript": "^2.10.0",
"pushrocks": "^1.0.25"
} }
} }

30
ts/compile/compile.js Normal file
View File

@ -0,0 +1,30 @@
// import gulp
var gulp = require("gulp")
var gulpTypescript = require("gulp-typescript");
var pr = require("pushrocks");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTestTS', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTestTS'], function() {
pr.beautylog.success('Typescript compiled');
});
//lets tell gulp to start with the default task.
pr.beautylog.log('Starting Gulp to compile TypeScript');
gulp.start.apply(gulp, ['default']);

View File

@ -1,2 +0,0 @@
nvm use v0.12.7
gulp

View File

@ -1,25 +0,0 @@
// import gulp
var gulp = require("gulp"),
gulpTypescript = require("gulp-typescript");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTSTest', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTSTest'], function() {
console.log('Typescript compiled');
});