From 11f56b06bfcc8c47c70811750a6d45b6dd285358 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 28 Mar 2023 14:37:24 +0100 Subject: [PATCH 01/11] Upgrade matrix-js-sdk to 24.0.0 --- package.json | 2 +- yarn.lock | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 30ed10fe18..5eeff14334 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "gfm.css": "^1.1.2", "jsrsasign": "^10.5.25", "katex": "^0.16.0", - "matrix-js-sdk": "23.5.0", + "matrix-js-sdk": "24.0.0", "matrix-react-sdk": "3.68.0", "matrix-widget-api": "^1.1.1", "react": "17.0.2", diff --git a/yarn.lock b/yarn.lock index d3709105ff..ffbae18580 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8141,6 +8141,24 @@ matrix-js-sdk@23.5.0: unhomoglyph "^1.0.6" uuid "9" +matrix-js-sdk@24.0.0: + version "24.0.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-24.0.0.tgz#cc08c55e6a88dcc177341705a8ff7cdfe93e0c27" + integrity sha512-AOhO036ziDf6lwYoauj5DES/RJ6RDTq+vrK2yO/GW/8n+bAXhkjWc9AA/WcTK/9SkNHS46ZanmolkhS1n8WniQ== + dependencies: + "@babel/runtime" "^7.12.5" + "@matrix-org/matrix-sdk-crypto-js" "^0.1.0-alpha.3" + another-json "^0.2.0" + bs58 "^5.0.0" + content-type "^1.0.4" + loglevel "^1.7.1" + matrix-events-sdk "0.0.1" + matrix-widget-api "^1.0.0" + p-retry "4" + sdp-transform "^2.14.1" + unhomoglyph "^1.0.6" + uuid "9" + matrix-mock-request@^2.5.0: version "2.6.0" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-2.6.0.tgz#0855c10b250668ce542b697251087be2bcc23f92" From 21fa0887bdf0d5bbf84fc2c4d91cbb90b1b6ed36 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 28 Mar 2023 14:37:43 +0100 Subject: [PATCH 02/11] Upgrade matrix-react-sdk to 3.69.0 --- package.json | 2 +- yarn.lock | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 5eeff14334..0aecfba234 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "jsrsasign": "^10.5.25", "katex": "^0.16.0", "matrix-js-sdk": "24.0.0", - "matrix-react-sdk": "3.68.0", + "matrix-react-sdk": "3.69.0", "matrix-widget-api": "^1.1.1", "react": "17.0.2", "react-dom": "17.0.2", diff --git a/yarn.lock b/yarn.lock index ffbae18580..b70d967dcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8123,24 +8123,6 @@ matrix-events-sdk@0.0.1: resolved "https://registry.yarnpkg.com/matrix-events-sdk/-/matrix-events-sdk-0.0.1.tgz#c8c38911e2cb29023b0bbac8d6f32e0de2c957dd" integrity sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA== -matrix-js-sdk@23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-23.5.0.tgz#644a1546340160bfc3de44df30030373e7cc2fc9" - integrity sha512-jkHJBxXcLqzz0aZ4+Hjbx7hvgryIy+DZPOxvNfM2jJM0sc803Yyu4JMZLEdx/JLwFG1KE7bFZGiXP26g5yu6Mw== - dependencies: - "@babel/runtime" "^7.12.5" - "@matrix-org/matrix-sdk-crypto-js" "^0.1.0-alpha.3" - another-json "^0.2.0" - bs58 "^5.0.0" - content-type "^1.0.4" - loglevel "^1.7.1" - matrix-events-sdk "0.0.1" - matrix-widget-api "^1.0.0" - p-retry "4" - sdp-transform "^2.14.1" - unhomoglyph "^1.0.6" - uuid "9" - matrix-js-sdk@24.0.0: version "24.0.0" resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-24.0.0.tgz#cc08c55e6a88dcc177341705a8ff7cdfe93e0c27" @@ -8166,10 +8148,10 @@ matrix-mock-request@^2.5.0: dependencies: expect "^28.1.0" -matrix-react-sdk@3.68.0: - version "3.68.0" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.68.0.tgz#792435db0211377376509145dca2166ad5bb5a07" - integrity sha512-h+QSxVW8cz3GbJDAkcMq/jgXNzMjI1+mbttRtc0pVmzckjVDHyU6d5hzyzFakgvgFrv6LnRrtalU/mmMurrg2Q== +matrix-react-sdk@3.69.0: + version "3.69.0" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.69.0.tgz#63bc203531b45c37f9aa928b389c89b205f940d1" + integrity sha512-QmMAk+k/W2eb+KMHcOWcDtQzg2OQ5KV38lUY6UGOnvlM2n823YzKaio2a0OhMPxhf6GQ0yIKPGiGBftV+SdDQw== dependencies: "@babel/runtime" "^7.12.5" "@matrix-org/analytics-events" "^0.5.0" @@ -8209,7 +8191,7 @@ matrix-react-sdk@3.68.0: maplibre-gl "^2.0.0" matrix-encrypt-attachment "^1.0.3" matrix-events-sdk "0.0.1" - matrix-js-sdk "23.5.0" + matrix-js-sdk "24.0.0" matrix-widget-api "^1.1.1" minimist "^1.2.5" opus-recorder "^8.0.3" From 4969a80c06835fcbbca4047a8136a6cf45fbe4ca Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 28 Mar 2023 14:40:54 +0100 Subject: [PATCH 03/11] Prepare changelog for v1.11.26 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bc80359fa..acb6b7f1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [1.11.26](https://github.com/vector-im/element-web/releases/tag/v1.11.26) (2023-03-28) +================================================================================================= + +## 🐛 Bug Fixes + * Changes for matrix-js-sdk v24.0.0 + * Changes for matrix-react-sdk v3.69.0 + Changes in [1.11.25](https://github.com/vector-im/element-web/releases/tag/v1.11.25) (2023-03-15) ================================================================================================= From 7a002341f4e67152ec7fa29f3d97f2291a5b9980 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 28 Mar 2023 14:40:55 +0100 Subject: [PATCH 04/11] v1.11.26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0aecfba234..9d3a15d095 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-web", - "version": "1.11.25", + "version": "1.11.26", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 145564719f42e01a5d7cec356a282b2846914c54 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 31 Mar 2023 10:23:03 +0100 Subject: [PATCH 05/11] Upgrade matrix-react-sdk to 3.69.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9d3a15d095..3ac6f39f6f 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "jsrsasign": "^10.5.25", "katex": "^0.16.0", "matrix-js-sdk": "24.0.0", - "matrix-react-sdk": "3.69.0", + "matrix-react-sdk": "3.69.1", "matrix-widget-api": "^1.1.1", "react": "17.0.2", "react-dom": "17.0.2", diff --git a/yarn.lock b/yarn.lock index b70d967dcb..7f40f59a54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8148,10 +8148,10 @@ matrix-mock-request@^2.5.0: dependencies: expect "^28.1.0" -matrix-react-sdk@3.69.0: - version "3.69.0" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.69.0.tgz#63bc203531b45c37f9aa928b389c89b205f940d1" - integrity sha512-QmMAk+k/W2eb+KMHcOWcDtQzg2OQ5KV38lUY6UGOnvlM2n823YzKaio2a0OhMPxhf6GQ0yIKPGiGBftV+SdDQw== +matrix-react-sdk@3.69.1: + version "3.69.1" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.69.1.tgz#bc1efcf51d0c003a9149686a994b64387ec6a45d" + integrity sha512-jOzZiWTlHclN+LTUyVH6FC950XUQ3aUUPyAkLvbRgo4On8pyC8jyMyvrowEQgrsOgYaflSI/DcX+B9RTnHDbcQ== dependencies: "@babel/runtime" "^7.12.5" "@matrix-org/analytics-events" "^0.5.0" From ebda5f4d31ae2a63451a1b625bc19bff6802319e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 31 Mar 2023 10:27:09 +0100 Subject: [PATCH 06/11] Prepare changelog for v1.11.27 --- CHANGELOG.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acb6b7f1c8..73b542df9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ -Changes in [1.11.26](https://github.com/vector-im/element-web/releases/tag/v1.11.26) (2023-03-28) +Changes in [1.11.27](https://github.com/vector-im/element-web/releases/tag/v1.11.27) (2023-03-31) ================================================================================================= ## 🐛 Bug Fixes - * Changes for matrix-js-sdk v24.0.0 - * Changes for matrix-react-sdk v3.69.0 + * Fix detection of encryption for all users in a room ([\#10487](https://github.com/matrix-org/matrix-react-sdk/pull/10487)). Fixes #24995. + +Changes in [1.11.26](https://github.com/vector-im/element-web/releases/tag/v1.11.26) (2023-03-28) +================================================================================================= + +## 🔒 Security + * Fixes for [CVE-2023-28427](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-28427) / GHSA-mwq8-fjpf-c2gr + * Fixes for [CVE-2023-28103](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2023-28103) / GHSA-6g43-88cp-w5gv Changes in [1.11.25](https://github.com/vector-im/element-web/releases/tag/v1.11.25) (2023-03-15) ================================================================================================= From 9faa625551950f034cd4f09bfe45b7a2b8b5c3a6 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 31 Mar 2023 10:27:10 +0100 Subject: [PATCH 07/11] v1.11.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3ac6f39f6f..877cfb0509 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-web", - "version": "1.11.26", + "version": "1.11.27", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From cc6498d00c0fa9d557f4d22fe456aa8609ab93ab Mon Sep 17 00:00:00 2001 From: Olivier D Date: Fri, 31 Mar 2023 15:52:09 +0200 Subject: [PATCH 08/11] move tchap scripts to script/tchap subfolder (#518) --- .github/workflows/build.yml | 4 ++-- .github/workflows/cypress.yaml | 4 ++-- .github/workflows/static_analysis.yaml | 8 ++++---- .github/workflows/tests.yaml | 4 ++-- .gitignore | 2 +- README.md | 2 +- package.json | 4 ++-- scripts/{ => tchap}/apply_patches.sh | 2 +- scripts/{ => tchap}/checkPatchFile.js | 2 +- scripts/{ => tchap}/install-yarn-linked-repositories.sh | 0 scripts/{ => tchap}/makePatch.ts | 2 +- scripts/{ => tchap}/merge-patches.sh | 0 12 files changed, 17 insertions(+), 17 deletions(-) rename scripts/{ => tchap}/apply_patches.sh (86%) rename scripts/{ => tchap}/checkPatchFile.js (98%) rename scripts/{ => tchap}/install-yarn-linked-repositories.sh (100%) rename scripts/{ => tchap}/makePatch.ts (95%) rename scripts/{ => tchap}/merge-patches.sh (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb356ca8dc..b978a92b2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ #Build the application -#tchap modification : use "./scripts/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" +#tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Build on: pull_request: {} @@ -23,7 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: "./scripts/install-yarn-linked-repositories.sh" + run: "./scripts/tchap/install-yarn-linked-repositories.sh" - name: Build run: "yarn build" diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 98fce0d16b..46d12d6bf0 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -1,6 +1,6 @@ # Run the tests # Todo : reuse a build from another action, instead of rebuilding for nothing. -# tchap modification : use "./scripts/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" +# tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Cypress End to End Tests on: pull_request: {} @@ -28,7 +28,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: "./scripts/install-yarn-linked-repositories.sh" + run: "./scripts/tchap/install-yarn-linked-repositories.sh" - name: Run Cypress tests uses: cypress-io/github-action@v4.1.1 diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 13848236fe..77714bd156 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -1,5 +1,5 @@ #Run a static analysis -#tchap modification : use "./scripts/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" +#tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Static Analysis on: pull_request: {} @@ -27,7 +27,7 @@ jobs: # node-version: 16 # # - name: Install Dependencies - # run: "./scripts/install-yarn-linked-repositories.sh" + # run: "./scripts/tchap/install-yarn-linked-repositories.sh" # # - name: Typecheck # run: "yarn run lint:types" @@ -68,7 +68,7 @@ jobs: # Needs branch matching as it inherits .stylelintrc.js from matrix-react-sdk - name: Install Dependencies - run: "./scripts/install-yarn-linked-repositories.sh" + run: "./scripts/tchap/install-yarn-linked-repositories.sh" - name: Run Linter run: "yarn run lint:style" @@ -85,7 +85,7 @@ jobs: # node-version: 16 # - name: Install Deps -# run: "scripts/install-yarn-linked-repositories.sh" +# run: "scripts/tchap/install-yarn-linked-repositories.sh" # - name: Dead Code Analysis # run: "yarn run analyse:unused-exports" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e0344d9944..c0c717959f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,5 +1,5 @@ #Run the tests -#tchap modification : use "./scripts/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" +#tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Tests on: pull_request: {} @@ -26,7 +26,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: "./scripts/install-yarn-linked-repositories.sh" + run: "./scripts/tchap/install-yarn-linked-repositories.sh" - name: Run tests with coverage run: "yarn coverage --ci" diff --git a/.gitignore b/.gitignore index cae2eb08c2..7173768aed 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ electron/pub /matrix-react-sdk /matrix-js-sdk /matrix-analytics-events -# yarn links dependencies generated with /scripts/install-yarn-linked-repositories.sh +# yarn links dependencies generated with /scripts/tchap/install-yarn-linked-repositories.sh /yarn-linked-dependencies # ignore folder for patch merging conflicts diff --git a/README.md b/README.md index d5717085f1..3542a9e83e 100644 --- a/README.md +++ b/README.md @@ -323,7 +323,7 @@ yarn start Alternatively, you can skip the above commands and only run the command below. The only difference is that both 'matrix-react-sdk and 'matrix-js-sdk' will be cloned inside the root project folder. ```bash -./scripts/install-yarn-linked-repositories.sh +./scripts/tchap/install-yarn-linked-repositories.sh yarn install yarn start ``` diff --git a/package.json b/package.json index bfd4daa279..a76c3cc871 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "test:cypress:open": "cypress open", "coverage": "yarn test --coverage", "analyse:unused-exports": "node ./scripts/analyse_unused_exports.js", - "postinstall": "./scripts/apply_patches.sh", + "postinstall": "./scripts/tchap/apply_patches.sh", "patch-package": "patch-package", "patches-reapply": "rm -rf node_modules/matrix-react-sdk; rm -rf node_modules/matrix-js-sdk; yarn install --force", - "patch-make": "node scripts/makePatch.ts" + "patch-make": "node scripts/tchap/makePatch.ts" }, "dependencies": { "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.12.tgz", diff --git a/scripts/apply_patches.sh b/scripts/tchap/apply_patches.sh similarity index 86% rename from scripts/apply_patches.sh rename to scripts/tchap/apply_patches.sh index ef31d9b001..170bb40ab6 100755 --- a/scripts/apply_patches.sh +++ b/scripts/tchap/apply_patches.sh @@ -3,7 +3,7 @@ # Script to apply the patches in patches directory, using patch-package. set -e -node scripts/checkPatchFile.js +node scripts/tchap/checkPatchFile.js for d in patches/*/ ; do echo "Patching $d..." diff --git a/scripts/checkPatchFile.js b/scripts/tchap/checkPatchFile.js similarity index 98% rename from scripts/checkPatchFile.js rename to scripts/tchap/checkPatchFile.js index 54a3940dc9..4d62a9b0cf 100644 --- a/scripts/checkPatchFile.js +++ b/scripts/tchap/checkPatchFile.js @@ -69,7 +69,7 @@ const getPatchDirs = () => { .map((dir) => dir.name); }; -const patchFile = require("../patches/patches.json"); +const patchFile = require("../../patches/patches.json"); const patchDirs = getPatchDirs(); checkForDuplicateFiles(patchFile); checkForMissingPatchDirs(patchFile, patchDirs); diff --git a/scripts/install-yarn-linked-repositories.sh b/scripts/tchap/install-yarn-linked-repositories.sh similarity index 100% rename from scripts/install-yarn-linked-repositories.sh rename to scripts/tchap/install-yarn-linked-repositories.sh diff --git a/scripts/makePatch.ts b/scripts/tchap/makePatch.ts similarity index 95% rename from scripts/makePatch.ts rename to scripts/tchap/makePatch.ts index 28c763168a..d2e54a38a8 100644 --- a/scripts/makePatch.ts +++ b/scripts/tchap/makePatch.ts @@ -1,4 +1,4 @@ -const patchFile = require("../patches/patches.json"); +const patchFile = require("../../patches/patches.json"); if (process.argv.length !== 3) { console.log("\nMissing patch name."); diff --git a/scripts/merge-patches.sh b/scripts/tchap/merge-patches.sh similarity index 100% rename from scripts/merge-patches.sh rename to scripts/tchap/merge-patches.sh From 62fa62dc3aad4480de904e036f8521e79253b47e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 31 Mar 2023 15:23:06 +0100 Subject: [PATCH 09/11] Prepare changelog for v1.11.28 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73b542df9f..34f15c04df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [1.11.28](https://github.com/vector-im/element-web/releases/tag/v1.11.28) (2023-03-31) +================================================================================================= + +## 🐛 Bug Fixes + * (No changes, version bumped to sync with element-desktop.) + Changes in [1.11.27](https://github.com/vector-im/element-web/releases/tag/v1.11.27) (2023-03-31) ================================================================================================= From f2160391c2a243e2a5f94ed16294ec2d4c2c3420 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 31 Mar 2023 15:23:07 +0100 Subject: [PATCH 10/11] v1.11.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 877cfb0509..0e462d489e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-web", - "version": "1.11.27", + "version": "1.11.28", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 20194de707244dc5704da52917164d4000e78819 Mon Sep 17 00:00:00 2001 From: Olivier D Date: Mon, 3 Apr 2023 10:35:35 +0200 Subject: [PATCH 11/11] unify package scripts, move ci files to tchap scripts folder (#519) * move ci files to tchap scripts folder * fix lint * avoid using install-yarn-linked-repositories when not necessary * unify tchap package of scalingo and github * add yarn install * add yarn linkedin dependencies --- .github/workflows/build.yml | 3 +- .github/workflows/create-release.yml | 13 ++++-- .github/workflows/static_analysis.yaml | 20 +-------- .prettierignore | 1 + package.json | 7 ++- .../tchap-common/css/_tchap_custom.pcss | 4 +- scripts/{ => tchap}/fetchdep.with.version.sh | 0 .../get-version-from-package-json.sh | 0 .../tchap/install-yarn-linked-repositories.sh | 4 +- scripts/{ => tchap}/package-github.sh | 4 +- scripts/{ => tchap}/package-scalingo-prod.sh | 9 ++-- scripts/tchap/package-tchap.sh | 43 +++++++++++++++++++ scripts/{ => tchap}/scalingo-deploy.sh | 0 src/util/TchapUrls.ts | 6 +-- 14 files changed, 74 insertions(+), 40 deletions(-) rename scripts/{ => tchap}/fetchdep.with.version.sh (100%) rename scripts/{ => tchap}/get-version-from-package-json.sh (100%) rename scripts/{ => tchap}/package-github.sh (91%) rename scripts/{ => tchap}/package-scalingo-prod.sh (77%) create mode 100755 scripts/tchap/package-tchap.sh rename scripts/{ => tchap}/scalingo-deploy.sh (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b978a92b2b..67847f1942 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,4 @@ #Build the application -#tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Build on: pull_request: {} @@ -23,7 +22,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: "./scripts/tchap/install-yarn-linked-repositories.sh" + run: "yarn install" - name: Build run: "yarn build" diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 0c9e368208..4c8fea3271 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -1,4 +1,4 @@ -name: Create tag and release for tchap-web +name: Build archives and create release for tchap-web on tag "tchap-" on: push: @@ -11,6 +11,7 @@ jobs: permissions: contents: write steps: + #Build artifacts for dev, preprod and prod - uses: actions/checkout@v3 - name: Get Node Version id: node_version @@ -19,24 +20,28 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ steps.node_version.outputs.node_version }} + - name: Install Dependencies + run: "yarn install" - name: Get Tchap Web Version id: version run: echo ::set-output name=version::$(node -e 'console.log(require("./package.json").version)') - name: Build the archive ${{ steps.version.outputs.version }} for dev - run: scripts/package-github.sh + run: scripts/tchap/package-tchap.sh env: CONFIG: dev - name: Build the archive ${{ steps.version.outputs.version }} for preprod - run: scripts/package-github.sh + run: scripts/tchap/package-tchap.sh env: CONFIG: preprod - name: Build the archive ${{ steps.version.outputs.version }} for prod - run: scripts/package-github.sh + run: scripts/tchap/package-tchap.sh env: CONFIG: prod - name: Get current date id: date run: echo "::set-output name=date::$(date +'%Y%m%d')" + + #create release - name: Create tchap-web release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 77714bd156..22a5b03b89 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -1,5 +1,4 @@ #Run a static analysis -#tchap modification : use "./scripts/tchap/install-yarn-linked-repositories.sh" instead of "./scripts/layered.sh" name: Static Analysis on: pull_request: {} @@ -68,24 +67,7 @@ jobs: # Needs branch matching as it inherits .stylelintrc.js from matrix-react-sdk - name: Install Dependencies - run: "./scripts/tchap/install-yarn-linked-repositories.sh" + run: "yarn install --pure-lockfile" - name: Run Linter run: "yarn run lint:style" -# tchap : analyse:unused-exports does not work well with tchap customisations, it raises exception for "default export" not used -#analyse_dead_code: -# name: "Analyse Dead Code" -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 - -# - uses: actions/setup-node@v3 -# with: -# cache: 'yarn' -# node-version: 16 - -# - name: Install Deps -# run: "scripts/tchap/install-yarn-linked-repositories.sh" - -# - name: Dead Code Analysis -# run: "yarn run analyse:unused-exports" diff --git a/.prettierignore b/.prettierignore index c9f5f08f95..8d84823e9e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -28,3 +28,4 @@ src/vector/modernizr.js #remove tchap files from prettier patches/patches.json +yarn-linked-dependencies/ \ No newline at end of file diff --git a/package.json b/package.json index a76c3cc871..a93400eb30 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,9 @@ "contribute.json" ], "style": "bundle.css", + "scripts_comments": { + "build:jitsi": "tchap don't need that, deactivate?" + }, "scripts": { "i18n": "matrix-gen-i18n", "prunei18n": "matrix-prune-i18n", @@ -43,8 +46,8 @@ "build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js", "build:github": "yarn build:genfiles && yarn build:bundle", "dist": "scripts/package.sh", - "scalingo-postbuild": "scripts/package-scalingo-prod.sh", - "start": "export VERSION=$(scripts/get-version-from-package-json.sh) && yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"", + "scalingo-postbuild": "scripts/tchap/package-tchap.sh", + "start": "export VERSION=$(scripts/tchap/get-version-from-package-json.sh) && yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"", "start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"", "start:res": "yarn build:jitsi && node scripts/copy-res.js -w", "start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot", diff --git a/res/themes/tchap-common/css/_tchap_custom.pcss b/res/themes/tchap-common/css/_tchap_custom.pcss index 10ee8407ad..37414d8f72 100644 --- a/res/themes/tchap-common/css/_tchap_custom.pcss +++ b/res/themes/tchap-common/css/_tchap_custom.pcss @@ -19,7 +19,7 @@ div.mx_SettingsTab.mx_SecurityUserSettingsTab > div:nth-child(4) > div:nth-child } /* change link color and decoration in login error when email is not autorized */ -.mx_Login_error.mx_Login_error_link{ +.mx_Login_error.mx_Login_error_link { color: $alert important!; text-decoration: underline important!; -} \ No newline at end of file +} diff --git a/scripts/fetchdep.with.version.sh b/scripts/tchap/fetchdep.with.version.sh similarity index 100% rename from scripts/fetchdep.with.version.sh rename to scripts/tchap/fetchdep.with.version.sh diff --git a/scripts/get-version-from-package-json.sh b/scripts/tchap/get-version-from-package-json.sh similarity index 100% rename from scripts/get-version-from-package-json.sh rename to scripts/tchap/get-version-from-package-json.sh diff --git a/scripts/tchap/install-yarn-linked-repositories.sh b/scripts/tchap/install-yarn-linked-repositories.sh index a60458cf42..d4d6630d97 100755 --- a/scripts/tchap/install-yarn-linked-repositories.sh +++ b/scripts/tchap/install-yarn-linked-repositories.sh @@ -32,7 +32,7 @@ mkdir -p yarn-linked-dependencies cd yarn-linked-dependencies # Set up the js-sdk first -../scripts/fetchdep.with.version.sh matrix-org matrix-js-sdk $MATRIX_JS_SDK_VERSION +../scripts/tchap/fetchdep.with.version.sh matrix-org matrix-js-sdk $MATRIX_JS_SDK_VERSION pushd matrix-js-sdk yarn unlink # :TCHAP: for local build, undo previous links if present. yarn link @@ -50,7 +50,7 @@ popd #popd # Now set up the react-sdk -../scripts/fetchdep.with.version.sh matrix-org matrix-react-sdk $MATRIX_REACT_SDK_VERSION +../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 diff --git a/scripts/package-github.sh b/scripts/tchap/package-github.sh similarity index 91% rename from scripts/package-github.sh rename to scripts/tchap/package-github.sh index 76151e35c8..1e94c63205 100755 --- a/scripts/package-github.sh +++ b/scripts/tchap/package-github.sh @@ -1,12 +1,14 @@ #!/bin/bash +#DEPRECRATED, see package-tchap.sh + # Tchap: File copied from scripts/package.json. set -e today=$(date +%Y%m%d) -version=$(./scripts/get-version-from-package-json.sh) +version=$(./scripts/tchap/get-version-from-package-json.sh) export VERSION=$version echo "VERSION is set to $VERSION" diff --git a/scripts/package-scalingo-prod.sh b/scripts/tchap/package-scalingo-prod.sh similarity index 77% rename from scripts/package-scalingo-prod.sh rename to scripts/tchap/package-scalingo-prod.sh index dcbafc2397..a7762fa09a 100755 --- a/scripts/package-scalingo-prod.sh +++ b/scripts/tchap/package-scalingo-prod.sh @@ -1,12 +1,15 @@ #!/bin/bash +#DEPRECRATED, see package-tchap.sh + # Tchap: File copied from scripts/package.json. +# use package-github instead set -e today=$(date +%Y%m%d) -version=$(./scripts/get-version-from-package-json.sh) +version=$(./scripts/tchap/get-version-from-package-json.sh) export VERSION=$version echo "VERSION is set to $VERSION" @@ -33,8 +36,8 @@ fi # Copy the files in /dist, ready to be served. cp -r tchap-$version/* dist/ -# Also make a tar file. Useful for releases. -tar chvzf tchap-$version-$CONFIG-$today.tar.gz dist +# Also make a tar file. Useful for releases. EDIT: not needed +#tar chvzf tchap-$version-$CONFIG-$today.tar.gz dist rm -r tchap-$version echo diff --git a/scripts/tchap/package-tchap.sh b/scripts/tchap/package-tchap.sh new file mode 100755 index 0000000000..c1efe27250 --- /dev/null +++ b/scripts/tchap/package-tchap.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Tchap: File copied from scripts/package.js +# This file is meant to be used in scalingo and github actions + +set -e + +today=$(date +%Y%m%d) + +version=$(./scripts/tchap/get-version-from-package-json.sh) +export VERSION=$version +echo "VERSION is set to $VERSION" + +if [[ -n "$CONFIG" ]]; then + echo "CONFIG=$CONFIG" + cp "config.$CONFIG.json" config.json + echo "Using config.$CONFIG.json" +else + echo "No config specified, using config.json." +fi + +yarn clean +yarn build + +mkdir -p dist +cp -r webapp tchap-$version + +# if $version looks like semver with leading v, strip it before writing to file +if [[ ${version} =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then + echo ${version:1} > tchap-$version/version +else + echo ${version} > tchap-$version/version +fi + +# Copy the files in /dist, ready to be served. +cp -r tchap-$version/* dist/ + +# Also make a tar file. Useful for releases. +#tar chvzf tchap-$version-$CONFIG-$today.tar.gz dist +rm -r tchap-$version + +echo +echo "Packaged tchap-$version-$CONFIG" diff --git a/scripts/scalingo-deploy.sh b/scripts/tchap/scalingo-deploy.sh similarity index 100% rename from scripts/scalingo-deploy.sh rename to scripts/tchap/scalingo-deploy.sh diff --git a/src/util/TchapUrls.ts b/src/util/TchapUrls.ts index 7dd0bfcabd..36c7bdbfab 100644 --- a/src/util/TchapUrls.ts +++ b/src/util/TchapUrls.ts @@ -1,8 +1,4 @@ - - export default class TchapUrls { - //url to request the opening of a new domain on Tchap public static requestDomainUrl = "https://www.demarches-simplifiees.fr/commencer/utiliser-tchap"; - -} \ No newline at end of file +}