Skip to content

Commit fdc9453

Browse files
committed
Clean configuration and improve readme
Clean configuration, improve readme, write some necessary comments.
1 parent 2624636 commit fdc9453

File tree

20 files changed

+211
-171
lines changed

20 files changed

+211
-171
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ npm install -g yo
1919

2020
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.
2121

22+
### Generator info
23+
24+
The Angular Require Fullstack generator comes to speed up the scaffolding of projects using both AngularJS and RequireJS alongside with some must-have tools/plugins like file revving, i18n, minification of images and files among others.
25+
26+
####Why do we need a generator at all?
27+
Well, unless you like spending time creating the basic structure for each project you start, setting up its configuration and the tools/plugins/frameworks you're going to use, you will agree that those tasks are terrible repetitive, tough, long and on top of that, they have a ROI tending to zero. Using a generator will simplify most of these tasks in seconds.
28+
29+
####Why to use this generator?
30+
We believe that both AngularJS and RequireJS are extremely usefull when building up web applications, and we wanted to use both of them on all of the web projects we develop, but we couldn't find a generator that did these while providing support to file revving and i18n, which we think must be present in any decent web application.
31+
32+
####Who built this generator?
33+
This generator was built 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)
34+
35+
![](monits_logo.png)
36+
37+
### How to use it
38+
2239
To install generator-angular-require-fullstack from npm, run:
2340

