Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta information in ComponentConfig #79

Closed
mauroerta opened this issue Sep 21, 2021 · 0 comments · Fixed by #82
Closed

Meta information in ComponentConfig #79

mauroerta opened this issue Sep 21, 2021 · 0 comments · Fixed by #82

Comments

@mauroerta
Copy link
Collaborator

As suggested by Luca it could be useful to have an additional attribute inside the ComponentConfig with additional information of the component such as a description, a category, tags or other meta infos that can be used to document the component or by external plugins.

These information should not be used to stylize the component but only to get additional informations.

To enable this feature it's enough to only edit the type ComponentStyle inside the file packages/spec/src/types/components.ts and add a new attribute called meta:

type ComponentStyle<Props extends Style = Style> = {
  tag?: string;
  style: Style;
  props?: Props;
  meta?: Meta;
};

This Meta type could be or any object type Meta = Record<string, any> or a more strict interface like:

interface Meta {
   name?: string;
   description?: string;
   category?: string;
   tags?: string[];
};
lucacacciarru added a commit to lucacacciarru/morfeo that referenced this issue Sep 23, 2021
@mauroerta mauroerta linked a pull request Sep 23, 2021 that will close this issue
9 tasks
mauroerta added a commit that referenced this issue Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant