This repository has been archived by the owner on Jul 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5865dad
Showing
9 changed files
with
179 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 @@ | ||
* text=auto |
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,2 @@ | ||
node_modules | ||
app/templates |
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,21 @@ | ||
{ | ||
"node": true, | ||
"es5": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": 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,3 @@ | ||
language: node_js | ||
node_js: | ||
- 0.8 |
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 @@ | ||
'use strict'; | ||
|
||
var Generator = module.exports = function () { | ||
var cb = this.async(); | ||
var url = 'https://github.com/h5bp/html5-boilerplate/archive/v4.1.0.tar.gz'; | ||
var ignores = [ | ||
'.git', | ||
'CHANGELOG.md', | ||
'CONTRIBUTING.md', | ||
'LICENSE.md', | ||
'README.md' | ||
]; | ||
|
||
this.prompt([{ | ||
name: 'docs', | ||
message: 'Would you like docs included?', | ||
default: 'y/N' | ||
}], function (err, props) { | ||
if (err) { | ||
return this.emit('error', err); | ||
} | ||
|
||
this.tarball(url, this.sourceRoot(), function () { | ||
if (!/n/i.test(props.docs)) { | ||
this.directory('doc'); | ||
} | ||
|
||
this.directory('css'); | ||
this.directory('img'); | ||
this.directory('js'); | ||
this.expandFiles('*', { | ||
cwd: this.sourceRoot(), | ||
dot: true | ||
}).forEach(function (el) { | ||
if (/n/i.test(props.docs)) { | ||
if (ignores.indexOf(el) === -1) { | ||
this.copy(el, el); | ||
} | ||
} else { | ||
if (el !== '.git') { | ||
this.copy(el, el); | ||
} | ||
} | ||
}, this); | ||
|
||
cb(); | ||
}.bind(this)); | ||
}.bind(this)); | ||
}; | ||
|
||
Generator.name = 'HTML5 Boilerplate'; |
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,40 @@ | ||
{ | ||
"name": "generator-h5bp", | ||
"version": "0.1.0", | ||
"description": "HTML5 Boilerplate generator", | ||
"keywords": [ | ||
"yeoman-generator", | ||
"html", | ||
"boilerplate", | ||
"template" | ||
], | ||
"homepage": "https://github.com/sindresorhus/generator-h5bp", | ||
"bugs": "https://github.com/sindresorhus/generator-h5bp/issues", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
}, | ||
"main": "app/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/sindresorhus/generator-h5bp.git" | ||
}, | ||
"scripts": { | ||
"test": "mocha test/test-*.js" | ||
}, | ||
"dependencies": { | ||
"yeoman-generator": "~0.10.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.8.1" | ||
}, | ||
"engines": { | ||
"node": ">=0.8.0" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT" | ||
} | ||
] | ||
} |
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,16 @@ | ||
# HTML5 Boilerplate generator [![Build Status](https://secure.travis-ci.org/sindresorhus/generator-h5bp.png?branch=master)](http://travis-ci.org/sindresorhus/generator-h5bp) | ||
|
||
Scaffolds out [HTML5 Boilerplate](http://html5boilerplate.com) | ||
|
||
|
||
## Getting started | ||
|
||
- Make sure you have [yo](https://github.com/yeoman/yo) installed: `npm install -g yo` | ||
- Install the generator locally: `npm install generator-h5bp` | ||
- Run: `yo h5bp` | ||
|
||
|
||
## License | ||
|
||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) | ||
(c) [Sindre Sorhus](http://sindresorhus.com) |
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,33 @@ | ||
/*global describe beforeEach it */ | ||
'use strict'; | ||
var path = require('path'); | ||
var helpers = require('yeoman-generator').test; | ||
|
||
describe('H5BP generator', function () { | ||
beforeEach(function(cb) { | ||
var deps = ['../../app', [helpers.createDummyGenerator(), 'h5bp:app']]; | ||
|
||
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
|
||
this.h5bp = helpers.createGenerator('h5bp:app', deps); | ||
cb(); | ||
}.bind(this)); | ||
}); | ||
|
||
it('generates expected files', function (cb) { | ||
var expected = ['index.html', 'README.md']; | ||
|
||
helpers.mockPrompt(this.h5bp, { docs: 'y' }); | ||
|
||
this.h5bp.sourceRoot(path.join(__dirname, 'temp')); | ||
|
||
this.h5bp.run({}, function () { | ||
// TODO: figure out why this doesn't work | ||
//helpers.assertFiles(expected); | ||
cb(); | ||
}); | ||
}); | ||
}); |