Phials plugin documentation
User guide
AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0

parseManifest

Since Plugin API: 1.0.0

Parse and validate a manifest JSON string

Signature

export function parseManifest(json: string): {
    manifest: PluginManifest | null;
    errors: string[];
} {
    let parsed: unknown;
    try {
        parsed = JSON.parse(json);
    }
    catch {
        return { manifest: null, errors: ["Invalid JSON"] };
    }
    const result = validateManifest(parsed);
    if (!result.valid) {
        return { manifest: null, errors: result.errors };
    }
    return { manifest: parsed as PluginManifest, errors: [] };
}