2.0.1 • Published 2 years ago
generator-drupal-twig-component v2.0.1
generator-twig-component
Generates a component directory for use with Storybook + Twig/Drupal
Requirements
Requires Yeoman
npm install -g yo
Install
npm i -g git@github.com:bryanbuchs/generator-twig-component.git
(@TODO: publish to NPM)
Run
yo twig-component {component-name}
or yo twig-component
and follow the prompts.
Options
Variants
yo twig-component {component-name} {n}
to generate n
story variants beyond the default export, or enter the count at the prompt
Drupal Behaviors
yo twig-component {component-name} --js
to include a *.behavior.js
file in your component, or enter "Y" at the prompt
Output
Running the generator will create a directory with a series of boilerplate files:
{component-name}/{component-name}.less
{component-name}/{component-name}.library.js
{component-name}/{component-name}.stories.js
{component-name}/{component-name}.twig
{component-name}/{component-name}.behavior.js
(optional)