Skip to content

Commit

Permalink
v4.1.0
Browse files Browse the repository at this point in the history
- Added back ability to copy static files and directories
- Updated reference to `main` in package.json
- Updated readme-template.md for easier updating
  • Loading branch information
cferdinandi committed Jan 15, 2016
1 parent a05cecf commit 703eb3e
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 593 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_js:
- "0.10"
before_script:
- npm install -g gulp
script: gulp
script: gulp test
61 changes: 28 additions & 33 deletions README-TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,54 @@
# NAMESPACE-UP [![Build Status](https://travis-ci.org/GITHUB-USERNAME/NAMESPACE-LOW.svg)](https://travis-ci.org/GITHUB-USERNAME/NAMESPACE-LOW)
# {{project name - title case}} [![Build Status](https://travis-ci.org/{{GitHub username}}/{{project name - lowercase}}.svg)](https://travis-ci.org/{{GitHub username}}/{{project name - lowercase}})
DESCRIPTION.

[Download NAMESPACE-UP](https://github.com/GITHUB-USERNAME/NAMESPACE-LOW/archive/master.zip) / [View the demo](http://GITHUB-USERNAME.github.io/NAMESPACE-LOW/)
[Download {{project name - title case}}](https://github.com/{{GitHub username}}/{{project name - lowercase}}/archive/master.zip) / [View the demo](http://{{GitHub username}}.github.io/{{project name - lowercase}}/)



## Getting Started

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.
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.

### 1. Include NAMESPACE-UP on your site.
### 1. Include {{project name - title case}} on your site.

```html
<link rel="stylesheet" href="dist/css/NAMESPACE-LOW.css">
<script src="dist/js/classList.js"></script>
<script src="dist/js/NAMESPACE-LOW.js"></script>
<link rel="stylesheet" href="dist/css/{{project name - lowercase}}.css">
<script src="dist/js/{{project name - lowercase}}.js"></script>
```

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.

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.

NAMESPACE-UP also requires [classList.js](https://github.com/eligrey/classList.js), a polyfill that extends ECMAScript 5 API support to more browsers.

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

Details...

```html
Markup here...
```

Details.
### 3. Initialize {{project name - title case}}.

### 3. Initialize NAMESPACE-UP.
In the footer of your page, after the content, initialize {{project name - title case}}. And that's it, you're done. Nice work!

```html
<script>
NAMESPACE-LOW.init();
{{project name - lowercase}}.init();
</script>
```

In the footer of your page, after the content, initialize NAMESPACE-UP. And that's it, you're done. Nice work!



## Installing with Package Managers

You can install NAMEPSACE-UP with your favorite package manager.

* **NPM:** `npm install GITHUB-USERNAME/NAMESPACE-LOW`
* **Bower:** `bower install https://github.com/GITHUB-USERNAME/NAMESPACE-LOW.git`
* **Component:** `component install GITHUB-USERNAME/NAMESPACE-LOW`
* **NPM:** `npm install {{GitHub username}}/{{project name - lowercase}}`
* **Bower:** `bower install https://github.com/{{GitHub username}}/{{project name - lowercase}}.git`
* **Component:** `component install {{GitHub username}}/{{project name - lowercase}}`



## Working with the Source Files

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.
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.

### Dependencies
Make sure these are installed first.
Expand All @@ -69,34 +62,36 @@ Make sure these are installed first.
2. Run `npm install` to install required files.
3. When it's done installing, run one of the task runners to get going:
* `gulp` manually compiles files.
* `gulp watch` automatically compiles files when changes are made and applies changes using [LiveReload](http://livereload.com/).
* `gulp watch` automatically compiles files and applies changes using [LiveReload](http://livereload.com/).
* `gulp test` compiles files and runs unit tests.



## Options and Settings

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.
{{project name - title case}} 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.

### Global Settings

You can pass options and callbacks into NAMESPACE-UP through the `init()` function:
You can pass options and callbacks into {{project name - title case}} through the `init()` function:

```javascript
NAMESPACE-LOW.init();
{{project name - lowercase}}.init({
// Settings go here...
});
```

### Override settings with data attributes

NAMESPACE-UP also lets you override global settings on a link-by-link basis using the `[data-options]` data attribute:
{{project name - title case}} also lets you override global settings on a link-by-link basis using the `[data-options]` data attribute:

```html
// Markup here...
```

### Use NAMESPACE-UP events in your own scripts
### Use {{project name - title case}} events in your own scripts

You can also call NAMESPACE-UP events in your own scripts.
You can also call {{project name - title case}} events in your own scripts.

#### functionName()
Description
Expand All @@ -112,19 +107,19 @@ Description
```

#### destroy()
Destroy the current `NAMESPACE-LOW.init()`. This is called automatically during the init function to remove any existing initializations.
Destroy the current `{{project name - lowercase}}.init()`. This is called automatically during the `init` function to remove any existing initializations.

```javascript
NAMESPACE-LOW.destroy();
{{project name - lowercase}}.destroy();
```



## Browser Compatibility

NAMESPACE-UP works in all modern browsers, and IE 9 and above.
{{project name - title case}} works in all modern browsers, and IE 9 and above.

NAMESPACE-UP is built with modern JavaScript APIs, and uses progressive enhancement. If the JavaScript file fails to load, or if your site is viewed on older and less capable browsers, all content will be displayed by default.
{{project name - title case}} is built with modern JavaScript APIs, and uses progressive enhancement. If the JavaScript file fails to load, or if your site is viewed on older and less capable browsers, all content will be displayed by default.



Expand Down
77 changes: 47 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ gulp-boilerplate/
| | |—— _mixins.scss
| | |—— components/
| | | |—— myplugin.scss
| |—— img/
| | |—— # static files and folders
| |—— svg/
| | |—— # svgs
|—— test/
Expand Down Expand Up @@ -126,6 +128,14 @@ Gulp Boilerplate is set up for unit testing with [Jasmine](http://jasmine.github

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`.

### Images

Image files placed in the `src` > `img` directory will be copied as-is into the `dist` > `img` directory. While you can add image optimization processes to Gulp, I find that tools like [ImageOptim](https://imageoptim.com/) and [b64.io](http://b64.io/) do a better job.

### Static Files

Files and folders placed in the `src` > `static` directory will be copied as-is into the `dist` directory.

### SVGs

SVG files placed in the `src/svg` directory will be optimized with SVGO and compiled into `dist/svg` as-is.
Expand Down Expand Up @@ -155,34 +165,41 @@ Inside `gulpfile.js` you'll see a variable named `paths`. Adjust the paths to su

```js
var paths = {
input: 'src/**/*',
output: 'dist/',
scripts: {
input: 'src/js/*',
output: 'dist/js/'
},
styles: {
input: 'src/sass/**/*.{scss,sass}',
output: 'dist/css/'
},
svgs: {
input: 'src/svg/**/*.svg',
output: 'dist/svg/'
},
static: 'src/static/**',
test: {
input: 'src/js/**/*.js',
karma: 'test/karma.conf.js',
spec: 'test/spec/**/*.js',
coverage: 'test/coverage/',
results: 'test/results/'
},
docs: {
input: 'src/docs/*.{html,md,markdown}',
output: 'docs/',
templates: 'src/docs/_templates/',
assets: 'src/docs/assets/**'
}
input: 'src/**/*',
output: 'dist/',
scripts: {
input: 'src/js/*',
output: 'dist/js/'
},
styles: {
input: 'src/sass/**/*.{scss,sass}',
output: 'dist/css/'
},
svgs: {
input: 'src/svg/*',
output: 'dist/svg/'
},
images: {
input: 'src/img/*',
output: 'dist/img/'
},
static: {
input: 'src/static/*',
output: 'dist/'
},
test: {
input: 'src/js/**/*.js',
karma: 'test/karma.conf.js',
spec: 'test/spec/**/*.js',
coverage: 'test/coverage/',
results: 'test/results/'
},
docs: {
input: 'src/docs/*.{html,md,markdown}',
output: 'docs/',
templates: 'src/docs/_templates/',
assets: 'src/docs/assets/**'
}
};
```

Expand All @@ -202,7 +219,7 @@ The `.travis.yml` file is pre-configured for the boilerplate's build system. Eve

This boilerplate also works with [Codeship.io](https://codeship.com/).

After you have signed up and connected your repository you will be given options for configuring your tests. In the dropdown labeled `Select your technology to prepopulate basic commands` choose `node.js.` This will cause codeship to run npm install prior to running your tests.
After you have signed up and connected your repository you will be given options for configuring your tests. In the dropdown labeled `Select your technology to prepopulate basic commands` choose `node.js.` This will cause codeship to run npm install prior to running your tests.

Then in the `Configure Test Pipelines` box replace `grunt test` with `gulp test.` Save your settings and make
a commit to your repository. Codeship should then build and test your repository successfully.
Expand All @@ -215,4 +232,4 @@ In lieu of a formal style guide, take care to maintain the existing coding style

## License

The code is available under the [MIT License](LICENSE.md).
The code is available under the [MIT License](LICENSE.md).
2 changes: 1 addition & 1 deletion dist/css/myplugin.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* gulp-boilerplate v4.0.0: My Gulp.js boilerplate for creating new web projects
* gulp-boilerplate v4.1.0: My Gulp.js boilerplate for creating new web projects
* (c) 2016 Chris Ferdinandi
* MIT License
* http://github.com/cferdinandi/Plugin
Expand Down
2 changes: 1 addition & 1 deletion dist/css/myplugin.min.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*! gulp-boilerplate v4.0.0 | (c) 2016 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/Plugin */
/*! gulp-boilerplate v4.1.0 | (c) 2016 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/Plugin */
Loading

0 comments on commit 703eb3e

Please sign in to comment.