{"push_id":752273715,"size":3,"distinct_size":0,"ref":"refs/heads/master","head":"6e4de3014ea1ba0c9c8f1f6cf4292df063b1e965","before":"7e7ccd26692e1e31b4297ef9578fe904b5a804bd","commits":[{"sha":"0f6c9c7dc9750a4e8917230b8dab38e6feb486f3","author":{"email":"d360f2f4106184aea4888959fb571dd20fb793b5@gmail.com","name":"0xazure"},"message":"Re-implement build tasks in Gulp.js","distinct":false,"url":"https://api.github.com/repos/new-xkit/XKit/commits/0f6c9c7dc9750a4e8917230b8dab38e6feb486f3"},{"sha":"9809c97f6d8ff5a556c7ceac65d08cfec2f0c293","author":{"email":"d360f2f4106184aea4888959fb571dd20fb793b5@gmail.com","name":"0xazure"},"message":"Fix JSCS 'Mixed spaces and tabs'","distinct":false,"url":"https://api.github.com/repos/new-xkit/XKit/commits/9809c97f6d8ff5a556c7ceac65d08cfec2f0c293"},{"sha":"6e4de3014ea1ba0c9c8f1f6cf4292df063b1e965","author":{"email":"5c2bd99229d434a2f7174ea3f8798d821bc7f9ae@barosl.com","name":"Homu"},"message":"Auto merge of #175 - 0xazure:feature/improve-build-tasks, r=hobinjk\n\n[WIP] Re-implement build tasks in Gulp.js\n\nBack [when I first implemented build scripts](https://github.com/atesh/XKit/pull/167) for this project, there weren't many options for task runners.  I had settled on [Grunt](http://gruntjs.com/) simply because there weren't any other reasonably mature task runners around.  Since then, we've had a veritable explosion of options, each approaching the problem in a different way.\r\n\r\nAfter some tentative probing on Gitter, I found that none of the current core maintainers seem to have a preference for one task runner over another, as most don't have experience with any of the options available.  From this, I've gone ahead and reimplemented the build scripts in [Gulp.js](http://gulpjs.com/).\r\n\r\nI find Gulp to be a better option for this project than Grunt for a number of reasons:\r\n\r\n* It's much harder to make silly mistakes like #163 since Gulp has no notion of sub-tasks\r\n* Gulp is [based on streams](http://maxogden.com/node-streams.html#why-streams), and so doesn't leave build artifacts behind (unlike Grunt) because all the operations Gulp performs modify the in-memory data and only writes to the filesystem [when explicitly instructed to do so](https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpdestpath-options).\r\n* With Gulp, all of the instructions live in the task code, whereas Grunt relies on configuration objects in addition to task code to instruct tasks how to do their job (you can see this [in our own `Gruntfile.js`](https://github.com/new-xkit/XKit/blob/b3d23843df40f2075148e4a5a77fa6f7dd9fd4b1/Gruntfile.js#L50-L169)).  This can make task comprehension more difficult, as there is more cognitive load in Grunt's split of task code and configuration objects.\r\n* In my experience, Gulpfiles are typically shorter and easier to understand than Gruntfiles.  Compare the `gulpfile.js` in this PR to [what we currently have](https://github.com/new-xkit/XKit/blob/b3d23843df40f2075148e4a5a77fa6f7dd9fd4b1/Gruntfile.js) and you'll see a significant line number reduction while implementing the same tasks.\r\n\r\n## Implemented in this PR:\r\n\r\n* Complete re-implementation of the old Grunt tasks as Gulp tasks\r\n  * Fixes #163\r\n* Updated 'Develop XKit' info in the README\r\n* A project-level [EditorConfig](http://editorconfig.org/) file to help maintain style across contributors\r\n* [JSCS](http://jscs.info/) linting and reporting for code style\r\n* [CSSLint](https://github.com/CSSLint/csslint) linting and reporting for CSS files\r\n  * **NB**: CSS linting is currently not included in the `lint` task by default, there are way too many errors for it to be useful for CI right now\r\n* Remove outdated `build.sh` and Grunt-related code\r\n* Dropped support for building Safari releases (as per #77)\r\n\r\n## Gulp tasks:\r\n\r\n#### `gulp` (default)\r\n\r\nThe default task.\r\n\r\nSee also: `gulp lint`.\r\n\r\n#### `gulp watch`\r\n\r\nWatches filesystem and lints files on change.\r\n\r\nSee also: `gulp lint:scripts`, `gulp lint:css`.\r\n\r\n#### `gulp clean`\r\n\r\nTop-level cleaning task.\r\n\r\nSee also: `gulp clean:build`.\r\n\r\n#### `gulp clean:build`\r\n\r\nCleans the `build/` directory, deleting it and any subfolders.\r\n\r\n#### `gulp clean:modules`\r\n\r\nCleans the `node_modules/` directory, deleting it and any subfolders.\r\n\r\n#### `gulp clean:chrome`\r\n\r\nCleans the `build/chrome/` directory, deleting the previous build for Chrome.\r\n\r\n#### `gulp clean:firefox`\r\n\r\nCleans the `build/firefox/` directory, deleting the previous build for Firefox.\r\n\r\n#### `gulp lint`\r\n\r\nTop-level linting task.\r\n\r\nSee also `gulp lint:scripts`, `gulp lint:css`.\r\n\r\n#### `gulp lint:scripts`\r\n\r\nLints JavaScript files using JSHint and JSCS, and reports the output.\r\n\r\n#### `gulp lint:css`\r\n\r\nLints CSS files using CSSLint and reports the output.\r\n\r\n#### `gulp build`\r\n\r\nTop-level build task.\r\n\r\nSee also: `gulp build:chrome`, `gulp build:firefox`.\r\n\r\n#### `gulp build:chrome`\r\n\r\nBuilds the Chrome browser extension from source and outputs it to `build/chrome/`.  Also creates an archive, `new-xkit-x.x.x.zip`, and outputs it to `build/chrome/`.\r\n\r\n#### `gulp copy:chrome`\r\n\r\nBuilds the Chrome browser extension from source and outputs it to `build/chrome/`.\r\n\r\nSee also: `gulp build`, `gulp build:chrome`, `gulp compress:chrome`.\r\n\r\n#### `gulp compress:chrome`\r\n\r\nCreates an archive, `new-xkit-x.x.x.zip`, from an existing Chrome source build and outputs it to `build/chrome/`.\r\n\r\nSee also: `gulp build`, `gulp build:chrome`, `gulp copy:chrome`.\r\n\r\n#### `gulp build:firefox`\r\n\r\nBuilds the Firefox browser extension from source and outputs it to `build/firefox`.  Also creates a [Cross-platform Installer Module](https://developer.mozilla.org/en/docs/XPI), `@new-xkit-x.x.x.xpi`, and outputs it to `build/firefox/`.\r\n\r\nSee also: `gulp compress:firefox`, `gulp copy:firefox`.\r\n\r\n#### `gulp copy:firefox`\r\n\r\nBuilds the Firefox browser extension from source and outputs it to `build/firefox/`.\r\n\r\nSee also: `gulp build`, `gulp build:firefox`, `gulp compress:firefox`.\r\n\r\n#### `gulp compress:firefox`\r\n\r\nCreates a [Cross-platform Installer Module](https://developer.mozilla.org/en/docs/XPI), `@new-xkit-x.x.x.xpi`, from an existing Firefox source build and outputs it to `build/firefox`.\r\n\r\nSee also: `gulp build`, `gulp build:firefox`, `gulp copy:firefox`.\r\n\r\n## Feedback:\r\n\r\nI'd love to hear thoughts on this PR.  I'd especially like to know:\r\n\r\n* [ ] Am I missing any common tasks we don't have automation for?\r\n* [ ] Does the task organization make sense? (i.e. `gulp build[:<platform>]` vs. some other format)\r\n* [ ] Is there anything that isn't well documented?\r\n\r\nas well as anything else!\r\n\r\nI also specifically need another sanity check on the builds that get produced to confirm they work as expected.\r\n\r\n---\r\n\r\n#### Post-merge TODO:\r\n\r\n* [ ] Move the above documentation on Gulp tasks over to the wiki\r\n* [ ] Update the README with a proper link to the above wiki page","distinct":false,"url":"https://api.github.com/repos/new-xkit/XKit/commits/6e4de3014ea1ba0c9c8f1f6cf4292df063b1e965"}]}