-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from jimmynotjim/gulp-option
Add gulp option
- Loading branch information
Showing
26 changed files
with
686 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# <%= humanName %> | ||
|
||
<%= props.description %> | ||
|
||
![Screenshot](screenshot.png) | ||
|
||
## Dependencies | ||
|
||
- [Gulp](http://gulpjs.com): task runner for pulling in assets, | ||
linting and concatenating code, etc. | ||
- [Bower](http://bower.io): Package manager for front-end dependencies. | ||
- [Less](http://lesscss.org): CSS pre-processor. | ||
- [Capital Framework](https://cfpb.github.io/capital-framework/getting-started): | ||
User interface pattern-library produced by the CFPB. | ||
|
||
**NOTE:** If you're new to Capital Framework, we encourage you to | ||
[start here](https://cfpb.github.io/capital-framework/getting-started). | ||
|
||
## Installation | ||
|
||
1. Install [Node.js](http://nodejs.org) however you'd like. | ||
2. Install [Gulp](http://gulpjs.com) and [Bower](http://bower.io): | ||
```bash | ||
npm install -g gulp bower | ||
``` | ||
3. Next, install the dependencies and compile the project with: | ||
```bash | ||
./setup.sh | ||
``` | ||
__NOTE:__ To re-install and rebuild all the site’s assets run | ||
`./setup.sh` again. See the [usage](#usage) section on updating all the | ||
project dependencies. | ||
|
||
## Configuration | ||
|
||
_If the software is configurable, describe it in detail, | ||
either here or in other documentation to which you link._ | ||
|
||
## Usage | ||
|
||
Each time you fetch from the upstream repository (this repo), run `./setup.sh`. | ||
This setup script will remove and re-install the project dependencies and | ||
rebuild the site's JavaScript and CSS assets. | ||
|
||
To watch for changes in the source code and automatically update the running site, | ||
open a terminal and run: | ||
|
||
```bash | ||
gulp watch | ||
``` | ||
|
||
## How to test the software | ||
|
||
After running `./setup.sh` or compiling with Gulp, | ||
you can view the site in a browser by opening `/dist/index.html`. | ||
Alternatively, you may want to use a local server with something like | ||
`python -m SimpleHTTPServer`. | ||
|
||
## Known issues | ||
|
||
_Document any known significant shortcomings with the software._ | ||
|
||
## Getting help | ||
|
||
_Instruct users how to get help with this software; this might include links | ||
to an issue tracker, wiki, mailing list, etc._ | ||
|
||
Use the issue tracker to follow the development conversation. | ||
If you find a bug not listed in the issue tracker, please file a bug report. | ||
|
||
## Getting involved | ||
|
||
We welcome your feedback and contributions. See the | ||
[contribution guidelines](https://github.com/cfpb/open-source-project-template/blob/master/CONTRIBUTING.md) | ||
for more details. | ||
|
||
Additionally, you may want to consider | ||
[contributing to the Capital Framework](https://cfpb.github.io/capital-framework/contributing/), | ||
which is the front-end pattern library used in this project. | ||
|
||
|
||
---- | ||
|
||
## Open source licensing info | ||
1. [TERMS](TERMS.md) | ||
2. [LICENSE](LICENSE) | ||
3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/) | ||
|
||
|
||
---- | ||
|
||
## Credits and references | ||
|
||
1. Projects that inspired you | ||
2. Related projects | ||
3. Books, papers, talks, or other sources that have meaniginful impact or | ||
influence on this project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
/* | ||
gulpfile.js | ||
=========== | ||
Rather than manage one giant configuration file responsible | ||
for creating multiple tasks, each task has been broken out into | ||
its own file in gulp/tasks. Any files in that directory get | ||
automatically required below. | ||
To add a new task, simply add a new task file the gulp/tasks directory. | ||
gulp/tasks/default.js specifies the default set of tasks to run | ||
when you run `gulp`. | ||
*/ | ||
|
||
var requireDir = require( 'require-dir' ); | ||
|
||
// Require all tasks in gulp/tasks, including subfolders | ||
requireDir( './gulp/tasks', { recurse: true } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "<%= slugname %>", | ||
"version": "0.1.0", | ||
"description": "<%= props.description %>", | ||
<% if (props.homepage) { %>"homepage": "<%= props.homepage %>",<% } %> | ||
"author": { | ||
"name": "<%= props.authorName %>", | ||
"email": "<%= props.authorEmail %>"<% if (props.authorUrl) { %>, | ||
"url": "<%= props.authorUrl %>"<% } %> | ||
}, | ||
"repository": { | ||
"type": "<%= props.repoType %>", | ||
"url": "<%= props.repoUrl %>" | ||
}, | ||
"license": "<%= props.license %>", | ||
"keywords": [ | ||
"<%= slugname %>" | ||
], | ||
"devDependencies": { | ||
"browser-sync": "^2.8.0", | ||
"del": "^1.2.0", | ||
"fs": "0.0.2", | ||
"gulp": "^3.9.0", | ||
"gulp-autoprefixer": "^2.3.1", | ||
"gulp-changed": "^1.2.1", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-cssmin": "^0.1.7", | ||
"gulp-eslint": "^1.0.0", | ||
"gulp-header": "^1.2.2", | ||
"gulp-imagemin": "^2.3.0", | ||
"gulp-less": "^3.0.3", | ||
"gulp-load-plugins": "^1.0.0-rc.1", | ||
"gulp-mq-remove": "0.0.2", | ||
"gulp-notify": "^2.2.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-replace": "^0.5.3", | ||
"gulp-sourcemaps": "^1.5.2", | ||
"gulp-uglify": "^1.4.1", | ||
"gulp-util": "^3.0.6", | ||
"jquery": "^1.11.3", | ||
"pretty-hrtime": "^1.0.0", | ||
"require-dir": "^0.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/sh | ||
|
||
# Set script to exit on any errors. | ||
set -e | ||
|
||
# Initialize project dependency directories. | ||
init(){ | ||
NODE_DIR=node_modules | ||
BOWER_DIR=bower_components | ||
|
||
if [ -f .bowerrc ]; then | ||
# Get the "directory" line from .bowerrc | ||
BOWER_DIR=$(grep "directory" .bowerrc | cut -d '"' -f 4) | ||
fi | ||
|
||
echo 'npm components directory:' $NODE_DIR | ||
echo 'Bower components directory:' $BOWER_DIR | ||
} | ||
|
||
# Clean project dependencies. | ||
clean(){ | ||
# If the node and bower directories already exist, | ||
# clear them so we know we're working with a clean | ||
# slate of the dependencies listed in package.json | ||
# and bower.json. | ||
if [ -d $NODE_DIR ] || [ -d $BOWER_DIR ]; then | ||
echo 'Removing project dependency directories...' | ||
rm -rf $NODE_DIR | ||
rm -rf $BOWER_DIR | ||
fi | ||
echo 'Project dependencies have been removed.' | ||
} | ||
|
||
# Install project dependencies. | ||
install(){ | ||
echo 'Installing project dependencies...' | ||
npm install | ||
bower install --config.interactive=false | ||
} | ||
|
||
# Run tasks to build the project for distribution. | ||
build(){ | ||
echo 'Building project...' | ||
gulp clean | ||
gulp build | ||
} | ||
|
||
init | ||
clean | ||
install | ||
build |
Oops, something went wrong.