Skip to content

Commit d23e824

Browse files
committed
Merge pull request #72 from serratus/feature/webpack
From RequireJS to Webpack
2 parents a852394 + f4e79e5 commit d23e824

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+27811
-14499
lines changed

.eslintrc

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"settings" : {
3+
"ecmascript": 6,
4+
"jsx": true
5+
},
6+
"env": {
7+
"browser": true,
8+
"node": true
9+
},
10+
"ecmaFeatures": {
11+
"blockBindings": true,
12+
"forOf": true,
13+
"blockBindings": true,
14+
"defaultParams": true,
15+
"globalReturn": false,
16+
"modules": true,
17+
"objectLiteralShorthandMethods": true,
18+
"objectLiteralShorthandProperties": true,
19+
"templateStrings": true,
20+
"spread": true,
21+
"jsx": true,
22+
"arrowFunctions": true,
23+
"classes": true,
24+
"destructuring": true,
25+
"objectLiteralComputedProperties": true
26+
},
27+
"globals": {},
28+
"rules": {
29+
"no-unused-expressions": 1,
30+
"no-extra-boolean-cast": 1,
31+
"no-multi-spaces": 2,
32+
"no-underscore-dangle": 0,
33+
"comma-dangle": 2,
34+
"camelcase": 0,
35+
"curly": 2,
36+
"eqeqeq": 2,
37+
"guard-for-in": 2,
38+
"wrap-iife": 0,
39+
"no-use-before-define": [1, "nofunc"],
40+
"new-cap": 2,
41+
"quotes": 0,
42+
"strict": 0,
43+
"no-caller": 2,
44+
"no-empty": 1,
45+
"no-new": 2,
46+
"no-plusplus": 0,
47+
"no-unused-vars": 1,
48+
"no-trailing-spaces": 2,
49+
50+
// STYLE
51+
"max-params": [2, 7],
52+
"key-spacing": [1, {
53+
beforeColon: false,
54+
afterColon: true
55+
}],
56+
"indent": [2, 4],
57+
"brace-style": [2, "1tbs"],
58+
"comma-spacing": [2, {before: false, after: true}],
59+
"comma-style": [2, "last"],
60+
"consistent-this": [1, "self"],
61+
"eol-last": 0,
62+
"new-cap": 0,
63+
"new-parens": 2,
64+
"no-array-constructor": 2,
65+
"no-mixed-spaces-and-tabs": 2,
66+
"no-multiple-empty-lines": 2,
67+
"semi-spacing": 2,
68+
"dot-notation": 2,
69+
"no-spaced-func": 1,
70+
"no-shadow": 2,
71+
"no-undef": 2,
72+
"padded-blocks": [2, "never"],
73+
"semi": [2, "always"],
74+
"space-after-keywords": [2, "always"],
75+
"space-infix-ops": 2,
76+
"max-len" : [1, 120],
77+
"consistent-return": 2,
78+
"yoda": 2
79+
}
80+
}

Gruntfile.js

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,22 @@
11
module.exports = function(grunt) {
2-
32
// Project configuration.
43
grunt.initConfig({
5-
pkg : grunt.file.readJSON('package.json'),
4+
pkg: grunt.file.readJSON('package.json'),
65
karma: {
76
unit: {
87
configFile: 'karma.conf.js'
98
},
109
integration: {
1110
configFile: 'karma-integration.conf.js'
1211
}
13-
},
14-
uglify : {
15-
options : {
16-
banner : '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
17-
preserveComments: 'some'
18-
},
19-
build : {
20-
src : 'dist/<%= pkg.name %>.js',
21-
dest : 'dist/<%= pkg.name %>.min.js'
22-
}
23-
},
24-
jshint : {
25-
all : ['Gruntfile.js', 'src/*.js']
26-
},
27-
requirejs : {
28-
compile : {
29-
options : {
30-
almond : true,
31-
wrap : {
32-
startFile : 'build/start.frag',
33-
endFile : 'build/end.frag'
34-
},
35-
"baseUrl" : "src",
36-
"name" : "quagga",
37-
"useStrict": true,
38-
"out" : "dist/quagga.js",
39-
"include" : ['quagga'],
40-
"optimize" : "none",
41-
"findNestedDependencies" : true,
42-
"skipSemiColonInsertion" : true,
43-
44-
"shim" : {
45-
"typedefs" : {
46-
"deps" : [],
47-
"exports" : "typedefs"
48-
}
49-
},
50-
51-
"paths" : {
52-
"typedefs" : "typedefs",
53-
"gl-matrix": "../node_modules/gl-matrix/dist/gl-matrix-min"
54-
}
55-
}
56-
}
5712
}
5813
});
5914

60-
// Load the plugin that provides the "uglify" task.
61-
grunt.loadNpmTasks('grunt-contrib-jshint');
62-
grunt.loadNpmTasks('grunt-contrib-uglify');
63-
6415
grunt.loadNpmTasks('grunt-requirejs');
6516
grunt.loadNpmTasks('grunt-karma');
6617

6718
grunt.loadTasks('tasks');
6819

69-
grunt.registerTask('build', ['check', 'requirejs']);
70-
grunt.registerTask('check', ['jshint']);
71-
grunt.registerTask('dist', ['build', 'uglify', 'uglyasm']);
7220
grunt.registerTask('test', ['karma']);
7321
grunt.registerTask('integrationtest', ['karma:integration']);
74-
75-
grunt.registerTask('default', ['build']);
76-
};
22+
};

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
quaggaJS
22
========
33

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

66
## What is QuaggaJS?
77

@@ -34,9 +34,9 @@ be aligned with the viewport.
3434

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

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

9191
```console
9292
> npm install
93-
> grunt dist
93+
> npm run build
9494
```
9595

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

99103
## API
100104

@@ -360,7 +364,7 @@ automatically generated in the coverage/ folder.
360364

361365
```console
362366
> npm install
363-
> grunt test
367+
> npm run test
364368
```
365369
## Image Debugging
366370

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

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

437+
### 2015-10-13
438+
Take a look at the release-notes ([0.8.0]
439+
(https://github.com/serratus/quaggaJS/releases/tag/v0.8.0))
440+
441+
- Improvements
442+
- Replaced RequireJS with webpack
443+
433444
### 2015-09-15
434445
Take a look at the release-notes ([0.7.0]
435446
(https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))

0 commit comments

Comments
 (0)