2441
```bash
@@ -30,20 +47,14 @@ Finally, initiate the generator:
3047
```bash
3148
yo angular-require-fullstack
3249
```
33-
34-
### Generator info - Monits
35-
36-
This generator was built 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)
50+
It will guide you from there
3951

4052
### Getting To Know Yeoman
4153

4254
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.
4355

4456
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).
4557

46-
4758
## License
4859

4960
MIT

app/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ module.exports = yeoman.generators.Base.extend({
5151

5252
writing: {
5353
app: function () {
54-
this.fs.copy(
54+
this.fs.copyTpl(
5555
this.templatePath('_package.json'),
56-
this.destinationPath('package.json')
56+
this.destinationPath('package.json'),
57+
this
5758
);
58-
this.fs.copy(
59+
this.fs.copyTpl(
5960
this.templatePath('_bower.json'),
60-
this.destinationPath('bower.json')
61+
this.destinationPath('bower.json'),
62+
this
6163
);
6264

6365
//Main files
@@ -166,8 +168,8 @@ module.exports = yeoman.generators.Base.extend({
166168
this.destinationPath('.editorconfig')
167169
);
168170
this.fs.copy(
169-
this.templatePath('jshintrc'),
170-
this.destinationPath('.jshintrc')
171+
this.templatePath('.eslintrc'),
172+
this.destinationPath('.eslintrc')
171173
);
172174
}
173175
},

app/templates/.eslintrc

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"env": {
3+
"browser": true
4+
},
5+
"globals": {
6+
"require": true,
7+
"define": true,
8+
"$": true,
9+
"angular": true,
10+
"moment": true
11+
},
12+
"rules": {
13+
"block-scoped-var": 1,
14+
"brace-style": [2, "1tbs"],
15+
"camelcase": 2,
16+
"comma-style": [2, "last"],
17+
"consistent-this": [0, "self"],
18+
"curly": 2,
19+
"default-case": 2,
20+
"dot-notation": 2,
21+
"eqeqeq": 1,
22+
"func-names": 0,
23+
"func-style": 0,
24+
"guard-for-in": 1,
25+
"key-spacing": 1,
26+
"max-nested-callbacks": [2, 5],
27+
"new-cap": 2,
28+
"new-parens": 1,
29+
"no-alert": 2,
30+
"no-array-constructor": 2,
31+
"no-comma-dangle": 2,
32+
"no-constant-condition": 1,
33+
"no-control-regex": 2,
34+
"no-debugger": 2,
35+
"no-dupe-keys": 1,
36+
"no-empty": 2,
37+
"no-eval": 2,
38+
"no-extra-bind": 1,
39+
"no-extra-parens": 0,
40+
"no-fallthrough": 1,
41+
"no-floating-decimal": 1,
42+
"no-func-assign": 0,
43+
"no-implied-eval": 2,
44+
"no-invalid-regexp": 2,
45+
"no-labels": 2,
46+
"no-lone-blocks": 1,
47+
"no-lonely-if": 1,
48+
"no-mixed-requires": [1, true],
49+
"no-multi-spaces": 1,
50+
"no-multi-str": 1,
51+
"no-native-reassign": 2,
52+
"no-nested-ternary": 2,
53+
"no-new-object": 1,
54+
"no-octal": 2,
55+
"no-redeclare": 1,
56+
"no-script-url": 2,
57+
"no-sequences": 1,
58+
"no-shadow-restricted-names": 0,
59+
"no-space-before-semi": 2,
60+
"no-spaced-func": 2,
61+
"no-ternary": 0,
62+
"no-underscore-dangle": 0,
63+
"no-unreachable": 1,
64+
"no-unused-expressions": 1,
65+
"no-void": 1,
66+
"no-wrap-func": 1,
67+
"one-var": 0,
68+
"quote-props": 0,
69+
"quotes": [1, "single", "avoid-escape"],
70+
"radix": 2,
71+
"semi": 2,
72+
"sort-vars": 0,
73+
"space-after-keywords": [2, "always"],
74+
"space-before-blocks": [1, "always"],
75+
"space-in-brackets": [2, "never"],
76+
"space-in-parens": [2, "never"],
77+
"space-infix-ops": 2,
78+
"space-return-throw-case": 2,
79+
"space-unary-ops": [1, { "words": true, "nonwords": false }],
80+
"spaced-line-comment": ["always", { exceptions: ["-", "#"]}],
81+
"strict": 2,
82+
"use-isnan": 2,
83+
"valid-jsdoc": 0,
84+
"valid-typeof": 1,
85+
"vars-on-top": 0,
86+
"wrap-iife": [2, "inside"],
87+
"wrap-regex": 2,
88+
"yoda": [1, "never"]
89+
}
90+
}

app/templates/Gruntfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env node */
2+
13
module.exports = function (grunt) {
24
'use strict';
35
require('load-grunt-tasks')(grunt);
@@ -9,8 +11,6 @@ module.exports = function (grunt) {
911
dist: 'dist'
1012
};
1113

12-
13-
1414
grunt.initConfig({
1515
yeoman: appConfig,
1616
connect: {
@@ -471,7 +471,7 @@ module.exports = function (grunt) {
471471
grunt.task.run(['serve:' + target]);
472472
});
473473

474-
grunt.registerTask('build', 'Compiles app for production or release candidate', function (target) {
474+
grunt.registerTask('build', 'Compiles app for production or release candidate', function () {
475475
grunt.task.run([
476476
'clean:dist',
477477
// copy stylesheets, in: app/styles/ out: .tmp/styles
@@ -511,4 +511,4 @@ module.exports = function (grunt) {
511511
'newer:eslint',
512512
'build'
513513
]);
514-
};
514+
};

app/templates/_bower.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "package",
2+
"name": "<%= appname %>",
33
"version": "0.0.0",
44
"dependencies": {
55
"angular": "~1.2.0",
@@ -8,12 +8,10 @@
88
"bootstrap-sass-official": "~3.2.0",
99
"angular-route": "~1.2.0",
1010
"moment": "~2.8.3",
11-
"underscore": "~1.7.0",
12-
"requirejs": "~2.1.11"
11+
"requirejs": "~2.1.11",
12+
"angular-translate": "~2.4.2"
1313
},
1414
"devDependencies": {
15-
"jQuery.dotdotdot": "~1.6.16",
16-
"angular-translate": "~2.4.2",
1715
"bootstrap": "~3.3.1"
1816
}
1917
}

app/templates/_package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "package",
2+
"name": "<%= appname %>",
33
"version": "0.0.0",
44
"dependencies": {},
55
"devDependencies": {

app/templates/jshintrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/templates/scripts/_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ define(['routes',
99
'use strict';
1010
var <%= appname %> = angular.module('<%= appname %>', [
1111
'ngRoute',
12-
'pascalprecht.translate',
12+
'pascalprecht.translate'
1313
]);
1414
<%= appname %>
1515
.config(

app/templates/scripts/_build.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global paths */
12
require.config({
23
baseUrl: '/scripts',
34
paths: {
@@ -24,7 +25,7 @@ require.config({
2425
moment: '../../bower_components/moment/moment',
2526
requirejs: '../../bower_components/requirejs/require',
2627
underscore: '../../bower_components/underscore/underscore',
27-
'angular-translate': '../../bower_components/angular-translate/angular-translate',
28+
'angular-translate': '../../bower_components/angular-translate/angular-translate'
2829
},
2930
shim: {
3031
angular: {
@@ -57,7 +58,7 @@ require.config({
5758
deps: [
5859
'angular'
5960
]
60-
},
61+
}
6162
},
6263
packages: [
6364

app/templates/scripts/_paths.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
/* eslint-disable */
2+
//Used by filerev grunt task to output the creation of require-js compatible path mappings
13
var paths = undefined;

0 commit comments

Comments
 (0)