-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
73 lines (56 loc) · 1.56 KB
/
justfile
File metadata and controls
73 lines (56 loc) · 1.56 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
set dotenv-load := true
set unstable := true
name := "bookfeed"
main := "cmd" / name / "main.go"
out := "dist" / name
root := justfile_directory()
air := if which("air") != "" { which("air") } else { "go run github.com/air-verse/air@latest" }
hardcoverApi := "https://api.hardcover.app/v1/graphql"
export CGO_ENABLED := "0"
# List available recipes
@list:
just --list
# Install frontend dependencies and setup pre-commit hooks
install:
npm install
-npx lefthook install
# Run formatting
fmt *args:
golangci-lint fmt {{ args }}
# Run linting (with fixes enabled)
lint *args:
golangci-lint run --fix {{ args }}
# Clean temporary files/folders
clean:
-rm -r {{ root }}/dist
# Run code generation
generate:
go generate ./...
# Build the app
build OUT=out: generate
go build -o {{ OUT }} {{ main }}
build-all:
goreleaser build --snapshot --clean
# Run the app
run:
go run {{ main }}
# Run the app in dev mode (auto-restart) with air
dev:
{{ air }}
# Run tests
test:
go test ./... -v
# Run TemplUI commands
templui *args:
go run github.com/templui/templui/cmd/templui@latest {{ args }}
# Update all TemplUI components
templui-update:
@just templui -f add $(ls internal/view/components)
@just fmt
# Download the Hardcover GraphQL Schema
schema:
go run github.com/benweint/gquil/cmd/gquil@latest introspection generate-sdl {{ hardcoverApi }} -H "Authorization: {{ env('HARDCOVER_TOKEN') }}" > internal/schema/schema.gql
release-snapshot:
goreleaser release --snapshot --clean
release:
goreleaser release --clean