Skip to content

craft-hub / parseProjectConfig

Function: parseProjectConfig() ​

parseProjectConfig(content): object

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

Validate project JSONC content with the same parser used for discovery and edits.

Parameters ​

content ​

string

Returns ​

object

$schema? ​

optional $schema?: string

capabilities? ​

optional capabilities?: object

capabilities.descriptions? ​

optional descriptions?: Record<string, string | {[key: string]: string; default: string; }>

capabilities.disabledPresets? ​

optional disabledPresets?: string[]

capabilities.hidden? ​

optional hidden?: string[]

capabilities.inputs? ​

optional inputs?: Record<string, Record<string, { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: string]: string; default: string; }; flag: string; label?: string | {[key: string]: string; default: string; }; options: (string | { arguments?: ...; icon?: ...; label?: ...; omitArgument?: ...; value: ...; })[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "select"; visibleWhen?: { equals: string; input: string; } | object[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: string]: string; default: string; }; flag?: undefined; label?: string | {[key: string]: string; default: string; }; options: (string | { arguments?: ...; icon?: ...; label?: ...; omitArgument?: ...; value: ...; })[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "select"; visibleWhen?: { equals: string; input: string; } | object[]; } | { argumentStyle?: "equals" | "separate"; default?: string; description?: string | {[key: string]: string; default: string; }; flag: string; label?: string | {[key: string]: string; default: string; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "text"; visibleWhen?: { equals: string; input: string; } | object[]; } | { argumentStyle: "positional"; default?: string; description?: string | {[key: string]: string; default: string; }; flag?: undefined; label?: string | {[key: string]: string; default: string; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "text"; visibleWhen?: { equals: string; input: string; } | object[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: string]: string; default: string; }; flag: string; label?: string | {[key: string]: string; default: string; }; omitArgument?: false; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "boolean"; visibleWhen?: { equals: string; input: string; } | object[]; } | { argumentStyle?: undefined; default?: "true" | "false"; description?: string | {[key: string]: string; default: string; }; flag?: undefined; label?: string | {[key: string]: string; default: string; }; omitArgument: true; options?: undefined; pattern?: undefined; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "boolean"; visibleWhen?: { equals: string; input: string; } | object[]; }>>

capabilities.operations? ​

optional operations?: Record<string, { customVersionInput?: string; kind: "release"; prereleaseIdInput?: string; requiredBranch?: string; requiresCleanGit?: boolean; versionInput?: string; workflowPath?: string; }>

capabilities.skillInputs? ​

optional skillInputs?: Record<string, Record<string, { default?: string; description?: string | {[key: string]: string; default: string; }; label?: string | {[key: string]: string; default: string; }; options: (string | { icon?: ...; label?: ...; value: ...; })[]; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "select"; visibleWhen?: { equals: string; input: string; } | object[]; } | { default?: string; description?: string | {[key: string]: string; default: string; }; label?: string | {[key: string]: string; default: string; }; options?: undefined; pattern?: string; private?: boolean; redactInHistory?: boolean; required?: boolean; requiredWhen?: { equals: string; input: string; } | object[]; type: "text"; visibleWhen?: { equals: string; input: string; } | object[]; }>>

capabilities.skills? ​

optional skills?: object

capabilities.skills.disabled? ​

optional disabled?: object[]

capabilities.skills.disabledPlugins? ​

optional disabledPlugins?: string[]

capabilities.skills.enabled? ​

optional enabled?: object[]

capabilities.skills.enabledPlugins? ​

optional enabledPlugins?: string[]

capabilities.skills.mode? ​

optional mode?: "auto" | "manual"

defaults? ​

optional defaults?: object

defaults.agent? ​

optional agent?: string

extensions? ​

optional extensions?: Record<string, unknown>

packages? ​

optional packages?: Record<string, { description?: string | {[key: string]: string; default: string; }; featured?: boolean; hidden?: boolean; order?: number; quickActions?: string[]; readme?: string; }>

project? ​

optional project?: object

project.color? ​

optional color?: "blue" | "cyan" | "green" | "orange" | "pink" | "purple" | "red" | "yellow"

project.description? ​

optional description?: string | {[key: string]: string; default: string; }

project.icon? ​

optional icon?: string

project.name? ​

optional name?: string

project.quickActions? ​

optional quickActions?: string[]

project.readme? ​

optional readme?: string

version ​

version: 1

Released under the MIT License.