Skip to content

Commit

Permalink
feat(script): add postinstall script and fix yarnlinked script
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Apr 24, 2024
1 parent 92271f4 commit ae77987
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"patches-reapply": "cd ./yarn-linked-dependencies/matrix-js-sdk; git checkout .; cd ../..; ./scripts/tchap/apply_patches.sh",
"patch-make": "node scripts/tchap/makePatch.ts",
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js"
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js",
"postinstall": "./scripts/tchap/postinstall.sh"
},
"resolutions": {
"@types/react-dom": "17.0.21",
Expand Down
23 changes: 3 additions & 20 deletions scripts/tchap/install-yarn-linked-repositories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,13 @@ rm -R examples/

popd

# :TCHAP: we don't use this.
# Also set up matrix-analytics-events so we get the latest from
# the main branch or a branch with matching name
#./scripts/fetchdep.sh matrix-org matrix-analytics-events main
#pushd matrix-analytics-events
#yarn link
#yarn install --pure-lockfile
#yarn build:ts
#popd

# # Now set up the react-sdk
# ../scripts/tchap/fetchdep.with.version.sh matrix-org matrix-react-sdk $MATRIX_REACT_SDK_VERSION
# pushd matrix-react-sdk
# yarn unlink # :TCHAP: for local build, undo previous links if present.
# yarn link
# yarn link matrix-js-sdk
# #yarn link @matrix-org/analytics-events # :TCHAP: we don't use this
# yarn install --pure-lockfile
# popd
cd ../linked-dependencies/matrix-react-sdk
cd ../linked-dependencies
pushd matrix-react-sdk
yarn unlink # :TCHAP: for local build, undo previous links if present.
yarn link
yarn link matrix-js-sdk
yarn install --pure-lockfile
popd


# :TCHAP: yarn-link modules
Expand Down
18 changes: 18 additions & 0 deletions scripts/tchap/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -x

# This postinstall script is to make sure we use the linked-dependencies module for matrx-react-sdk

./scripts/tchap/apply_patches.sh

cd linked-dependencies
pushd matrix-react-sdk
yarn unlink # :TCHAP: for local build, undo previous links if present.
yarn link
yarn install --pure-lockfile
popd

cd ..
# Link the layers into element-web
yarn link matrix-react-sdk

0 comments on commit ae77987

Please sign in to comment.