git.iko.soy/purestack-dev/todomvc
on master help sign in
Basic template
commitba699f1b97b8506bfd596ce2b26fb5f33348a3fd authoriko <mail@iko.soy> dateFri 20 Jun 2025, 20:01 (1 year ago) parent7ef6e80
10 files changed+248
.gitignore+12 .helix/languages.toml+4 flake.lock+120 flake.nix+55 index.html+14 packages.dhall+5 spago.dhall+5 src/Backend.purs+11 src/Frontend.purs+11 test/Main.purs+11
.gitignorenew file+12
@@ -0,0 +1,12 @@
1+/bower_components/
2+/node_modules/
3+/.pulp-cache/
4+/output/
5+/generated-docs/
6+/.psc-package/
7+/.psc*
8+/.purs*
9+/.psa*
10+/.spago
11+backend.js
12+frontend.js
.helix/languages.tomlnew file+4
@@ -0,0 +1,4 @@
1+[[language]]
2+name = "nix"
3+auto-format = true
4+formatter = { command = "nixfmt" }
flake.locknew file+120
@@ -0,0 +1,120 @@
1+{
2+ "nodes": {
3+ "flake-compat": {
4+ "flake": false,
5+ "locked": {
6+ "lastModified": 1696426674,
7+ "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
8+ "owner": "edolstra",
9+ "repo": "flake-compat",
10+ "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
11+ "type": "github"
12+ },
13+ "original": {
14+ "owner": "edolstra",
15+ "repo": "flake-compat",
16+ "type": "github"
17+ }
18+ },
19+ "flake-utils": {
20+ "inputs": {
21+ "systems": "systems"
22+ },
23+ "locked": {
24+ "lastModified": 1731533236,
25+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
26+ "owner": "numtide",
27+ "repo": "flake-utils",
28+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
29+ "type": "github"
30+ },
31+ "original": {
32+ "owner": "numtide",
33+ "repo": "flake-utils",
34+ "type": "github"
35+ }
36+ },
37+ "nixpkgs": {
38+ "locked": {
39+ "lastModified": 1750436177,
40+ "narHash": "sha256-eFUa/c9PbojU6FCM0ApWOidagas9Roa1eR9G8ZgPkvs=",
41+ "owner": "NixOS",
42+ "repo": "nixpkgs",
43+ "rev": "6990f4ce664f97b0ded551dbc9d4cccc7940d08d",
44+ "type": "github"
45+ },
46+ "original": {
47+ "owner": "NixOS",
48+ "repo": "nixpkgs",
49+ "type": "github"
50+ }
51+ },
52+ "purescript-overlay": {
53+ "inputs": {
54+ "flake-compat": "flake-compat",
55+ "nixpkgs": [
56+ "nixpkgs"
57+ ],
58+ "slimlock": "slimlock"
59+ },
60+ "locked": {
61+ "lastModified": 1749721661,
62+ "narHash": "sha256-z0Wfm2ThrUilogAeewLf/0Oc2a/4ODrxrA+4NWAdoAQ=",
63+ "owner": "thomashoneyman",
64+ "repo": "purescript-overlay",
65+ "rev": "c73f85b379dcb30f4f3f1bca152b19c880309d01",
66+ "type": "github"
67+ },
68+ "original": {
69+ "owner": "thomashoneyman",
70+ "repo": "purescript-overlay",
71+ "type": "github"
72+ }
73+ },
74+ "root": {
75+ "inputs": {
76+ "flake-utils": "flake-utils",
77+ "nixpkgs": "nixpkgs",
78+ "purescript-overlay": "purescript-overlay"
79+ }
80+ },
81+ "slimlock": {
82+ "inputs": {
83+ "nixpkgs": [
84+ "purescript-overlay",
85+ "nixpkgs"
86+ ]
87+ },
88+ "locked": {
89+ "lastModified": 1688756706,
90+ "narHash": "sha256-xzkkMv3neJJJ89zo3o2ojp7nFeaZc2G0fYwNXNJRFlo=",
91+ "owner": "thomashoneyman",
92+ "repo": "slimlock",
93+ "rev": "cf72723f59e2340d24881fd7bf61cb113b4c407c",
94+ "type": "github"
95+ },
96+ "original": {
97+ "owner": "thomashoneyman",
98+ "repo": "slimlock",
99+ "type": "github"
100+ }
101+ },
102+ "systems": {
103+ "locked": {
104+ "lastModified": 1681028828,
105+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
106+ "owner": "nix-systems",
107+ "repo": "default",
108+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
109+ "type": "github"
110+ },
111+ "original": {
112+ "owner": "nix-systems",
113+ "repo": "default",
114+ "type": "github"
115+ }
116+ }
117+ },
118+ "root": "root",
119+ "version": 7
120+}
flake.nixnew file+55
@@ -0,0 +1,55 @@
1+{
2+ inputs = {
3+ nixpkgs.url = "github:NixOS/nixpkgs";
4+ flake-utils.url = "github:numtide/flake-utils";
5+ purescript-overlay = {
6+ url = "github:thomashoneyman/purescript-overlay";
7+ inputs.nixpkgs.follows = "nixpkgs";
8+ };
9+ };
10+ outputs = { self, nixpkgs, flake-utils, purescript-overlay }:
11+ let supportedSystems = flake-utils.lib.defaultSystems;
12+ in flake-utils.lib.eachSystem supportedSystems (system:
13+ let
14+ pkgs = import nixpkgs {
15+ inherit system;
16+ overlays = [ purescript-overlay.overlays.default ];
17+ };
18+ pc-config = pkgs.writeText "process-compose.yaml" (builtins.toJSON {
19+ version = "0.5";
20+ processes = {
21+ spago-frontend = {
22+ command =
23+ "${pkgs.spago}/bin/spago bundle-app --watch --main Frontend --to frontend.js";
24+ is_tty = true;
25+ };
26+ spago-backend = {
27+ command =
28+ "${pkgs.spago}/bin/spago bundle-app --watch --main Backend --to backend.js";
29+ is_tty = true;
30+ };
31+ bun = { command = "${pkgs.bun}/bin/bun run --watch backend.js"; };
32+ };
33+ });
34+ in {
35+ apps = {
36+ dev = {
37+ type = "app";
38+ program = (pkgs.writeScript "process-compose" ''
39+ #!/bin/sh
40+ ${pkgs.process-compose}/bin/process-compose --config ${pc-config} "$@"
41+ '').outPath;
42+ };
43+ };
44+ devShells = {
45+ default = pkgs.mkShell {
46+ buildInputs = with pkgs; [
47+ purescript
48+ spago
49+ nodePackages_latest.purs-tidy
50+ nodePackages_latest.purescript-language-server
51+ ];
52+ };
53+ };
54+ });
55+}
index.htmlnew file+14
@@ -0,0 +1,14 @@
1+<!DOCTYPE html>
2+<html lang="en">
3+ <head>
4+ <meta charset="UTF-8">
5+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7+ <title>PureStack</title>
8+ </head>
9+ <body>
10+ <div id="plum"></div>
11+ <script src="frontend.js"></script>
12+ </body>
13+</html>
14+
packages.dhallnew file+5
@@ -0,0 +1,5 @@
1+let upstream =
2+ https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20250618/packages.dhall
3+ sha256:52dddb1212541ee91aa2e360e5fb65914ef7aaefb65ebd7ea9dc291dc8949c19
4+
5+in upstream
spago.dhallnew file+5
@@ -0,0 +1,5 @@
1+{ name = "my-project"
2+, dependencies = [ "console", "effect", "prelude" ]
3+, packages = ./packages.dhall
4+, sources = [ "src/**/*.purs", "test/**/*.purs" ]
5+}
src/Backend.pursnew file+11
@@ -0,0 +1,11 @@
1+module Backend where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Console (log)
7+
8+main :: Effect Unit
9+main = do
10+ log "backend!!!"
11+
src/Frontend.pursnew file+11
@@ -0,0 +1,11 @@
1+module Frontend where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Console (log)
7+
8+main :: Effect Unit
9+main = do
10+ log "frontend"
11+
test/Main.pursnew file+11
@@ -0,0 +1,11 @@
1+module Test.Main where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Class.Console (log)
7+
8+main :: Effect Unit
9+main = do
10+ log "🍝"
11+ log "You should add some tests."