@@ -7,7 +7,7 @@ import { z } from 'zod'
77export const LinkSchema = z . object ( {
88 title : z . string ( ) ,
99 href : z . string ( ) ,
10- icon : z . string ( ) ,
10+ icon : z . string ( ) . optional ( ) ,
1111} )
1212
1313/**
@@ -19,7 +19,7 @@ export type TLinkSchema = {
1919 /** The URL the link points to. */
2020 href : string
2121 /** The icon associated with the link. */
22- icon : string
22+ icon ? : string
2323}
2424
2525/**
@@ -76,7 +76,7 @@ export type GitHubRepositoryAPIResponse = NonNullable<
7676 * Schema for loader options.
7777 */
7878export const LoaderOptions = z . object ( {
79- username : z . string ( ) ,
79+ username : z . string ( ) . optional ( ) ,
8080 debug : z . boolean ( ) ,
8181 orgs : z . array ( z . string ( ) ) . optional ( ) ,
8282 filter : z
@@ -93,12 +93,18 @@ export const LoaderOptions = z.object({
9393 * Schema for loader options.
9494 */
9595export type LoaderOptionsType = {
96- /** The username from GitHub to fetch the repositories from. */
97- username : string
96+ /**
97+ * The username from GitHub to fetch the repositories from.
98+ * At least one of `username`, `orgs` must be present in order to have any content to load.
99+ */
100+ username ?: string
101+ /**
102+ * GitHub organizations to fetch projects from.
103+ * At least one of `username`, `orgs` must be present in order to have any content to load.
104+ */
105+ orgs ?: string [ ]
98106 /** Debug flag - if true, the loader will output debug information. */
99107 debug ?: boolean
100- /** GitHub organizations to fetch projects from. */
101- orgs ?: string [ ]
102108 /** A function to filter out projects. Filtered projects will not be parsed or saved in the collection. */
103109 // eslint-disable-next-line no-unused-vars
104110 filter ?: ( project : GitHubRepositoryAPIResponse ) => boolean
0 commit comments