Skip to content

Commit 24b0a8a

Browse files
committed
Initial commit
0 parents  commit 24b0a8a

36 files changed

+1613
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.jshintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"immed": true,
9+
"indent": 2,
10+
"latedef": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"undef": true,
15+
"unused": true,
16+
"strict": true
17+
}

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- 'iojs'
5+
- '0.12'
6+
- '0.10'

.yo-rc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"generator-generator": {}
3+
}

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# generator-angular-require-fullstack [![Build Status](https://secure.travis-ci.org/fciancio/generator-angular-require-fullstack.png?branch=master)](https://travis-ci.org/fciancio/generator-angular-require-fullstack)
2+
3+
> [Yeoman](http://yeoman.io) generator
4+
5+
## Getting Started
6+
7+
### What is Yeoman?
8+
9+
Trick question. It's not a thing. It's this guy:
10+
11+
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.
12+
13+
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.*
14+
15+
```bash
16+
npm install -g yo
17+
```
18+
### Yeoman Generators
19+
20+
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.
21+
22+
To install generator-angular-require-fullstack from npm, run:
23+
24+
```bash
25+
npm install -g generator-angular-require-fullstack
26+
```
27+
28+
Finally, initiate the generator:
29+
30+
```bash
31+
yo angular require fullstack
32+
```
33+
34+
### Generator info - Monits
35+
36+
This generator was build by Monits. If you'd like to know more about Monits, go to [Monits](http://www.monits.com) or check out our [Blog](https://medium.com/monits-blog)
37+
38+
![](monits_logo.png)
39+
40+
### Getting To Know Yeoman
41+
42+
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.
43+
44+
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).
45+
46+
47+
## License
48+
49+
MIT

app/index.js

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
'use strict';
2+
var yeoman = require('yeoman-generator');
3+
var chalk = require('chalk');
4+
var yosay = require('yosay');
5+
6+
module.exports = yeoman.generators.Base.extend({
7+
initializing: function () {
8+
this.pkg = require('../package.json');
9+
10+
},
11+
constructor: function () {
12+
yeoman.generators.Base.apply(this, arguments);
13+
},
14+
15+
prompting: function () {
16+
var done = this.async();
17+
18+
// Have Yeoman greet the user.
19+
this.log(yosay(
20+
'Welcome to the brilliant ' + chalk.red('AngularRequireFullstack') + ' generator! by ' + chalk.blue('MONITS')
21+
));
22+
23+
this.log(
24+
'I will generate a fullstack structure based on AngularJS + RequireJS, alongside some must-have modules'
25+
);
26+
27+
var prompts = [{
28+
type: 'input',
29+
name: 'projectName',
30+
message: 'Your project name:',
31+
default: this.appname
32+
},{
33+
type: 'confirm',
34+
name: 'continueOption',
35+
message: 'This process may take some time, do you want to continue?',
36+
default: true
37+
}];
38+
39+
this.prompt(prompts, function (props) {
40+
this.props = props;
41+
if (!this.props.continueOption) {
42+
return;
43+
}
44+
45+
this.appname = this.props.projectName;
46+
// To access props later use this.props.someOption;
47+
48+
done();
49+
}.bind(this));
50+
},
51+
52+
writing: {
53+
app: function () {
54+
this.fs.copy(
55+
this.templatePath('_package.json'),
56+
this.destinationPath('package.json')
57+
);
58+
this.fs.copy(
59+
this.templatePath('_bower.json'),
60+
this.destinationPath('bower.json')
61+
);
62+
63+
//Main files
64+
this.fs.copyTpl(
65+
this.templatePath('/scripts/_app.js'),
66+
this.destinationPath('/app/scripts/' + this.appname + '.js'),
67+
this
68+
);
69+
this.fs.copyTpl(
70+
this.templatePath('/scripts/_build.js'),
71+
this.destinationPath('/app/scripts/build.js'),
72+
this
73+
);
74+
this.fs.copyTpl(
75+
this.templatePath('/scripts/_paths.js'),
76+
this.destinationPath('/app/scripts/paths.js'),
77+
this
78+
);
79+
this.fs.copyTpl(
80+
this.templatePath('/scripts/_routes.js'),
81+
this.destinationPath('/app/scripts/routes.js'),
82+
this
83+
);
84+
this.fs.copy(
85+
this.templatePath('Gruntfile.js'),
86+
this.destinationPath('Gruntfile.js')
87+
);
88+
this.fs.copy(
89+
this.templatePath('robots.txt'),
90+
this.destinationPath('/app/robots.txt')
91+
);
92+
93+
//i18n
94+
this.fs.copy(
95+
this.templatePath('/scripts/i18n/*.*'),
96+
this.destinationPath('/app/scripts/i18n/')
97+
);
98+
99+
//Controllers
100+
this.fs.copyTpl(
101+
this.templatePath('/scripts/controllers/_IndexCtrl.js'),
102+
this.destinationPath('/app/scripts/controllers/IndexCtrl.js'),
103+
this
104+
);
105+
this.fs.copyTpl(
106+
this.templatePath('/scripts/controllers/_HomeCtrl.js'),
107+
this.destinationPath('/app/scripts/controllers/HomeCtrl.js'),
108+
this
109+
);
110+
111+
//Directives
112+
this.fs.copyTpl(
113+
this.templatePath('/scripts/directives/_sample.js'),
114+
this.destinationPath('/app/scripts/directives/sample.js'),
115+
this
116+
);
117+
118+
//Services
119+
this.fs.copyTpl(
120+
this.templatePath('/scripts/services/_sampleService.js'),
121+
this.destinationPath('/app/scripts/services/sampleService.js'),
122+
this
123+
);
124+
125+
this.fs.copy(
126+
this.templatePath('/scripts/services/dependencyResolverFor.js'),
127+
this.destinationPath('/app/scripts/services/dependencyResolverFor.js')
128+
);
129+
130+
//Images
131+
this.fs.copy(
132+
this.templatePath('/images/yeoman.png'),
133+
this.destinationPath('/app/images/yeoman.png')
134+
);
135+
136+
//Styles
137+
this.fs.copy(
138+
this.templatePath('/styles/**/*'),
139+
this.destinationPath('/app/styles/')
140+
);
141+
142+
//Views
143+
this.fs.copyTpl(
144+
this.templatePath('_index.html'),
145+
this.destinationPath('/app/index.html'),
146+
this
147+
);
148+
149+
this.fs.copy(
150+
this.templatePath('404.html'),
151+
this.destinationPath('/app/404.html')
152+
);
153+
154+
this.fs.copyTpl(
155+
this.templatePath('/views/_home.html'),
156+
this.destinationPath('/app/views/home.html'),
157+
this
158+
);
159+
160+
//this.gruntfile.insertConfig("compass", "{ watch: { watch: true } }");
161+
},
162+
163+
projectfiles: function () {
164+
this.fs.copy(
165+
this.templatePath('editorconfig'),
166+
this.destinationPath('.editorconfig')
167+
);
168+
this.fs.copy(
169+
this.templatePath('jshintrc'),
170+
this.destinationPath('.jshintrc')
171+
);
172+
}
173+
},
174+
175+
install: function () {
176+
this.installDependencies();
177+
},
178+
179+
end: function () {
180+
this.log('Run ' + chalk.red('grunt serve') + ' to see the app in action or ' + chalk.blue('grunt build') + ' when you are ready to deploy it');
181+
this.log('Visit our blog at ' + chalk.blue('https://medium.com/monits-blog'));
182+
}
183+
});

0 commit comments

Comments
 (0)