Skip to content

Commit 695453f

Browse files
committed
allow for more metadata
1 parent 2448036 commit 695453f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

jsrepo.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,24 +642,32 @@ type Variant = (typeof VARIANTS)[number];
642642
* @param title The title of the component.
643643
* @param description The description of the component.
644644
* @param category The category of the component.
645+
* @param categories Organize the component into multiple categories.
646+
* @param meta Optional meta data for the component.
647+
* @param variants The variants of the component that are available through the registry (default: all variants)
645648
* @returns An array of RegistryItem objects.
646649
*/
647650
function defineComponent({
648651
title,
649652
description,
650653
category,
654+
categories,
655+
meta,
651656
variants = ['JS-CSS', 'JS-TW', 'TS-CSS', 'TS-TW']
652657
}: {
653658
title: string;
654659
description: string;
655660
category: Category;
661+
categories?: string[];
662+
meta?: Record<string, string>;
656663
variants?: readonly Variant[];
657664
}): RegistryItem[] {
658665
const baseItem: Omit<RegistryItem, 'files' | 'name'> = {
659666
title,
660667
description,
661668
type: 'registry:component',
662-
categories: [category]
669+
categories: [category, ...(categories ?? [])],
670+
meta
663671
};
664672

665673
// this might warrant a bit of explanation

0 commit comments

Comments
 (0)