Skip to content

Commit

Permalink
everything manually
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAlbertCom committed Jan 3, 2015
1 parent 8198377 commit 8baf4c2
Show file tree
Hide file tree
Showing 21 changed files with 39,926 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
bower_components
bower_components
source/app/**/*.js
source/css/**/*.css
18 changes: 17 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,21 @@
"bower_components",
"test",
"tests"
]
],
"dependencies": {
"angular": "~1.3.8",
"angular-route": "~1.3.8",
"bootstrap": "~3.3.1"
},
"overrides" : {
"jquery" : {
"main" : ".ignore"
},
"bootstrap" : {
"main" : [
"dist/css/bootstrap.css",
"dist/css/bootstrap-theme.css",
"dist/fonts/*"]
}
}
}
97 changes: 97 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

var gulp = require('gulp');
var path = require('path');
var ignore = require('gulp-ignore');
var less = require('gulp-less');
var typescript = require('gulp-typescript');
var inject = require('gulp-inject');
var mainBowerFiles = require('main-bower-files');
var browserSync = require('browser-sync');
var ngAnnotate = require('gulp-ng-annotate');
var sync = require('gulp-sync');
var del = require('del');

var config = {
'site' : './source',
'assets' : './source/assets',
'app' : './source/app/',
'injectFiles' : './source/index.html',
'bowerComponents': './bower_components',

'typescript' : {
removeComments: false,
target: 'ES5',
noExternalResolve: false,
noImplicitAny: false
},
'typings' : './typings'
}

gulp.task('clean-app', function(cb) {
del([
path.join(config.app, "**/*.css"),
path.join(config.app, "**/*.map"),
path.join(config.app, "**/*.js")
], cb)
});

gulp.task('clean-assets', function(cb) {
del([path.join(config.assets,"**/*")], cb);
})

gulp.task('copy-assets', ['clean-assets'], function() {
return gulp.src(mainBowerFiles(),{
'base': config.bower_components
})
.pipe(gulp.dest(config.assetsDir));
});

gulp.task('copy-assets', ['clean-assets'], function() {
return gulp.src(mainBowerFiles(), { 'base': config.bowerComponents })
.pipe(gulp.dest(config.assets));
});

gulp.task('inject-files', function() {
var assetsFiles = [
path.join(config.assets, "angular/*"),
path.join(config.assets, "bootstrap/dist/css/bootstrap.css"),
path.join(config.assets, "**/*"),
];

var appFiles = [
path.join(config.app, "common/**/*"),
path.join(config.app, "common/*"),
path.join(config.app, "modules/**/*"),
path.join(config.app, "*"),
path.join(config.site, "css/*")
];

var appStream = gulp.src(appFiles, { 'base' : config.site});
var assetsStream = gulp.src(assetsFiles, { 'base' : config.site});

return gulp.src(config.injectFiles)
.pipe(inject(assetsStream, { name: 'assets', ignorePath: config.site.substring(2), relative:false}))
.pipe(inject(appStream, { name: 'app', ignorePath: config.site.substring(2), relative:false}))
.pipe(gulp.dest(config.site));
});

var tsProject = typescript.createProject(config.typescript);
gulp.task('compile-ts', function() {

var result = gulp.src([
path.join(config.app, "**/*.ts"),
path.join(config.typings, "**/*.ts")
])
.pipe(typescript(tsProject));

return result
.pipe(ngAnnotate())
.pipe(gulp.dest(config.app));
});

gulp.task('compile-less', function() {
return gulp.src(path.join(config.site, "**/*.less"), {base: config.site})
.pipe(less())
.pipe(gulp.dest(config.site));

});
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,17 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Albert Weinert",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"browser-sync": "^1.8.3",
"del": "^1.1.1",
"gulp": "^3.8.10",
"gulp-ignore": "^1.2.1",
"gulp-inject": "^1.1.1",
"gulp-less": "^2.0.1",
"gulp-ng-annotate": "^0.4.3",
"gulp-sync": "^0.1.4",
"gulp-typescript": "^2.3.0",
"main-bower-files": "^2.4.1"
}
}
3 changes: 3 additions & 0 deletions source/app/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module MyApp {
angular.module('MyApp', []);
}
3 changes: 3 additions & 0 deletions source/app/modules/home/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module home {
angular.module('home', []);
}
Loading

0 comments on commit 8baf4c2

Please sign in to comment.