File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/sv/lib/core/addon Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,17 @@ export type Addon<Args extends OptionDefinition> = {
3333 options : Args ;
3434 setup ?: (
3535 workspace : Workspace & {
36+ /** On what official addons does this addon depend on? */
3637 dependsOn : ( name : string ) => void ;
38+
39+ /** Why is this addon not supported?
40+ *
41+ * @example
42+ * if (!kit) unsupported('Requires SvelteKit');
43+ */
3744 unsupported : ( reason : string ) => void ;
45+
46+ /** On what official addons does this addon run after? */
3847 runsAfter : ( addonName : string ) => void ;
3948 }
4049 ) => MaybePromise < void > ;
@@ -103,6 +112,18 @@ export type OptionBuilder<T extends OptionDefinition> = {
103112} ;
104113
105114// Initializing with an empty object is intended given that the starting state _is_ empty.
115+ /**
116+ * Example:
117+ * ```ts
118+ * const options = defineAddonOptions()
119+ * .add('demo', {
120+ * question: `Do you want to include a demo? ${style.optional('(includes a login/register page)')}`
121+ * type: 'boolean' | 'string' | 'number' | 'select' | 'multiselect' | 'boolean',
122+ * default: true,
123+ * })
124+ * .build();
125+ * ```
126+ */
106127// eslint-disable-next-line @typescript-eslint/no-empty-object-type
107128export function defineAddonOptions ( ) : OptionBuilder < { } > {
108129 return createOptionBuilder ( { } ) ;
You can’t perform that action at this time.
0 commit comments