Skip to content

Commit 17a4582

Browse files
committed
Move to ES 5
1 parent dbbd41e commit 17a4582

17 files changed

+661
-1153
lines changed

Diff for: .babelrc

-3
This file was deleted.

Diff for: .eslintrc.json

-8
This file was deleted.

Diff for: .jscsrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"preset": "jquery",
3+
"requireSpacesInsideParentheses": false,
4+
"validateQuoteMarks": true,
5+
"requireSpacesInsideBrackets": false,
6+
"requireSpacesInsideObjectBrackets": false,
7+
"maximumLineLength": 120,
8+
"requirePaddingNewLinesBeforeLineComments": false
9+
}

Diff for: CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
This project is an outcome of a lot of contributions from developers who have been kind enough to point out any issues and/or have taken the time to create pull requests that fix issues or add new features to this repo. In other words, contributions are welcome :) Here are some guidelines to consider:
44

5-
- The jQuery timer plugin is written in ES6. It uses babel along with webpack for transpiling to ES5
5+
- The jQuery timer plugin is written in ES 5. It was written in ES 6 when I once felt that the browsers will catchup to ES6 and we ll not have to transpile anymore. The transpiled version of the jQuery timer adds 30% cruft to the code just to manage the fancy syntax. I moved away from it coz I realized users of this plugin don't care about that and should not be subjected to it.
66
- All source code is in the `src` directory. Any changes you make should ideally happen in the files inside `src` (unless you are making changes to the README or this file itself)
77
- To start contributing code changes, fork this repo to your Github account and clone it in your local computer
88
- Run `npm install` to install all the dependencies
9-
- The package.json has all the required commands for you to test and transpile
10-
* `npm test` to run eslint and the unit tests
11-
* `npm run webpack` to transpile the scripts from the _src_ directory to _dist/timer.jquery.js_
12-
* `npm grunt` for minifying the transpiled file to _dist/timer.jquery.min.js_
9+
- The package.json has all the required commands for you to test, lint, style check and put together a production file
10+
* `npm test` to run unit tests
11+
* `npm run build` for running jscs, jshint, concat and uglify to generate timer.jquery.js and timer.jquery.min.js inside dist/
12+
* `npm run watch` Watch over files from src and test as you work on them to running jscs, jshint, concat and uglify on changes
1313
- Once you ve made the changes and are sure that the existing tests pass, commit them to your _origin_ and issue a Pull Request to the upstream (this repo)
1414
- Please write tests for your changes
1515

16-
That's it. Happy coding!
16+
That's it. Time is precious, use it wisely & Happy Coding :)

Diff for: Gruntfile.js

+37-10
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
1-
module.exports = function (grunt) {
1+
module.exports = function(grunt) {
2+
var commonTasks = ['jscs', 'jshint', 'concat', 'uglify'];
23
grunt.initConfig({
34
pkg: grunt.file.readJSON('package.json'),
45

5-
uglify: {
6+
jscs: {
7+
src: ['Gruntfile.js', 'src/*.js', 'test/*.js']
8+
},
9+
10+
jshint: {
11+
all: ['Gruntfile.js', 'src/*.js', 'test/*.js']
12+
},
13+
14+
concat: {
615
options: {
7-
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%=grunt.template.today("yyyy-mm-dd")%>*/'
16+
banner: [
17+
'/*! <%= pkg.name %> <%= pkg.version %> <%=grunt.template.today("yyyy-mm-dd")%>*/\n',
18+
'(function() {\n'
19+
].join(''),
20+
footer: '} ());'
821
},
922
dist: {
10-
src: ['dist/timer.jquery.js'],
23+
src: [
24+
'src/constants.js',
25+
'src/utils.js',
26+
'src/Timer.js',
27+
'src/index.js'
28+
],
29+
dest: 'dist/timer.jquery.js'
30+
}
31+
},
32+
33+
uglify: {
34+
dist: {
35+
src: 'dist/timer.jquery.js',
1136
dest: 'dist/timer.jquery.min.js'
12-
},
37+
}
1338
},
1439

1540
watch: {
1641
scripts: {
17-
files: ['dist/timer.jquery.js'],
18-
tasks: ['uglify'],
42+
files: ['src/*.js'],
43+
tasks: commonTasks,
1944
options: {
2045
nospawn: true
2146
}
2247
}
2348
}
2449
});
2550

51+
grunt.loadNpmTasks('grunt-jscs');
52+
grunt.loadNpmTasks('grunt-contrib-jshint');
53+
grunt.loadNpmTasks('grunt-contrib-concat');
2654
grunt.loadNpmTasks('grunt-contrib-uglify');
2755
grunt.loadNpmTasks('grunt-contrib-watch');
2856

29-
//register default task
30-
grunt.registerTask('default', 'watch');
31-
}
57+
grunt.registerTask('default', commonTasks);
58+
};

Diff for: LICENSE-MIT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 Walmik Deshpande
1+
Copyright (c) 2017 Walmik Deshpande
22

33
Permission is hereby granted, free of charge, to any person
44
obtaining a copy of this software and associated documentation

Diff for: bower.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{
22
"name": "timer.jquery",
33
"ignore": [
4-
".babelrc",
5-
".eslintrc.json",
64
".gitignore",
75
".travis.yml",
86
"Gruntfile.js",
9-
"index.html",
107
"package.json",
11-
"test",
12-
"webpack.config.js"
8+
"test"
139
],
1410
"dependencies": {
1511
"jquery": ">=1.9.0"

0 commit comments

Comments
 (0)