Skip to content

Commit

Permalink
Merge pull request #80 from neocotic/develop
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
neocotic committed Jun 1, 2017
2 parents 89e61d3 + a033060 commit a7c1f9e
Show file tree
Hide file tree
Showing 41 changed files with 5,255 additions and 9,448 deletions.
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/

Gruntfile.js
8 changes: 3 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"extends": "notninja/es6",
"extends": "notninja/es5",
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"max-params": [
"error",
5
],
"no-bitwise": "off",
"no-empty-function": "off",
"no-invalid-this": "off",
"no-unused-vars": [
"warn",
{
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "6"
- "8"
before_script:
- npm install -g npm@latest
script:
- npm test
- npm run ci
env:
- CXX=g++-4.8
addons:
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Version 3.0.0, 2017.06.01

* Reduce size of distribution files [#59](https://github.com/neocotic/qrious/issues/59) (**breaking change**)
* Drop support for Node.js < 4 [#74](https://github.com/neocotic/qrious/issues/74) (**breaking change**)
* Remove QRious.DEFAULTS [#77](https://github.com/neocotic/qrious/issues/77) (**breaking change**)
* Rewrite code in ES5 [#81](https://github.com/neocotic/qrious/issues/81) (**breaking change**)

## Version 2.3.0, 2017.05.31

* Enable setting of multiple properties at once resulting in a single re-render [#69](https://github.com/neocotic/qrious/issues/69)
Expand Down
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ $ npm install
$ npm test
```

This will recompile the distribution files as well so feel free to make use of the `demo.html` to test your changes
locally before committing.
You must have at least [Node.js](https://nodejs.org) version 4 or newer and [npm](https://npmjs.com) installed version 5
or newer installed.

If you're using a version of [Node.js](https://nodejs.org) that is older than 0.12, then linting is not performed by
this step. Please consider upgrading to at least 0.12 or your pull request may fail on the CI build.
Feel free to make use of the `demo.html` to test your changes locally before committing. You will need to rebuild the
distribution files in order to see your changes in the `demo.html`, but you can do so by running the following command:

Likewise, [Node.js](https://nodejs.org) versions older than 0.10 will also not be able to compile the source code using
[Rollup](http://rollupjs.org) so the test suite will not be executed against any changes you've made to `src/**.js`. For
this reason, 0.10 is not supported from a development perspective, but our CI builds do run the test suite against the
pre-compiled code for this version to ensure that it works.
``` bash
$ npm run build
```

All pull requests should be made to the `develop` branch.

Expand Down
244 changes: 86 additions & 158 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,176 +20,104 @@
'use strict';

module.exports = function(grunt) {
var babel;
var commonjs;
var nodeResolve;
var semver = require('semver');
var uglify;

var bannerLarge = [
'/*',
' * QRious v<%= pkg.version %>',
' * Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>',
' * Copyright (C) 2010 Tom Zerucha',
' *',
' * This program is free software: you can redistribute it and/or modify',
' * it under the terms of the GNU General Public License as published by',
' * the Free Software Foundation, either version 3 of the License, or',
' * (at your option) any later version.',
' *',
' * This program is distributed in the hope that it will be useful,',
' * but WITHOUT ANY WARRANTY; without even the implied warranty of',
' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
' * GNU General Public License for more details.',
' *',
' * You should have received a copy of the GNU General Public License',
' * along with this program. If not, see <http://www.gnu.org/licenses/>.',
' */'
].join('\n');
var bannerSmall = [
'/*! QRious v<%= pkg.version %> | (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | GPL v3 License',
'Based on jsqrencode | (C) 2010 [email protected] | GPL v3 License',
'*/'
].join('\n');
var commonjs = require('rollup-plugin-commonjs');
var nodeResolve = require('rollup-plugin-node-resolve');
var uglify = require('rollup-plugin-uglify');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

watch: {
all: {
files: [ 'src/**/*.js' ],
tasks: [ 'test' ]
}
}
});

var buildTasks = [ 'compile' ];
var compileTasks = [];
var testTasks = [ 'compile' ];

if (semver.satisfies(process.version, '>=0.12')) {
babel = require('rollup-plugin-babel');
commonjs = require('rollup-plugin-commonjs');
nodeResolve = require('rollup-plugin-node-resolve');
uglify = require('rollup-plugin-uglify');
clean: {
build: [ 'dist/**' ]
},

compileTasks.push('clean', 'rollup');

grunt.config.merge({
clean: {
build: [ 'dist/**' ]
},

rollup: {
cjs: {
options: {
format: 'cjs',
sourceMap: true,
sourceMapRelativePaths: true,
banner: bannerLarge,
external: [ 'canvas' ],
plugins: function() {
return [
nodeResolve({
jsnext: true,
main: true
}),
commonjs(),
babel({
exclude: [ 'node_modules/**' ],
runtimeHelpers: true
})
];
}
},
files: {
'dist/cjs/qrious.js': 'src/runtime/node.js'
}
},
umdDevelopment: {
options: {
format: 'umd',
moduleId: 'qrious',
moduleName: 'QRious',
sourceMap: true,
sourceMapRelativePaths: true,
banner: bannerLarge,
plugins: function() {
return [
nodeResolve({
jsnext: true,
main: true
}),
commonjs(),
babel({
exclude: [ 'node_modules/**' ],
runtimeHelpers: true
})
];
}
},
files: {
'dist/umd/qrious.js': 'src/runtime/browser.js'
eslint: {
target: [ 'src/**/*.js' ]
},

rollup: {
umdDevelopment: {
options: {
format: 'umd',
moduleId: 'qrious',
moduleName: 'QRious',
sourceMap: true,
sourceMapRelativePaths: true,
banner: [
'/*',
' * QRious v<%= pkg.version %>',
' * Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>',
' * Copyright (C) 2010 Tom Zerucha',
' *',
' * This program is free software: you can redistribute it and/or modify',
' * it under the terms of the GNU General Public License as published by',
' * the Free Software Foundation, either version 3 of the License, or',
' * (at your option) any later version.',
' *',
' * This program is distributed in the hope that it will be useful,',
' * but WITHOUT ANY WARRANTY; without even the implied warranty of',
' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
' * GNU General Public License for more details.',
' *',
' * You should have received a copy of the GNU General Public License',
' * along with this program. If not, see <http://www.gnu.org/licenses/>.',
' */'
].join('\n'),
plugins: function() {
return [
nodeResolve({ main: true }),
commonjs()
];
}
},
umdProduction: {
options: {
format: 'umd',
moduleId: 'qrious',
moduleName: 'QRious',
sourceMap: true,
sourceMapRelativePaths: true,
banner: bannerSmall,
plugins: function() {
return [
nodeResolve({
jsnext: true,
main: true
}),
commonjs(),
babel({
exclude: [ 'node_modules/**' ],
runtimeHelpers: true
}),
uglify({
output: {
comments: function(node, comment) {
return comment.type === 'comment2' && /^\!/.test(comment.value);
}
files: {
'dist/qrious.js': 'src/runtime/browser.js'
}
},
umdProduction: {
options: {
format: 'umd',
moduleId: 'qrious',
moduleName: 'QRious',
sourceMap: true,
sourceMapRelativePaths: true,
banner: [
'/*! QRious v<%= pkg.version %> | (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | GPL v3 License',
'Based on jsqrencode | (C) 2010 [email protected] | GPL v3 License',
'*/'
].join('\n'),
plugins: function() {
return [
nodeResolve({ main: true }),
commonjs(),
uglify({
output: {
comments: function(node, comment) {
return comment.type === 'comment2' && /^\!/.test(comment.value);
}
})
];
}
},
files: {
'dist/umd/qrious.min.js': 'src/runtime/browser.js'
}
})
];
}
},
files: {
'dist/qrious.min.js': 'src/runtime/browser.js'
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-rollup');
} else {
grunt.log.writeln('"clean" and "rollup" tasks are disabled because Node.js version is <0.12! Please consider upgrading Node.js...');
}

if (semver.satisfies(process.version, '>=4')) {
compileTasks.unshift('eslint');

grunt.config.set('eslint', {
target: [ 'src/**/*.js' ]
});
},

grunt.loadNpmTasks('grunt-eslint');
} else {
grunt.log.writeln('"eslint" task is disabled because Node.js version is <4! Please consider upgrading Node.js...');
}
watch: {
all: {
files: [ 'src/**/*.js' ],
tasks: [ 'eslint' ]
}
}
});

grunt.loadNpmTasks('grunt-contrib-watch');
require('load-grunt-tasks')(grunt);

grunt.registerTask('default', [ 'build' ]);
grunt.registerTask('build', buildTasks);
grunt.registerTask('compile', compileTasks);
grunt.registerTask('test', testTasks);
grunt.registerTask('default', [ 'ci' ]);
grunt.registerTask('build', [ 'eslint', 'clean:build', 'rollup' ]);
grunt.registerTask('ci', [ 'eslint', 'clean', 'rollup' ]);
grunt.registerTask('test', [ 'eslint' ]);
};
Loading

0 comments on commit a7c1f9e

Please sign in to comment.