From d7bf8801c90eda139baf6f6bced4afc3cf85591a Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 10 Jul 2024 16:32:28 -0400 Subject: [PATCH] Put the important scripts package.json so they can be run without Just --- justfile | 25 +++++++++++++++---------- package.json | 11 +++++++---- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/justfile b/justfile index e6194d8..ed6e8d0 100644 --- a/justfile +++ b/justfile @@ -3,13 +3,14 @@ default: @just --list # Test coverage -coverage: bun-test deno-coverage +coverage: deno-coverage bun-coverage # Typescript checking -check: deno-check bun-check tsx-check +check: deno-check bun-check +# Generate source docs docs: - deno doc --html --unstable-ffi --name="Scroll" ./src/scroll.ts ./src/common/*.ts ./src/deno/mod.ts ./src/bun/mod.ts + deno doc --html --name="Scroll" ./src/scroll.ts ./src/common/*.ts ./src/deno/mod.ts ./src/bun/mod.ts ./src/tsx/mod.ts # Reformat the code fmt: @@ -37,15 +38,19 @@ clean: # Check code with actual Typescript compiler bun-check: - bunx tsc + bun run bun-check # Test with bun bun-test: - bun test --coverage + bun run bun-test + +# CLI test coverage report +bun-coverage: + bun run bun-coverage # Run with bun bun-run file="": - bun run ./src/scroll.ts {{file}} + bun run bun-run {{file}} ########################################################################################## # Deno-specific commands @@ -58,16 +63,15 @@ deno-check: # Test with deno deno-test: - deno test --allow-all --unstable-ffi + deno task deno-test # Create test coverage report with deno deno-coverage: - ./coverage.sh + deno task deno-coverage # Run with deno deno-run file="": deno task deno-run {{file}} - #deno run --allow-all --allow-ffi --deny-hrtime --unstable-ffi ./src/scroll.ts {{file}} ########################################################################################## # tsx(Node JS)-specific commands @@ -83,5 +87,6 @@ tsx-test: # Run with tsx (NodeJS) tsx-run file="": - npx tsx ./src/scroll.ts {{file}} + npm run tsx-run {{file}} + diff --git a/package.json b/package.json index 91e1445..94eb310 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,21 @@ { "dependencies": {}, "devDependencies": { - "bun-types": "^1.0.11" + "bun-types": "^1.0.11", + "typescript": "^5.5" }, "scripts": { "bun-check": "bunx tsc", "bun-coverage": "bun test --coverage", + "bun-run": "bun run ./src/scroll.ts", "bun-test": "bun test", "deno-lint": "deno lint", - "deno-check": "deno check --unstable-ffi --all -c deno.jsonc ./src/deno/*.ts ./src/common/*.ts ./src/tsx/*.ts", + "deno-check": "deno check --all -c deno.jsonc ./src/deno/*.ts ./src/common/*.ts ./src/tsx/*.ts", "deno-coverage": "./coverage.sh", - "deno-run": "deno run --allow-all --allow-ffi --deny-hrtime --unstable-ffi ./src/scroll.ts", - "deno-test": "deno test --allow-all --unstable-ffi", + "deno-run": "deno run --allow-all --deny-hrtime ./src/scroll.ts", + "deno-test": "deno test --allow-all", "tsx-check": "npx tsc", + "tsx-run": "npx tsx ./src/scroll.ts", "tsx-test": "npx tsx --test './src/common/all_test.ts'" }, "type": "module"