scroll/justfile

83 lines
1.9 KiB
Makefile
Raw Normal View History

# Lists the available actions
default:
@just --list
2023-11-20 11:12:22 -05:00
# Test coverage
coverage: bun-test deno-coverage
2023-11-02 13:06:48 -04:00
# Typescript checking
check: deno-check bun-check
docs:
2024-07-05 15:51:30 -04:00
deno doc --html --unstable-ffi --name="Scroll" ./src/scroll.ts ./src/common/*.ts ./src/deno/mod.ts ./src/bun/mod.ts
2023-11-02 13:06:48 -04:00
# Reformat the code
fmt:
deno fmt
2023-11-03 11:59:58 -04:00
# Run tests with all the runtimes
2024-07-09 16:12:28 -04:00
test: deno-test tsx-test bun-test
2023-11-03 11:59:58 -04:00
# Run all code-quality related tasks
quality: check test
2023-11-03 11:59:58 -04:00
# Clean up any generated files
clean:
2024-07-05 15:51:30 -04:00
rm -f test.file
2023-11-03 11:59:58 -04:00
rm -rf .deno-cover
rm -rf coverage
2023-11-03 11:59:58 -04:00
rm -rf docs
rm -f scroll.log
rm -f scroll.err
2023-11-29 16:09:58 -05:00
rm -f tsconfig.tsbuildinfo
2023-11-03 11:59:58 -04:00
##########################################################################################
2023-11-03 11:59:58 -04:00
# Bun-specific commands
##########################################################################################
2023-11-03 11:59:58 -04:00
# Check code with actual Typescript compiler
bun-check:
bunx tsc
2023-11-03 11:59:58 -04:00
# Test with bun
bun-test:
bun test --coverage
2023-10-31 14:47:59 -04:00
# Run with bun
bun-run file="":
bun run ./src/scroll.ts {{file}}
2023-10-31 14:47:59 -04:00
##########################################################################################
2023-11-03 11:59:58 -04:00
# Deno-specific commands
##########################################################################################
2023-11-03 11:59:58 -04:00
# Lint code and check types
deno-check:
deno lint
deno check --unstable-ffi --all -c deno.jsonc ./src/deno/*.ts ./src/common/*.ts
2023-11-03 11:59:58 -04:00
# Test with deno
deno-test:
deno test --allow-all --unstable-ffi
2023-11-03 11:59:58 -04:00
# Create test coverage report with deno
deno-coverage:
./coverage.sh
2023-11-03 11:59:58 -04:00
# Run with deno
deno-run file="":
deno run --allow-all --allow-ffi --deny-hrtime --unstable-ffi ./src/scroll.ts {{file}}
2024-07-05 15:51:30 -04:00
##########################################################################################
# tsx(Node JS)-specific commands
##########################################################################################
# Test with tsx (NodeJS)
tsx-test:
npx tsx --test './src/common/all_test.ts'
# Run with tsx (NodeJS)
tsx-run file="":
npx tsx ./src/scroll.ts {{file}}