From 729404dff5454d74785e0c632bb6b4a855fa59ff Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Mon, 18 Aug 2014 17:25:07 -0600 Subject: [PATCH] Adding project files --- .gitignore | 3 ++ .npmignore | 0 Gruntfile.js | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bower.json | 35 ++++++++++++++++++++++ package.json | 43 +++++++++++++++++++++++++++ 5 files changed, 164 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 Gruntfile.js create mode 100644 bower.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ff7dfd2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +*.iml +node_modules diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..e69de29b diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..63c20bf3 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,83 @@ +module.exports = function(grunt) { + require('load-grunt-tasks')(grunt); + + grunt.initConfig({ + clean: { + dist: 'dist/**' + }, + + update_json: { + bower: { + src: 'package.json', + dest: 'bower.json', + fields: [ + 'name', + 'description', + 'version', + 'homepage', + 'license', + 'keywords' + ] + } + }, + + karma: { + options: { + configFile: 'karma.conf.js' + }, + single: { + singleRun: true + }, + continuous: { + singleRun: false + } + }, + + webpack: generateWebpackConfig(), + + watch: { + build: { + files: ['lib/**/*.js'], + tasks: ['build'] + }, + test: { + files: ['lib/**/*.js', 'specs/**/*.js'], + tasks: ['test'] + } + } + }); + + grunt.registerTask('test', ['webpack:global', 'karma:single']); + grunt.registerTask('build', ['webpack']); + grunt.registerTask('publish', ['clean', 'test', 'build', 'update_json']); + + function generateWebpackConfig() { + var webpack = require('webpack'); + var webpackConfig = {}; + var webpackBase = { + entry: './index.js', + output: { + path: 'dist/', + filename: 'axios.js', + library: 'axios' + }, + devtool: '#inline-source-map' + }; + + ['amd', 'global'].forEach(function (key) { + webpackConfig[key] = JSON.parse(JSON.stringify(webpackBase)); + webpackConfig[key + '-min'] = JSON.parse(JSON.stringify(webpackBase)); + webpackConfig[key + '-min'].pugins = [ + new webpack.optimize.UglifyJsPlugin() + ]; + }); + + webpackConfig['amd'].output.filename = 'axios.amd.js'; + webpackConfig['amd'].output.libraryTarget = 'amd'; + webpackConfig['amd-min'].output.filename = 'axios.amd.min.js'; + webpackConfig['amd-min'].output.libraryTarget = 'amd'; + webpackConfig['global-min'].output.filename = 'axios.min.js'; + + return webpackConfig; + } +}; \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..f2716c11 --- /dev/null +++ b/bower.json @@ -0,0 +1,35 @@ +{ + "name": "axios", + "main": "./dist/axios.js", + "version": "0.0.0", + "homepage": "https://github.com/mzabriskie/axios", + "authors": [ + "Matt Zabriskie" + ], + "description": "Lightweight Promise based XHR library", + "moduleType": [ + "amd", + "globals" + ], + "keywords": [ + "xhr", + "http", + "ajax", + "promise" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "*.md", + "*.iml", + "example", + "bower_components", + "node_modules", + "lib", + "specs", + "index.js", + "karma.conf.js", + "Gruntfile.js", + "package.json" + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..039abce2 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "axios", + "version": "0.0.0", + "description": "Lightweight Promise based XHR library", + "main": "index.js", + "scripts": { + "test": "grunt test" + }, + "repository": { + "type": "git", + "url": "https://github.com/mzabriskie/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/mzabriskie/axios/issues" + }, + "homepage": "https://github.com/mzabriskie/axios", + "dependencies": { + "es6-promise": "^1.0.0" + }, + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-watch": "^0.6.1", + "webpack": "^1.3.3-beta2", + "webpack-dev-server": "^1.4.10", + "grunt-webpack": "^1.0.8", + "load-grunt-tasks": "^0.6.0", + "karma": "^0.12.21", + "karma-jasmine": "^0.1.5", + "grunt-karma": "^0.8.3", + "karma-phantomjs-launcher": "^0.1.4", + "karma-jasmine-ajax": "^0.1.4", + "grunt-update-json": "^0.1.3" + } +}