Skip to content

Commit

Permalink
Merge pull request #72 from serratus/feature/webpack
Browse files Browse the repository at this point in the history
From RequireJS to Webpack
  • Loading branch information
serratus committed Oct 14, 2015
2 parents a852394 + f4e79e5 commit d23e824
Show file tree
Hide file tree
Showing 69 changed files with 27,811 additions and 14,499 deletions.
80 changes: 80 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"settings" : {
"ecmascript": 6,
"jsx": true
},
"env": {
"browser": true,
"node": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
"blockBindings": true,
"defaultParams": true,
"globalReturn": false,
"modules": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"templateStrings": true,
"spread": true,
"jsx": true,
"arrowFunctions": true,
"classes": true,
"destructuring": true,
"objectLiteralComputedProperties": true
},
"globals": {},
"rules": {
"no-unused-expressions": 1,
"no-extra-boolean-cast": 1,
"no-multi-spaces": 2,
"no-underscore-dangle": 0,
"comma-dangle": 2,
"camelcase": 0,
"curly": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"wrap-iife": 0,
"no-use-before-define": [1, "nofunc"],
"new-cap": 2,
"quotes": 0,
"strict": 0,
"no-caller": 2,
"no-empty": 1,
"no-new": 2,
"no-plusplus": 0,
"no-unused-vars": 1,
"no-trailing-spaces": 2,

// STYLE
"max-params": [2, 7],
"key-spacing": [1, {
beforeColon: false,
afterColon: true
}],
"indent": [2, 4],
"brace-style": [2, "1tbs"],
"comma-spacing": [2, {before: false, after: true}],
"comma-style": [2, "last"],
"consistent-this": [1, "self"],
"eol-last": 0,
"new-cap": 0,
"new-parens": 2,
"no-array-constructor": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": 2,
"semi-spacing": 2,
"dot-notation": 2,
"no-spaced-func": 1,
"no-shadow": 2,
"no-undef": 2,
"padded-blocks": [2, "never"],
"semi": [2, "always"],
"space-after-keywords": [2, "always"],
"space-infix-ops": 2,
"max-len" : [1, 120],
"consistent-return": 2,
"yoda": 2
}
}
58 changes: 2 additions & 56 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,22 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
pkg: grunt.file.readJSON('package.json'),
karma: {
unit: {
configFile: 'karma.conf.js'
},
integration: {
configFile: 'karma-integration.conf.js'
}
},
uglify : {
options : {
banner : '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
preserveComments: 'some'
},
build : {
src : 'dist/<%= pkg.name %>.js',
dest : 'dist/<%= pkg.name %>.min.js'
}
},
jshint : {
all : ['Gruntfile.js', 'src/*.js']
},
requirejs : {
compile : {
options : {
almond : true,
wrap : {
startFile : 'build/start.frag',
endFile : 'build/end.frag'
},
"baseUrl" : "src",
"name" : "quagga",
"useStrict": true,
"out" : "dist/quagga.js",
"include" : ['quagga'],
"optimize" : "none",
"findNestedDependencies" : true,
"skipSemiColonInsertion" : true,

"shim" : {
"typedefs" : {
"deps" : [],
"exports" : "typedefs"
}
},

"paths" : {
"typedefs" : "typedefs",
"gl-matrix": "../node_modules/gl-matrix/dist/gl-matrix-min"
}
}
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.loadNpmTasks('grunt-requirejs');
grunt.loadNpmTasks('grunt-karma');

grunt.loadTasks('tasks');

grunt.registerTask('build', ['check', 'requirejs']);
grunt.registerTask('check', ['jshint']);
grunt.registerTask('dist', ['build', 'uglify', 'uglyasm']);
grunt.registerTask('test', ['karma']);
grunt.registerTask('integrationtest', ['karma:integration']);

grunt.registerTask('default', ['build']);
};
};
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
quaggaJS
========

- [Changelog](#changelog) (2015-09-15)
- [Changelog](#changelog) (2015-10-13)

## What is QuaggaJS?

Expand Down Expand Up @@ -34,9 +34,9 @@ be aligned with the viewport.

In order to take full advantage of quaggaJS, the browser needs to support the
`getUserMedia` API which is already implemented in recent versions of Firefox,
Chrome, IE (Edge) and Opera. The API is also available on their mobile
Chrome, IE (Edge) and Opera. The API is also available on their mobile
counterparts installed on Android (except IE). Safari does not allow the access
to the camera yet, neither on desktop, nor on mobile. You can check
to the camera yet, neither on desktop, nor on mobile. You can check
[caniuse][caniuse_getusermedia] for updates.

In cases where real-time decoding is not needed, or the platform does not
Expand Down Expand Up @@ -90,11 +90,15 @@ You can build the library yourself by simply cloning the repo and typing:

```console
> npm install
> grunt dist
> npm run build
```

This grunt task builds a non optimized version `quagga.js` and a minified
This npm script builds a non optimized version `quagga.js` and a minified
version `quagga.min.js` and places both files in the `dist` folder.
Additionally, a `quagga.map` source-map is placed alongside these files. This
file is only valid for the non-uglified version `quagga.js` because the
minified version is altered after compression and does not align with the map
file any more.

## API

Expand Down Expand Up @@ -360,7 +364,7 @@ automatically generated in the coverage/ folder.

```console
> npm install
> grunt test
> npm run test
```
## Image Debugging

Expand Down Expand Up @@ -430,6 +434,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.

## <a name="changelog">Changelog</a>

### 2015-10-13
Take a look at the release-notes ([0.8.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.8.0))

- Improvements
- Replaced RequireJS with webpack

### 2015-09-15
Take a look at the release-notes ([0.7.0]
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
Expand Down
Loading

0 comments on commit d23e824

Please sign in to comment.