This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Express 4 Support New naming convention Glob patterns CSS Linting Uglify CSS Min Environmental Asset Management DI Menu System
- Loading branch information
Showing
60 changed files
with
425 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"adjoining-classes": false, | ||
"box-model": false, | ||
"box-sizing": false, | ||
"floats": false, | ||
"font-sizes": false, | ||
"important": false, | ||
"known-properties": false, | ||
"overqualified-elements": false, | ||
"qualified-headings": false, | ||
"regex-selectors": false, | ||
"unique-headings": false, | ||
"universal-selector": false, | ||
"unqualified-attributes": false | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,74 @@ | ||
'use strict'; | ||
|
||
var _ = require('lodash'), | ||
utilities = require('./utilities'); | ||
glob = require('glob'); | ||
|
||
// Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV | ||
process.env.NODE_ENV = ~utilities.walk('./config/env', /(.*)\.js$/).map(function(file) { | ||
return file.split('/').pop().slice(0, -3); | ||
}).indexOf(process.env.NODE_ENV) ? process.env.NODE_ENV : 'development'; | ||
/** | ||
* Before we begin, lets set the envrionment variable | ||
* We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV | ||
*/ | ||
glob('./config/env/' + process.env.NODE_ENV + '.js', { | ||
sync: true | ||
}, function(err, environmentFiles) { | ||
process.env.NODE_ENV = environmentFiles.length ? process.env.NODE_ENV : 'development'; | ||
}); | ||
|
||
// Load app configurations | ||
module.exports = _.extend( | ||
require('./env/all'), | ||
require('./env/' + process.env.NODE_ENV) || {} | ||
); | ||
); | ||
|
||
/** | ||
* Get the modules JavaScript files | ||
*/ | ||
module.exports.getGlobbedFiles = function(globPatterns, removeRoot) { | ||
// For context switching | ||
var _this = this; | ||
|
||
// The output array | ||
var output = []; | ||
|
||
// If glob pattern is array so we use each pattern in a recursive way, otherwise we use glob | ||
if (_.isArray(globPatterns)) { | ||
globPatterns.forEach(function(globPattern) { | ||
output = _.union(output, _this.getGlobbedFiles(globPattern, removeRoot)); | ||
}); | ||
} else if (_.isString(globPatterns)) { | ||
glob(globPatterns, { | ||
sync: true | ||
}, function(err, files) { | ||
if (removeRoot) { | ||
files = files.map(function(file) { | ||
return file.replace(removeRoot, ''); | ||
}); | ||
} | ||
|
||
output = _.union(output, files); | ||
}); | ||
} | ||
|
||
return output; | ||
}; | ||
|
||
/** | ||
* Get the modules JavaScript files | ||
*/ | ||
module.exports.getJavaScriptAssets = function(includeTests) { | ||
var output = this.getGlobbedFiles(this.assets.js, 'public/'); | ||
|
||
// To include tests | ||
if (includeTests) { | ||
output = _.union(output, this.getGlobbedFiles(this.assets.tests)); | ||
} | ||
|
||
return output; | ||
}; | ||
|
||
/** | ||
* Get the modules CSS files | ||
*/ | ||
module.exports.getCSSAssets = function() { | ||
var output = this.getGlobbedFiles(this.assets.css, 'public/'); | ||
return output; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
44bf81a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @revdave33, @gaboesquivel, @kwakayama, @timoweiss, @stefanbuck, @kojiwakayama, @epicwhale, @D1no, @snez:
New major release(0.3) approaching and we wanted to hear your ideas and thoughts before releasing it. A recap of the major changes:
Thank you,
Amos
44bf81a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. I can see how this opens up lots of flexibility. I'm interested to see what you do with the generator.
44bf81a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too. Loving the naming conventions. I still get confused switching between server and client sometimes. So having a .server. in there really helps.
44bf81a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. I like the new naming convention too. Also the new menu service is really useful to separate modules from the core. But one question. Why do you not use an existing acl module like Node ACL? I have no experience with it, but why you should build your own acl module. Use the
node_modules
way 😉44bf81a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