forked from diegonetto/generator-ionic
-
Notifications
You must be signed in to change notification settings - Fork 0
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 692f195
Showing
15 changed files
with
297 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 = 4 | ||
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": 4, | ||
"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,8 @@ | ||
language: node_js | ||
node_js: | ||
- '0.8' | ||
- '0.10' | ||
before_install: | ||
- currentfolder=${PWD##*/} | ||
- if [ "$currentfolder" != 'generator-ionic' ]; then cd .. && eval "mv $currentfolder generator-ionic" && cd generator-ionic; 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,20 @@ | ||
Copyright 2013 Diego Netto | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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-ionic [](https://travis-ci.org/diegonetto/generator-ionic) | ||
|
||
A generator for [Yeoman](http://yeoman.io). | ||
|
||
|
||
## Getting Started | ||
|
||
### What is Yeoman? | ||
|
||
Trick question. It's not a thing. It's this guy: | ||
|
||
 | ||
|
||
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-ionic from npm, run: | ||
|
||
``` | ||
$ npm install -g generator-ionic | ||
``` | ||
|
||
Finally, initiate the generator: | ||
|
||
``` | ||
$ yo ionic | ||
``` | ||
|
||
### 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 License](http://en.wikipedia.org/wiki/MIT_License) |
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,50 @@ | ||
'use strict'; | ||
var util = require('util'); | ||
var path = require('path'); | ||
var yeoman = require('yeoman-generator'); | ||
|
||
|
||
var IonicGenerator = module.exports = function IonicGenerator(args, options, config) { | ||
yeoman.generators.Base.apply(this, arguments); | ||
|
||
this.on('end', function () { | ||
this.installDependencies({ skipInstall: options['skip-install'] }); | ||
}); | ||
|
||
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); | ||
}; | ||
|
||
util.inherits(IonicGenerator, yeoman.generators.Base); | ||
|
||
IonicGenerator.prototype.askFor = function askFor() { | ||
var cb = this.async(); | ||
|
||
// have Yeoman greet the user. | ||
console.log(this.yeoman); | ||
|
||
var prompts = [{ | ||
type: 'confirm', | ||
name: 'someOption', | ||
message: 'Would you like to enable this option?', | ||
default: true | ||
}]; | ||
|
||
this.prompt(prompts, function (props) { | ||
this.someOption = props.someOption; | ||
|
||
cb(); | ||
}.bind(this)); | ||
}; | ||
|
||
IonicGenerator.prototype.app = function app() { | ||
this.mkdir('app'); | ||
this.mkdir('app/templates'); | ||
|
||
this.copy('_package.json', 'package.json'); | ||
this.copy('_bower.json', 'bower.json'); | ||
}; | ||
|
||
IonicGenerator.prototype.projectfiles = function projectfiles() { | ||
this.copy('editorconfig', '.editorconfig'); | ||
this.copy('jshintrc', '.jshintrc'); | ||
}; |
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 @@ | ||
{ | ||
"name": "package", | ||
"version": "0.0.0", | ||
"dependencies": {} | ||
} | ||
|
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 @@ | ||
{ | ||
"name": "package", | ||
"version": "0.0.0", | ||
"dependencies": {} | ||
} |
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 = 4 | ||
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,21 @@ | ||
{ | ||
"node": 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, | ||
"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,41 @@ | ||
{ | ||
"name": "generator-ionic", | ||
"version": "0.0.0", | ||
"description": "A generator for Yeoman", | ||
"keywords": [ | ||
"yeoman-generator" | ||
], | ||
"homepage": "https://github.com/diegonetto/generator-ionic", | ||
"bugs": "https://github.com/diegonetto/generator-ionic/issues", | ||
"author": { | ||
"name": "Diego Netto", | ||
"email": "[email protected]", | ||
"url": "https://github.com/diegonetto" | ||
}, | ||
"main": "app/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/diegonetto/generator-ionic.git" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"dependencies": { | ||
"yeoman-generator": "~0.14.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.14.0" | ||
}, | ||
"peerDependencies": { | ||
"yo": ">=1.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.8.0", | ||
"npm": ">=1.2.10" | ||
}, | ||
"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,38 @@ | ||
/*global describe, beforeEach, it*/ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var helpers = require('yeoman-generator').test; | ||
|
||
|
||
describe('ionic generator', function () { | ||
beforeEach(function (done) { | ||
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
this.app = helpers.createGenerator('ionic: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.assertFiles(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,11 @@ | ||
/*global describe, beforeEach, it*/ | ||
'use strict'; | ||
|
||
var assert = require('assert'); | ||
|
||
describe('ionic generator', function () { | ||
it('can be imported without blowing up', function () { | ||
var app = require('../app'); | ||
assert(app !== undefined); | ||
}); | ||
}); |