Skip to content

Commit 8ebc94f

Browse files
committed
style(build): removed redundant code, minor styling updates
1 parent dabd094 commit 8ebc94f

6 files changed

Lines changed: 34 additions & 34 deletions

File tree

gulpfile.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ var processWinPath = function (file) {
3838

3939
// Compile SASS
4040
gulp.task('styles:sass', function () {
41-
var files = [config.app + '/+(sass|app|common)/**/*.scss', '!' + config.app + '/sass/includes/*.scss', '!' + config.app + '/+(app|common)/**/_*.scss'];
41+
var files = [
42+
config.app + '/+(sass|app|common)/**/*.scss',
43+
'!' + config.app + '/sass/includes/*.scss',
44+
'!' + config.app + '/+(app|common)/**/_*.scss'
45+
];
46+
4247
return gulp.src(files, { read: false })
4348
.on('data', processWinPath)
4449
.pipe(plugins.plumber())
@@ -53,8 +58,8 @@ gulp.task('styles:sass', function () {
5358
.pipe(plugins.concat('app.scss'))
5459
.pipe(plugins.sourcemaps.init())
5560
.pipe(plugins.sass().on('error', plugins.sass.logError))
56-
.pipe(plugins.sourcemaps.write())
57-
.pipe(plugins.size({ showFiles: true, title: '[CSS]' }))
61+
.pipe(plugins.sourcemaps.write({ sourceRoot: '/' + config.app }))
62+
.pipe(plugins.size({ showFiles: true, title: '»»»' }))
5863
.pipe(gulp.dest(config.build + '/assets'))
5964
.pipe(bs.stream());
6065
});

karma.conf.default.js

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,24 @@
33
var cfg = require('./config.json');
44

55
module.exports = function (config) {
6-
config.set({
7-
files: [
8-
// bower:js
9-
// endbower
10-
'node_modules/ng-describe/dist/ng-describe.js',
11-
cfg.app + '/+(app|common)/**/*.module.js',
12-
cfg.app + '/+(app|common)/**/!(*.spec).js',
13-
cfg.build + '/assets/' + cfg.templateFile,
14-
cfg.paths.tests
15-
],
16-
frameworks: ['jasmine'],
17-
plugins: ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage'],
6+
var options = {
7+
frameworks: [ 'jasmine' ],
8+
plugins: [ 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage' ],
9+
browsers: [ 'PhantomJS' ],
10+
coverageReporter: { type: 'text' },
11+
preprocessors: {}
12+
};
1813

19-
preprocessors: {
20-
'src/+(app|common)/**/!(*.spec).js': 'coverage'
21-
},
14+
options.preprocessors[ cfg.app + '/+(app|common)/**/!(*.spec).js' ] = 'coverage';
15+
options.files = [
16+
// bower:js
17+
// endbower
18+
'node_modules/ng-describe/dist/ng-describe.js',
19+
cfg.app + '/+(app|common)/**/*.module.js',
20+
cfg.app + '/+(app|common)/**/!(*.spec).js',
21+
cfg.build + '/assets/' + cfg.templateFile,
22+
cfg.paths.tests
23+
];
2224

23-
coverageReporter: {
24-
type: 'text'
25-
},
26-
27-
browsers: [
28-
'PhantomJS'
29-
]
30-
});
25+
config.set(options);
3126
};

src/app/about/about.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ angular.module('ngDevstack.about')
44

55
.config(function ($stateProvider) {
66
$stateProvider.state('about', {
7-
url: '/about/',
7+
url: '/about',
88
views: {
9-
"main": {
9+
'main': {
1010
controller: 'AboutCtrl',
1111
templateUrl: 'about/about.tpl.html'
1212
}

src/app/app.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ angular.module('ngDevstack')
55
.config(function ($urlRouterProvider) {
66

77
$urlRouterProvider.otherwise('/');
8+
89
// Please enable mod rewrite in server.js when html5Mode is enabled.
910
// Don't forget to inject $locationProvider.
1011
// Depending on your project requirements, you may further want to
@@ -16,12 +17,11 @@ angular.module('ngDevstack')
1617

1718

1819
/*
19-
Make a trailing slash optional for all routes
20-
*/
20+
// Make a trailing slash optional for all routes
2121
$urlRouterProvider.rule(function ($injector, $location) {
2222
var path = $location.path(),
2323
search = $location.search(),
24-
params;
24+
params = [];
2525
2626
if (path[path.length - 1] === '/') {
2727
return;
@@ -31,11 +31,11 @@ angular.module('ngDevstack')
3131
return path + '/';
3232
}
3333
34-
params = [];
3534
angular.forEach(search, function (v, k) {
3635
params.push(k + '=' + v);
3736
});
3837
3938
return path + '/?' + params.join('&');
4039
});
40+
*/
4141
});

src/app/app.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ angular.module('ngDevstack')
77
// handling UI Bootstrap Collapse plugin
88
$scope.isCollapsed = true;
99

10-
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
10+
$rootScope.$on('$stateChangeSuccess', function (event, toState) {
1111
if (angular.isDefined(toState.data.pageTitle)) {
1212
$scope.pageTitle = toState.data.pageTitle + ' | ng-devstack';
1313
}

src/app/home/home.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ angular.module('ngDevstack.home')
66
$stateProvider.state('home', {
77
url: '/',
88
views: {
9-
"main": {
9+
'main': {
1010
controller: 'HomeCtrl',
1111
templateUrl: 'home/home.tpl.html'
1212
}

0 commit comments

Comments
 (0)