Skip to content

Commit b14c0d7

Browse files
committed
Add angular-foundation support
1 parent 9ed52a1 commit b14c0d7

File tree

8 files changed

+87
-11
lines changed

8 files changed

+87
-11
lines changed

app/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ var GulpAngularGenerator = yeoman.generators.Base.extend({
5858
return props.ui.key === 'bootstrap';
5959
};
6060

61+
this._.findWhere(prompts, {name: 'foundationComponents'}).when = function(props) {
62+
return props.ui.key === 'foundation';
63+
};
64+
6165
this.prompt(prompts, function (props) {
6266
if(props.ui.key !== 'bootstrap') {
6367
props.bootstrapComponents = {
@@ -68,6 +72,15 @@ var GulpAngularGenerator = yeoman.generators.Base.extend({
6872
};
6973
}
7074

75+
if(props.ui.key !== 'foundation') {
76+
props.foundationComponents = {
77+
name: null,
78+
version: null,
79+
key: null,
80+
module: null
81+
};
82+
}
83+
7184
this.props = props;
7285
this.config.set('props', this.props);
7386

app/prompts.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,40 @@
234234
}
235235
]
236236
},
237+
{
238+
"type": "list",
239+
"name": "foundationComponents",
240+
"message": "How do you want to implements your Foundation components?",
241+
"choices": [
242+
{
243+
"value": {
244+
"name": "angular-foundation",
245+
"version": "~0.5.1",
246+
"key": "angular-foundation",
247+
"module": "mm.foundation"
248+
},
249+
"name": "Angular Foundation, a set of native AngularJS directives based on Foundation's markup and CSS"
250+
},
251+
{
252+
"value": {
253+
"name": null,
254+
"version": null,
255+
"key": "official",
256+
"module": null
257+
},
258+
"name": "The official jQuery implementation of Foundation"
259+
},
260+
{
261+
"value": {
262+
"name": null,
263+
"version": null,
264+
"key": "none",
265+
"module": null
266+
},
267+
"name": "No JavaScript, just CSS"
268+
}
269+
]
270+
},
237271
{
238272
"type": "list",
239273
"name": "cssPreprocessor",

app/src/format.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = function () {
1818
this.props.resource.module,
1919
this.props.router.module,
2020
this.props.ui.module,
21-
this.props.bootstrapComponents.module
21+
this.props.bootstrapComponents.module,
22+
this.props.foundationComponents.module
2223
]);
2324

2425
this.modulesDependencies = _.chain(ngModules)
@@ -37,6 +38,7 @@ module.exports = function () {
3738
this.props.jQuery.name,
3839
this.props.ui.key,
3940
this.props.bootstrapComponents.key,
41+
this.props.foundationComponents.key,
4042
this.props.cssPreprocessor.key
4143
]
4244
.filter(_.isString)
@@ -86,16 +88,29 @@ module.exports = function () {
8688

8789
// Wiredep exclusions
8890
this.wiredepExclusions = [];
89-
if(this.props.bootstrapComponents.key !== 'official') {
90-
if(this.props.cssPreprocessor.extension === 'scss') {
91-
this.wiredepExclusions.push('/bootstrap-sass-official/');
92-
} else {
93-
this.wiredepExclusions.push('/bootstrap\\.js/');
91+
if (this.props.ui.key === 'bootstrap') {
92+
if(this.props.bootstrapComponents.key !== 'official') {
93+
94+
if(this.props.cssPreprocessor.extension === 'scss') {
95+
this.wiredepExclusions.push('/bootstrap-sass-official/');
96+
} else {
97+
this.wiredepExclusions.push('/bootstrap\\.js/');
98+
}
99+
}
100+
101+
if(this.props.cssPreprocessor.key !== 'css') {
102+
this.wiredepExclusions.push('/bootstrap\\.css/');
103+
}
104+
105+
} else if (this.props.ui.key === 'foundation') {
106+
107+
if(this.props.foundationComponents.key !== 'official') {
108+
this.wiredepExclusions.push('/foundation\\.js/');
109+
}
110+
111+
if(this.props.cssPreprocessor.key !== 'css') {
112+
this.wiredepExclusions.push('/foundation\\.css/');
94113
}
95-
}
96-
if(this.props.cssPreprocessor.key !== 'css') {
97-
this.wiredepExclusions.push('/bootstrap\\.css/');
98-
this.wiredepExclusions.push('/foundation\\.css/');
99114
}
100115

101116
// Format choice UI Framework

app/techs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
"description": "The most advanced responsive front-end framework in the world.",
4242
"logo": "foundation.png"
4343
},
44+
"angular-foundation": {
45+
"title": "Angular Foundation",
46+
"url": "http://pineconellc.github.io/angular-foundation/",
47+
"description": "A set of native AngularJS directives based on Foundation's markup and CSS",
48+
"logo": "angular-foundation.png"
49+
},
4450
"gulp": {
4551
"title": "GulpJS",
4652
"url": "http://gulpjs.com/",

app/templates/_bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"angular-route": "<%= props.angularVersion %>",<% } else if (props.router.name === 'angular-ui-router') { %>
1111
"angular-ui-router": "~0.2.13",<% } if(props.ui.name !== null) { %>
1212
"<%= props.ui.name %>": "<%= props.ui.version %>",<% } if(props.bootstrapComponents && props.bootstrapComponents.name !== null) { %>
13-
"<%= props.bootstrapComponents.name %>": "<%= props.bootstrapComponents.version %>",<% } %>
13+
"<%= props.bootstrapComponents.name %>": "<%= props.bootstrapComponents.version %>",<% } if(props.foundationComponents && props.foundationComponents.name !== null) { %>
14+
"<%= props.foundationComponents.name %>": "<%= props.foundationComponents.version %>",<% } %>
1415
"angular": "<%= props.angularVersion %>"
1516
},
1617
"devDependencies": {
11.3 KB
Loading

test/deps/bower.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"angular-route": "~1.3.4",
1414
"angular-resource": "~1.3.4",
1515
"angular-bootstrap": "~0.12.0",
16+
"angular-foundation": "~0.5.1",
1617
"angular-material": "~0.5.1",
1718
"restangular": "~1.4.0",
1819
"angular-ui-router": "~0.2.13",

test/mock-prompts.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var questions = [
2121
'router',
2222
'ui',
2323
'bootstrapComponents',
24+
'foundationComponents',
2425
'cssPreprocessor'
2526
];
2627

@@ -75,6 +76,10 @@ model.bootstrapComponents.choices.forEach(function(choice) {
7576
model.bootstrapComponents.values[choice.value.key] = choice.value;
7677
});
7778

79+
model.foundationComponents.choices.forEach(function(choice) {
80+
model.foundationComponents.values[choice.value.key] = choice.value;
81+
});
82+
7883
model.cssPreprocessor.choices.forEach(function(choice) {
7984
model.cssPreprocessor.values[choice.value.key] = choice.value;
8085
});
@@ -89,6 +94,7 @@ module.exports = {
8994
router: model.router.values['angular-route'],
9095
ui: model.ui.values.bootstrap,
9196
bootstrapComponents: model.bootstrapComponents.values['ui-bootstrap'],
97+
foundationComponents: model.foundationComponents.values['angular-foundation'],
9298
cssPreprocessor: model.cssPreprocessor.values['node-sass']
9399
},
94100
libRegexp: function(name, version) {

0 commit comments

Comments
 (0)