Skip to content

Commit f0750a5

Browse files
author
Cristian Escudero
committed
Staging version 0.2.0
* development: Dynamically change the routes.js when a new controller is generated Added services/directives scaffolding feature. Create arcconfig file. Bump version to v0.2.0-dev
2 parents b3ce62d + 6bc4dbe commit f0750a5

File tree

17 files changed

+473
-83
lines changed

17 files changed

+473
-83
lines changed

.arcconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"project_id" : "generator-angular-require-fullstack",
3+
"conduit_uri" : "http://ph.monits.com/",
4+
"load": [
5+
"/opt/arc-lint"
6+
]
7+
}

.arclint

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"linters": {
3+
"chmod": {
4+
"type": "chmod"
5+
},
6+
"json": {
7+
"type": "json",
8+
"include": [
9+
"(^\\.arcconfig$)",
10+
"(^\\.arclint$)",
11+
"(^\\.eslintrc$)"
12+
]
13+
},
14+
"merge-conflict": {
15+
"type": "merge-conflict"
16+
},
17+
"spelling": {
18+
"type": "spelling"
19+
},
20+
"eslint": {
21+
"type": "eslint",
22+
"exclude": "(^(_|.*\\/_)[^\\/]+\\.js$)",
23+
"include": "(\\.js$)"
24+
},
25+
"sass": {
26+
"type": "sass",
27+
"include": "(\\.scss$)"
28+
}
29+
}
30+
}
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
{
2-
"env": {
3-
"browser": true
4-
},
5-
"globals": {
6-
"require": true,
7-
"define": true,
8-
"$": true,
9-
"angular": true,
10-
"moment": true
11-
},
122
"rules": {
3+
"array-bracket-spacing": [2, "never"],
134
"block-scoped-var": 1,
145
"brace-style": [2, "1tbs"],
156
"camelcase": 2,
7+
"comma-dangle": 2,
168
"comma-style": [2, "last"],
9+
"computed-property-spacing": [2, "never"],
1710
"consistent-this": [0, "self"],
1811
"curly": 2,
1912
"default-case": 2,
@@ -28,7 +21,6 @@
2821
"new-parens": 1,
2922
"no-alert": 2,
3023
"no-array-constructor": 2,
31-
"no-comma-dangle": 2,
3224
"no-constant-condition": 1,
3325
"no-control-regex": 2,
3426
"no-debugger": 2,
@@ -56,29 +48,28 @@
5648
"no-script-url": 2,
5749
"no-sequences": 1,
5850
"no-shadow-restricted-names": 0,
59-
"no-space-before-semi": 2,
6051
"no-spaced-func": 2,
6152
"no-ternary": 0,
6253
"no-underscore-dangle": 0,
6354
"no-unreachable": 1,
6455
"no-unused-expressions": 1,
6556
"no-void": 1,
66-
"no-wrap-func": 1,
57+
"object-curly-spacing": [2, "never"],
6758
"one-var": 0,
6859
"quote-props": 0,
6960
"quotes": [1, "single", "avoid-escape"],
7061
"radix": 2,
7162
"semi": 2,
63+
"semi-spacing": 2,
7264
"sort-vars": 0,
7365
"space-after-keywords": [2, "always"],
7466
"space-before-blocks": [1, "always"],
75-
"space-in-brackets": [2, "never"],
7667
"space-in-parens": [2, "never"],
7768
"space-infix-ops": 2,
7869
"space-return-throw-case": 2,
7970
"space-unary-ops": [1, { "words": true, "nonwords": false }],
80-
"spaced-line-comment": ["always", { exceptions: ["-", "#"]}],
81-
"strict": 2,
71+
"spaced-comment": 2,
72+
"strict": [2, "global"],
8273
"use-isnan": 2,
8374
"valid-jsdoc": 0,
8475
"valid-typeof": 1,

.jshintrc

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

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Angular Require Fullstack generator comes to speed up the scaffolding of pro
2727
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, time-consuming and on top of that, they have a ROI tending to zero. Using a generator will simplify most of these tasks, and will get them done in seconds.
2828

2929
####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. If this isn't enough for you to consider this generator, you might reconsider it if we tell you that it will provide you dependency lazy loading.
30+
We believe that both AngularJS and RequireJS are extremely useful 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. If this isn't enough for you to consider this generator, you might reconsider it if we tell you that it will provide you dependency lazy loading.
3131

3232
####Who built this generator?
3333
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)
@@ -47,7 +47,15 @@ Finally, initiate the generator:
4747
```bash
4848
yo angular-require-fullstack
4949
```
50-
It will guide you from there
50+
It will guide you from there.
51+
52+
Also, you can create your own services/directives/controllers using our templates by doing:
53+
54+
```bash
55+
yo angular-require-fullstack:whatiwant
56+
```
57+
58+
Replace `whatiwant` with the word `controller`, `service` or `directive` as you need. The rest is straightforward.
5159

5260
### Getting To Know Yeoman
5361

app/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = yeoman.generators.Base.extend({
6262
this
6363
);
6464

65-
//Main files
65+
// Main files
6666
this.fs.copyTpl(
6767
this.templatePath('/scripts/_app.js'),
6868
this.destinationPath('/app/scripts/' + this.appname + '.js'),
@@ -92,13 +92,13 @@ module.exports = yeoman.generators.Base.extend({
9292
this.destinationPath('/app/robots.txt')
9393
);
9494

95-
//i18n
95+
// i18n
9696
this.fs.copy(
9797
this.templatePath('/scripts/i18n/*.*'),
9898
this.destinationPath('/app/scripts/i18n/')
9999
);
100100

101-
//Controllers
101+
// Controllers
102102
this.fs.copyTpl(
103103
this.templatePath('/scripts/controllers/_IndexCtrl.js'),
104104
this.destinationPath('/app/scripts/controllers/IndexCtrl.js'),
@@ -110,14 +110,14 @@ module.exports = yeoman.generators.Base.extend({
110110
this
111111
);
112112

113-
//Directives
113+
// Directives
114114
this.fs.copyTpl(
115115
this.templatePath('/scripts/directives/_sample.js'),
116116
this.destinationPath('/app/scripts/directives/sample.js'),
117117
this
118118
);
119119

120-
//Services
120+
// Services
121121
this.fs.copyTpl(
122122
this.templatePath('/scripts/services/_sampleService.js'),
123123
this.destinationPath('/app/scripts/services/sampleService.js'),
@@ -129,19 +129,19 @@ module.exports = yeoman.generators.Base.extend({
129129
this.destinationPath('/app/scripts/services/dependencyResolverFor.js')
130130
);
131131

132-
//Images
132+
// Images
133133
this.fs.copy(
134134
this.templatePath('/images/yeoman.png'),
135135
this.destinationPath('/app/images/yeoman.png')
136136
);
137137

138-
//Styles
138+
// Styles
139139
this.fs.copy(
140140
this.templatePath('/styles/**/*'),
141141
this.destinationPath('/app/styles/')
142142
);
143143

144-
//Views
144+
// Views
145145
this.fs.copyTpl(
146146
this.templatePath('_index.html'),
147147
this.destinationPath('/app/index.html'),
@@ -159,7 +159,7 @@ module.exports = yeoman.generators.Base.extend({
159159
this
160160
);
161161

162-
//this.gruntfile.insertConfig("compass", "{ watch: { watch: true } }");
162+
// this.gruntfile.insertConfig("compass", "{ watch: { watch: true } }");
163163
},
164164

165165
projectfiles: function () {
@@ -168,7 +168,7 @@ module.exports = yeoman.generators.Base.extend({
168168
this.destinationPath('.editorconfig')
169169
);
170170
this.fs.copy(
171-
this.templatePath('.eslintrc'),
171+
this.templatePath('_.eslintrc'),
172172
this.destinationPath('.eslintrc')
173173
);
174174
}

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-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/scripts/_routes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
'use strict';
2+
13
define([], function() {
2-
'use strict';
34
return {
45
defaultRoutePath: '/',
56
routes: {
67
'/': {
78
templateUrl: '/views/home.html',
89
controller: 'HomeCtrl'
910
}
11+
/* ===== yeoman hook ===== */
12+
/* Do not remove these commented lines! Needed for auto-generation */
1013
}
1114
};
1215
});
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
'use strict';
12
define([], function() {
2-
'use strict';
33

44
return {
5-
WELCOME_MESSAGE: 'Always a pleasure scaffolding your apps'
5+
WELCOME_MESSAGE: 'Always a pleasure scaffolding your apps',
6+
7+
WELCOME_CONTROLLER: 'A new and shiny controller has been made!',
8+
WELCOME_CONTROLLER_FOLLOWUP: 'This is the default view for your controlller. Change it (if you want, of course)!'
69
};
710
});

0 commit comments

Comments
 (0)