Skip to content

Commit

Permalink
Finish refactor things
Browse files Browse the repository at this point in the history
  • Loading branch information
antonybudianto committed May 25, 2016
1 parent 62a5db9 commit 73f7a71
Show file tree
Hide file tree
Showing 48 changed files with 38 additions and 662 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/build
/report
/typings
/tmp
/src/tmp
.DS_Store
assets/styles/*.css
/src/assets/styles/*.css
14 changes: 8 additions & 6 deletions gulp.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
var historyApiFallback = require('connect-history-api-fallback')

module.exports = function () {
var root = 'src/';
var app = root + 'app/';
var test = root + 'test/';
var tmp = root + 'tmp/';
var root = '';
var src = root + 'src/';
var app = src + 'app/';
var test = src + 'test/';
var tmp = src + 'tmp/';
var tmpApp = tmp + 'app/';
var tmpTest = tmp + 'test/';
var testHelper = test + 'test-helpers/';
var e2e = test + 'e2e/';
var tmpE2E = tmpTest + 'e2e/';
var assets = root + 'assets/';
var assets = src + 'assets/';
var assetsPath = {
styles: assets + 'styles/',
images: assets + 'images/',
fonts: assets + 'fonts/'
};
var index = root + 'index.html';
var index = src + 'index.html';
var tsFiles = [
app + '**/!(*.spec)+(.ts)'
];
Expand Down Expand Up @@ -84,6 +85,7 @@ module.exports = function () {

var config = {
root: root,
src: src,
app: app,
test: test,
tmp: tmp,
Expand Down
50 changes: 27 additions & 23 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = function(config) {
var gulpConfig = require('./gulp.config')();
var dependencies = require('./package.json').dependencies;
var excludedDependencies = [
'systemjs', 'zone.js', 'font-awesome'
Expand All @@ -10,11 +11,7 @@ module.exports = function(config) {
browsers: ['PhantomJS'],
reporters: ['progress', 'coverage'],

preprocessors: {
'src/tmp/app/**/!(*.spec)+(.js)': ['coverage'],
'src/tmp/app/**/*.js': ['sourcemap'],
'src/tmp/test/**/*.js': ['sourcemap']
},
preprocessors: {},

// Generate json used for remap-istanbul
coverageReporter: {
Expand All @@ -26,30 +23,13 @@ module.exports = function(config) {

files: [
'node_modules/traceur/bin/traceur-runtime.js',
// IE required polyfills, in this exact order
'node_modules/es6-shim/es6-shim.min.js',
'node_modules/systemjs/dist/system-polyfills.js',
'node_modules/zone.js/dist/zone.js',
'node_modules/reflect-metadata/Reflect.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
'node_modules/systemjs/dist/system.src.js',

'src/tmp/test/test-helpers/global/**/*.js',
'src/systemjs.conf.js',
'karma-test-shim.js',

{ pattern: 'src/tmp/app/**/*.js', included: false },
{ pattern: 'src/tmp/test/test-helpers/*.js', included: false },

// paths loaded via Angular's component compiler
// (these paths need to be rewritten, see proxies section)
{ pattern: 'src/app/**/*.html', included: false },
{ pattern: 'src/app/**/*.css', included: false },

// paths to support debugging with source maps in dev tools
{ pattern: 'src/app/**/*.ts', included: false, watched: false },
{ pattern: 'src/tmp/app/**/*.js.map', included: false, watched: false }
'node_modules/systemjs/dist/system.src.js'
],

// proxied base paths
Expand All @@ -66,6 +46,24 @@ module.exports = function(config) {
autoWatch: true,
};

configuration.preprocessors[gulpConfig.tmpApp + '**/!(*.spec)+(.js)'] = ['coverage'];
configuration.preprocessors[gulpConfig.tmpApp + '**/*.js'] = ['sourcemap'];
configuration.preprocessors[gulpConfig.tmpTest + '**/*.js'] = ['sourcemap'];

var files = [
gulpConfig.tmpTest + 'test-helpers/global/**/*.js',
gulpConfig.src + 'systemjs.conf.js',
'karma-test-shim.js',
createFilePattern(gulpConfig.tmpApp + '**/*.js', { included: false }),
createFilePattern(gulpConfig.tmpTest + 'test-helpers/*.js', { included: false }),
createFilePattern(gulpConfig.app + '**/*.html', { included: false }),
createFilePattern(gulpConfig.app + '**/*.css', { included: false }),
createFilePattern(gulpConfig.app + '**/*.ts', { included: false, watched: false }),
createFilePattern(gulpConfig.tmpApp + '**/*.js.map', { included: false, watched: false })
];

configuration.files = configuration.files.concat(files);

Object.keys(dependencies).forEach(function(key) {
if(excludedDependencies.indexOf(key) >= 0) { return; }

Expand All @@ -83,4 +81,10 @@ module.exports = function(config) {
}

config.set(configuration);

// Helpers
function createFilePattern(path, config) {
config.pattern = path;
return config;
}
}
34 changes: 0 additions & 34 deletions src/tmp/app/app.component.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/app.component.js.map

This file was deleted.

46 changes: 0 additions & 46 deletions src/tmp/app/app.component.spec.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/app.component.spec.js.map

This file was deleted.

11 changes: 0 additions & 11 deletions src/tmp/app/app.routes.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/app.routes.js.map

This file was deleted.

26 changes: 0 additions & 26 deletions src/tmp/app/blocks/logger.service.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/blocks/logger.service.js.map

This file was deleted.

16 changes: 0 additions & 16 deletions src/tmp/app/blocks/logger.service.spec.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/blocks/logger.service.spec.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions src/tmp/app/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/bundle.js.map

This file was deleted.

29 changes: 0 additions & 29 deletions src/tmp/app/home/home.component.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/home/home.component.js.map

This file was deleted.

14 changes: 0 additions & 14 deletions src/tmp/app/main.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/main.js.map

This file was deleted.

38 changes: 0 additions & 38 deletions src/tmp/app/navbar/navbar.component.js

This file was deleted.

1 change: 0 additions & 1 deletion src/tmp/app/navbar/navbar.component.js.map

This file was deleted.

Loading

0 comments on commit 73f7a71

Please sign in to comment.