{"id":16354852,"url":"https://github.com/bryanbuchs/generator-component","last_synced_at":"2025-06-20T13:35:48.185Z","repository":{"id":57677650,"uuid":"488764081","full_name":"bryanbuchs/generator-component","owner":"bryanbuchs","description":"Drupal SDC generator for Yo","archived":false,"fork":false,"pushed_at":"2025-06-11T21:50:14.000Z","size":1474,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T04:06:11.052Z","etag":null,"topics":["drupal","storybook","yo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryanbuchs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-04T22:47:50.000Z","updated_at":"2025-05-19T19:35:24.000Z","dependencies_parsed_at":"2023-10-02T23:14:55.284Z","dependency_job_id":"2a25e436-aa46-4645-9c92-887dd4caa027","html_url":"https://github.com/bryanbuchs/generator-component","commit_stats":{"total_commits":117,"total_committers":3,"mean_commits":39.0,"dds":0.5726495726495726,"last_synced_commit":"25403f25ea3f324327eea4484ce021918608d33e"},"previous_names":["bryanbuchs/generator-drupal-twig-component"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/bryanbuchs/generator-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanbuchs%2Fgenerator-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanbuchs%2Fgenerator-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanbuchs%2Fgenerator-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanbuchs%2Fgenerator-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanbuchs","download_url":"https://codeload.github.com/bryanbuchs/generator-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanbuchs%2Fgenerator-component/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260953732,"owners_count":23088093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","storybook","yo"],"created_at":"2024-10-11T01:37:16.512Z","updated_at":"2025-06-20T13:35:43.169Z","avatar_url":"https://github.com/bryanbuchs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generator-component\n\nGenerates a component directory for use with Storybook + Twig/Drupal\n\n## Requirements\n\nRequires Yeoman\n\n`npm install -g yo`\n\n## Install\n\n`npm i -g @bryanbuchs/generator-component`\n\nOr, to simplify the `yo` command to `component`:\n\n`npm i -g generator-component@npm:@bryanbuchs/generator-component`\n\n## Run\n\nRun the generator from the theme directory, files will be scaffolded into `components/{component-name}`:\n\n1. `yo component` and follow the prompts.\n2. `yo component name` to prefill the name prompt\n3. `yo component group-name` to prefill the name and group prompts (splits on \"-\")\n4. `yo component --js` to prefill \"y\" in the \"Include *.behavior.js file?\"\n\n### Prompts\n\n* `name` - The base name of the component (\"Video\")\n* `group` - The name of the storybook group for the component (\"Media\")\n\nThe `group` and `name` values will be combined to create `component-name` (\"MediaVideo\", \"media-video\")\n\n* `description` - Optional; added as a comment in the story and behavior files\n* `fields` - A list of fieldnames for the component. Added to the story args with default values, output in the twig file, and placeholders in the less file. If a fieldname is plural (\"cards\", \"people\"), it will be treated as an array in story/twig\n* `js` - Boolean flag to add a behavior.js file to the component + library\n* `removePaddings` - Boolean flag to remove paddings from the story parameters\n* `decorator` - Boolean flag to wrap the story output in additional markup\n\n### Output\n\nRunning the generator will create a directory with a series of boilerplate files:\n\n1. `components/{component-name}/{component-name}.stories.js`\n2. `components/{component-name}/{component-name}.twig`\n3. `components/{component-name}/{component-name}.library.js`\n4. `components/{component-name}/{component-name}.less`\n5. `components/{component-name}/{component-name}.behavior.js`\n6. `components/{component-name}/{component-name}.yml`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanbuchs%2Fgenerator-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanbuchs%2Fgenerator-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanbuchs%2Fgenerator-component/lists"}