Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Plugin

import type { Plugin } from "https://garn.io/ts/v0.0.20/mod.ts";

Plugins automatically add one or more fields to your project. You can use existing plugins to automatically add prepackaged functionality to your Project. declare them manually yourself.

Here's an example of a simple Plugin and how to use it:

import * as garn from "https://garn.io/ts/v0.0.19/mod.ts";
import * as pkgs from "https://garn.io/ts/v0.0.19/nixpkgs.ts";

const prettier =
  (
    globPattern: string,
  ): garn.Plugin<
    { formatCheck: garn.Check; format: garn.Executable },
    garn.ProjectHelpers
  > =>
  (p) =>
    p
      .withDevTools([pkgs.nodePackages.prettier])
      .addCheck("formatCheck", `prettier --check '${globPattern}'`)
      .addExecutable("format", `prettier --write '${globPattern}'`);

export const frontend = garn.javascript
  .mkNpmProject({
    src: ".",
    description: "An NPM frontend",
    nodeVersion: "18",
  })
  .add(prettier("src/*.ts"));
type Plugin<Additions, Dependencies = object> = (project: Dependencies & ProjectData) => Additions;

§Type Parameters

§
Additions
[src]
§
Dependencies = object
[src]

§Type

§
(project: Dependencies & ProjectData) => Additions
[src]