@bryanbuchs/generator-component
Version:
CLI tool for Drupal SDC + Storybook components
36 lines (30 loc) • 1.31 kB
YAML
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
name: <%= label %>
group: <%= group %>
# Docs:
# www.drupal.org/docs/develop/theming-drupal/using-single-directory-components/annotated-example-componentyml
# Status can be: "experimental", "stable", "deprecated", "obsolete".
status: experimental
props:
type: object
properties:<% if (fields.length === 0) { %> {}<% } else { %><% fields.forEach(field => { %>
<%= field.name %>:
type: <%= field.type %><% if (field.type === 'array') { %>
items:
type: string<% } %><% }) %><% } %><% if (required.length) { %>
required:<% required.forEach(field => { %>
- <%= field %><% }) %><% } %><% if (slots.length) { %>
slots:<% slots.forEach(slot => { %>
<%= slot.name %>: { }<% }) %><% } %>
<% if (exports.style || exports.script) { %>
libraryOverrides:<% if (exports.style) { %>
css:
component:
<%= exports.style %>: { minified: true }<% } %><% if (exports.script) { %>
js:
<%= exports.script %>: { attributes: { type: module } }<% } %>
dependencies:
<% if (!exports.script) { %># <% } %>- core/drupal
<% if (!exports.script) { %># <% } %>- core/once
# - <%= project %>/LIBRARY
# - core/components.<%= project %>--ANOTHER_COMPONENT<% } %>