-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
42 lines (33 loc) · 966 Bytes
/
Justfile
File metadata and controls
42 lines (33 loc) · 966 Bytes
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
# Generate examples using sqlc-dev
generate: plugin-wasm
cd examples && sqlc-dev -f sqlc.dev.yaml generate
# Compile JavaScript to WASM using javy
# https://github.com/bytecodealliance/javy
# Set JAVY_PATH to the directory containing javy if not in system PATH
plugin-wasm: out-js
#!/usr/bin/env bash
JAVY=javy
if [ -n "$JAVY_PATH" ]; then
JAVY="$JAVY_PATH/javy"
fi
$JAVY build out.js -o examples/plugin.wasm
# Bundle TypeScript to JavaScript using rolldown
out-js: codegen-proto
bun run rolldown -c rolldown.config.ts
# Generate protobuf code using buf
codegen-proto: lint
buf generate --template buf.gen.yaml buf.build/sqlc/sqlc --path plugin/
# Clean build artifacts
clean:
rm -f out.js examples/plugin.wasm
# Format TypeScript
fmt:
bun run oxfmt
# Lint TypeScript
lint:
bun run oxlint --type-aware --type-check
# Run unit tests
test:
bun test
# Build everything from scratch
build: clean generate