Fix layered.sh linking js-sdk incorrectly (#33143)

* Simplify layered.sh

pnpm link already installs dependencies, this was causing the prepare script to run twice

* Improve logging in fetchdep and make linter happier

* Fix incorrectly linking js-sdk
This commit is contained in:
Michael Telatynski
2026-04-15 08:59:27 +00:00
committed by GitHub
parent dfdd438ae6
commit 5475edbbc5
2 changed files with 23 additions and 19 deletions
+10 -10
View File
@@ -14,7 +14,7 @@ set -ex
# for the primary repo (element-web in this case).
# Install dependencies
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile $@
# Pass appropriate repo to fetchdep.sh
export PR_ORG=element-hq
@@ -25,16 +25,16 @@ js_sdk_dep=$(jq -r '.dependencies["matrix-js-sdk"]' < $(pnpm -w root)/../apps/we
# Set up the js-sdk first (unless package.json pins a specific version)
if [ "$js_sdk_dep" = "github:matrix-org/matrix-js-sdk#develop" ]; then
scripts/fetchdep.sh matrix-org matrix-js-sdk develop
pushd matrix-js-sdk
[ -n "$JS_SDK_GITHUB_BASE_REF" ] && git fetch --depth 1 origin $JS_SDK_GITHUB_BASE_REF && git checkout $JS_SDK_GITHUB_BASE_REF
pnpm link
pnpm install --frozen-lockfile
popd
# Link into into element-web
pnpm link matrix-js-sdk
if [ -n "$JS_SDK_GITHUB_BASE_REF" ]; then
git -C matrix-js-sdk fetch --depth 1 origin $JS_SDK_GITHUB_BASE_REF
git -C matrix-js-sdk checkout $JS_SDK_GITHUB_BASE_REF
fi
pnpm -C matrix-js-sdk install --frozen-lockfile --ignore-scripts
# Link into into element-web & the monorepo
pnpm -C apps/web link ./matrix-js-sdk
pnpm link ./matrix-js-sdk
else
echo "Skipping matrix-js-sdk fetch and link as package.json pins $js_sdk_dep"
fi
pnpm install --frozen-lockfile $@