Skip to content

craft-hub / saveProjectVisual

Function: saveProjectVisual() ​

saveProjectVisual(projectPath, visual): Promise<{ $schema?: string; capabilities?: { descriptions?: Record<string, string | {[key: string]: string; default: string; }>; disabledPresets?: string[]; hidden?: string[]; inputs?: Record<string, Record<string, { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; omitArgument?: false; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "boolean"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; omitArgument: true; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "boolean"; visibleWhen?: { equals: ...; input: ...; } | ...[]; }>>; operations?: Record<string, { customVersionInput?: string; kind: "release"; prereleaseIdInput?: string; requiredBranch?: string; requiresCleanGit?: boolean; versionInput?: string; workflowPath?: string; }>; skillInputs?: Record<string, Record<string, { default?: string; description?: string | {[key: ...]: ...; default: ...; }; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { default?: string; description?: string | {[key: ...]: ...; default: ...; }; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; }>>; skills?: { disabled?: object[]; disabledPlugins?: string[]; enabled?: object[]; enabledPlugins?: string[]; mode?: "auto" | "manual"; }; }; defaults?: { agent?: string; }; extensions?: Record<string, unknown>; packages?: Record<string, { description?: string | {[key: string]: string; default: string; }; featured?: boolean; hidden?: boolean; order?: number; quickActions?: string[]; readme?: string; }>; project?: { color?: "blue" | "cyan" | "green" | "orange" | "pink" | "purple" | "red" | "yellow"; description?: string | {[key: string]: string; default: string; }; icon?: string; name?: string; quickActions?: string[]; readme?: string; }; version: 1; }>

Defined in: packages/craft-hub/src/config.ts:96

Persist user-selected project visuals in the portable project configuration.

Parameters ​

projectPath ​

string

visual ​

color? ​

"blue" | "cyan" | "green" | "orange" | "pink" | "purple" | "red" | "yellow"

icon? ​

string

Returns ​

Promise<{ $schema?: string; capabilities?: { descriptions?: Record<string, string | {[key: string]: string; default: string; }>; disabledPresets?: string[]; hidden?: string[]; inputs?: Record<string, Record<string, { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: ...]: ...; default: ...; }; flag: string; label?: string | {[key: ...]: ...; default: ...; }; omitArgument?: false; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "boolean"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: ...]: ...; default: ...; }; flag?: undefined; label?: string | {[key: ...]: ...; default: ...; }; omitArgument: true; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "boolean"; visibleWhen?: { equals: ...; input: ...; } | ...[]; }>>; operations?: Record<string, { customVersionInput?: string; kind: "release"; prereleaseIdInput?: string; requiredBranch?: string; requiresCleanGit?: boolean; versionInput?: string; workflowPath?: string; }>; skillInputs?: Record<string, Record<string, { default?: string; description?: string | {[key: ...]: ...; default: ...; }; label?: string | {[key: ...]: ...; default: ...; }; options: (... | ...)[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "select"; visibleWhen?: { equals: ...; input: ...; } | ...[]; } | { default?: string; description?: string | {[key: ...]: ...; default: ...; }; label?: string | {[key: ...]: ...; default: ...; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: ...; input: ...; } | ...[]; type: "text"; visibleWhen?: { equals: ...; input: ...; } | ...[]; }>>; skills?: { disabled?: object[]; disabledPlugins?: string[]; enabled?: object[]; enabledPlugins?: string[]; mode?: "auto" | "manual"; }; }; defaults?: { agent?: string; }; extensions?: Record<string, unknown>; packages?: Record<string, { description?: string | {[key: string]: string; default: string; }; featured?: boolean; hidden?: boolean; order?: number; quickActions?: string[]; readme?: string; }>; project?: { color?: "blue" | "cyan" | "green" | "orange" | "pink" | "purple" | "red" | "yellow"; description?: string | {[key: string]: string; default: string; }; icon?: string; name?: string; quickActions?: string[]; readme?: string; }; version: 1; }>

Released under the MIT License.