updated the grunt tasks, and the jquery connector will now properly parse json response bodies
This commit is contained in:
@ -1,30 +1,37 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function (grunt) {
|
||||||
grunt.registerTask('browser_clients:test', [
|
grunt.registerTask('browser_clients:test', [
|
||||||
'build',
|
'build',
|
||||||
|
'browserify:yaml_tests',
|
||||||
'run:browser_unit_tests',
|
'run:browser_unit_tests',
|
||||||
'run:browser_integration_tests'
|
'run:browser_integration_tests'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('browser_clients:build', [
|
grunt.registerTask('browser_clients:build', [
|
||||||
'clean:dist',
|
'clean:dist',
|
||||||
'browserify',
|
'browserify:browser_client',
|
||||||
|
'browserify:angular_client',
|
||||||
|
'browserify:jquery_client',
|
||||||
'uglify:dist',
|
'uglify:dist',
|
||||||
'concat:dist_banners'
|
'concat:dist_banners'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('browser_clients:publish', [
|
grunt.registerTask('browser_clients:distribute', [
|
||||||
|
'clean:dist',
|
||||||
'browser_clients:build',
|
'browser_clients:build',
|
||||||
'compress:dist_zip',
|
'copy:dist_to_named_dir',
|
||||||
'compress:dist_tarball',
|
'compress:master_zip',
|
||||||
|
'compress:master_tarball',
|
||||||
's3:latest'
|
's3:latest'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('browser_clients:release', [
|
grunt.registerTask('browser_clients:release', [
|
||||||
'prompt:confirm_release',
|
'prompt:confirm_release',
|
||||||
'__check_for_confirmation',
|
'__check_for_confirmation',
|
||||||
|
'clean:dist',
|
||||||
'browser_clients:build',
|
'browser_clients:build',
|
||||||
'compress:dist_zip',
|
'copy:dist_to_named_dir',
|
||||||
'compress:dist_tarball',
|
'compress:release_zip',
|
||||||
|
'compress:release_tarball',
|
||||||
's3:release'
|
's3:release'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,17 @@
|
|||||||
|
// make it dry
|
||||||
|
function archive(out) {
|
||||||
|
return {
|
||||||
|
cwd: '<%= distDir %>',
|
||||||
|
src: 'elasticsearch-js',
|
||||||
|
options: {
|
||||||
|
archive: '<%= distDir %>/archives/' + out
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dist_zip: {
|
master_zip: archive('elasticsearch-js-master.zip'),
|
||||||
src: '<%= distDir %>/*.js',
|
master_tarball: archive('elasticsearch-js-master.tar.gz'),
|
||||||
options: {
|
release_zip: archive('elasticsearch-js-<%= package.version %>.zip'),
|
||||||
archive: '<%= distDir %>/archives/elasticsearch-js.zip'
|
release_tarball: archive('elasticsearch-js-<%= package.version %>.tar.gz')
|
||||||
}
|
|
||||||
},
|
|
||||||
dist_tarball: {
|
|
||||||
src: '<%= distDir %>/*.js',
|
|
||||||
options: {
|
|
||||||
archive: '<%= distDir %>/archives/elasticsearch-js.tar.gz'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
8
grunt/config/copy.js
Normal file
8
grunt/config/copy.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module.exports = {
|
||||||
|
dist_to_named_dir: {
|
||||||
|
cwd: '<%= distDir %>',
|
||||||
|
src: '*.js',
|
||||||
|
dest: '<%= distDir %>/elasticsearch-js/',
|
||||||
|
expand: true
|
||||||
|
}
|
||||||
|
};
|
||||||
4
src/lib/connectors/jquery.js
vendored
4
src/lib/connectors/jquery.js
vendored
@ -34,7 +34,9 @@ JqueryConnector.prototype.request = function (params, cb) {
|
|||||||
|
|
||||||
var jqXHR = jQuery.ajax(ajax)
|
var jqXHR = jQuery.ajax(ajax)
|
||||||
.done(function (data, textStatus, jqXHR) {
|
.done(function (data, textStatus, jqXHR) {
|
||||||
cb(null, data, jqXHR.statusCode(), jqXHR.getAllResponseHeaders());
|
cb(null, data, jqXHR.statusCode(), {
|
||||||
|
'content-type': jqXHR.getResponseHeader('content-type')
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.fail(function (jqXHR, textStatus, err) {
|
.fail(function (jqXHR, textStatus, err) {
|
||||||
cb(new ConnectionFault(err && err.message));
|
cb(new ConnectionFault(err && err.message));
|
||||||
|
|||||||
Reference in New Issue
Block a user