oss.sarwagya.wtf

Plugin System

How plugins consume the Software Graph.

Every plugin receives:

SoftwareGraph

Nothing else is required. A plugin should not need to search files or parse source to perform its job.

import type { OntolyPlugin } from "@0xsarwagya/ontoly-core";
 
export const plugin: OntolyPlugin = {
  name: "example",
  version: "1.0.0",
  run: ({ graph }) => ({
    artifacts: [
      {
        path: "graph.json",
        mediaType: "application/json",
        contents: JSON.stringify(graph, null, 2),
      },
    ],
  }),
};

This keeps the compiler narrow and makes everything else replaceable.