Skip to content

Commit

Permalink
Stable Version 2.2.3.
Browse files Browse the repository at this point in the history
Converted to ES6.
  • Loading branch information
jmdobry committed Mar 9, 2015
1 parent 05c4e7a commit 86a9c7d
Show file tree
Hide file tree
Showing 8 changed files with 1,020 additions and 899 deletions.
1 change: 0 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"node": false,
"browser": true,
"es5": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
##### 2.2.3 - 08 March 2015

###### Other
- Converted to ES6, using Babel.js to transpile to ES5.

##### 2.2.2 - 04 March 2015

###### Backwards compatible bug fixes
- #312 - UMDifying js-data-angular
- #312 - UMDifying js-data-angular
- #313 - DSHttpAdapter#find/create/update/destroy do not call queryTransform

##### 2.2.1 - 25 February 2015
Expand Down
73 changes: 46 additions & 27 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ module.exports = function (grunt) {
});
require('time-grunt')(grunt);

var webpack = require('webpack');
var pkg = grunt.file.readJSON('package.json');
var banner = 'js-data-angular\n' +
'@version ' + pkg.version + ' - Homepage <https://www.js-data.io/docs/js-data-angular/>\n' +
'@author Jason Dobry <[email protected]>\n' +
'@copyright (c) 2014-2015 Jason Dobry \n' +
'@license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' +
'\n' +
'@overview Angular wrapper for js-data.';

// Project configuration.
grunt.initConfig({
pkg: pkg,
clean: {
dist: ['dist/']
},
jshint: {
all: ['Gruntfile.js', 'src/**/*.js'],
jshintrc: '.jshintrc'
},
watch: {
dist: {
files: ['src/**/*.js'],
Expand All @@ -36,10 +40,10 @@ module.exports = function (grunt) {
options: {
sourceMap: true,
sourceMapName: 'dist/js-data-angular.min.map',
banner: '/**\n' +
banner: '/*!\n' +
'* js-data-angular\n' +
'* @version <%= pkg.version %> - Homepage <https://www.js-data.io/docs/js-data-angular/>\n' +
'* @author Jason Dobry <[email protected]>\n' +
'* @file js-data-angular.min.js\n' +
'* @version <%= pkg.version %> - Homepage <https://www.js-data.io/js-data-angular/>\n' +
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' +
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' +
'*\n' +
Expand Down Expand Up @@ -80,6 +84,40 @@ module.exports = function (grunt) {
options: {
coverage_dir: 'coverage'
}
},
webpack: {
dist: {
entry: './src/index.js',
output: {
filename: './dist/js-data-angular.js',
libraryTarget: 'umd',
library: 'jsDataAngularModuleName'
},
externals: {
'js-data': {
amd: 'js-data',
commonjs: 'js-data',
commonjs2: 'js-data',
root: 'JSData'
},
'angular': 'angular'
},
module: {
loaders: [
{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict' }
],
preLoaders: [
{
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
exclude: /node_modules/, // exclude any and all files in the node_modules folder
loader: "jshint-loader?failOnHint=true"
}
]
},
plugins: [
new webpack.BannerPlugin(banner)
]
}
}
});

Expand All @@ -91,28 +129,9 @@ module.exports = function (grunt) {
grunt.file.write(filePath, file);
});

grunt.registerTask('banner', function () {
var file = grunt.file.read('./src/index.js');

var banner = '/**\n' +
'* @author Jason Dobry <[email protected]>\n' +
'* @file js-data-angular.js\n' +
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/docs/js-data-angular/>\n' +
'* @copyright (c) 2014-2015 Jason Dobry <https://github.com/jmdobry/>\n' +
'* @license MIT <https://github.com/js-data/js-data-angular/blob/master/LICENSE>\n' +
'*\n' +
'* @overview Angular wrapper for js-data.js.\n' +
'*/\n';

file = banner + file;

grunt.file.write('./dist/js-data-angular.js', file);
});

grunt.registerTask('build', [
'clean',
'jshint',
'banner',
'webpack',
'uglify'
]);
grunt.registerTask('go', ['build', 'watch:dist']);
Expand Down
Loading

0 comments on commit 86a9c7d

Please sign in to comment.