garn version v0.0.18
Release announcement for garn version v0.0.17 and v0.0.18. Includes better Haskell support, and less confusing file tracking.
Release: Garn version v0.0.17 and v0.0.18
Progress on Garn has been happening at an astounding pace! The last update from us was only a week ago; since we released two new versions of Garn.
For those of us hearing about it for the first time, Garn is a build tool and environment manager, built with Nix, but configured in Typescript. You can read more about it on the website, or follow the development on GitHub.
If you try out Garn's latest version, we'd love to hear what you thinkj on Discord or GitHub.
Highlights
-
A new edit command. A lot of the power of Garn, where it almost feels like garn.ts files write themselves, comes from IDE integration. Because we use Deno instead of the more traditional Node, a lot of people don't have their editors set up fully yet. We previously had a Garn Executable, editGarnConfig, that you could expose for users. But that had problems, such as being less discoverable, and breaking if your garn.ts file was broken. Now, we made editing a built-in. This means you can just run garn edit and you'll open garn.ts on an editor configured with autocompletion and other features. Currently the only editor option is VSCodium, but we're very open to PRs - see this file.
-
Garn no longer ignores untracked files. Previously you'd get confusing errors about files missing if you hadn't yet git added them. This was because (controversially) Nix behaved similarly. We submitted a patch to Nix, and made Garn already use that patch.
-
Multiple executables in Haskell projects. Previously you needed exactly one executable, which was quite arbitrary and confusing. Now any number of executables, including none, is supported.
-
Make garn init add executables to Haskell projects based on the executables listed in the cabal file.
-
Overriding Haskell dependency versions. Now you can write, for example:
export const project = haskell.mkHaskellProject({ description: "", compiler: "ghc94", src: ".", executables: ["foo"], // This is new overrideDependencies: { "string-conversions": "0.3.0.3", }, })
And you get the correponding version from Hackage, rather than the default one from the package set. This is as easy as Stack, but with the power of Nix.
- garn enter top-level Environments. Previously Environments, unlike everything else, didn't really work at the top-level, and instead had to be part of a Project.
Breaking change
A breaking change is that mkNpmProject and mkYarnProject no longer expose a devShell field, since that was redundant with defaultEnvironment.
Full changelogs
There were quite a number of other changes, here are the full changelogs:
v0.0.18
- Allow entering top-level Environments with garn enter.
- Environment.mkNpmProject and Environment.mkYarnProject don't expose a devShell field anymore, since that was a duplicate of defaultEnvironment.
- Fix jsdocs rendering
- Fix type safety around Executables exported from mkHaskellProject.
v0.0.17
- Fix locale warnings on MacOS
- Make executables a list, and optional, in mkHaskellPackage
- Add addCabalExecutable to Haskell projects
- Make garn init on Haskell projects fill in the executables based on the cabal file.
- For git repositories, add untracked files to build sandboxes for Checks and Packages.
- Tweak the API for creating Environments, making it easier to create Environments that have a source directory
- Fix needing to use -- twice in garn run in order to pass arguments to executables.
- Create a new edit command. This opens VSCodium with deno LSP already set up, in exactly the same way as the old editGarnConfig function did. (That function has now been removed.)
Continue Reading
We've added incremental compilation to garnix. In this blog, we discuss prior art on incremental compilation in Nix, and describe our own design.
A short note about custom typing for functions in Nix