# Lists the available actions
default:
	@just --list

# Typescript checking
check: deno-check bun-check

# Reformat the code
fmt:
	deno fmt

# Run tests with all the runtimes
test: deno-test bun-test

# Clean up any generated files
clean:
	rm -rf .deno-cover
	rm -rf cover
	rm -rf docs

########################################################################################################################
# Bun-specific commands
########################################################################################################################

# Check code with actual Typescript compiler
bun-check:
	bunx tsc

# Test with bun
bun-test:
	bun test --coverage

# Run with bun
bun-run:
	bun run ./src/scroll.ts

########################################################################################################################
# Deno-specific commands
########################################################################################################################

# Lint code and check types
deno-check:
	deno lint
	deno check --unstable  --all -c deno.jsonc ./src/deno/*.ts ./src/common/*.ts

# Test with deno
deno-test:
	deno test --allow-all

# Create test coverage report with deno
deno-coverage:
	deno test --allow-all --coverage=.deno-cover
	deno coverage --lcov .deno-cover

# Run with deno
deno-run:
	deno run --allow-all --allow-ffi --deny-net --deny-hrtime --unstable ./src/scroll.ts