Skip to content

Commit

Permalink
Merge pull request #38 from jakemmarsh/bump-node-npm-versions
Browse files Browse the repository at this point in the history
clean up package.json, move build task into npm script
  • Loading branch information
jakemmarsh committed May 12, 2016
2 parents 9f757c5 + 3488257 commit 8e34e39
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '0.12.7'
- '4.2'
branches:
only:
- master
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A boilerplate using ReactJS (along with React Router and RefluxJS), SASS, Gulp,
2. Run `npm install` from the root directory
3. Run `gulp dev` (may require installing Gulp globally `npm install gulp -g`)
4. Your browser will automatically be opened and directed to the browser-sync proxy address
5. To prepare assets for production, run the `gulp prod` task (Note: the production task does not fire up the browser-sync server, and won't provide you with browser-sync's live reloading. Simply use `gulp dev` during development. More information below)
5. To prepare assets for production, run the `npm run build` task (Note: the production task does not fire up the browser-sync server, and won't provide you with browser-sync's live reloading. Simply use `gulp dev` during development. More information below)

Now that `gulp dev` is running, the server is up as well and serving files from the `/build` directory. Any changes in the `/app` directory will be automatically processed by Gulp and the changes will be injected to any open browsers pointed at the proxy address.

Expand All @@ -35,7 +35,7 @@ Along with many Gulp libraries (these can be seen in either `package.json`, or a
### Running tests

1. If you haven't already, follow steps 1 & 2 above
2. If you haven't already run `gulp dev` or `gulp prod` at least once, run `gulp prod`
2. If you haven't already run `gulp dev` or `npm run build` at least once, run `npm run build`
3. Run all tests in the `tests/` directory with the `gulp test` command
* A single file can be run by specifing an `-f` flag: `gulp test -f <PATH_TO_TEST_FILE>`
* In the `PATH_TO_TEST_FILE`, it is possible to omit the `tests/` prefix, as well as the `.test.js` suffix. They will be automatically added if not detected.
Expand Down Expand Up @@ -151,14 +151,14 @@ Just one task is necessary for processing our SASS files, and that is `gulp-sass

##### Images

Any images placed within `/app/images` will be automatically copied to the `build/images` directory. If running `gulp prod`, they will also be compressed via imagemin.
Any images placed within `/app/images` will be automatically copied to the `build/images` directory. If running `npm run build`, they will also be compressed via imagemin.

##### Watching files

All of the Gulp processes mentioned above are run automatically when any of the corresponding files in the `/app` directory are changed, and this is thanks to our Gulp watch tasks. Running `gulp dev` will begin watching all of these files, while also serving to `localhost:3000`, and with browser-sync proxy running at `localhost:3001` (by default).

##### Production Task

Just as there is the `gulp dev` task for development, there is also a `gulp prod` task for putting your project into a production-ready state. This will run each of the tasks, while also adding the image minification task discussed above. There is also an empty `gulp deploy` task that is included when running the production task. This deploy task can be fleshed out to automatically push your production-ready site to your hosting setup.
Just as there is the `gulp dev` task for development, there is also a `npm run build` task for putting your project into a production-ready state. This will run each of the tasks, while also adding the image minification task discussed above. There is also an empty `gulp deploy` task that is included when running the production task. This deploy task can be fleshed out to automatically push your production-ready site to your hosting setup.

**Reminder:** When running the production task, gulp will not fire up the express server and serve your index.html. This task is designed to be run before the `deploy` step that may copy the files from `/build` to a production web server.
16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-rocket-boilerplate",
"version": "2.4.1",
"version": "2.5.0",
"author": "Jake Marsh <[email protected]>",
"description": "Boilerplate using React, Browserify, SASS, and Gulp.",
"repository": {
Expand All @@ -14,11 +14,6 @@
"sass",
"boilerplate"
],
"private": true,
"engines": {
"node": "^0.12.x",
"npm": "^2.1.x"
},
"devDependencies": {
"babel-core": "^6.3.15",
"babel-eslint": "^5.0.0-beta4",
Expand All @@ -42,14 +37,14 @@
"gulp-mocha": "^2.1.3",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.x",
"gulp-sass": "^2.3.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"history": "^1.17.0",
"istanbul": "^0.4.0",
"jsdom": "3.1.2",
"jsdom": "^8.0.2",
"lodash": "^3.10.0",
"mocha": "^2.3.3",
"react": "^0.14.x",
Expand All @@ -67,7 +62,8 @@
"yargs": "^3.27.0"
},
"scripts": {
"lint": "./node_modules/.bin/gulp lint",
"test": "./node_modules/.bin/gulp test"
"lint": "NODE_ENV=test ./node_modules/.bin/gulp lint",
"test": "NODE_ENV=test ./node_modules/.bin/gulp test",
"build": "NODE_ENV=production ./node_modules/.bin/gulp prod"
}
}

0 comments on commit 8e34e39

Please sign in to comment.