Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
  • Loading branch information
lbrunet committed Dec 7, 2014
1 parent 46d1e44 commit fb80be2
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ bower_components/

build/
dist/
.idea/
temp/
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- '0.10'
before_install:
- currentfolder=${PWD##*/}
- if [ "$currentfolder" != 'generator-jolistarter' ]; then cd .. && eval "mv $currentfolder generator-jolistarter" && cd generator-jolistarter; fi
1 change: 1 addition & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
generator-jolistarter
=====================
# generator-jolistarter [![Build Status](https://secure.travis-ci.org/lbrunet/generator-jolistarter.png?branch=master)](https://travis-ci.org/lbrunet/generator-jolistarter)

Scaffolds a standard Symfony2 application with Yeoman
> [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.*

```bash
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-jolistarter from npm, run:

```bash
npm install -g generator-jolistarter
```

Finally, initiate the generator:

```bash
yo jolistarter
```

### 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
62 changes: 62 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = yeoman.generators.Base.extend({
initializing: function () {
this.pkg = require('../package.json');
},

prompting: function () {
var done = this.async();

// Have Yeoman greet the user.
this.log(yosay(
'Welcome to the groundbreaking' + chalk.red('Jolistarter') + ' generator!'
));

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;

done();
}.bind(this));
},

writing: {
app: function () {
this.fs.copy(
this.templatePath('_package.json'),
this.destinationPath('package.json')
);
this.fs.copy(
this.templatePath('_bower.json'),
this.destinationPath('bower.json')
);
},

projectfiles: function () {
this.fs.copy(
this.templatePath('editorconfig'),
this.destinationPath('.editorconfig')
);
this.fs.copy(
this.templatePath('jshintrc'),
this.destinationPath('.jshintrc')
);
}
},

install: function () {
this.installDependencies({
skipInstall: this.options['skip-install']
});
}
});
6 changes: 6 additions & 0 deletions app/templates/_bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "package",
"version": "0.0.0",
"dependencies": {}
}

5 changes: 5 additions & 0 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "package",
"version": "0.0.0",
"dependencies": {}
}
12 changes: 12 additions & 0 deletions app/templates/editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
17 changes: 17 additions & 0 deletions app/templates/jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true
}
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "generator-jolistarter",
"version": "0.0.1",
"description": "Scaffolds a standard Symfony2 application with Yeoman",
"license": "MIT",
"main": "app/index.js",
"repository": "lbrunet/generator-jolistarter",
"author": {
"name": "Laurent Brunet",
"email": "",
"url": "/~https://github.com/lbrunet"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"files": [
"app"
],
"keywords": [
"yeoman-generator"
],
"dependencies": {
"yeoman-generator": "^0.18.0",
"chalk": "^0.5.0",
"yosay": "^0.3.0",
"js-yaml": "^3.2.3"
},
"devDependencies": {
"mocha": "*"
},
"peerDependencies": {
"yo": ">=1.0.0"
}
}
27 changes: 27 additions & 0 deletions test/test-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');

describe('jolistarter:app', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(os.tmpdir(), './temp-test'))
.withOptions({ 'skip-install': true })
.withPrompt({
someOption: true
})
.on('end', done);
});

it('creates files', function () {
assert.file([
'bower.json',
'package.json',
'.editorconfig',
'.jshintrc'
]);
});
});

0 comments on commit fb80be2

Please sign in to comment.