This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
forked from Plutonomicon/cardano-transaction-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (48 loc) · 1.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SHELL := bash
.ONESHELL:
.PHONY: run-dev run-build check-format format run-datum-cache-postgres-console
query-testnet-tip clean check-explicit-exports
.SHELLFLAGS := -eu -o pipefail -c
ps-sources := $(shell fd -epurs -Etmp)
nix-sources := $(shell fd -enix --exclude='spago*' -Etmp)
hs-sources := $(shell fd . './server/src' './server/exe' -ehs -Etmp)
js-sources := $(shell fd -ejs -Etmp)
ps-entrypoint := Examples.ByUrl # points to one of the example PureScript modules in examples/
ps-bundle = spago bundle-module -m ${ps-entrypoint} --to output.js
node-ipc = $(shell docker volume inspect cardano-transaction-lib_node-ipc | jq -r '.[0].Mountpoint')
run-dev:
@${ps-bundle} && BROWSER_RUNTIME=1 webpack-dev-server --progress
run-build:
@${ps-bundle} && BROWSER_RUNTIME=1 webpack --mode=production
.ONESHELL:
check-explicit-exports:
@if grep -rn '(\.\.)' ${ps-sources}; then
echo "Use explicit imports/exports ^"
exit 1
else
echo "All imports/exports are explicit"
fi
check-format: check-explicit-exports
@purs-tidy check ${ps-sources}
@nixpkgs-fmt --check ${nix-sources}
@fourmolu -m check -o -XTypeApplications -o -XImportQualifiedPost ${hs-sources}
@prettier --loglevel warn -c ${js-sources}
@eslint --quiet ${js-sources}
format:
@purs-tidy format-in-place ${ps-sources}
nixpkgs-fmt ${nix-sources}
fourmolu -m inplace -o -XTypeApplications -o -XImportQualifiedPost ${hs-sources}
prettier -w ${js-sources}
run-datum-cache-postgres-console:
@nix shell nixpkgs#postgresql -c psql postgresql://ctxlib:ctxlib@localhost:5432
query-testnet-tip:
CARDANO_NODE_SOCKET_PATH=${node-ipc}/node.socket cardano-cli query tip \
--testnet-magic 1097911063
clean:
@ rm -rf dist-newstyle || true
@ rm -r .psc-ide-port || true
@ rm -rf .psci_modules || true
@ rm -rf .spago || true
@ rm -rf .spago2nix || true
@ rm -rf node_modules || true
@ rm -rf output || true