Skip to content

Commit

Permalink
Create initial files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Elrey Belmonti and LDMacKrell committed Oct 23, 2017
0 parents commit 5eb74b6
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
npm-debug.log
bower_components/
app/*.js
app/*.js.map
.DS_Store
build/
14 changes: 14 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "angular2-to-do",
"description": "",
"main": "",
"license": "MIT",
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
109 changes: 109 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');

var lib = require('bower-files')({
"overrides":{
"bootstrap" : {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
}
});

var utilities = require('gulp-util');
var buildProduction = utilities.env.production;
var del = require('del');
var browserSync = require('browser-sync').create();
var shell = require('gulp-shell');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');

////////////////////// TYPESCRIPT //////////////////////


gulp.task('tsClean', function(){
return del(['app/*.js', 'app/*.js.map']);
});

gulp.task('ts', ['tsClean'], shell.task([
'tsc'
]));

////////////////////// BOWER //////////////////////


gulp.task('jsBowerClean', function(){
return del(['./build/js/vendor.min.js']);
});

gulp.task('jsBower', ['jsBowerClean'], function() {
return gulp.src(lib.ext('js').files)
.pipe(concat('vendor.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./build/js'));
});

gulp.task('cssBowerClean', function(){
return del(['./build/css/vendor.css']);
});

gulp.task('cssBower', ['cssBowerClean'], function() {
return gulp.src(lib.ext('css').files)
.pipe(concat('vendor.css'))
.pipe(gulp.dest('./build/css'));
});

gulp.task('bower', ['jsBower', 'cssBower']);

////////////////////// SASS //////////////////////

gulp.task('sassBuild', function() {
return gulp.src(['resources/styles/*'])
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./build/css'));
});

////////////////////// SERVER //////////////////////


gulp.task('serve', ['build'], function() {
browserSync.init({
server: {
baseDir: "./",
index: "index.html"
}
});
gulp.watch(['resources/js/*.js'], ['jsBuild']); // vanilla js changes, reload.
gulp.watch(['*.html'], ['htmlBuild']); // html changes, reload.
gulp.watch(['resources/styles/*.css', 'resources/styles/*.scss'], ['cssBuild']); gulp.watch(['app/*.ts'], ['tsBuild']); // typescript files change, compile then reload.
});

gulp.task('jsBuild', function(){
browserSync.reload();
});

gulp.task('htmlBuild', function(){
browserSync.reload();
});

gulp.task('cssBuild', ['sassBuild'], function(){
browserSync.reload();
});

gulp.task('tsBuild', ['ts'], function(){
browserSync.reload();
});

////////////////////// GLOBAL BUILD TASK //////////////////////

gulp.task('build', ['ts'], function(){
// we can use the buildProduction environment variable here later.
gulp.start('bower');
gulp.start('sassBuild');
});
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular 2 To Do List for Epicodus</title>
<meta name="viewpoint" content="width=device-width, initial-scale=1">
<script src="build/js/vendor.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="build/css/vendor.css">
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>

<link rel="stylesheet" href="build/css/master.css">
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "angular2-to-do",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w"
},
"license": "MIT",
"dependencies": {
"@angular/common": "2.4.0",
"@angular/compiler": "2.4.0",
"@angular/core": "2.4.0",
"@angular/forms": "2.4.0",
"@angular/http": "2.4.0",
"@angular/platform-browser": "2.4.0",
"@angular/platform-browser-dynamic": "2.4.0",
"@angular/router": "3.4.0",
"@angular/upgrade": "2.4.0",
"bootstrap": "3.3.6",
"angular-in-memory-web-api": "0.3.1",
"core-js": "2.4.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.1",
"zone.js": "0.7.2",
"systemjs": "0.19.27"
},
"devDependencies": {
"bower-files": "3.11.3",
"browser-sync": "2.11.1",
"del": "2.2.0",
"gulp": "3.9.1",
"gulp-concat": "2.6.0",
"gulp-sass": "2.2.0",
"gulp-shell": "0.5.2",
"gulp-sourcemaps": "1.6.0",
"gulp-uglify": "1.5.3",
"gulp-util": "3.0.7",
"concurrently": "3.0.0",
"lite-server": "2.2.2",
"typescript": "2.2.2",
"typings":"1.3.2"
}
}
13 changes: 13 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
}
}

0 comments on commit 5eb74b6

Please sign in to comment.