This repository has no description
1current_version := `git describe --tags --abbrev=0 | cut -c 2-`
2
3dev:
4 docker compose up -d
5 go mod tidy
6 go fmt
7 go run server/*.go
8
9build output="bin/server":
10 echo "Building version {{current_version}}"
11 just genprisma
12 go mod tidy
13 go build -v -ldflags="-X main.Version={{current_version}}" -o {{output}} server/*.go
14
15
16install:
17 just build
18 cp bin/server ~/.local/bin/notella
19
20updateschema url="https://git.inpt.fr/churros/churros/-/raw/main/packages/db/prisma/schema.prisma":
21 curl -fsSL {{url}} -o schema.prisma
22 sed -i '/^generator .* {/,/^}/d' schema.prisma
23 sed -i '1i\
24 generator goprisma {\n\
25 provider = "go run github.com/steebchen/prisma-client-go"\n\
26 previewFeatures = ["fullTextSearchPostgres", "postgresqlExtensions"]\n\
27 }\
28 ' schema.prisma
29 go run github.com/steebchen/prisma-client-go format
30
31
32genprisma:
33 go get github.com/steebchen/prisma-client-go
34 go run github.com/steebchen/prisma-client-go generate
35
36gen_typescript:
37 bash scripts/sync-event-enum.sh
38 go run scripts/typing.go
39 just gen_typescript_lib_txt
40
41gen_typescript_lib_txt:
42 #!/bin/bash
43 mkdir -p testarea; cd testarea
44 npm init -y
45 jq '.type = "module"' < package.json > package.json.new
46 mv package.json.new package.json
47 cp ../typescript-dist/index.js notella.js
48 echo "import * as notella from './notella.js'; console.log(notella)" > index.js
49 node index.js > lib.txt
50 cp lib.txt ../typescript/lib.txt
51 cd ..
52 rm -rf testarea
53
54generate:
55 just updateschema
56 just gen_typescript
57
58release_typescript:
59 just gen_typescript
60 git add *.ts
61 git commit -m "chore: update typescript types"
62 npm version minor
63 npm publish --access=public
64 git push
65 git push --tags