The runtime build installs the module's SDK itself and shows its compiler's output
A module never built on this workstation had no node_modules, tsc failed on the first import behind /dev/null, and the suite reported a build that said nothing.
This commit is contained in:
@@ -33,7 +33,16 @@ SRCS=(); for f in \
|
|||||||
pg.d.ts; do
|
pg.d.ts; do
|
||||||
[ -f "$MOD/$f" ] && SRCS+=("$f")
|
[ -f "$MOD/$f" ] && SRCS+=("$f")
|
||||||
done
|
done
|
||||||
TSC="$MESH_SDK/node_modules/.bin/tsc"; ( cd "$MOD" && "$TSC" "${SRCS[@]}" --module NodeNext --moduleResolution NodeNext --target ES2022 --outDir dist >/dev/null )
|
# The module compiles against the SDK, which its package.json names and nothing installs: a module
|
||||||
|
# never built on this workstation has no node_modules, and tsc fails on the first import. Installed
|
||||||
|
# as a package copy from the sibling checkout (never a link) when absent — the compile needs only
|
||||||
|
# the types; the image takes the SDK from MESH_SDK below.
|
||||||
|
if [ ! -e "$MOD/node_modules/@novox/mesh-sdk" ]; then
|
||||||
|
( cd "$MOD" && npm install --no-save --install-links --no-package-lock --ignore-scripts --silent "$MESH_SDK" ) \
|
||||||
|
|| { echo "cannot install the SDK into $MOD for the compile" >&2; exit 1; }
|
||||||
|
fi
|
||||||
|
# Output kept: a compile error hidden behind /dev/null is a build that fails saying nothing.
|
||||||
|
TSC="$MESH_SDK/node_modules/.bin/tsc"; ( cd "$MOD" && "$TSC" "${SRCS[@]}" --module NodeNext --moduleResolution NodeNext --target ES2022 --outDir dist 1>&2 )
|
||||||
|
|
||||||
STAGE="$(mktemp -d)"; trap 'rm -rf "$STAGE"' EXIT
|
STAGE="$(mktemp -d)"; trap 'rm -rf "$STAGE"' EXIT
|
||||||
cp -r "$MESH_TOOLS/dist" "$STAGE/dist"
|
cp -r "$MESH_TOOLS/dist" "$STAGE/dist"
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ export function rebuild(env: NodeJS.ProcessEnv = process.env, testFiles: string[
|
|||||||
// the code in front of you, which is the whole of 005.
|
// the code in front of you, which is the whole of 005.
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`could not build the ${build.what}: ${build.argv.join(" ")} in ${build.in}\n\n` +
|
`could not build the ${build.what}: ${build.argv.join(" ")} in ${build.in}\n\n` +
|
||||||
`${(ran.stderr || ran.stdout || String(ran.error)).trim()}`,
|
`${(ran.stderr || ran.stdout || (ran.error ? String(ran.error) : `exit status ${ran.status}, and it said nothing`)).trim()}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
built.push(build.what);
|
built.push(build.what);
|
||||||
|
|||||||
Reference in New Issue
Block a user