-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alex Chaplinsky
committed
Apr 22, 2014
0 parents
commit e4c91fe
Showing
25 changed files
with
339 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,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
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/ | ||
temp/ |
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, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": 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,7 @@ | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
before_install: | ||
- currentfolder=${PWD##*/} | ||
- if [ "$currentfolder" != 'generator-simpleapp' ]; then cd .. && eval "mv $currentfolder generator-simpleapp" && cd generator-simpleapp; fi | ||
|
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,47 @@ | ||
# generator-simpleapp [![Build Status](https://secure.travis-ci.org/alchapone/generator-simpleapp.png?branch=master)](https://travis-ci.org/alchapone/generator-simpleapp) | ||
|
||
> [Yeoman](http://yeoman.io) generator | ||
|
||
## Getting Started | ||
|
||
### What is Yeoman? | ||
|
||
Trick question. It's not a thing. It's this guy: | ||
|
||
![](http://i.imgur.com/JHaAlBJ.png) | ||
|
||
Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create. | ||
|
||
Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.* | ||
|
||
``` | ||
$ npm install -g yo | ||
``` | ||
|
||
### Yeoman Generators | ||
|
||
Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension. | ||
|
||
To install generator-simpleapp from npm, run: | ||
|
||
``` | ||
$ npm install -g generator-simpleapp | ||
``` | ||
|
||
Finally, initiate the generator: | ||
|
||
``` | ||
$ yo simpleapp | ||
``` | ||
|
||
### Getting To Know Yeoman | ||
|
||
Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. | ||
|
||
If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started). | ||
|
||
|
||
## License | ||
|
||
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,68 @@ | ||
'use strict'; | ||
var util = require('util'); | ||
var path = require('path'); | ||
var yeoman = require('yeoman-generator'); | ||
var chalk = require('chalk'); | ||
|
||
|
||
var SimpleappGenerator = yeoman.generators.Base.extend({ | ||
init: function () { | ||
this.pkg = require('../package.json'); | ||
|
||
this.on('end', function () { | ||
if (!this.options['skip-install']) { | ||
this.installDependencies(); | ||
} | ||
}); | ||
}, | ||
|
||
askFor: function () { | ||
var done = this.async(); | ||
|
||
// have Yeoman greet the user | ||
this.log(this.yeoman); | ||
|
||
// replace it with a short and sweet description of your generator | ||
this.log(chalk.magenta('You\'re using the fantastic Simpleapp generator.')); | ||
|
||
var prompts = [{ | ||
name: 'appName', | ||
message: 'What do you wand to call your app?', | ||
}]; | ||
|
||
this.prompt(prompts, function (props) { | ||
this.appName = props.appName; | ||
|
||
done(); | ||
}.bind(this)); | ||
}, | ||
|
||
app: function () { | ||
this.mkdir('app'); | ||
this.mkdir('app/assets/images'); | ||
this.mkdir('app/assets/stylesheets'); | ||
this.mkdir('app/assets/javascripts'); | ||
|
||
this.write('app/assets/javascripts/application.coffee', '# Main CoffeeScript File'); | ||
this.write('app/assets/stylesheets/application.sass', '// Use @import to link all components'); | ||
|
||
this.template('Gruntfile.coffee', 'Gruntfile.coffee'); | ||
this.directory('grunt', 'grunt'); | ||
this.template('index.html', 'app/index.html'); | ||
|
||
this.template('_package.json', 'package.json'); | ||
this.template('_bower.json', 'bower.json'); | ||
}, | ||
|
||
runtime: function () { | ||
this.copy('bowerrc', '.bowerrc'); | ||
this.copy('gitignore', '.gitignore'); | ||
}, | ||
|
||
projectfiles: function () { | ||
this.copy('editorconfig', '.editorconfig'); | ||
this.copy('jshintrc', '.jshintrc'); | ||
} | ||
}); | ||
|
||
module.exports = SimpleappGenerator; |
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,5 @@ | ||
module.exports = (grunt) => | ||
|
||
require('load-grunt-config')(grunt) | ||
|
||
grunt.registerTask 'compile', ['sass:dist','coffee:dist'] |
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,9 @@ | ||
{ | ||
"name": "<%= _.slugify(appName) %>", | ||
"private": true, | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"jquery": "~2.0.0" | ||
}, | ||
"devDependencies": {} | ||
} |
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 @@ | ||
{ | ||
"name": "<%= _.slugify(appName) %>", | ||
"version": "0.0.0", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"load-grunt-config": "0.8.0", | ||
"grunt-contrib-copy": "~0.5.0", | ||
"grunt-contrib-concat": "~0.3.0", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
"grunt-contrib-sass": "~0.7.3", | ||
"grunt-contrib-coffee": "~0.10.1", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-watch": "~0.6.1", | ||
"grunt-autoprefixer": "~0.7.2", | ||
"load-grunt-tasks": "~0.4.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.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,3 @@ | ||
{ | ||
"directory": "bower_components" | ||
} |
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,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
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,5 @@ | ||
.DS_Store | ||
.tmp | ||
.sass-cache | ||
node_modules | ||
bower_components |
Empty file.
Empty file.
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,6 @@ | ||
module.exports = | ||
dist: | ||
options: | ||
bare: true | ||
files: | ||
'.tmp/application.js': ['app/assets/javascripts/**/*.coffee'] |
Empty file.
Empty file.
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,4 @@ | ||
module.exports = | ||
dist: | ||
files: | ||
'.tmp/application.css': 'app/assets/stylesheets/application.sass' |
Empty file.
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 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>SimpleApp</title> | ||
<link rel="stylesheet" href="assets/application.css"> | ||
<script type="text/javascript" src="assets/application.js"></script> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> |
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, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": 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,35 @@ | ||
{ | ||
"name": "generator-simpleapp", | ||
"version": "0.0.0", | ||
"description": "Yeoman generator", | ||
"license": "MIT", | ||
"main": "app/index.js", | ||
"repository": "alchapone/generator-simpleapp", | ||
"author": { | ||
"name": "Alex Chaplinsky", | ||
"email": "alchapone@yandex.ru", | ||
"url": "https://github.com/alchapone" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"files": [ | ||
"app" | ||
], | ||
"keywords": [ | ||
"yeoman-generator" | ||
], | ||
"dependencies": { | ||
"yeoman-generator": "~0.16.0", | ||
"chalk": "~0.4.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
}, | ||
"peerDependencies": { | ||
"yo": ">=1.0.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,36 @@ | ||
/*global describe, beforeEach, it */ | ||
'use strict'; | ||
var path = require('path'); | ||
var helpers = require('yeoman-generator').test; | ||
|
||
describe('simpleapp generator', function () { | ||
beforeEach(function (done) { | ||
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
this.app = helpers.createGenerator('simpleapp:app', [ | ||
'../../app' | ||
]); | ||
done(); | ||
}.bind(this)); | ||
}); | ||
|
||
it('creates expected files', function (done) { | ||
var expected = [ | ||
// add files you expect to exist here. | ||
'.jshintrc', | ||
'.editorconfig' | ||
]; | ||
|
||
helpers.mockPrompt(this.app, { | ||
'someOption': true | ||
}); | ||
this.app.options['skip-install'] = true; | ||
this.app.run({}, function () { | ||
helpers.assertFile(expected); | ||
done(); | ||
}); | ||
}); | ||
}); |
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,10 @@ | ||
/*global describe, beforeEach, it*/ | ||
'use strict'; | ||
var assert = require('assert'); | ||
|
||
describe('simpleapp generator', function () { | ||
it('can be imported without blowing up', function () { | ||
var app = require('../app'); | ||
assert(app !== undefined); | ||
}); | ||
}); |