Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit b5479b7

Browse files
committed
Merge branch 'canary'
2 parents 0489131 + 896489a commit b5479b7

38 files changed

+2144
-858
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ bower_components
55
temp
66
*.iml
77
/build
8+
/dist/docs
89

910
# Integration stuff
1011
/test/e2e/vertx/app/mods/io.vertx~mod-auth-mgr~2.0.0-final

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
components
44
bower_components
55
temp
6+
dist/docs
67

78
# Test Stuff
89
/test/

Gruntfile.js

Lines changed: 147 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ module.exports = function (grunt) {
66
require('load-grunt-tasks')(grunt);
77
var _ = require('lodash');
88

9-
var karmaConfig = function(configFile, customOptions) {
10-
var options = { configFile: configFile, keepalive: true };
11-
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
9+
var karmaConfig = function (configFile, customOptions) {
10+
var options = {configFile : configFile, keepalive : true};
11+
var travisOptions = process.env.TRAVIS && {browsers : ['Firefox'], reporters : 'dots'};
1212
return _.extend(options, customOptions, travisOptions);
1313
};
1414

1515
// Returns configuration for bower-install plugin
1616
var loadTestScopeConfigurations = function () {
1717
var scopes = fs.readdirSync('./test_scopes').filter(function (filename) {
18-
return filename[0] !== '.';
18+
return typeof filename === 'string' && filename[0] !== '.';
1919
});
2020
var config = {
2121
options : {
@@ -25,149 +25,181 @@ module.exports = function (grunt) {
2525
};
2626
// Create a sub config for each test scope
2727
for (var idx in scopes) {
28-
var scope = scopes[idx];
29-
config['test_scopes_' + scope] = {
30-
options : {
31-
cwd : 'test_scopes/' + scope,
32-
production : false
33-
}
34-
};
28+
if (scopes.hasOwnProperty(idx)) {
29+
var scope = scopes[idx];
30+
config['test_scopes_' + scope] = {
31+
options : {
32+
cwd : 'test_scopes/' + scope,
33+
production : false
34+
}
35+
};
36+
}
3537
}
36-
return config;
38+
return config;
3739
};
3840

3941
grunt.initConfig({
40-
pkg: grunt.file.readJSON('bower.json'),
41-
meta: {
42-
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
43-
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
44-
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
45-
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
46-
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
42+
pkg : grunt.file.readJSON('package.json'),
43+
meta : {
44+
banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
45+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
46+
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
47+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
48+
' Licensed <%= _.pluck(pkg.licenses, "name").join(", ") %> */'
4749
},
48-
clean: {
49-
dist: 'dist/',
50-
temp: 'temp/'
50+
clean : {
51+
dist : 'dist/',
52+
temp : 'temp/'
5153
},
52-
watch: {
53-
'coffee-src': {
54-
files: ['src/**/*.coffee'],
55-
tasks: ['coffee:src']
56-
},
57-
'coffee-test': {
58-
files: ['test/**/*.coffee'],
59-
tasks: ['coffee:test']
60-
},
61-
scripts: {
62-
files: ['Gruntfile.js', 'temp/**/*.js', 'test/**/*.js'],
63-
tasks: ['jshint', 'karma:unit']
54+
jshint : {
55+
all : ['Gruntfile.js', 'test/unit/*.js', 'src/**/*.js'],
56+
options : {
57+
esnext: true,
58+
eqeqeq : true,
59+
globals : {
60+
angular : true
61+
}
6462
}
6563
},
66-
jshint: {
67-
all: ['Gruntfile.js', 'src/**/*.js', 'test/unit/*.js'],
68-
options: {
69-
eqeqeq: true,
70-
globals: {
71-
angular: true
72-
}
64+
babel : {
65+
options : {
66+
sourceMap : false,
67+
sourceType: 'module'
68+
},
69+
src : {
70+
expand : true,
71+
cwd : 'src/',
72+
src : ['**/*.js'],
73+
dest : 'temp/',
74+
ext : '.js'
7375
}
7476
},
75-
coffee: {
76-
src: {
77-
options: {
78-
join: true
79-
},
80-
files: {
81-
'temp/src/angular-vertxbus-adapter.js': [
82-
'src/module.coffee', 'src/wrapper.coffee', 'src/service.coffee'
83-
]
84-
}
77+
karma : {
78+
unit : {
79+
options : karmaConfig('karma.conf.js', {
80+
singleRun : true
81+
})
8582
},
86-
test: {
87-
options: {
88-
bare: true
89-
},
90-
expand: true,
91-
cwd: 'test/',
92-
src: ['unit/**/*.coffee'],
93-
dest: 'temp/test/',
94-
ext: '.js'
83+
headless : {
84+
options : karmaConfig('karma.conf.js', {
85+
singleRun : true,
86+
browsers : ['PhantomJS']
87+
})
88+
},
89+
server : {
90+
options : karmaConfig('karma.conf.js', {
91+
singleRun : false
92+
})
9593
}
9694
},
97-
concat: {
98-
src: {
99-
options: {
100-
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
101-
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
102-
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
103-
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
104-
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
105-
},
106-
src: ['temp/src/**/*.js'],
107-
dest: 'dist/angular-vertxbus.js'
95+
watch : {
96+
scripts : {
97+
files : ['Gruntfile.js', 'temp/**/*.js', 'test/**/*.js'],
98+
tasks : ['karma:unit']
10899
},
109-
lib: {
100+
ngdocs: {
101+
files : ['src/**/*.js'],
102+
tasks : ['ngdocs:api']
103+
}
104+
},
105+
browserify: {
106+
dist : {
110107
options: {
111-
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
112-
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
113-
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
114-
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
115-
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
108+
browserifyOptions: {
109+
fullPaths: false,
110+
debug: false // TODO enable sourcemaps
111+
},
112+
transform: ['babelify', require('browserify-ngannotate')],
113+
banner : '<%= meta.banner %>',
114+
watch: true
116115
},
117-
src: [
118-
'build-data-for-requirejs/angular-vertxbus_start.txt',
119-
'temp/src/**/*.js',
120-
'build-data-for-requirejs/angular-vertxbus_end.txt'
121-
],
122-
dest: 'dist/requirejs/angular-vertxbus.js'
116+
files : {
117+
'dist/angular-vertxbus.js' : [
118+
'src/index.js'
119+
]
120+
}
123121
}
124122
},
125-
uglify: {
126-
src: {
123+
extract_sourcemap: {
124+
dist: {
127125
files: {
128-
'dist/angular-vertxbus.min.js': '<%= concat.src.dest %>'
126+
'dist': ['dist/angular-vertxbus.js']
129127
}
130128
}
131129
},
132-
karma: {
133-
unit: {
134-
options: karmaConfig('karma.conf.js', {
135-
singleRun: true
136-
})
130+
uglify : {
131+
options : {
132+
preserveComments : 'some',
133+
sourceMap: false, // TODO enable sourcemaps
134+
sourceMapIn: 'dist/angular-vertxbus.js.map'
137135
},
138-
server: {
139-
options: karmaConfig('karma.conf.js', {
140-
singleRun: false
141-
})
136+
dist : {
137+
files : {
138+
'dist/angular-vertxbus.min.js' : 'dist/angular-vertxbus.js'
139+
}
142140
}
143141
},
144-
changelog: {
145-
options: {
146-
dest: 'CHANGELOG.md'
142+
changelog : {
143+
options : {
144+
dest : 'CHANGELOG.md'
147145
}
148146
},
149-
ngAnnotate: {
147+
ngdocs: {
150148
options: {
151-
singleQuotes: true
149+
dest: 'dist/docs',
150+
html5Mode: false,
151+
startPage: '/api/knalli.angular-vertxbus',
152+
scripts: [
153+
'angular.js',
154+
'docs/github-badge.js'
155+
]
152156
},
153-
src: {
154-
src: '<%= concat.src.dest %>',
155-
dest: '<%= concat.src.dest %>'
156-
},
157-
lib: {
158-
src: '<%= concat.lib.dest %>',
159-
dest: '<%= concat.lib.dest %>'
160-
}
157+
api: ['src/**/*.js']
161158
},
162159

163-
'bower-install-simple': loadTestScopeConfigurations()
160+
'bower-install-simple' : loadTestScopeConfigurations()
164161

165162
});
166163

167-
grunt.registerTask('default', ['clean:temp', 'coffee', 'jshint', 'karma:unit']);
168-
grunt.registerTask('test', ['coffee', 'jshint', 'karma:unit']);
169-
grunt.registerTask('install-test', ['bower-install-simple']);
170-
grunt.registerTask('test-server', ['karma:server']);
171-
grunt.registerTask('build', ['clean', 'coffee', 'jshint', 'karma:unit', 'concat', 'ngAnnotate', 'uglify']);
172-
grunt.registerTask('release', ['changelog', 'build']);
164+
// Compile and test (use "build" for dist/*)
165+
grunt.registerTask('default', [
166+
'clean',
167+
'jshint',
168+
'karma:unit'
169+
]);
170+
171+
// Testing
172+
grunt.registerTask('test', [
173+
'clean',
174+
'jshint',
175+
'karma:unit'
176+
]);
177+
grunt.registerTask('install-test', [
178+
'bower-install-simple'
179+
]);
180+
grunt.registerTask('test-server', [
181+
'karma:server'
182+
]);
183+
184+
grunt.registerTask('docs', [
185+
'ngdocs:api'
186+
]);
187+
188+
grunt.registerTask('watch-docs', [
189+
'docs', 'watch:ngdocs'
190+
]);
191+
192+
// Building & releasing
193+
grunt.registerTask('build', [
194+
'clean',
195+
'jshint',
196+
'karma:unit',
197+
'browserify',
198+
// 'extract_sourcemap',// TODO enable sourcemaps
199+
'uglify'
200+
]);
201+
grunt.registerTask('release', [
202+
'changelog',
203+
'build'
204+
]);
173205
};

0 commit comments

Comments
 (0)