Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tchap-web using matrix-react-sdk as a subtree #964

Merged
merged 19 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
209a9f6
feat(subtree): local matrix-react-sdk dependencies
Apr 4, 2024
7c47865
feat(readme): update matrix-react-sdk subtree readme
Apr 4, 2024
3c918d0
feat(subtree): remove linked-dependencies from prettier and add insta…
Apr 4, 2024
d8ee2d7
feat(subtree): hard replace node_modules/matrix-react-sdk occurences
Apr 10, 2024
6caa666
feat(subtree): modify tsconfig and jest config to use linked-dep
Apr 11, 2024
2669a20
feat(subtree): removed subtree
Apr 11, 2024
f97d0bc
fix(subtree): hardcorded yarn-dep in translations script
Apr 11, 2024
9a8057d
Squashed 'linked-dependencies/matrix-react-sdk/' content from commit …
Apr 13, 2024
d2807b7
Merge commit '9a8057d6fcee0ab849f05305f5154a6d2fc959d2' as 'linked-de…
Apr 13, 2024
ed95e56
fix(subtree): bugreporting tests hardcoded deps path
Apr 13, 2024
54de792
feat(subtree): add patch name next to all :tchap: modifications
Apr 15, 2024
8bb837a
Revert "feat(subtree): hard replace node_modules/matrix-react-sdk occ…
Apr 15, 2024
1d2233d
Revert "feat(readme): update matrix-react-sdk subtree readme"
Apr 15, 2024
423ecdf
feat(subtree): remove tchap in matrix-react-sdk name to facilitate links
Apr 15, 2024
9e82229
feat(subtree): update install script to link our linked-dep directory
Apr 15, 2024
d7614e9
feat: create tchap readme
Apr 15, 2024
4e0fad8
chore: change global path configs, remove linked-dep
Apr 16, 2024
51c2706
Merge remote-tracking branch 'origin/develop_tchap' into develop_tcha…
Apr 16, 2024
a13d252
feat(subtree): move tchap annonce room under favorite
Apr 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ src/vector/modernizr.js
#remove tchap files from prettier
patches/
yarn-linked-dependencies/
linked-dependencies/
.github/
res/
scripts/tchap
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,20 @@ yarn install
popd
```

Then similarly with `matrix-react-sdk`:
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
For `matrix-react-sdk` we are using a subtree and our own fork:
When you clone tchap-web-v4, you should be able to see the repo in `linked-dependencies/matrix-react-sdk`.

Don't forget to run a first yarn install inside `linked-dependencies/matrix-react-sdk`. Our `package.json`
will be using this directory as local dependencies for `matrix-react-sdk`

You can make changes to the subtree repo as if it was code from the parent repo.
But you have to make sure to also update the fork using those commands :
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved

```bash
git clone https://github.com/matrix-org/matrix-react-sdk.git
pushd matrix-react-sdk
yarn link
yarn link matrix-js-sdk
yarn install
popd
```
git subree push --prefix=./linked-dependencies/matrix-react-sdk matrix-react-sdk-tchap [email protected]:tchapgouv/matrix-react-sdk-tchap.git develop_tchap
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
```

This command will take all the commits that touch the subtree repo and push them to the remote fork. If you don't want to take all the commits (shouldnt happen), you will have to cherry-pick and push manually to the remote.

Clone the repo and switch to the `element-web` directory:

Expand All @@ -242,7 +246,6 @@ Finally, build and start Element itself:

