Refactored the API, moving it into a single api.js file which can be

exluded from a build if desired.
This commit is contained in:
Spencer Alger
2013-10-23 06:24:02 -07:00
parent b063dfdca7
commit 01763c2c39
102 changed files with 4097 additions and 8459 deletions

View File

@ -3,20 +3,6 @@
module.exports = function (grunt) {
var argv = require('optimist').argv;
var pre = [
'src/pre.js',
'src/shared.js',
'src/serializer.js',
'src/serializer/*',
'src/selector.js',
'src/logger/*',
'src/transport.js'
];
var post = ['src/client.js', 'src/post.js'];
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@ -27,15 +13,6 @@ module.exports = function (grunt) {
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= pkg.license %> */\n\n'
},
concat: {
options: {
banner: '<%= meta.banner %>'
},
node: {
src: pre.concat(['src/transport/elasticsearch-node.js'], post),
dest: 'dist/elasticsearch-node.js'
}
},
mochaTest: {
unit: [
'test/unit/**/*.test.js'
@ -52,40 +29,80 @@ module.exports = function (grunt) {
jshint: {
source: {
src: [
'Gruntfile.js',
'src/**/*.js',
'test/**/*.js'
'test/**/*.js',
'Gruntfile.js'
]
},
options: {
jshintrc: true
}
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
logo: '<%= pkg.logo %>',
options: {
paths: 'src',
themedir: '../yuidoc-bootstrap-theme',
helpers: [
'../yuidoc-bootstrap-theme/helpers/helpers.js'
],
outdir: 'docs'
}
watch: {
source: {
files: [
'src/**/*',
'test/**/*',
'Gruntfile.js'
],
tasks: [
'jshint:source'
]
},
options: {
interupt: true
}
}
}//,
// docular: {
// groups: [
// {
// groupTitle: 'Node',
// groupId: 'example',
// groupIcon: 'icon-beer',
// sections: [
// {
// id: "client",
// title: "Client",
// scripts: [
// "src/lib/client.js"
// ],
// docs: [],
// rank : {}
// }
// ]
// }
// ],
// }
// ,
// yuidoc: {
// compile: {
// name: '<%= pkg.name %>',
// description: '<%= pkg.description %>',
// version: '<%= pkg.version %>',
// url: '<%= pkg.homepage %>',
// logo: '<%= pkg.logo %>',
// options: {
// paths: 'src',
// themedir: '../yuidoc-bootstrap-theme',
// helpers: [
// '../yuidoc-bootstrap-theme/helpers/helpers.js'
// ],
// outdir: 'docs'
// }
// }
// }
});
// load plugins
grunt.loadNpmTasks('grunt-docular');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
// Default task.
grunt.registerTask('docs', ['docular']);
grunt.registerTask('default', ['jshint', 'mochaTest']);
};