Skip to content

Commit a411f91

Browse files
update to stable spago on node
1 parent acca6cf commit a411f91

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The overlay is tested on the following architectures:
2222

2323
The included overlay inserts the latest stable and unstable executables into your packages (ie. `purs`, `purs-unstable`, and so on). You can see all specific versions in the [named.json](./manifests/named.json) file. It also provides many versions of each executable under a `-bin` namespace (ie. `purs-bin`, `spago-bin`, and so on) so you can access specific versions of a tool. For example, you can use `purs-bin.purs-0_15_8` to get the 0.15.8 PureScript compiler. These are tracked in the [manifests](./manifests/) directory.
2424

25-
If you're looking for a way to *build* your `spago@next`-based projects using Nix, take a look at https://github.com/jeslie0/mkSpagoDerivation.
25+
If you're looking for a way to *build* your `spago`-based projects using Nix, take a look at https://github.com/jeslie0/mkSpagoDerivation.
2626

2727
## Usage
2828

flake.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,22 @@
100100
VERSION="$(${lib.getExe bin} --version 2>&1)"
101101
fi
102102
103+
# spago 1.x may emit Node experimental warnings; keep first line
104+
if [ ${builtins.toString (name == "spago")} ]; then
105+
VERSION_LINE=""
106+
while IFS= read -r line; do
107+
case "$line" in
108+
[0-9]*.[0-9]*)
109+
VERSION_LINE="$line"
110+
break
111+
;;
112+
esac
113+
done <<< "$VERSION"
114+
if [ -n "$VERSION_LINE" ]; then
115+
VERSION="$VERSION_LINE"
116+
fi
117+
fi
118+
103119
# purs-tidy includes a 'v' prefix in its output beginning with version 0.9.0
104120
if [ ${builtins.toString (name == "purs-tidy" && !(lib.versionOlder version "0.9.0"))} ]; then
105121
EXPECTED_VERSION="v${version}"

generate/bin/src/Run.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ writeSpagoUpdates updates = do
298298
Right m1, Right m2 -> Right $ Map.union m1 m2
299299
Left x, _ -> Left x
300300
Right m1, _ -> Right m1
301-
-- For spago, "stable" means pre-spaghetto (< 0.90.0)
302-
minSpaghetto = SemVer { version: fromRight' (\_ -> unsafeCrashWith "bad") (Version.parse "0.90.0"), pre: Nothing }
301+
-- For spago, "stable" means 1.x and newer
302+
minStableSpago = SemVer { version: fromRight' (\_ -> unsafeCrashWith "bad") (Version.parse "1.0.0"), pre: Nothing }
303303
AppM.writeManifest Manifest.spagoManifest newManifest
304304
updateNamedManifest Spago (Map.keys newManifest) $
305-
Set.filter (_ < minSpaghetto)
305+
Set.filter (\v@(SemVer { pre }) -> v >= minStableSpago && isNothing pre)
306306

307307
writePursTidyUpdates :: NPMRegistryManifest -> AppM Unit
308308
writePursTidyUpdates updates = do

manifests/named.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"purs-stable": "purs-0_15_15",
33
"purs-unstable": "purs-0_15_16-8",
4-
"spago-stable": "spago-0_21_0",
5-
"spago-unstable": "spago-0_93_45",
4+
"spago-stable": "spago-1_0_2",
5+
"spago-unstable": "spago-1_0_2",
66
"purs-tidy-stable": "purs-tidy-0_11_1",
77
"purs-tidy-unstable": "purs-tidy-0_11_1",
88
"purs-backend-es-stable": "purs-backend-es-1_4_3",

manifests/spago.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,5 +434,16 @@
434434
"hash": "sha256-HObabcu18qVQbgg+HwRe64wPTCywJfMzlQqBLww5xfI=",
435435
"url": "https://registry.npmjs.org/spago/-/spago-0.93.45.tgz"
436436
}
437+
},
438+
"1.0.2": {
439+
"depsHash": "sha256-ByCMRkhjFddOKWOgvwCAe874B7FPoirsg/tmzHXmKtM=",
440+
"lockfile": {
441+
"hash": "sha256-RyoIuKcuef+1DHnAoWi0SmxNhCrp4W84ve8hnlMf1M8=",
442+
"url": "https://raw.githubusercontent.com/purescript/spago/fb999755d00551ad9fb479fdcb3bcc9cf1e92d59/package-lock.json"
443+
},
444+
"tarball": {
445+
"hash": "sha256-I6HYzlhXhlhD8PLKHudWwLH3k1DKhjlvXO2Um5UTAq0=",
446+
"url": "https://registry.npmjs.org/spago/-/spago-1.0.2.tgz"
447+
}
437448
}
438449
}

0 commit comments

Comments
 (0)