Skip to content

definePlugin

Import from @varavel/vdl-plugin-sdk.

function definePlugin(handler): VdlPluginHandler;

Wraps a plugin handler so it can be exported as the canonical VDL entry point.

definePlugin is intentionally minimal. It preserves the handler's type information and gives plugin projects a single, explicit pattern for exporting generate from src/index.ts.

Parameters

Parameter Type Description
handler VdlPluginHandler The plugin implementation to expose as the runtime entry point.

Returns

VdlPluginHandler

The same handler function, unchanged.

Example

import { definePlugin } from "@varavel/vdl-plugin-sdk";

export const generate = definePlugin((input) => {
  return {
    files: [
      {
        path: "schema-summary.txt",
        content: `VDL ${input.version}`,
      },
    ],
  };
});