fix: bun monorepo complex deps
This commit is contained in:
54
tests/script_test/run_paraglide_monorepo_builds.sh
Executable file
54
tests/script_test/run_paraglide_monorepo_builds.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
app_a_binary="$1"
|
||||
app_b_binary="$2"
|
||||
workdir="$(mktemp -d)"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${workdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
verify_build() {
|
||||
local binary="$1"
|
||||
local out_dir="$2"
|
||||
local expected_title="$3"
|
||||
local expected_text="$4"
|
||||
|
||||
"${binary}" --outDir "${out_dir}" >/dev/null
|
||||
|
||||
if [[ ! -f "${out_dir}/index.html" ]]; then
|
||||
echo "missing build output index.html for ${binary}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq "${expected_title}" "${out_dir}/index.html"; then
|
||||
echo "missing expected title in ${out_dir}/index.html" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local asset
|
||||
asset="$(find "${out_dir}/assets" -type f -name '*.js' | head -n 1)"
|
||||
if [[ -z ${asset} ]]; then
|
||||
echo "missing built JS asset for ${binary}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -Fq "${expected_text}" "${asset}"; then
|
||||
echo "missing expected translated text in ${asset}" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
verify_build \
|
||||
"${app_a_binary}" \
|
||||
"${workdir}/app-a-dist" \
|
||||
"Paraglide monorepo app A" \
|
||||
"En gemensam oversattningskalla"
|
||||
|
||||
verify_build \
|
||||
"${app_b_binary}" \
|
||||
"${workdir}/app-b-dist" \
|
||||
"Paraglide monorepo app B" \
|
||||
"One shared translation source"
|
||||
Reference in New Issue
Block a user