```bash
yarn link matrix-js-sdk
yarn link matrix-react-sdk
yarn install
yarn start
```
Expand Down
14 changes: 7 additions & 7 deletions customisations.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"src/components/views/messages/MStickerBody.tsx": "src/tchap/customisations/components/views/messages/ContentScanningStickerBody.tsx",
"src/components/views/messages/MVideoBody.tsx": "src/tchap/customisations/components/views/messages/ContentScanningVideoBody.tsx",
"src/components/views/messages/MVoiceMessageBody.tsx": "src/tchap/customisations/components/views/messages/ContentScanningVoiceMessageBody.tsx",
"src/tchap/components/views/messages/OriginalAudioBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MAudioBody.tsx",
"src/tchap/components/views/messages/OriginalFileBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MFileBody.tsx",
"src/tchap/components/views/messages/OriginalImageBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MImageBody.tsx",
"src/tchap/components/views/messages/OriginalImageReplyBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MImageReplyBody.tsx",
"src/tchap/components/views/messages/OriginalStickerBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MStickerBody.tsx",
"src/tchap/components/views/messages/OriginalVideoBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MVideoBody.tsx",
"src/tchap/components/views/messages/OriginalVoiceMessageBody.tsx": "node_modules/matrix-react-sdk/src/components/views/messages/MVoiceMessageBody.tsx",
"src/tchap/components/views/messages/OriginalAudioBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MAudioBody.tsx",
"src/tchap/components/views/messages/OriginalFileBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MFileBody.tsx",
"src/tchap/components/views/messages/OriginalImageBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MImageBody.tsx",
"src/tchap/components/views/messages/OriginalImageReplyBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MImageReplyBody.tsx",
"src/tchap/components/views/messages/OriginalStickerBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MStickerBody.tsx",
"src/tchap/components/views/messages/OriginalVideoBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MVideoBody.tsx",
"src/tchap/components/views/messages/OriginalVoiceMessageBody.tsx": "linked-dependencies/matrix-react-sdk/src/components/views/messages/MVoiceMessageBody.tsx",
"src/components/views/messages/UnknownBody.tsx": "src/tchap/components/views/messages/TchapUnknownBody.tsx",
"src/components/views/settings/JoinRuleSettings.tsx": "src/tchap/components/views/settings/TchapJoinRuleSettings.tsx",
"src/components/views/dialogs/RoomUpgradeWarningDialog.tsx": "src/tchap/components/views/dialogs/TchapRoomUpgradeWarningDialog.tsx",
Expand Down
30 changes: 16 additions & 14 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,40 @@ const config: Config = {
testMatch: ["<rootDir>/test/unit-tests/tchap/**/*-test.[tj]s?(x)"], // :TCHAP: only tchap tests
setupFiles: ["jest-canvas-mock"],
setupFilesAfterEnv: [
"<rootDir>/node_modules/matrix-react-sdk/test/setupTests.ts",
"<rootDir>/linked-dependencies/matrix-react-sdk/test/setupTests.ts",
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
"<rootDir>/test/setup/setupLanguage.ts",
"<rootDir>/test/setupTests.ts",
],
moduleNameMapper: {
"\\.(css|scss|pcss)$": "<rootDir>/__mocks__/cssMock.js",
"\\.(gif|png|ttf|woff2)$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
"\\.svg$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/svg.js",
"\\$webapp/i18n/languages.json": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/languages.json",
"\\.(gif|png|ttf|woff2)$": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/imageMock.js",
"\\.svg$": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/svg.js",
"\\$webapp/i18n/languages.json": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/languages.json",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
"^matrix-react-sdk$": "<rootDir>/node_modules/matrix-react-sdk/src",
"decoderWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)Factory": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerFactoryMock.js",
"^matrix-react-sdk$": "<rootDir>/linked-dependencies/matrix-react-sdk/src",
"decoderWorker\\.min\\.js": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/empty.js",
"decoderWorker\\.min\\.wasm": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/empty.js",
"waveWorker\\.min\\.js": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)Factory": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/workerFactoryMock.js",
"^!!raw-loader!.*": "jest-raw-loader",
"recorderWorkletFactory": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"recorderWorkletFactory": "<rootDir>/linked-dependencies/matrix-react-sdk/__mocks__/empty.js",
"^fetch-mock$": "<rootDir>/node_modules/fetch-mock",
// :TCHAP:
"MImageBody": "<rootDir>/src/tchap/customisations/components/views/messages/ContentScanningImageBody.tsx",
"../../../../../../src/tchap/components/views/messages/OriginalFileBody":
"<rootDir>/node_modules/matrix-react-sdk/src/components/views/messages/MImageBody.tsx",
"<rootDir>/linked-dependencies/matrix-react-sdk/src/components/views/messages/MImageBody.tsx",
"MAudioBody": "<rootDir>/src/tchap/customisations/components/views/messages/ContentScanningAudioBody.tsx",
"../../../../../../src/tchap/components/views/messages/OriginalAudioBody":
"<rootDir>/node_modules/matrix-react-sdk/src/components/views/messages/MAudioBody.tsx",
"<rootDir>/linked-dependencies/matrix-react-sdk/src/components/views/messages/MAudioBody.tsx",
"MStickerBody": "<rootDir>/src/tchap/customisations/components/views/messages/ContentScanningStickerBody.tsx",
"~tchap-web-dep/(.*)": "<rootDir>/yarn-linked-dependencies/$1",
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
"~tchap-web/(.*)": "<rootDir>/$1",
"~linked-dep/(.*)": "<rootDir>/linked-dependencies/$1",
MarcWadai marked this conversation as resolved.
Show resolved Hide resolved
"matrix-react-sdk/(.*)": "<rootDir>/linked-dependencies/matrix-react-sdk/$1",
// end :TCHAP:
},
transformIgnorePatterns: ["/node_modules/(?!matrix-js-sdk|matrix-react-sdk).+$"],
Expand Down
29 changes: 29 additions & 0 deletions linked-dependencies/matrix-react-sdk/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2017 Aviral Dasgupta
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

[*]
charset=utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 4

[*.tsx.snap]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions linked-dependencies/matrix-react-sdk/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test/end-to-end-tests/node_modules/
test/end-to-end-tests/element/
test/end-to-end-tests/synapse/
test/end-to-end-tests/lib/
# Legacy skinning file that some people might still have
src/component-index.js
Loading
Loading