Skip to content

0.71.0

Choose a tag to compare

@sigmaSd sigmaSd released this 24 Feb 22:56
· 108 commits to master since this release

Chef now provides an SDK for javascript providers, so they dont need
to write the json RPC code manually (though its not a lot of code)

example of a client using this SDK:

import { runChefProvider } from "jsr:@sigmasd/chef/sdk";
import {
  uninstallScript,
  updateScripts,
  listScripts
} from "./main.ts";

export async function runChefMode() {
  await runChefProvider({
    list: async (_signal: AbortSignal) => {
      const result = await listScripts();
      return result;
    },
    update: async ({ name }: {
      name: string;
      version: string;
      force?: boolean;
      signal: AbortSignal;
    }) => {
      try {
        await updateScripts([name], { "dry-run": false });
        return true;
      } catch {
        return false;
      }
    },
    remove: async (name: string, _signal: AbortSignal) => {
      return await uninstallScript(name, {});
    },
  });
}