Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to put each feature in its own file
- Loading branch information
1 parent
41707e6
commit 2851e78
Showing
8 changed files
with
40 additions
and
25 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
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,13 +1,16 @@ | ||
'use strict'; | ||
|
||
const DEFAULTS = { | ||
'application-template-wrapper': true, | ||
'template-only-component-wrapper': true | ||
}; | ||
const glob = require('glob'); | ||
const path = require('path'); | ||
|
||
const NAMES = Object.keys(DEFAULTS).sort(); | ||
const FEATURES_PATH = path.resolve(__dirname, './features'); | ||
const FEATURES = {}; | ||
|
||
module.exports = { | ||
DEFAULTS, | ||
NAMES | ||
}; | ||
glob.sync('*.js', { cwd: FEATURES_PATH }).sort().forEach(filename => { | ||
let key = filename.slice(0, -3); | ||
let value = Object.assign({}, require(`./features/${key}`)); | ||
|
||
FEATURES[key] = Object.freeze(value); | ||
}); | ||
|
||
module.exports = Object.freeze(FEATURES); |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
default: true | ||
}; |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
default: false | ||
}; |
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