Skip to content

Commit a836403

Browse files
committed
run all script
1 parent fa5fa4a commit a836403

File tree

5 files changed

+47
-9
lines changed

5 files changed

+47
-9
lines changed

bin/run-all

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
# Run a command across all packages in a specific order
4+
# Usage: bin/run-all <command> [additional args]
5+
6+
set -e
7+
8+
if [ -z "$1" ]; then
9+
echo "Usage: bin/run-all <command> [additional args]"
10+
echo "Example: bin/run-all test:unit"
11+
exit 1
12+
fi
13+
14+
COMMAND=$1
15+
shift
16+
ARGS=$@
17+
18+
# Define package order: lib first, then others
19+
PACKAGES=("lib" "cli" "server" "postgres-server")
20+
21+
for pkg in "${PACKAGES[@]}"; do
22+
echo "========== Running command in @queryleaf/$pkg =========="
23+
yarn workspace "@queryleaf/$pkg" run $COMMAND $ARGS
24+
done
25+
26+
echo "========== All commands completed successfully =========="

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
"build:cli": "yarn workspace @queryleaf/cli build",
1717
"build:server": "yarn workspace @queryleaf/server build",
1818
"build:pg-server": "yarn workspace @queryleaf/postgres-server build",
19-
"build": "yarn clean && yarn build:lib && yarn build:cli && yarn build:server && yarn build:pg-server",
19+
"build": "bin/run-all build",
2020
"build:references": "tsc --build",
21-
"test": "yarn build:lib test:lib test:cli test:server test:pg-server",
21+
"test": "bin/run-all test",
22+
"test:unit": "bin/run-all test:unit",
23+
"test:integration": "bin/run-all test:integration",
2224
"test:lib": "yarn workspace @queryleaf/lib test",
2325
"test:cli": "yarn workspace @queryleaf/cli test",
2426
"test:server": "yarn workspace @queryleaf/server test",
2527
"test:pg-server": "yarn workspace @queryleaf/postgres-server test",
26-
"typecheck": "cd packages/lib && npx tsc --noEmit && cd ../cli && npx tsc --noEmit && cd ../server && npx tsc --noEmit && cd ../postgres-server && npx tsc --noEmit",
27-
"lint": "eslint --ext .ts packages/*/src",
28-
"lint:fix": "eslint --ext .ts --fix packages/*/src",
28+
"typecheck": "bin/run-all typecheck",
29+
"lint": "bin/run-all lint",
30+
"lint:fix": "bin/run-all lint:fix",
2931
"format": "prettier --write \"packages/*/src/**/*.ts\"",
3032
"format:check": "prettier --check \"packages/*/src/**/*.ts\"",
3133
"validate": "yarn typecheck && yarn lint && yarn test && yarn format:check",

packages/cli/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"build": "yarn clean && tsc",
1212
"typecheck": "tsc --noEmit",
1313
"start": "ts-node src/cli.ts",
14-
"test": "jest"
14+
"test": "yarn test:unit && yarn test:integration",
15+
"test:unit": "jest tests/unit",
16+
"test:integration": "jest tests/integration --runInBand",
17+
"lint": "eslint --ext .ts src",
18+
"lint:fix": "eslint --ext .ts --fix src"
1519
},
1620
"keywords": [
1721
"sql",

packages/lib/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
"typecheck": "npx tsc --noEmit",
1111
"dev": "ts-node src/index.ts",
1212
"example": "ts-node src/examples/basic-usage.ts",
13-
"test": "jest",
13+
"test": "yarn test:unit && yarn test:integration",
1414
"test:unit": "jest tests/unit",
15-
"test:integration": "jest tests/integration --runInBand"
15+
"test:integration": "jest tests/integration --runInBand",
16+
"lint": "eslint --ext .ts src",
17+
"lint:fix": "eslint --ext .ts --fix src"
1618
},
1719
"keywords": [
1820
"sql",

packages/server/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"build": "yarn clean && tsc",
1212
"typecheck": "tsc --noEmit",
1313
"start": "ts-node src/server.ts",
14-
"test": "jest"
14+
"test": "yarn test:unit && yarn test:integration",
15+
"test:unit": "jest tests/unit",
16+
"test:integration": "jest tests/integration --runInBand",
17+
"lint": "eslint --ext .ts src",
18+
"lint:fix": "eslint --ext .ts --fix src"
1519
},
1620
"keywords": [
1721
"sql",

0 commit comments

Comments
 (0)