Skip to content

Commit c1c40d8

Browse files
author
@soyjavi
committed
Step 2/2: Refolder bower component and added GULP
1 parent 8f938e2 commit c1c40d8

File tree

5 files changed

+96
-124
lines changed

5 files changed

+96
-124
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "bower"]
2+
path = bower
3+
url = https://github.com/soyjavi/package-quojs.git

Gruntfile.coffee

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

bower

Submodule bower added at d935edf

gulpfile.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
"use strict"
2+
3+
// -- DEPENDENCIES -------------------------------------------------------------
4+
var gulp = require('gulp');
5+
var coffee = require('gulp-coffee');
6+
var concat = require('gulp-concat');
7+
var header = require('gulp-header');
8+
var jasmine = require('gulp-jasmine');
9+
var uglify = require('gulp-uglify');
10+
var pkg = require('./package.json');
11+
12+
13+
// -- FILES --------------------------------------------------------------------
14+
var path = {
15+
// Exports
16+
bower : './bower',
17+
temp : './build',
18+
// Sources
19+
modules : ['source/quo.coffee',
20+
'source/quo.ajax.coffee',
21+
'source/quo.css.coffee',
22+
'source/quo.element.coffee',
23+
'source/quo.environment.coffee',
24+
'source/quo.events.coffee',
25+
'source/quo.output.coffee',
26+
'source/quo.query.coffee'],
27+
gestures: ['source/quo.gestures.coffee',
28+
'source/quo.gestures.*.coffee'],
29+
// Spec
30+
spec : ['spec/*.coffee'] };
31+
32+
var banner = ['/**',
33+
' * <%= pkg.name %> - <%= pkg.description %>',
34+
' * @version v<%= pkg.version %>',
35+
' * @link <%= pkg.homepage %>',
36+
' * @author <%= pkg.author.name %> (<%= pkg.author.site %>)',
37+
' * @license <%= pkg.license %>',
38+
' */',
39+
''].join('\n');
40+
41+
// -- TASKS --------------------------------------------------------------------
42+
gulp.task('modules', function() {
43+
gulp.src(path.modules)
44+
.pipe(coffee())
45+
.pipe(gulp.dest(path.temp))
46+
.pipe(uglify({mangle: true}))
47+
.pipe(header(banner, {pkg: pkg}))
48+
.pipe(gulp.dest(path.bower))
49+
});
50+
51+
gulp.task('gestures', function() {
52+
gulp.src(path.gestures)
53+
.pipe(concat('quo.gestures.coffee'))
54+
.pipe(coffee())
55+
.pipe(gulp.dest(path.temp))
56+
.pipe(uglify({mangle: true}))
57+
.pipe(header(banner, {pkg: pkg}))
58+
.pipe(gulp.dest(path.bower))
59+
});
60+
61+
gulp.task('spec', function() {
62+
gulp.src(path.spec)
63+
.pipe(concat('spec.coffee'))
64+
.pipe(coffee())
65+
.pipe(gulp.dest(path.temp))
66+
67+
var spec = [
68+
path.temp + '/spec.js',
69+
path.temp + '/quo.js',
70+
path.temp + '/quo.*.js'];
71+
72+
// gulp.src(spec).pipe(jasmine())
73+
});
74+
75+
gulp.task('init', function() {
76+
gulp.run(['modules', 'gestures', 'spec']);
77+
});
78+
79+
gulp.task('default', function() {
80+
gulp.run(['webserver'])
81+
gulp.watch(path.modules, ['source', 'spec']);
82+
gulp.watch(path.gestures, ['gestures', 'spec']);
83+
gulp.watch(path.spec, ['spec']);
84+
});

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
},
1010
"main": ["quo.js"],
1111
"keywords": [ "mobile" ],
12-
"license": [{"type": "MIT"}],
12+
"license": "MIT",
1313
"devDependencies": {
14-
"grunt-contrib-coffee" : "*",
15-
"grunt-contrib-concat" : "*",
16-
"grunt-contrib-uglify" : "*",
17-
"grunt-contrib-jasmine" : "*",
18-
"grunt-contrib-watch" : "*",
19-
"grunt-notify" : "*"
14+
"gulp" : "*",
15+
"gulp-coffee" : "*",
16+
"gulp-concat" : "*",
17+
"gulp-connect": "*",
18+
"gulp-header" : "*",
19+
"gulp-jasmine": "*",
20+
"gulp-uglify" : "*"
2021
}
2122
}

0 commit comments

Comments
 (0)