Skip to content

Commit 04c7511

Browse files
authored
Merge pull request #74 from huangqun/dev
Groups management and remove bower dependency
2 parents 96ff8e9 + c57198c commit 04c7511

32 files changed

+1104
-111
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ Internal application used to administer specific support tasks related to the To
1212

1313
## Installation
1414

15-
To install npm and bower dependencies run:
15+
To install npm dependencies run:
1616

1717
> npm install
1818
19-
Bower is set to run as a npm postinstall script.
20-
2119
## Configuration
2220

2321
The configuration is provided in `config.json` in the base directory.
@@ -64,13 +62,12 @@ Before executing the end-to-end (e2e) protractor tests, these environment variab
6462

6563
### Install global dependencies
6664

67-
```npm install -g [email protected] bower```
65+
```npm install -g [email protected]```
6866

6967
### Install project dependencies
7068

7169
```
7270
npm install
73-
bower install
7471
```
7572

7673
### Start the Application

bower.json

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

circle.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies:
1212
- curl -s https://raw.githubusercontent.com/chronogolf/circleci-google-chrome/master/use_chrome_stable_version.sh | bash
1313

1414
override:
15-
- rm -rf bower_components
1615
- npm install
1716

1817
post:

gulp/browserify.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
var gulp = require('gulp');
2+
3+
var paths = gulp.paths;
4+
5+
var browserify = require('browserify');
6+
var uglify = require('gulp-uglify');
7+
var buffer = require('vinyl-buffer');
8+
var source = require('vinyl-source-stream');
9+
var gutil = require('gulp-util');
10+
var fs = require('fs');
11+
12+
gulp.task('browserify', ['styles'], function () {
13+
14+
var cssFilePath = paths.tmp + '/serve/app/bundle.css';
15+
16+
//delete file if exist
17+
if (fs.existsSync(cssFilePath)) {
18+
fs.unlinkSync(cssFilePath);
19+
}
20+
21+
browserify('./src/index.js')
22+
.transform(require('browserify-css'), {
23+
rootDir: 'src',
24+
onFlush: function (options, done) {
25+
fs.appendFileSync(cssFilePath, options.data);
26+
27+
// Do not embed CSS into a JavaScript bundle
28+
done(null);
29+
}
30+
})
31+
.bundle()
32+
.on('error', function (e) {
33+
gutil.log("Browserify Error", gutil.colors.red(e.message))
34+
})
35+
//Pass desired output filename to vinyl-source-stream
36+
.pipe(source('bundle.js'))
37+
.pipe(buffer())
38+
.pipe(uglify())
39+
.pipe(gulp.dest(paths.tmp + '/serve/app'));
40+
});

gulp/build.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var gulp = require('gulp');
55
var paths = gulp.paths;
66

77
var $ = require('gulp-load-plugins')({
8-
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
8+
pattern: ['gulp-*', 'uglify-save-license', 'del']
99
});
1010

1111
gulp.task('partials', function () {
@@ -46,7 +46,7 @@ gulp.task('html', ['inject', 'partials'], function () {
4646
.pipe($.uglify({preserveComments: $.uglifySaveLicense}))
4747
.pipe(jsFilter.restore())
4848
.pipe(cssFilter)
49-
.pipe($.replace('../bootstrap/fonts', 'fonts'))
49+
.pipe($.replace(/\.?\.?\/node_modules\/\w+-?\/?\w+\/fonts\/?/g, '../fonts/'))
5050
.pipe($.csso())
5151
.pipe(cssFilter.restore())
5252
.pipe(assets.restore())
@@ -69,15 +69,18 @@ gulp.task('images', function () {
6969
});
7070

7171
gulp.task('fonts', function () {
72-
return gulp.src($.mainBowerFiles())
72+
return gulp.src([
73+
"node_modules/bootstrap/dist/fonts/*.{eot,svg,ttf,woff}",
74+
"node_modules/footable/css/fonts/*.{eot,svg,ttf,woff}"
75+
])
7376
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
7477
.pipe($.flatten())
7578
.pipe(gulp.dest(paths.dist + '/fonts/'))
7679
.pipe(gulp.dest(paths.dist + '/styles/fonts/'));
7780
});
7881

7982
gulp.task('fontawesome', function () {
80-
return gulp.src('bower_components/font-awesome/fonts/*.{eot,svg,ttf,woff}')
83+
return gulp.src('node_modules/font-awesome/fonts/*.{eot,svg,ttf,woff}')
8184
.pipe(gulp.dest(paths.dist + '/fonts/'));
8285
});
8386

gulp/inject.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var paths = gulp.paths;
66

77
var $ = require('gulp-load-plugins')();
88

9-
var wiredep = require('wiredep').stream;
109

11-
gulp.task('inject', ['styles'], function () {
10+
gulp.task('inject', ['browserify'], function () {
1211

1312
var injectStyles = gulp.src([
1413
paths.tmp + '/serve/{app,components}/**/*.css',
@@ -26,15 +25,9 @@ gulp.task('inject', ['styles'], function () {
2625
addRootSlash: false
2726
};
2827

29-
var wiredepOptions = {
30-
directory: 'bower_components',
31-
exclude: [/bootstrap\.js/, /bootstrap\.css/, /bootstrap\.css/, /foundation\.css/]
32-
};
33-
3428
return gulp.src(paths.src + '/*.html')
3529
.pipe($.inject(injectStyles, injectOptions))
3630
.pipe($.inject(injectScripts, injectOptions))
37-
.pipe(wiredep(wiredepOptions))
3831
.pipe(gulp.dest(paths.tmp + '/serve'));
3932

4033
});

gulp/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function browserSyncInit(baseDir, files, browser) {
1616
var routes = null;
1717
if(baseDir === paths.src || (util.isArray(baseDir) && baseDir.indexOf(paths.src) !== -1)) {
1818
routes = {
19-
'/bower_components': 'bower_components'
19+
'/node_modules': 'node_modules'
2020
};
2121
}
2222

gulp/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gulp.task('styles', function () {
1010

1111
var lessOptions = {
1212
paths: [
13-
'bower_components',
13+
'node_modules',
1414
paths.src + '/app',
1515
paths.src + '/components'
1616
]

gulp/unit-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var paths = gulp.paths;
1010

1111
function runTests (singleRun, done) {
1212
var bowerDeps = wiredep({
13-
directory: 'bower_components',
13+
directory: 'node_modules',
1414
exclude: ['bootstrap-sass-official'],
1515
dependencies: true,
1616
devDependencies: true

gulp/watch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ var paths = gulp.paths;
77
gulp.task('watch', ['inject'], function () {
88
gulp.watch([
99
paths.src + '/*.html',
10+
paths.src + '/*.css',
11+
paths.src + '/*.js',
1012
paths.src + '/{app,components}/**/*.less',
1113
paths.src + '/{app,components}/**/*.js',
12-
'bower.json'
14+
'package.json'
1315
], ['inject']);
1416
});

0 commit comments

Comments
 (0)