layered.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env bash
  2. set -ex
  3. # Creates a layered environment with the full repo for the app and SDKs cloned
  4. # and linked. This gives an element-web dev environment ready to build with
  5. # matching branches of react-sdk's dependencies so that changes can be tested
  6. # in element-web.
  7. # Note that this style is different from the recommended developer setup: this
  8. # file nests js-sdk and matrix-react-sdk inside element-web, while the local
  9. # development setup places them all at the same level. We are nesting them here
  10. # because some CI systems do not allow moving to a directory above the checkout
  11. # for the primary repo (element-web in this case).
  12. # Install dependencies, as we'll be using fetchdep.sh from matrix-react-sdk
  13. yarn install --pure-lockfile
  14. # Pass appropriate repo to fetchdep.sh
  15. export PR_ORG=vector-im
  16. export PR_REPO=element-web
  17. # Set up the js-sdk first
  18. node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-js-sdk
  19. pushd matrix-js-sdk
  20. yarn link
  21. yarn install --pure-lockfile
  22. popd
  23. # Also set up matrix-analytics-events so we get the latest from
  24. # the main branch or a branch with matching name
  25. node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-analytics-events main
  26. pushd matrix-analytics-events
  27. yarn link
  28. yarn install --pure-lockfile
  29. yarn build:ts
  30. popd
  31. # Now set up the react-sdk
  32. node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-react-sdk
  33. pushd matrix-react-sdk
  34. yarn link
  35. yarn link matrix-js-sdk
  36. yarn link @matrix-org/analytics-events
  37. yarn install --pure-lockfile
  38. popd
  39. # Link the layers into element-web
  40. yarn link matrix-js-sdk
  41. yarn link matrix-react-sdk