Skip to content

Commit bbd4880

Browse files
Major Restructuring (#88)
Bugs: * Fixed reload issue Enhancements: * Made close button look clickable * Folder restructure * Test refactor
1 parent b9a3c30 commit bbd4880

57 files changed

Lines changed: 104 additions & 81 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
/build
44
/report
55
/typings
6-
/tmp
6+
/src/tmp
77
.DS_Store
8-
assets/styles/*.css
8+
/src/assets/styles/*.css

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ node_js:
1010
- "4.3"
1111
script: gulp build
1212
after_script:
13+
- npm install coveralls
1314
- npm run-script coveralls

README.md

Lines changed: 8 additions & 2 deletions

assets/styles/bootstrap.scss

Lines changed: 0 additions & 2 deletions
This file was deleted.

gulp.config.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ var historyApiFallback = require('connect-history-api-fallback')
22

33
module.exports = function () {
44
var root = '';
5-
var app = root + 'app/';
6-
var test = root + 'test/';
7-
var tmp = root + 'tmp/';
5+
var src = root + 'src/';
6+
var app = src + 'app/';
7+
var test = src + 'test/';
8+
var tmp = src + 'tmp/';
9+
var tmpApp = tmp + 'app/';
10+
var tmpTest = tmp + 'test/';
811
var testHelper = test + 'test-helpers/';
912
var e2e = test + 'e2e/';
10-
var assets = root + 'assets/';
13+
var tmpE2E = tmpTest + 'e2e/';
14+
var assets = src + 'assets/';
1115
var assetsPath = {
1216
styles: assets + 'styles/',
1317
images: assets + 'images/',
1418
fonts: assets + 'fonts/'
1519
};
16-
var index = root + 'index.html';
20+
var index = src + 'index.html';
1721
var tsFiles = [
1822
app + '**/!(*.spec)+(.ts)'
1923
];
@@ -41,16 +45,19 @@ module.exports = function () {
4145
dev: {
4246
port: 3000,
4347
server: {
44-
baseDir: './',
45-
middleware: [historyApiFallback()]
48+
baseDir: './src/',
49+
middleware: [historyApiFallback()],
50+
routes: {
51+
"/node_modules": "node_modules"
52+
}
4653
},
4754
files: [
48-
"index.html",
49-
"systemjs.conf.js",
50-
"assets/styles/main.css",
51-
"tmp/app/**/*.js",
52-
"app/**/*.css",
53-
"app/**/*.html"
55+
src + "index.html",
56+
src + "systemjs.conf.js",
57+
src + "assets/styles/main.css",
58+
tmpApp + "**/*.js",
59+
app + "**/*.css",
60+
app + "**/*.html"
5461
]
5562
},
5663
prod: {
@@ -78,9 +85,13 @@ module.exports = function () {
7885

7986
var config = {
8087
root: root,
88+
src: src,
8189
app: app,
8290
test: test,
8391
tmp: tmp,
92+
tmpApp: tmpApp,
93+
tmpTest: tmpTest,
94+
tmpE2E: tmpE2E,
8495
testHelper: testHelper,
8596
e2e: e2e,
8697
e2eConfig: e2eConfig,

karma-test-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function onlySpecFiles(path) {
3030
// Normalize paths to module names.
3131
function file2moduleName(filePath) {
3232
return filePath.replace(/\\/g, '/')
33-
.replace(/^\/base\//, '')
33+
.replace(/^\/base\/src\/tmp\//, '')
3434
.replace(/\.js/, '');
3535
}
3636

karma.conf.js

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
module.exports = function(config) {
2+
var gulpConfig = require('./gulp.config')();
23
var dependencies = require('./package.json').dependencies;
34
var excludedDependencies = [
45
'systemjs', 'zone.js', 'font-awesome'
56
];
67
var configuration = {
7-
basePath: '',
8+
basePath: './',
89

910
frameworks: ['jasmine'],
1011
browsers: ['PhantomJS'],
1112
reporters: ['progress', 'coverage'],
1213

13-
preprocessors: {
14-
'tmp/app/**/!(*.spec)+(.js)': ['coverage'],
15-
'tmp/app/**/*.js': ['sourcemap'],
16-
'tmp/test/**/*.js': ['sourcemap']
17-
},
14+
preprocessors: {},
1815

1916
// Generate json used for remap-istanbul
2017
coverageReporter: {
@@ -26,38 +23,20 @@ module.exports = function(config) {
2623

2724
files: [
2825
'node_modules/traceur/bin/traceur-runtime.js',
29-
// IE required polyfills, in this exact order
3026
'node_modules/es6-shim/es6-shim.min.js',
3127
'node_modules/systemjs/dist/system-polyfills.js',
3228
'node_modules/zone.js/dist/zone.js',
3329
'node_modules/reflect-metadata/Reflect.js',
3430
'node_modules/zone.js/dist/async-test.js',
3531
'node_modules/zone.js/dist/fake-async-test.js',
36-
'node_modules/systemjs/dist/system.src.js',
37-
38-
'tmp/test/test-helpers/global/**/*.js',
39-
'systemjs.conf.js',
40-
'karma-test-shim.js',
41-
42-
{ pattern: 'tmp/app/**/*.js', included: false },
43-
{ pattern: 'tmp/test/test-helpers/*.js', included: false },
44-
45-
// paths loaded via Angular's component compiler
46-
// (these paths need to be rewritten, see proxies section)
47-
{ pattern: 'app/**/*.html', included: false },
48-
{ pattern: 'app/**/*.css', included: false },
49-
50-
// paths to support debugging with source maps in dev tools
51-
{ pattern: 'app/**/*.ts', included: false, watched: false },
52-
{ pattern: 'tmp/app/**/*.js.map', included: false, watched: false }
32+
'node_modules/systemjs/dist/system.src.js'
5333
],
5434

5535
// proxied base paths
5636
proxies: {
5737
// required for component assests fetched by Angular's compiler
58-
"/app/": "/base/app/",
59-
"/tmp/app/": "/base/tmp/app/",
60-
"/tmp/test/": "/base/tmp/test/",
38+
"/app/": "/base/src/app/",
39+
"/tmp/": "/base/src/tmp/",
6140
"/node_modules/": "/base/node_modules/"
6241
},
6342

@@ -67,6 +46,24 @@ module.exports = function(config) {
6746
autoWatch: true,
6847
};
6948

49+
configuration.preprocessors[gulpConfig.tmpApp + '**/!(*.spec)+(.js)'] = ['coverage'];
50+
configuration.preprocessors[gulpConfig.tmpApp + '**/*.js'] = ['sourcemap'];
51+
configuration.preprocessors[gulpConfig.tmpTest + '**/*.js'] = ['sourcemap'];
52+
53+
var files = [
54+
gulpConfig.tmpTest + 'test-helpers/global/**/*.js',
55+
gulpConfig.src + 'systemjs.conf.js',
56+
'karma-test-shim.js',
57+
createFilePattern(gulpConfig.tmpApp + '**/*.js', { included: false }),
58+
createFilePattern(gulpConfig.tmpTest + 'test-helpers/*.js', { included: false }),
59+
createFilePattern(gulpConfig.app + '**/*.html', { included: false }),
60+
createFilePattern(gulpConfig.app + '**/*.css', { included: false }),
61+
createFilePattern(gulpConfig.app + '**/*.ts', { included: false, watched: false }),
62+
createFilePattern(gulpConfig.tmpApp + '**/*.js.map', { included: false, watched: false })
63+
];
64+
65+
configuration.files = configuration.files.concat(files);
66+
7067
Object.keys(dependencies).forEach(function(key) {
7168
if(excludedDependencies.indexOf(key) >= 0) { return; }
7269

@@ -84,4 +81,10 @@ module.exports = function(config) {
8481
}
8582

8683
config.set(configuration);
84+
85+
// Helpers
86+
function createFilePattern(path, config) {
87+
config.pattern = path;
88+
return config;
89+
}
8790
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "angular2-starter",
3-
"version": "1.0.0-rc.1",
3+
"version": "1.0.0-rc.2",
44
"author": "Antony Budianto",
5-
"description": "Angular 2 Starter with Gulp, Karma, Jasmine, Protractor using SystemJS",
6-
"main": "index.html",
5+
"description": "Angular 2 Starter with extensible features",
6+
"main": "src/tmp/app/main.js",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/antonybudianto/angular2-starter.git"
@@ -19,6 +19,8 @@
1919
"starter",
2020
"seed",
2121
"gulp",
22+
"webpack",
23+
"extensible",
2224
"systemjs",
2325
"systemjs builder",
2426
"travis",
@@ -42,17 +44,16 @@
4244
"es6-shim": "^0.35.0",
4345
"font-awesome": "^4.6.1",
4446
"jquery": "^2.2.3",
45-
"lodash": "^4.11.0",
47+
"lodash": "^4.13.1",
4648
"reflect-metadata": "0.1.3",
4749
"rxjs": "5.0.0-beta.6",
48-
"systemjs": "^0.19.27",
50+
"systemjs": "^0.19.29",
4951
"zone.js": "^0.6.12"
5052
},
5153
"devDependencies": {
5254
"browser-sync": "^2.12.8",
5355
"codelyzer": "0.0.19",
5456
"connect-history-api-fallback": "^1.2.0",
55-
"coveralls": "^2.11.9",
5657
"del": "~2.2.0",
5758
"glob": "^7.0.3",
5859
"gulp": "^3.9.1",
@@ -74,15 +75,14 @@
7475
"karma-jasmine": "~1.0.2",
7576
"karma-phantomjs-launcher": "~1.0.0",
7677
"karma-sourcemap-loader": "^0.3.7",
77-
"ngstarter-systemjs-tasks": "^1.0.0-rc.0",
78+
"ngstarter-systemjs-tasks": "1.0.0-rc.1",
7879
"phantomjs-prebuilt": "^2.1.7",
7980
"remap-istanbul": "~0.6.4",
8081
"require-dir": "~0.3.0",
81-
"run-sequence": "^1.2.0",
82-
"systemjs-builder": "~0.15.16",
83-
"traceur": "~0.0.108",
82+
"run-sequence": "^1.2.1",
83+
"traceur": "~0.0.110",
8484
"tslint": "^3.10.2",
85-
"typings": "^1.0.3",
85+
"typings": "^1.0.4",
8686
"yargs": "^4.7.1"
8787
}
8888
}

0 commit comments

Comments
 (0)