Skip to content

Commit

Permalink
Adding project files
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Zabriskie committed Aug 18, 2014
1 parent 9187149 commit 729404d
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
*.iml
node_modules
Empty file added .npmignore
Empty file.
83 changes: 83 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -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;
}
};
35 changes: 35 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit 729404d

Please sign in to comment.