Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adambullmer committed Apr 1, 2016
1 parent 42c757d commit 240753c
Show file tree
Hide file tree
Showing 56 changed files with 1,520 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
81 changes: 81 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"disallowKeywords": ["with"],
"disallowKeywordsOnNewLine": ["else"],
"disallowMixedSpacesAndTabs": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowQuotedKeysInObjects": true,
"disallowTrailingWhitespace": true,

"requireCapitalizedConstructors": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
"function",
"switch"
],
"requireMultipleVarDecl": true,
"requirePaddingNewLineAfterVariableDeclaration": true,
"requirePaddingNewLinesAfterBlocks": true,
"requirePaddingNewlinesBeforeKeywords": [
"if",
"for",
"while",
"do",
"switch",
"return",
"try",
"function"
],
"requireSpaceBeforeKeywords": [
"else",
"catch",
"while"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"typeof",
"function"
],
"requireSpaceAfterLineComment": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceBeforeBinaryOperators": true,
"requireOperatorBeforeLineBreak": [
"?",
"=",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],

"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeObjectValues": true,
"requireSpacesInFunction": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"validateIndentation": 4,
"validateLineBreaks": "LF"
}
56 changes: 56 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"bitwise" : false,
"curly" : true,
"eqeqeq" : true,
"es3" : false,
"forin" : true,
"iterator" : true,
"latedef" : "nofunc",
"maxerr" : 100,
"noarg" : true,
"nonew" : true,
"regexp" : true,
"smarttabs" : true,
"shadow" : true,
"singleGroups" : true,
"strict" : false,
"undef" : true,
"unused" : true,
"varstmt" : false,

"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"esnext" : true,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"lastsemic" : false,
"loopfunc" : false,
"onecase" : false,
"plusplus" : false,
"proto" : false,
"scripturl" : false,
"supernew" : false,
"validthis" : false,

"laxbreak" : true,
"laxcomma" : true,
"sub" : true,
"camelcase" : false,
"indent" : false,
"immed" : false,
"maxlen" : false,
"multistr" : false,
"newcap" : false,
"noempty" : false,
"quotmark" : false,

"browser" : true,
"devel" : false,
"jasmine" : false,
"jquery" : false,
"node" : true
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# angular-bro
Angular app scaffolding and build chain

## Generators
```
yo angular-bro
yo angular-bro:controller name
yo angular-bro:directive name
yo angular-bro:factory name
yo angular-bro:mock path/to/url
yo angular-bro:module name
yo angular-bro:provider name
yo angular-bro:proxy path/to/url http://domain.com/path/to/proxy
yo angular-bro:server
yo angular-bro:service name
yo angular-bro:state name
yo angular-bro:template name
```
146 changes: 146 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
var generators = require('yeoman-generator'),
_ = require('underscore.string');

module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);

this.appName = _.camelize(this.appname);
this.hyphenName = _.dasherize(this.appName);
this.friendlyAppName = _.titleize(_.humanize(this.appName));
},

ask: function () {
var done = this.async(),
prompts = [{
type: 'input',
name: 'appName',
message: 'name',
default: this.hyphenName
}];

this.prompt(prompts, function (props) {
this.appName = props.appName;

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

writing: {
root: function () {
this.fs.copy(
this.templatePath('.jscsrc'),
this.destinationPath('.jscsrc')
);

this.fs.copyTpl(
this.templatePath('bower.json'),
this.destinationPath('bower.json'),
this
);

this.fs.copyTpl(
this.templatePath('Brocfile.js'),
this.destinationPath('Brocfile.js'),
this
);

this.fs.copy(
this.templatePath('circle.yml'),
this.destinationPath('circle.yml')
);

this.fs.copy(
this.templatePath('Gruntfile.js'),
this.destinationPath('Gruntfile.js')
);

this.fs.copyTpl(
this.templatePath('index.html'),
this.destinationPath('index.html'),
this
);

this.fs.copy(
this.templatePath('karma.conf.js'),
this.destinationPath('karma.conf.js')
);

this.fs.copyTpl(
this.templatePath('package.json'),
this.destinationPath('package.json'),
this
);
},

app: function () {
this.fs.copyTpl(
this.templatePath('app/app.js'),
this.destinationPath('app/app.js'),
this
);
},

assets: function () {
this.fs.copy(
this.templatePath('assets/.gitkeep'),
this.destinationPath('assets/.gitkeep')
);
},

config: function () {
this.fs.copy(
this.templatePath('config/environment.js'),
this.destinationPath('config/environment.js')
);
},

styles: function () {
this.fs.copy(
this.templatePath('styles/app.less'),
this.destinationPath('styles/app.less')
);

this.fs.copy(
this.templatePath('styles/_colors.less'),
this.destinationPath('styles/_colors.less')
);

this.fs.copy(
this.templatePath('styles/_mixins.less'),
this.destinationPath('styles/_mixins.less')
);

this.fs.copy(
this.templatePath('styles/_variables.less'),
this.destinationPath('styles/_variables.less')
);
},

tests: function () {
this.fs.copy(
this.templatePath('tests/e2e/.gitkeep'),
this.destinationPath('tests/e2e/.gitkeep')
);

this.fs.copy(
this.templatePath('tests/helpers/afterAll.js'),
this.destinationPath('tests/helpers/afterAll.js')
);

this.fs.copy(
this.templatePath('tests/helpers/beforeAll.js'),
this.destinationPath('tests/helpers/beforeAll.js')
);

this.fs.copy(
this.templatePath('tests/unit/.gitkeep'),
this.destinationPath('tests/unit/.gitkeep')
);
}
},

end: function () {
this.installDependencies();
}
});
17 changes: 17 additions & 0 deletions generators/app/templates/.jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"validateIndentation": 4,
"validateLineBreaks": "LF",
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
"function",
"switch"
]
}
8 changes: 8 additions & 0 deletions generators/app/templates/Brocfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var AngularApp = require('angular-bro-app'),
app = new AngularApp();

// Use `app.importScript` or `app.importStyle` to add additional
// libraries to the generated output files.


module.exports = app.toTree();
Loading

0 comments on commit 240753c

Please sign in to comment.