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.16/mod.ts";

§Namespaces

go
haskell
javascript
nix

§Variables

editGarnConfig

This is an Executable that will open a new vscodium editor that is preconfigured to provide a pleasant editing experience for garn.ts files.

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.

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.

javascript.mkNpmProject

Creates a npm-based garn Project.

javascript.mkYarnProject

Creates a yarn-based garn Project.

mkEnvironment

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

mkPackage

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

mkProject

Creates a new Project.

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 "[...]"

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).

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