Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export default ({
className = '<%= h.changeCase.lower(component_type).charAt(0) %>-<%= h.changeCase.lower(h.inflection.dasherize(name)) %>',
processingName = className,
context = document,
themeName = '<%= h.themeName %>',
} = {}) => {
once(processingName, `.${className}`, context).forEach((el) => {
// eslint-disable-next-line no-console
console.log(el);
console.log(themeName, el);
});
};
7 changes: 7 additions & 0 deletions packages/kaizen-cg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
const hygen = require("hygen");
const path = require("path");

let themeName = 'kaizenComponent';
const themeIndex = process.argv.indexOf('--theme_name');
if (themeIndex > -1) {
themeName = process.argv[themeIndex + 1];
}

const config = {
templates: `${__dirname}/_templates`,
cwd: __dirname,
Expand All @@ -14,6 +20,7 @@ const config = {
helpers: {
relative: (from, to) => path.relative(from, to),
src: () => process.cwd(),
themeName,
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/kaizen-cg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skilld/kaizen-cg",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"description": "Kaizen component generator",
"bin": "index.js",
"main": "index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ to: <%= h.src() %>/<%= h.changeCase.lower(name) %>/package.json
"browsersync": "yarn run browser-sync start --proxy '127.0.0.1:8888' --files ./dist",
"watch": "cross-env ./node_modules/.bin/webpack -w",
"watch:bs": "cross-env NODE_ENV=development ./node_modules/.bin/run-p browsersync watch",
"cc": "npx @skilld/kaizen-cg",
"cc": "npx @skilld/kaizen-cg --theme_name <%= h.inflection.camelize(name.replace(/ /g, '').replace(/-/g, '_'), true) %>",
"storybook": "start-storybook",
"build-storybook": "build-storybook -c .storybook -o dist/storybook"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kaizen-tg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skilld/kaizen-tg",
"version": "2.0.0-alpha.5",
"version": "2.0.0-alpha.6",
"description": "Kaizen drupal theme generator",
"bin": "index.js",
"main": "index.js",
Expand Down