Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.spago/
output/
node_modules/
.psci_modules

# Nix
.direnv/
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ instance graphqlReactFinlandConference ::
}
)

client :: GraphQLClient
client :: GraphQLClientAff
client = graphQL "https://api.react-finland.fi/graphql" [] driver

main ∷ Effect Unit
Expand All @@ -57,3 +57,40 @@ main =
```

You can check out the [test](./test/Main.purs) for a full example.

## Development

You can either use the nix shell, or the npm package.

### Nix shell

Having set up [flakes](https://nixos.wiki/wiki/Flakes), either using [direnv](https://direnv.net/) (`direnv allow`) or `nix develop`

Buliding:

```
spago build
```

Testing:

```
spago -x test.dhall test
```


### Npm

Just run `npm i` and then:

Building:

```
spago build
```

Testing:

```
npm run test
```
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
easy-purescript-nix = {
url = "github:justinwoo/easy-purescript-nix";
flake = false;
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs = { self, nixpkgs, easy-purescript-nix, ... }@inputs:
let
name = "purescript-graphql-fundeps";

supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];

forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
devShell = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };

easy-ps = import easy-purescript-nix { inherit pkgs; };
in
pkgs.mkShell {
inherit name;
buildInputs = (with pkgs; [
nodejs_20
nixpkgs-fmt
]) ++ (with easy-ps; [
purs
purs-tidy
psa
spago
purescript-language-server
]) ++ (pkgs.lib.optionals (system == "aarch64-darwin")
(with pkgs.darwin.apple_sdk.frameworks; [
Cocoa
CoreServices
]));
});
};
}