git.iko.soy/rowtype-yoga/purescript-graphql-fundeps
on main help sign in
5 files changed+155−1
since splitsnapshots
unifiedsplit
.envrc+1 .gitignore+4 README.md+38−1 flake.lock+61 flake.nix+51
.envrcnew file+1
@@ -0,0 +1 @@
1+use flake
.gitignore+4
@@ -1,3 +1,7 @@
11.spago/
22output/
33node_modules/
4+.psci_modules
5+
6+# Nix
7+.direnv/
README.md+38−1
@@ -43,7 +43,7 @@ instance graphqlReactFinlandConference ::
4343 }
4444 )
4545
46−client :: GraphQLClient
46+client :: GraphQLClientAff
4747client = graphQL "https://api.react-finland.fi/graphql" [] driver
4848
4949main ∷ Effect Unit
@@ -57,3 +57,40 @@ main =
5757```
5858
5959You can check out the [test](./test/Main.purs) for a full example.
60+
61+## Development
62+
63+You can either use the nix shell, or the npm package.
64+
65+### Nix shell
66+
67+Having set up [flakes](https://nixos.wiki/wiki/Flakes), either using [direnv](https://direnv.net/) (`direnv allow`) or `nix develop`
68+
69+Buliding:
70+
71+```
72+spago build
73+```
74+
75+Testing:
76+
77+```
78+spago -x test.dhall test
79+```
80+
81+
82+### Npm
83+
84+Just run `npm i` and then:
85+
86+Building:
87+
88+```
89+spago build
90+```
91+
92+Testing:
93+
94+```
95+npm run test
96+```
flake.locknew file+61
@@ -0,0 +1,61 @@
1+{
2+ "nodes": {
3+ "easy-purescript-nix": {
4+ "flake": false,
5+ "locked": {
6+ "lastModified": 1686900973,
7+ "narHash": "sha256-9whTjp8BYy8ZzyghhgbawS06/dVESduME3wsdNH/mpk=",
8+ "owner": "justinwoo",
9+ "repo": "easy-purescript-nix",
10+ "rev": "8cf400656945b2f2bacfd6a8775792aa701f60e9",
11+ "type": "github"
12+ },
13+ "original": {
14+ "owner": "justinwoo",
15+ "repo": "easy-purescript-nix",
16+ "type": "github"
17+ }
18+ },
19+ "flake-compat": {
20+ "flake": false,
21+ "locked": {
22+ "lastModified": 1673956053,
23+ "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
24+ "owner": "edolstra",
25+ "repo": "flake-compat",
26+ "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
27+ "type": "github"
28+ },
29+ "original": {
30+ "owner": "edolstra",
31+ "repo": "flake-compat",
32+ "type": "github"
33+ }
34+ },
35+ "nixpkgs": {
36+ "locked": {
37+ "lastModified": 1687829761,
38+ "narHash": "sha256-QRe1Y8SS3M4GeC58F/6ajz6V0ZLUVWX3ZAMgov2N3/g=",
39+ "owner": "nixos",
40+ "repo": "nixpkgs",
41+ "rev": "9790f3242da2152d5aa1976e3e4b8b414f4dd206",
42+ "type": "github"
43+ },
44+ "original": {
45+ "owner": "nixos",
46+ "ref": "nixos-23.05",
47+ "repo": "nixpkgs",
48+ "type": "github"
49+ }
50+ },
51+ "root": {
52+ "inputs": {
53+ "easy-purescript-nix": "easy-purescript-nix",
54+ "flake-compat": "flake-compat",
55+ "nixpkgs": "nixpkgs"
56+ }
57+ }
58+ },
59+ "root": "root",
60+ "version": 7
61+}
flake.nixnew file+51
@@ -0,0 +1,51 @@
1+{
2+ inputs = {
3+ nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
4+ easy-purescript-nix = {
5+ url = "github:justinwoo/easy-purescript-nix";
6+ flake = false;
7+ };
8+ flake-compat = {
9+ url = "github:edolstra/flake-compat";
10+ flake = false;
11+ };
12+ };
13+
14+ outputs = { self, nixpkgs, easy-purescript-nix, ... }@inputs:
15+ let
16+ name = "purescript-graphql-fundeps";
17+
18+ supportedSystems = [
19+ "aarch64-darwin"
20+ "x86_64-darwin"
21+ "x86_64-linux"
22+ ];
23+
24+ forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
25+ in
26+ {
27+ devShell = forAllSystems (system:
28+ let
29+ pkgs = import nixpkgs { inherit system; };
30+
31+ easy-ps = import easy-purescript-nix { inherit pkgs; };
32+ in
33+ pkgs.mkShell {
34+ inherit name;
35+ buildInputs = (with pkgs; [
36+ nodejs_20
37+ nixpkgs-fmt
38+ ]) ++ (with easy-ps; [
39+ purs
40+ purs-tidy
41+ psa
42+ spago
43+ purescript-language-server
44+ ]) ++ (pkgs.lib.optionals (system == "aarch64-darwin")
45+ (with pkgs.darwin.apple_sdk.frameworks; [
46+ Cocoa
47+ CoreServices
48+ ]));
49+ });
50+ };
51+}