Skip to content
Merged
Changes from 2 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
49 changes: 32 additions & 17 deletions scripts/layered.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,42 @@ pnpm install --frozen-lockfile
export PR_ORG=element-hq
export PR_REPO=element-web

# Set up the js-sdk first
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

# Also set up matrix-analytics-events for branch with matching name
scripts/fetchdep.sh matrix-org matrix-analytics-events
# We don't pass a default branch so cloning may fail when we are not in a PR
# This is expected as this project does not share a release cycle but we still branch match it
if [ -d matrix-analytics-events ]; then
pushd matrix-analytics-events
js_sdk_dep=`jq -r '.dependencies["matrix-js-sdk"]' < package.json`
analytics_events_dep=`jq -r '.dependencies["@matrix-org/analytics-events"]' < package.json`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused?


# Set up the js-sdk first (unless package.json pins a specific version)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Set up the js-sdk first (unless package.json pins a specific version)
# Set up the js-sdk (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
pnpm build:ts
popd
else
echo "Skipping matrix-js-sdk fetch and link as package.json pins $js_sdk_dep"
fi

# Also set up matrix-analytics-events for branch with matching name
if [ "$analytics_events_dep" = "github:matrix-org/matrix-analytics-events#develop" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this ever happens. TBH I think we should just nuke this branch match.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I did wonder

scripts/fetchdep.sh matrix-org matrix-analytics-events
# We don't pass a default branch so cloning may fail when we are not in a PR
# This is expected as this project does not share a release cycle but we still branch match it
if [ -d matrix-analytics-events ]; then
pushd matrix-analytics-events
pnpm link
pnpm install --frozen-lockfile
pnpm build:ts
popd
fi
else
echo "Skipping matrix-analytics-events fetch and link as package.json pins $analytics_events_dep"
fi

# Link the layers into element-web
pnpm link matrix-js-sdk
[ -d matrix-analytics-events ] && pnpm link @matrix-org/analytics-events
if [ "$js_sdk_dep" = "github:matrix-org/matrix-js-sdk#develop" ]; then
pnpm link matrix-js-sdk
fi
if [ "$analytics_events_dep" = "github:matrix-org/matrix-analytics-events#develop" ] && [ -d matrix-analytics-events ]; then
pnpm link @matrix-org/analytics-events
fi
pnpm install --frozen-lockfile $@
Loading