import { defineTemplate } from "../metadata-types.js";
import { codeMetaJsonDataSchema } from "../sources/codemeta-json.js";
import { codemeta } from "./codemeta.js";
//#region src/lib/templates/codemeta-json.ts
/**
* A JSON-friendly derivation of the `codemeta` template.
* Produces the same aggregated metadata but parses it through a strict
* schema,stripping JSON-LD artifacts (like `@context` and `@type`) to yield
* plain JSON suitable for consumption by tools that don't care to understand
* JSON-LD.
*
* This template also provides a handy baseline normalization abstraction for
* the other templates.
*/
const codemetaJson = defineTemplate((context, templateData) => {
	const codemetaTemplateOutput = codemeta(context, templateData);
	return codeMetaJsonDataSchema.parse(codemetaTemplateOutput);
});
//#endregion
export { codemetaJson };
