diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c6bfb50..e51f1596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## v0.0.20 (unreleased) +## v0.0.21 (unreleased) + +## v0.0.20 +- Remove `sandboxSetup` parameter from `mkEnvironment`, add lower-level + `addToSetup` helper function to use instead. +- Add support for Python projects through `garn.python.mkPythonProject`. ## v0.0.19 @@ -9,9 +14,6 @@ - Add `garn.callFlake` helper to allow importing flake files by local path. - Add `garn.importFlake` helper to allow importing flake files by url, e.g. from GitHub. -- Remove `sandboxSetup` parameter from `mkEnvironment`, add lower-level - `addToSetup` helper function to use instead. - ## v0.0.18 - Allow entering top-level `Environment`s with `garn enter`. diff --git a/README.md b/README.md index 4d2b1a15..f0d89416 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fgarnix-io%2Fgarn)](https://garnix.io) [![](https://dcbadge.vercel.app/api/server/q2Fptb7My4?style=flat)](https://discord.gg/q2Fptb7My4) -[![](https://img.shields.io/badge/library-v0.0.19-black)](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts) +[![](https://img.shields.io/badge/library-v0.0.20-black)](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts) [![License](https://img.shields.io/github/license/garnix-io/garn)](LICENSE)

@@ -32,7 +32,7 @@ works for you, it works for everyone.[^1] For example, with this `garn.ts` file: ```typescript -import * as garn from "https://garn.io/ts/v0.0.19/mod.ts"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; export const frontend = garn.javascript.mkNpmProject({ description: "My project frontend", @@ -185,8 +185,8 @@ directory, which contains tested examples of using **garn** in various ways. All examples below require the two following imports: ```typescript -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"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; +import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; ``` All `garn.ts` files require the first import, and often you also need the @@ -272,7 +272,7 @@ you can also from Nix call things generated by **garn**. ## Typescript API -You can find documentation for the **garn** Deno library [here](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts). +You can find documentation for the **garn** Deno library [here](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts). ## Comparison to other tools diff --git a/examples/getting-started/flake.nix b/examples/getting-started/flake.nix index 8f832066..a8984375 100644 --- a/examples/getting-started/flake.nix +++ b/examples/getting-started/flake.nix @@ -109,9 +109,8 @@ buildInputs = dev.buildInputs ++ dev.nativeBuildInputs; } "${"mkdir -p \$out"} ${" - ${" - echo copying source - cp -r ${(let + echo copying source + cp -r ${(let lib = pkgs.lib; lastSafe = list : if lib.lists.length list == 0 @@ -129,11 +128,11 @@ ${" fileName != "flake.nix" && fileName != "garn.ts"; })}/. . - chmod -R u+rwX . - "} - ${" - echo copying node_modules - cp -r ${let + chmod -R u+rwX . + "} +${" + echo copying node_modules + cp -r ${let npmlock2nix = import npmlock2nix-repo { inherit pkgs; }; @@ -164,11 +163,9 @@ ${" }); nodejs = pkgs.nodejs-18_x; }}/node_modules . - chmod -R u+rwX node_modules - "} - "} -${"npm test"} -"; + chmod -R u+rwX node_modules + "} +${"npm test"}"; } ); devShells = forAllSystems (system: diff --git a/examples/getting-started/garn.ts b/examples/getting-started/garn.ts index 9f33e523..65167628 100644 --- a/examples/getting-started/garn.ts +++ b/examples/getting-started/garn.ts @@ -1,5 +1,5 @@ -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"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; +import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; export const frontend = garn.javascript .mkNpmProject({ diff --git a/flake.nix b/flake.nix index c67d9400..27c84d59 100644 --- a/flake.nix +++ b/flake.nix @@ -167,7 +167,7 @@ installScriptFiles = nix-tool-installer.lib.${system}.mkInstallScriptFiles { toolName = "garn"; baseUrl = "https://garn.io"; - flakeLocation = "github:garnix-io/garn/v0.0.19"; + flakeLocation = "github:garnix-io/garn/v0.0.20"; testCommand = "garn --help"; }; } diff --git a/test/spec/GarnSpec.hs b/test/spec/GarnSpec.hs index faa5fe74..9f10f00b 100644 --- a/test/spec/GarnSpec.hs +++ b/test/spec/GarnSpec.hs @@ -104,12 +104,12 @@ spec = do it "outputs a version with --version" $ \onTestFailureLog -> do output <- runGarn ["--version"] "" repoDir Nothing onTestFailureLog output - when (stdout output /= "v0.0.19\n") $ + when (stdout output /= "v0.0.20\n") $ expectationFailure ( unindent [i| garn --version output wrong: - #{show (stdout output)} /= "v0.0.19\n" + #{show (stdout output)} /= "v0.0.20\n" (consider running `cabal clean`!) |] ) @@ -164,7 +164,7 @@ spec = do `shouldBe` unindent [i| [garn] Error: Version mismatch detected: - garn cli tool version: v0.0.19 + garn cli tool version: v0.0.20 garn typescript library version: Either: @@ -174,8 +174,8 @@ spec = do Or: - Use version v0.0.19 of the typescript library. - E.g.: import * as garn from "https://garn.io/ts/v0.0.19/mod.ts"; + Use version v0.0.20 of the typescript library. + E.g.: import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; (Internal details: Error in $: key \"tag\" not found) |] diff --git a/test/spec/InitSpec.hs b/test/spec/InitSpec.hs index 8e1d9673..f80f5c96 100644 --- a/test/spec/InitSpec.hs +++ b/test/spec/InitSpec.hs @@ -48,8 +48,8 @@ spec = do readFile "garn.ts" `shouldReturn` unindent [i| - 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"; + import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; + import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; export const test = garn.haskell.mkHaskellProject({ description: "", @@ -89,8 +89,8 @@ spec = do readFile "garn.ts" `shouldReturn` unindent [i| - 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"; + import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; + import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; export const someGoProject = garn.go.mkGoProject({ description: "My go project", @@ -161,8 +161,8 @@ spec = do onTestFailureLog output garnFile <- lines <$> readFile "garn.ts" take 2 garnFile - `shouldBe` [ "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\";" + `shouldBe` [ "import * as garn from \"https://garn.io/ts/v0.0.20/mod.ts\";", + "import * as pkgs from \"https://garn.io/ts/v0.0.20/nixpkgs.ts\";" ] forM_ (drop 2 garnFile) $ \line -> when (line /= "") $ diff --git a/ts/environment.ts b/ts/environment.ts index cd3f9fe6..3847a6ad 100644 --- a/ts/environment.ts +++ b/ts/environment.ts @@ -175,7 +175,7 @@ export function check( * * Example: * ```typescript - * import * as pkgs from "https://garn.io/ts/v0.0.19/nixpkgs.ts"; + * import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; * * garn.build` * ${pkgs.cowsay}/bin/cowsay moo > $out/moo @@ -290,7 +290,7 @@ export function mkEnvironment( * * For example: * ```typescript - * import * as pkgs from "https://garn.io/ts/v0.0.19/nixpkgs.ts"; + * import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; * * // Create an environment with nothing but go and gopls installed: * emptyEnvironment.withDevTools([pkgs.go, pkgs.gopls]) diff --git a/ts/internal/version.json b/ts/internal/version.json index 55158f33..3804da3f 100644 --- a/ts/internal/version.json +++ b/ts/internal/version.json @@ -1,5 +1,5 @@ { - "tsLibVersion": "v0.0.19", + "tsLibVersion": "v0.0.20", "nixpkgsInputComment": "pinned to master on 2023-10-26", "nixpkgsInput": "github:NixOS/nixpkgs/6fc7203e423bbf1c8f84cccf1c4818d097612566" } diff --git a/ts/javascript/vite.ts b/ts/javascript/vite.ts index 184df808..666739cc 100644 --- a/ts/javascript/vite.ts +++ b/ts/javascript/vite.ts @@ -18,7 +18,7 @@ import { Plugin } from "../project.ts"; * Here's an example: * * ```typescript - * import * as garn from "https://garn.io/ts/v0.0.19/mod.ts"; + * import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; * * export const frontend = garn.javascript * .mkNpmProject({ diff --git a/ts/project.ts b/ts/project.ts index be86d25c..6e78c064 100644 --- a/ts/project.ts +++ b/ts/project.ts @@ -30,8 +30,8 @@ export type ProjectData = { * Here's an example of a simple `Plugin` and how to use it: * * ```typescript - * 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"; + * import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; + * import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; * * const prettier = * ( diff --git a/website/src/components/Hero/index.tsx b/website/src/components/Hero/index.tsx index 36b87727..f3f51d49 100644 --- a/website/src/components/Hero/index.tsx +++ b/website/src/components/Hero/index.tsx @@ -94,7 +94,7 @@ const garnTs = ( import * as garn from{" "} " - + uses Deno to run 'garn.ts' files. This means you can import dependencies directly through URLs. But you don't need to have Deno installed, takes care of that for you. @@ -109,7 +109,7 @@ of packages, nixpkgs. If you need a tool or dependency, it's probably here`} {" "} - from "https://garn.io/ts/v0.0.19/nixpkgs.ts";
+ from "https://garn.io/ts/v0.0.20/nixpkgs.ts";

export const{" "} diff --git a/website/src/docs/concepts.mdx b/website/src/docs/concepts.mdx index d6e745f0..7bafcd7c 100644 --- a/website/src/docs/concepts.mdx +++ b/website/src/docs/concepts.mdx @@ -18,11 +18,11 @@ of the above entities and give them structure. `Project`s are described at the bottom in the [Projects](#projects) section. All of these concepts are implemented as typescript types. Feel free to browse -the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts) as well. +the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts) as well. ## Environments -(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts/~/Environment).) +(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts/~/Environment).) `Environment`s define what is available to a computation. For example they can contain compilers and developer tools that you want to use on a project, but @@ -42,7 +42,7 @@ what the `Environment`s provide. For example `Check`s, which are our next topic. ## Checks -(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts/~/Check).) +(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts/~/Check).) `Check`s are commands (usually shell commands) that are used to define reproducible, automated tests or other checks. They run in a sandbox, which @@ -65,7 +65,7 @@ configuration. ## Executables -(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts/~/Executable).) +(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts/~/Executable).) `Executable`s are commands (usually shell snippets) that are being run on your local machine (not in a sandbox). They are based on an underlying `Environment`, @@ -81,7 +81,7 @@ and can make use of e.g. the tools that `Environment`s provide. You can use Here's a small example: ```typescript -import * as garn from "https://garn.io/ts/v0.0.19/mod.ts"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; export const hello = garn.emptyEnvironment.shell("echo Hello, world!"); @@ -91,7 +91,7 @@ You can run `Executable`s with `garn run`. ## Packages -(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts/~/Package).) +(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts/~/Package).) `Package`s are instructions to `garn` about how to _build_ a set of files. For example for a Go backend a package would define how to compile it into @@ -107,7 +107,7 @@ You can build `Package`s with `garn build`. ## Projects -(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts/~/Project).) +(See also the [API docs](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts/~/Project).) `Project`s are used to combine `Environment`s, `Check`s, `Executable`s and `Package`s into a single entity. A `Project` can contain any number of these @@ -126,8 +126,8 @@ that contains a few `Check`s and adds a developer tool to its default environment: ```typescript -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"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; +import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; export const project = garn.javascript .mkNpmProject({ diff --git a/website/src/docs/getting_started.mdx b/website/src/docs/getting_started.mdx index 68d3f894..5b20bf2c 100644 --- a/website/src/docs/getting_started.mdx +++ b/website/src/docs/getting_started.mdx @@ -53,7 +53,7 @@ To update garn to a new version you can run: nix profile list # Find the index number of the entry where 'Original flake URL' starts with `github:garnix-io/garn`. nix profile remove -nix profile install github:garnix-io/garn/v0.0.19 +nix profile install github:garnix-io/garn/v0.0.20 ``` ### Manual installation @@ -165,4 +165,4 @@ garn --fish-completion-script (which garn) > ~/.config/fish/completions/garn.fis - [tutorial](/docs/tutorial) - [garn concepts](/docs/concepts) -- [typescript api](https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts) +- [typescript api](https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts) diff --git a/website/src/docs/tutorial.mdx b/website/src/docs/tutorial.mdx index 49cde3d9..606722ef 100644 --- a/website/src/docs/tutorial.mdx +++ b/website/src/docs/tutorial.mdx @@ -27,8 +27,8 @@ construct projects for common stacks, but you can also define these yourself. Here is an example `garn.ts` file for a single node-based project: ```typescript -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"; +import * as garn from "https://garn.io/ts/v0.0.20/mod.ts"; +import * as pkgs from "https://garn.io/ts/v0.0.20/nixpkgs.ts"; export const frontend = garn.javascript.mkNpmProject({ description: "my frontend", diff --git a/website/src/pages/docs.tsx b/website/src/pages/docs.tsx index c58ec99b..dd4e11fa 100644 --- a/website/src/pages/docs.tsx +++ b/website/src/pages/docs.tsx @@ -20,7 +20,7 @@ export const docMenuItems: { name: string; url: string }[] = [ ...docEntries.map(([{ name, url }]) => ({ name, url: `/docs/${url}` })), { name: "typescript api", - url: "https://doc.deno.land/https://garn.io/ts/v0.0.19/mod.ts", + url: "https://doc.deno.land/https://garn.io/ts/v0.0.20/mod.ts", }, ]; diff --git a/website/src/pages/main.tsx b/website/src/pages/main.tsx index 83a25fc6..ebbdd725 100644 --- a/website/src/pages/main.tsx +++ b/website/src/pages/main.tsx @@ -46,7 +46,7 @@ export const Info: React.FC = () => {