Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Commit

Permalink
add back erroneously .gitignored file
Browse files Browse the repository at this point in the history
  • Loading branch information
monte-hayward committed Mar 22, 2017
1 parent fbe742f commit e8f3ab6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions config/generators/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const fs = require('fs');
const componentGenerator = require('./component/index.js');
const containerGenerator = require('./container/index.js');
const pagesGenerator = require('./page/index.js');
const SafeString = require('./utils/safeString').SafeString;

module.exports = (plop) => {
plop.setGenerator('component', componentGenerator);
plop.setGenerator('container', containerGenerator);
plop.setGenerator('page', pagesGenerator);
plop.addHelper('uppercase', text => text.toUpperCase());
plop.addHelper('directory', (comp) => {
try {
fs.accessSync(`app/src/containers/${comp}`, fs.F_OK);
return `containers/${comp}`;
} catch (e) {
return `components/${comp}`;
}
});
plop.addHelper('createImports', (list) => {
const items = list.map(item => `import ${item} from 'grommet/components/${item}';`).join('\n');
return new SafeString(items);
});
plop.addHelper('curly', (object, open) => (open ? '{' : '}'));
};

0 comments on commit e8f3ab6

Please sign in to comment.