Skip to content

Commit

Permalink
Several minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ludohenin committed Sep 3, 2015
1 parent 2316365 commit 61d6e95
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 30 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"bitwise": true,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"trailing": true,
"maxlen": 200,
"boss": true,
"eqnull": true,
"expr": true,
"globalstrict": true,
"laxbreak": true,
"loopfunc": true,
"sub": true,
"undef": true,
"indent": 2,
"unused": true,

"node": true,
"globals": {
"System": true
}
}
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ It is something similar to the AngularJS Quick Start but does the entire build w
```bash
git clone https://github.com/mgechev/angular2-seed.git
cd angular2-seed
# If you don't have gulp already installed
npm install -g gulp
# If you don't have gulp and/or tsd already installed
npm install -g gulp tsd
npm install
# dev
gulp serve.dev
# test
gulp test
```

# Directory Structure
Expand Down Expand Up @@ -68,6 +66,17 @@ vim gulpfile.js
```
Add reference to the installed library in `PATH.src.lib`.

# Running test

```bash
# In a single bash window
gulp test # or npm test

# Debug - In two bash windows
npm run karma # 1st window
gulp test-dev # 2nd window
```

# Contributors

[<img alt="mgechev" src="https://avatars.githubusercontent.com/u/455023?v=3&s=117" width="117">](https://github.com/mgechev) |[<img alt="ludohenin" src="https://avatars.githubusercontent.com/u/1011516?v=3&s=117" width="117">](https://github.com/ludohenin) |[<img alt="NathanWalker" src="https://avatars.githubusercontent.com/u/457187?v=3&s=117" width="117">](https://github.com/NathanWalker) |[<img alt="aboeglin" src="https://avatars.githubusercontent.com/u/8297302?v=3&s=117" width="117">](https://github.com/aboeglin) |[<img alt="mjwwit" src="https://avatars.githubusercontent.com/u/4455124?v=3&s=117" width="117">](https://github.com/mjwwit) |[<img alt="dstockhammer" src="https://avatars.githubusercontent.com/u/1156637?v=3&s=117" width="117">](https://github.com/dstockhammer) |
Expand Down
6 changes: 4 additions & 2 deletions app/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Component, View, bootstrap} from 'angular2/angular2';
import {RouteConfig, RouterOutlet, RouterLink, ROUTER_BINDINGS} from 'angular2/router';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_BINDINGS} from 'angular2/router';
// import {HTTP_BINDINGS} from 'http/http';

import {Home} from './components/home/home';
import {About} from './components/about/about';
Expand All @@ -15,7 +16,8 @@ import {NamesList} from './services/NameList';
])
@View({
templateUrl: './app.html?v=<%= VERSION %>',
directives: [RouterOutlet, RouterLink]
styleUrls: ['./app.css'],
directives: [ROUTER_DIRECTIVES]
})
class App {}

Expand Down
4 changes: 2 additions & 2 deletions app/components/about/about.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, View, NgFor} from 'angular2/angular2';
import {Component, View, CORE_DIRECTIVES} from 'angular2/angular2';

import {NamesList} from '../../services/NameList';

Expand All @@ -7,7 +7,7 @@ import {NamesList} from '../../services/NameList';
})
@View({
templateUrl: './components/about/about.html?v=<%= VERSION %>',
directives: [NgFor]
directives: [CORE_DIRECTIVES]
})
export class About {
constructor(public list: NamesList) {
Expand Down
42 changes: 21 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
"use strict";

// Gulp dev.
var gulp = require('gulp');
var bump = require('gulp-bump');
var concat = require('gulp-concat');
var filter = require('gulp-filter');
var inject = require('gulp-inject');
var inlineNg2Template = require('gulp-inline-ng2-template');
var minifyCSS = require('gulp-minify-css');
var minifyHTML = require('gulp-minify-html');
var plumber = require('gulp-plumber');
var shell = require('gulp-shell');
var sourcemaps = require('gulp-sourcemaps');
var template = require('gulp-template');
var tsc = require('gulp-typescript');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
// Gulp prod.
// var concat = require('gulp-concat');
// var filter = require('gulp-filter');
// var minifyCSS = require('gulp-minify-css');
// var minifyHTML = require('gulp-minify-html');
// var uglify = require('gulp-uglify');


var Builder = require('systemjs-builder');
var del = require('del');
Expand All @@ -35,7 +38,10 @@ var connectLivereload = require('connect-livereload');

// --------------
// Configuration.
var PORT = 5555;
var LIVE_RELOAD_PORT = 4002;
var APP_BASE = '/';

var APP_SRC = 'app';
var APP_DEST = 'dist';
var ANGULAR_BUNDLES = './node_modules/angular2/bundles/';
Expand All @@ -54,33 +60,22 @@ var PATH = {
},
src: {
all: APP_SRC,
loader: [
lib: [
// Order is quite important here for the HTML tag injection.
'./node_modules/angular2/node_modules/traceur/bin/traceur-runtime.js',
'./node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.js',
'./node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.js.map',
'./node_modules/reflect-metadata/Reflect.js',
'./node_modules/reflect-metadata/Reflect.js.map',
'./node_modules/systemjs/dist/system.src.js'
],
loaderConfig: [
APP_SRC + '/system.config.js'
],
// Order is quite important here for the HTML tag injection.
angular: [
'./node_modules/systemjs/dist/system.src.js',
APP_SRC + '/system.config.js',
ANGULAR_BUNDLES + '/angular2.dev.js',
ANGULAR_BUNDLES + '/router.dev.js',
ANGULAR_BUNDLES + '/http.dev.js'
]
}
};

PATH.src.lib = PATH.src.loader
.concat(PATH.src.loaderConfig)
.concat(PATH.src.angular);

var PORT = 5555;
var LIVE_RELOAD_PORT = 4002;

var HTMLMinifierOpts = { conditionals: true };

var tsProject = tsc.createProject('tsconfig.json', {
Expand Down Expand Up @@ -206,6 +201,12 @@ gulp.task('karma.start', ['build.test'], function(done) {
}, done);
});

gulp.task('test-dev', ['build.test'], function() {
watch('./app/**', function() {
gulp.start('build.test');
});
});

gulp.task('test', ['karma.start'], function() {
watch('./app/**', function() {
gulp.start('karma.start');
Expand Down Expand Up @@ -268,7 +269,6 @@ function injectableDevAssetsRef() {
var src = PATH.src.lib.map(function (path) {
return join(PATH.dest.dev.lib, path.split('/').pop());
});
src.push(join(PATH.dest.dev.all, '**/*.css'));
return src;
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Seed for Angular 2 apps",
"repository": "https://github.com/mgechev/angular2-seed",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "gulp test",
"karma": "node_modules/.bin/karma start",
"postinstall": "gulp postinstall"
},
"author": "Minko Gechev <mgechev>",
Expand Down

0 comments on commit 61d6e95

Please sign in to comment.