Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Init bugs (#542)
Browse files Browse the repository at this point in the history
* add bower manifest

* fix readme

* fix tests
  • Loading branch information
gvonkoss committed Aug 15, 2018
1 parent 09d68db commit cccb8ca
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/tasks/boilerplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const buildTree = (root, name) => {
generate('/.circleci/config.yml', template.ciConfigYml()),
generate('/.gitignore', template.gitIgnore()),
generate('/.eslint', template.eslint()),
generate('/bower.json', template.bowerJson(name)),
generate('/main.js', template.mainJs(name)),
generate('/main.scss', template.mainScss(name)),
generate('/origami.json', template.origamiJson(name)),
Expand Down
1 change: 1 addition & 0 deletions templates/boilerplate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
module.exports = {
bowerJson: require('./component-boilerplate/bower-json'),
ciConfigYml: require('./component-boilerplate/ci-config-yml'),
demoJs: require('./component-boilerplate/demo-js'),
demoMustache: require('./component-boilerplate/demo-mustache'),
Expand Down
19 changes: 19 additions & 0 deletions templates/component-boilerplate/bower-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

module.exports = (name) => {
return `{
"name": "${name.original}",
"description": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"build"
],
"main": [
"main.scss",
"main.js"
]
}`;
};
5 changes: 3 additions & 2 deletions templates/component-boilerplate/read-me.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ You must either construct an \`${name.original}\` object or fire the \`o.DOMCont
\`\`\`js
const ${name.camelCase} = require('${name.original}');
const ${name.camelCase} = new ${name.camelCase}();
${name.camelCase}.init();
\`\`\`
#### Firing an oDomContentLoaded event
\`\`\`js
require('${name.original}');
document.addEventListener('DOMContentLoaded', function() {
document.dispatchEvent(new CustomEvent('o.DOMContentLoaded'));
});
Expand Down
4 changes: 3 additions & 1 deletion templates/component-boilerplate/src-sass-mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
module.exports = (name) => {
return `/// Output All oMessage Features
@mixin ${name.camelCase} ($class: '${name.original}') {
.#{$class} {
display: block;
}
}
/// Provide a component specific error message
Expand Down
3 changes: 2 additions & 1 deletion templates/component-boilerplate/test-sass-mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = (name) => {
};
@include expect($selector: false) {
.test-colors {
.test-mixin .${name.original} {
display: block;
}
};
};
Expand Down

0 comments on commit cccb8ca

Please sign in to comment.