Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.5 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
2022-05-16 15:23:44 +01:00
set -ex
2022-05-16 15:23:44 +01:00
# Creates a layered environment with the full repo for the app and SDKs cloned
# and linked. This gives an element-web dev environment ready to build with
# matching branches of react-sdk's dependencies so that changes can be tested
# in element-web.
# Note that this style is different from the recommended developer setup: this
2024-10-15 14:57:26 +01:00
# file nests js-sdk inside element-web, while the local
2022-05-16 15:23:44 +01:00
# development setup places them all at the same level. We are nesting them here
# because some CI systems do not allow moving to a directory above the checkout
# for the primary repo (element-web in this case).
2024-10-15 14:57:26 +01:00
# Install dependencies
pnpm install --frozen-lockfile $@
2022-05-16 15:23:44 +01:00
# Pass appropriate repo to fetchdep.sh
2023-12-12 10:31:44 +00:00
export PR_ORG=element-hq
2022-05-16 15:23:44 +01:00
export PR_REPO=element-web
js_sdk_dep=$(jq -r '.dependencies["matrix-js-sdk"]' < $(pnpm -w root)/../apps/web/package.json)
# 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
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