Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,7 @@ graph/test/typescript/.work-*/

# the one-command pipeline keeps its IR and scratch here
.intermediate/

# lock files are not committed: the engine is not published as a locked artifact, and two
# workspaces' locks drifted on every parser sync
package-lock.json
6 changes: 5 additions & 1 deletion graph/pipeline/run-souffle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ echo "Elapsed (solve): $((SOLVE_EPOCH-START_EPOCH))s"
# `npm run build` produced. Neither present is a setup error, and says so.
PKG="$SRC/.."
if [ -x "$PKG/node_modules/.bin/tsx" ]; then
BUNDLE=("$PKG/node_modules/.bin/tsx" "$SRC/bundle/cli.ts")
# --tsconfig, explicitly: cli.ts imports its neighbours through the @/ alias, and tsx
# resolves that from the tsconfig it finds relative to the CALLER's working directory —
# so without this the stage worked only when run from the engine checkout and failed
# from anywhere else with "Cannot find module '@/bundle/build'", after the solve (#470).
BUNDLE=("$PKG/node_modules/.bin/tsx" --tsconfig "$PKG/tsconfig.json" "$SRC/bundle/cli.ts")
elif [ -f "$PKG/dist/bundle/cli.js" ]; then
BUNDLE=(node "$PKG/dist/bundle/cli.js")
else
Expand Down
8 changes: 6 additions & 2 deletions graph/test/tools/bundle-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ fail=0; bad(){ echo " ✗ $*"; fail=$((fail+1)); }
# graph.sqlite alone — the CSVs are a debugging view of the same core tables, and a
# consumer that queries the database does not want a second copy of it on disk. The
# default is asserted separately at the end.
BUNDLE(){ "$TSX" "$ROOT/graph/bundle/cli.ts" --src "$ROOT/graph" --debug "$@"; }
BUNDLE_NO_DEBUG(){ "$TSX" "$ROOT/graph/bundle/cli.ts" --src "$ROOT/graph" "$@"; }
# Run from a FOREIGN working directory on purpose, with the tsconfig named explicitly, the
# way run-souffle.sh invokes the stage: tsx resolves the @/ alias from the tsconfig it finds
# relative to the cwd, so a test that ran from the checkout passed while every consumer
# running from its own repository failed with "Cannot find module '@/bundle/build'" (#470).
BUNDLE(){ ( cd "$W" && "$TSX" --tsconfig "$ROOT/tsconfig.json" "$ROOT/graph/bundle/cli.ts" --src "$ROOT/graph" --debug "$@" ); }
BUNDLE_NO_DEBUG(){ ( cd "$W" && "$TSX" --tsconfig "$ROOT/tsconfig.json" "$ROOT/graph/bundle/cli.ts" --src "$ROOT/graph" "$@" ); }
SQL(){ command -v sqlite3 >/dev/null && sqlite3 "$1" "$2"; }
HAVE_SQLITE=0; command -v sqlite3 >/dev/null && HAVE_SQLITE=1

Expand Down
Loading