Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 26 additions & 41 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,51 @@ var semver = require('semver'),
f = require('util').format,
files = {
common: [
'src/common/utils.js'
'src/common/utils.js'
],
bloodhound: [
'src/bloodhound/version.js',
'src/bloodhound/tokenizers.js',
'src/bloodhound/lru_cache.js',
'src/bloodhound/persistent_storage.js',
'src/bloodhound/transport.js',
'src/bloodhound/search_index.js',
'src/bloodhound/prefetch.js',
'src/bloodhound/remote.js',
'src/bloodhound/options_parser.js',
'src/bloodhound/bloodhound.js'
'src/bloodhound/version.js',
'src/bloodhound/tokenizers.js',
'src/bloodhound/lru_cache.js',
'src/bloodhound/persistent_storage.js',
'src/bloodhound/transport.js',
'src/bloodhound/search_index.js',
'src/bloodhound/prefetch.js',
'src/bloodhound/remote.js',
'src/bloodhound/options_parser.js',
'src/bloodhound/bloodhound.js'
],
typeahead: [
'src/typeahead/www.js',
'src/typeahead/event_bus.js',
'src/typeahead/event_emitter.js',
'src/typeahead/highlight.js',
'src/typeahead/input.js',
'src/typeahead/dataset.js',
'src/typeahead/menu.js',
'src/typeahead/status.js',
'src/typeahead/default_menu.js',
'src/typeahead/typeahead.js',
'src/typeahead/plugin.js'
'src/typeahead/www.js',
'src/typeahead/event_bus.js',
'src/typeahead/event_emitter.js',
'src/typeahead/highlight.js',
'src/typeahead/input.js',
'src/typeahead/dataset.js',
'src/typeahead/menu.js',
'src/typeahead/status.js',
'src/typeahead/default_menu.js',
'src/typeahead/typeahead.js',
'src/typeahead/plugin.js'
]
};

module.exports = function(grunt) {
grunt.initConfig({
version: grunt.file.readJSON('package.json').version,

tempDir: 'dist_temp',
buildDir: 'dist',

banner: [
'/*!',
' * typeahead.js <%= version %>',
' * https://github.com/twitter/typeahead.js',
' * Copyright 2013-<%= grunt.template.today("yyyy") %> Twitter, Inc. and other contributors; Licensed MIT',
' */\n\n'
].join('\n'),

uglify: {
options: {
banner: '<%= banner %>'
},

concatBloodhound: {
options: {
mangle: false,
Expand All @@ -71,7 +67,6 @@ module.exports = function(grunt) {
src: files.common.concat(files.typeahead),
dest: '<%= tempDir %>/typeahead.jquery.js'
},

bloodhound: {
options: {
mangle: false,
Expand Down Expand Up @@ -131,16 +126,15 @@ module.exports = function(grunt) {
dest: '<%= buildDir %>/typeahead.bundle.min.js'
}
},

umd: {
bloodhound: {
src: '<%= tempDir %>/bloodhound.js',
objectToExport: 'Bloodhound',
deps: {
default: ['$'],
amd: ['jquery'],
cjs: ['jquery'],
global: ['jQuery']
default: ['Promise'],
amd: ['Promise'],
cjs: ['Promise'],
global: ['Promise']
}
},
typeahead: {
Expand All @@ -153,7 +147,6 @@ module.exports = function(grunt) {
}
}
},

replace: {
version: {
options: {
Expand All @@ -175,7 +168,6 @@ module.exports = function(grunt) {
]
}
},

jshint: {
options: {
jshintrc: '.jshintrc'
Expand All @@ -184,14 +176,12 @@ module.exports = function(grunt) {
test: ['test/**/*_spec.js', 'test/integration/test.js'],
gruntfile: ['Gruntfile.js']
},

watch: {
js: {
files: 'src/**/*',
tasks: 'build'
}
},

exec: {
npm_publish: 'npm publish',
git_is_clean: 'test -z "$(git status --porcelain)"',
Expand Down Expand Up @@ -220,22 +210,18 @@ module.exports = function(grunt) {
'rm -rf typeahead.js'
].join(' && ')
},

clean: {
dist: 'dist'
},

connect: {
server: {
options: { port: 8888, keepalive: true }
}
},

concurrent: {
options: { logConcurrentOutput: true },
dev: ['server', 'watch']
},

step: {
options: {
option: false
Expand All @@ -245,7 +231,6 @@ module.exports = function(grunt) {

grunt.registerTask('release', '#shipit', function(version) {
var curVersion = grunt.config.get('version');

version = semver.inc(curVersion, version) || version;

if (!semver.valid(version) || semver.lte(version, curVersion)) {
Expand Down
1 change: 1 addition & 0 deletions data/countries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Åland","Azerbaijan","Bosnia and Herzegovina","Barbados","Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Saint Barthélemy","Bermuda","Brunei","Bolivia","Bonaire","Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos [Keeling] Islands","Congo","Central African Republic","Republic of the Congo","Switzerland","Ivory Coast","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica","Cuba","Cape Verde","Curacao","Christmas Island","Cyprus","Czechia","Germany","Djibouti","Denmark","Dominica","Dominican Republic","Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji","Falkland Islands","Micronesia","Faroe Islands","France","Gabon","United Kingdom","Grenada","Georgia","French Guiana","Guernsey","Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala","Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia","Ireland","Israel","Isle of Man","India","British Indian Ocean Territory","Iraq","Iran","Iceland","Italy","Jersey","Jamaica","Jordan","Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","North Korea","South Korea","Kuwait","Cayman Islands","Kazakhstan","Laos","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania","Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova","Montenegro","Saint Martin","Madagascar","Marshall Islands","Macedonia","Mali","Myanmar [Burma]","Mongolia","Macao","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives","Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua","Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia","Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestine","Portugal","Palau","Paraguay","Qatar","Réunion","Romania","Serbia","Russia","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan","Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname","South Sudan","São Tomé and Príncipe","El Salvador","Sint Maarten","Syria","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand","Tajikistan","Tokelau","East Timor","Turkmenistan","Tunisia","Tonga","Turkey","Trinidad and Tobago","Tuvalu","Taiwan","Tanzania","Ukraine","Uganda","U.S. Minor Outlying Islands","United States","Uruguay","Uzbekistan","Vatican City","Saint Vincent and the Grenadines","Venezuela","British Virgin Islands","U.S. Virgin Islands","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Kosovo","Yemen","Mayotte","South Africa","Zambia","Zimbabwe"]
Loading