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

Usage

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

§Namespaces

go
haskell
javascript
nix

§Variables

emptyEnvironment

The empty environment - this Environment has nothing installed in it. It can be easily extended using withDevTools.

javascript.vite

Plugin for vite projects. This will add to your Project:

§Functions

build

Creates a new Package, which will be built using the given shell script. It's run in the emptyEnvironment.

callFlake

Gets apps, checks, dev-shells, and packages from an existing flake file within your current project.

check

Creates a new shell script Check, run in the emptyEnvironment.

deployToGhPages

A garn plugin that allows easy deployment of a package to GitHub pages.

go.mkGoProject

Creates a go-based garn Project.

haskell.mkHaskellProject

Creates a haskell-based garn Project.

importFlake

Gets apps, checks, dev-shells, and packages from an existing flake file by adding it as a flake input to your project.

importFromGithub

Imports a flake file from a GitHub repository.

importFromGitlab

Imports a flake file from a GitLab repository.

importFromSourcehut

Imports a flake file from a SourceHut repository.

javascript.mkNpmProject

Creates a npm-based garn Project.

javascript.mkYarnProject

Creates a yarn-based garn Project.

javascript.prettier

A garn plugin that adds a format Executable that formats your code using prettier, and a Check to verify that your code is formatted.

mkEnvironment

A low-level helper to create new Environments.

mkPackage

A low-level helper to create new Packages from NixExpressions.

mkProject

Creates a new Project.

nix.escapeShellArg
nix.getPathOrError
nix.nixAttrSet

Turns a javascript object of NixExpressions into a Nix attribute set. Filters out undefined values.

nix.nixFlakeDep

Returns a NixExpression that renders as an identifier that refers to a flake input. At the same time it registers the flake input as a dependency, so that it'll be included in the inputs of the generated flake file. See renderFlakeFile for an example.

nix.nixList

Turns a javascript array of NixExpressions into a Nix list.

nix.nixRaw

A template literal function to construct NixExpressions from raw strings.

nix.nixStrLit

Returns a NixExpression which represents a Nix string literal, but with all typescript interpolations properly escaped and interpolated.

nix.renderFlakeFile

Renders the nix expression as the outputs of a flake file with all flake deps provided as inputs.

nix.renderNixExpression

Converts a NixExpression to a string representing that Nix expression.

nix.toHumanReadable

Converts a NixExpression to a (hopefully concise) human readable string with incidental dependencies snipped out with "[...]"

nix.unlinesNixStrings
processCompose

Creates an executable project that runs all specified executables simultaneously using process-compose.

shell

Creates a new shell script Executable, run in the emptyEnvironment.

§Type Aliases

Check

Checks are commands (usually shell commands) that are used to define reproducible automated tests or other checks.

Environment

Environments define what files and tools are available to Executables, Checks and development shells.

Executable

Executables are commands (usually shell snippets) that are being run on your local machine (not in a sandbox).

haskell.HaskellAddenda

Project components returned by mkHaskellProject

ImportedFlake

Methods for obtaining apps, checks, dev-shells, and packages from an imported flake file to include in your garn project.

nix.NixExpression

An opaque type representing a Nix expression.

nix.NixStrLitInterpolatable

A union of types that are allowed to be interpolated into the nixStrLit template literal function. This is also used in some higher level functions, such as Environment.shell.

Package

Packages are instructions to garn about how to build a set of files.

Plugin

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.

Project

A Project is a logical grouping of Packages and Environments. For example, you may have a 'frontend' Project, a 'backend' Project, a 'cli' Project, etc.

ProjectHelpers
RepoConfig

Config for importing flake files from GitHub/GitLab/SourceHut.