Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Commit 1ca53e4

Browse files
author
Chris Ferdinandi
committed
Merge pull request #16 from cferdinandi/development
v1.1.0
2 parents 99f37ff + 9317c8f commit 1ca53e4

34 files changed

+1005
-249
lines changed

STARTER-README.md renamed to README-TEMPLATE.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
# NAMESPACE-UP [![Build Status](https://travis-ci.org/GITHUB-USERNAME/NAMESPACE-LOW.svg)](https://travis-ci.org/GITHUB-USERNAME/NAMESPACE-LOW)
22
DESCRIPTION.
33

4-
[Download NAMESPACE-UP](https://github.com/GITHUB-USERNAME/NAMESPACE-LOW/archive/master.zip) / [View the demo](http://GITHUB-USERNAME.github.io/NAMESPACE-LOW/).
4+
[Download NAMESPACE-UP](https://github.com/GITHUB-USERNAME/NAMESPACE-LOW/archive/master.zip) / [View the demo](http://GITHUB-USERNAME.github.io/NAMESPACE-LOW/)
55

66
**In This Documentation**
77

88
1. [Getting Started](#getting-started)
99
2. [Installing with Package Managers](#installing-with-package-managers)
10-
3. [Options & Settings](#options-and-settings)
11-
4. [Browser Compatibility](#browser-compatibility)
12-
5. [How to Contribute](#how-to-contribute)
13-
6. [License](#license)
14-
7. [Changelog](#changelog)
15-
8. [Older Docs](#older-docs)
10+
3. [Working with the Source Files](#working-with-the-source-files)
11+
4. [Options & Settings](#options-and-settings)
12+
5. [Browser Compatibility](#browser-compatibility)
13+
6. [How to Contribute](#how-to-contribute)
14+
7. [License](#license)
15+
8. [Changelog](#changelog)
16+
9. [Older Docs](#older-docs)
1617

1718

1819

1920
## Getting Started
2021

21-
Compiled and production-ready code can be found in the `dist` directory. The `src` directory contains development code. Unit tests are located in the `test` directory.
22+
Compiled and production-ready code can be found in the `dist` directory. The `src` directory contains development code. Unit tests are located in the `test` directory. It's the same build system that's used by [Kraken](http://cferdinandi.github.io/kraken/), so it includes some unnecessary tasks and Sass variables but can be dropped right in to the boilerplate without any configuration.
2223

2324
### 1. Include NAMESPACE-UP on your site.
2425

2526
```html
2627
<link rel="stylesheet" href="dist/css/NAMESPACE-LOW.css">
2728
<script src="dist/js/classList.js"></script>
28-
<script src="dist/js/bind-polyfill.js"></script>
2929
<script src="dist/js/NAMESPACE-LOW.js"></script>
3030
```
3131

3232
NAMESPACE-UP is [built with Sass](http://sass-lang.com/) for easy customization. If you don't use Sass, that's ok. The `css` folder contains compiled vanilla CSS.
3333

3434
The `_config.scss` and `_mixins.scss` files are the same ones used in [Kraken](http://GITHUB-USERNAME.github.io/kraken/), so you can drop the `_NAMESPACE-LOW.css` file right into Kraken without making any updates. Or, adjust the variables to suit your own project.
3535

36-
NAMESPACE-UP also requires [classList.js](https://github.com/eligrey/classList.js) and `bind-polyfill.js`, polyfills that extend ECMAScript 5 API support to more browsers.
36+
NAMESPACE-UP also requires [classList.js](https://github.com/eligrey/classList.js), a polyfill that extends ECMAScript 5 API support to more browsers.
3737

3838
### 2. Add the markup to your HTML.
3939

@@ -65,6 +65,28 @@ You can install NAMEPSACE-UP with your favorite package manager.
6565

6666

6767

68+
## Working with the Source Files
69+
70+
If you would prefer, you can work with the development code in the `src` directory using the included [Gulp build system](http://gulpjs.com/). This compiles, lints, and minifies code, and runs unit tests. It's the same build system that's used by [Kraken](http://cferdinandi.github.io/kraken/), so it includes some unnecessary tasks and Sass variables but can be dropped right in to the boilerplate without any configuration.
71+
72+
### Dependencies
73+
Make sure these are installed first.
74+
75+
* [Node.js](http://nodejs.org)
76+
* [Ruby Sass](http://sass-lang.com/install)
77+
* [Gulp](http://gulpjs.com) `sudo npm install -g gulp`
78+
79+
### Quick Start
80+
81+
1. In bash/terminal/command line, `cd` into your project directory.
82+
2. Run `npm install` to install required files.
83+
3. When it's done installing, run one of the task runners to get going:
84+
* `gulp` manually compiles files.
85+
* `gulp watch` automatically compiles files when changes are made.
86+
* `gulp reload` automatically compiles files and applies changes using [LiveReload](http://livereload.com/).
87+
88+
89+
6890
## Options and Settings
6991

7092
NAMESPACE-UP includes smart defaults and works right out of the box. But if you want to customize things, it also has a robust API that provides multiple ways for you to adjust the default options and settings.
@@ -103,7 +125,7 @@ Description
103125
```
104126

105127
#### destroy()
106-
Destroy the current `NAMESPACE-LOW.init()`.
128+
Destroy the current `NAMESPACE-LOW.init()`. This is called automatically during the init function to remove any existing initializations.
107129

108130
```javascript
109131
NAMESPACE-LOW.destroy();

README.md

Lines changed: 103 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Gulp Boilerplate [![Build Status](https://travis-ci.org/cferdinandi/gulp-boilerplate.svg)](https://travis-ci.org/cferdinandi/gulp-boilerplate)
22

3-
My boilerplate for creating new web projects with [Gulp.js](http://gulpjs.com/). Forked from [Todd Motto's GulpOSS](https://github.com/toddmotto/gulp-oss) with some additions from [Mark Goodyear and Big Bite Creative](https://github.com/bigbitecreative/base).
3+
My boilerplate for creating new web projects with [Gulp.js](http://gulpjs.com/). Forked from [Todd Motto's GulpOSS](https://github.com/toddmotto/gulp-oss) with some additions from [Mark Goodyear and Big Bite Creative](https://github.com/bigbitecreative/base) and various tutorials around the web.
44

55
* Lints and concatenates JS files.
66
* Compiles Sass files and automatically [adds vendor prefixes](https://github.com/ai/autoprefixer).
7-
* Exports both minified and expanded JS and CSS files.
7+
* Exports both minified and expanded JS and CSS files with header info.
8+
* Generates SVG sprites.
9+
* Generates documentation.
810
* Cleans up file directories.
9-
* Adds a header to the top of all JS and CSS files.
1011
* Runs Jasmine unit tests and generates reports.
1112
* Includes a `.travis.yml` file for continuous integration with [TravisCI](https://travis-ci.org).
1213

@@ -15,10 +16,12 @@ My boilerplate for creating new web projects with [Gulp.js](http://gulpjs.com/).
1516
**In This Documentation**
1617

1718
1. [Getting Started](#getting-started)
18-
2. [Options & Settings](#options-and-settings)
19-
3. [Unit Testing](#unit-testing)
20-
3. [License](#license)
21-
4. [Changelog](#changelog)
19+
2. [File Structure](#file-structure)
20+
3. [Working with the Source Files](#working-with-the-source-files)
21+
4. [Options & Settings](#options-and-settings)
22+
5. [Continuous Integration](#continuous-integration)
23+
6. [License](#license)
24+
7. [Changelog](#changelog)
2225

2326
## Getting Started
2427

@@ -28,19 +31,28 @@ Make sure these are installed first.
2831
* [Node.js](http://nodejs.org)
2932
* [Ruby Sass](http://sass-lang.com/install)
3033
* [Gulp](http://gulpjs.com) `sudo npm install -g gulp`
31-
* [PhantomJS](http://phantomjs.org)
3234

3335
### Quick Start
3436

3537
1. In bash/terminal/command line, `cd` into your project directory.
3638
2. Run `npm install` to install required files.
37-
3. When it's done installing, run `gulp` to get going.
39+
3. When it's done installing, run one of the task runners to get going:
40+
* `gulp` manually compiles files.
41+
* `gulp docs` manually compiles files and generates documentation.
42+
* `gulp watch` automatically compiles files when changes are made.
43+
* `gulp watch:docs` automatically compiles files and geneates docs when changes are made.
44+
* `gulp reload` automatically compiles files and applies changes using [LiveReload](http://livereload.com/).
45+
* `gulp reload:docs` automatically compiles files, generates docs, and applies changes using [LiveReload](http://livereload.com/).
3846

39-
Every time you want to run your tasks, run `gulp`.
4047

41-
### File Structure
4248

43-
Add your files to the appropriate `src` subdirectories. Gulp will process and and compile them into `dist`. Content in subdirectories under the `js` folder will be concatenated. (For example, files in `js/detects` will compile into `detects.js`.) Files directly under `js` will compile individually.
49+
## File Structure
50+
51+
Add your files to the appropriate `src` subdirectories. Gulp will process and and compile them into `dist`.
52+
53+
* Content in subdirectories under the `js` folder will be concatenated. For example, files in `js/detects` will compile into `detects.js`. Files directly under `js` will compile individually.
54+
* SVGs in the `svg` directory will compile into `icons.svg`.
55+
* Assets in the `assets` directory will be copied as-is into the `dist` directory.
4456

4557
```
4658
gulp-boilerplate/
@@ -49,20 +61,29 @@ gulp-boilerplate/
4961
| | |—— myplugin.css
5062
| | |—— myplugin.min.css
5163
| |—— js/
52-
| | |—— bind-polyfill.js
53-
| | |—— bind-polyfill.min.js
5464
| | |—— classList.js
5565
| | |—— classList.min.js
5666
| | |—— myplugin.js
5767
| | |—— myplugin.min.js
68+
| |—— svg/
69+
| | |—— icons.svg
5870
| |—— # static assets
71+
|—— docs/
72+
| |—— assets/
73+
| |—— dist/
74+
| |—— index.html
75+
| |—— # other docs
5976
|—— src/
6077
| |—— js/
61-
| | |—— bind-polyfill.js
6278
| | |—— classList.js
6379
| | |—— myplugin.js
6480
| |—— sass/
65-
| | |—— myplugin.sass
81+
| | |—— _config.scss
82+
| | |—— _mixins.scss
83+
| | |—— components/
84+
| | | |—— myplugin.scss
85+
| |—— svg/
86+
| | |—— # svgs
6687
| |—— static/
6788
| | |—— # static assets
6889
|—— test/
@@ -77,11 +98,35 @@ gulp-boilerplate/
7798
|—— index.html
7899
|—— package.json
79100
|—— README.md
80-
|—— STARTER-README.md
101+
|—— README-TEMPLATE.md
81102
```
82103

83104

84105

106+
## Working with the Source Files
107+
108+
### Sass
109+
110+
Sass files are located in `src` > `sass`. Gulp generates minified and unminified CSS files. It also includes [autoprefixer](https://github.com/postcss/autoprefixer), which adds vendor prefixes for you if required by the last two versions of a browser.
111+
112+
### JavaScript
113+
114+
JavaScript files are located in the `src` > `js` directory.
115+
116+
Files placed directly in the js folder will compile directly to `dist` > `js` as both minified and unminified files. Files placed in subdirectories will also be concatenated into a single file. For example, files in `js/detects` will compile into `detects.js`. Files directly under `js` will compile individually.
117+
118+
#### Unit Testing
119+
120+
Gulp Boilerplate is set up for unit testing with [Jasmine](http://jasmine.github.io/2.0/introduction.html). Add your tests to `test/spec/spec-myplugin.js`. Adjust filenames and references as needed.
121+
122+
Unit test results are printed in terminal, but you can also view them in a browser under `test/results/unit-tests.html`. Get a report of how much of your scripts is covered by testing under `test/coverage`.
123+
124+
### SVGs
125+
126+
SVG files placed in the `src` > `svg` directory will be compiled into a single SVG sprite called `icons.svg` in the `dist` > `svg` directory.
127+
128+
129+
85130
## Options and Settings
86131

87132
### Updating Project Details
@@ -95,30 +140,47 @@ Inside `gulpfile.js` you'll see a variable named `paths`. Adjust the paths to su
95140

96141
```js
97142
var paths = {
98-
output : 'dist/',
99-
scripts : {
100-
input : [ 'src/js/*' ],
101-
output : 'dist/js/'
102-
},
103-
styles : {
104-
input : 'src/sass/**/*.scss',
105-
output : 'dist/css/'
106-
},
107-
static : 'src/static/**',
108-
test : {
109-
spec : [ 'test/spec/**/*.js' ],
110-
coverage: 'test/coverage/',
111-
results: 'test/results/'
112-
}
143+
input: 'src/**/*',
144+
output: 'dist/',
145+
scripts: {
146+
input: 'src/js/*',
147+
output: 'dist/js/'
148+
},
149+
styles: {
150+
input: 'src/sass/**/*.{scss,sass}',
151+
output: 'dist/css/'
152+
},
153+
svgs: {
154+
input: 'src/svg/**/*.svg',
155+
output: 'dist/svg/'
156+
},
157+
static: 'src/static/**',
158+
test: {
159+
input: 'src/js/**/*.js',
160+
karma: 'test/karma.conf.js',
161+
spec: 'test/spec/**/*.js',
162+
coverage: 'test/coverage/',
163+
results: 'test/results/'
164+
},
165+
docs: {
166+
input: 'src/docs/*.{html,md,markdown}',
167+
output: 'docs/',
168+
templates: 'src/docs/_templates/',
169+
assets: 'src/docs/assets/**'
170+
}
113171
};
114172
```
115173

116174

117-
## Unit Testing
118175

119-
Gulp Boilerplate is set up for unit testing with [Jasmine](http://jasmine.github.io/2.0/introduction.html). Add your tests to `test/spec/spec-myplugin.js`. Adjust filenames and references as needed.
176+
## Continuous Integration
177+
178+
This boilerplate includes a configuration file for [Travis CI](http://docs.travis-ci.com/user/getting-started/), a continuous integration service for GitHub.
179+
180+
If you sign-up and activate it for your repository, Travis CI will run your build and execute any processes to make sure everything is working as expected. This is particularly useful when working with a team or managing open source projects with multiple contributors.
181+
182+
The `.travis.yml` file is pre-configured for the boilerplate's build system. Even if you add files or update the Gulp tasks, you shouldn't need to change anything for it to work.
120183

121-
Unit test results are printed in terminal, but you can also view them in a browser under `test/results/unit-tests.html`. Get a report of how much of your scripts is covered by testing under `test/coverage`.
122184

123185

124186
## License
@@ -131,6 +193,12 @@ Gulp Boilerplate is licensed under the [MIT License](http://gomakethings.com/mit
131193

132194
Gulp Boilerplate uses [semantic versioning](http://semver.org/).
133195

196+
* v1.1.0 - October 18, 2014
197+
* Added documentation generator.
198+
* Added SVG sprite generator.
199+
* Added LiveReload and change watching tasks.
200+
* Renamed Gulp tasks for better semantics.
201+
* Updated docs.
134202
* v1.0.2 - October 2, 2014
135203
* Added CommonJS bug fix.
136204
* Updated readme.md to reflect new file structure.

dist/css/myplugin.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/**
2-
* gulp-boilerplate v1.0.2
2+
* gulp-boilerplate v1.1.0
33
* My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi.
44
* http://github.com/cferdinandi/Plugin
55
*
66
* Free to use under the MIT License.
77
* http://gomakethings.com/mit/
88
*/
99

10-
/* Your content here... */

dist/css/myplugin.css.min.map

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/css/myplugin.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/** gulp-boilerplate v1.0.2, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */
1+
/** gulp-boilerplate v1.1.0, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */

dist/js/bind-polyfill.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

dist/js/bind-polyfill.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/js/classList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gulp-boilerplate v1.0.2
2+
* gulp-boilerplate v1.1.0
33
* My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi.
44
* http://github.com/cferdinandi/Plugin
55
*

dist/js/classList.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/myplugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* gulp-boilerplate v1.0.2
2+
* gulp-boilerplate v1.1.0
33
* My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi.
44
* http://github.com/cferdinandi/Plugin
55
*

dist/js/myplugin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)