Use parseSkirConfig to parse a YAML string into a SkirConfig object. This is a synchronous function that uses a static list of built-in generators. It is suitable when you only need to support the standard generators included in the package.
If the parsing is successful, skirConfig will be defined and errors will be empty. If there are errors (YAML syntax errors, schema validation errors, or missing generator modules), skirConfig will be undefined and the errors array will contain detailed error information including line and column numbers.
import { parseSkirConfig } from "skir";
const yamlCode = `
generators:
- mod: "skir-typescript-gen"
config: {}
`;
const result = parseSkirConfig(yamlCode);
if (result.errors.length > 0) {
console.error("Config errors:", result.errors);
} else {
console.log("Parsed config:", result.skirConfig);
}