Switch from yarn classic to pnpm (#31971)

* Switch shared-components from yarn classic to pnpm

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch element-web from yarn classic to pnpm

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch CI to pnpm

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update docs & comments

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Hold back postcss to match yarn.lock & use workspace protocol

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Tweak CI

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Rid the world of `$(res)`

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch to type=module

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix module import

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Make knip happy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update playwright imports

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Make docker build happy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove stale params

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix badly formatted logging

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch to lodash-es

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Make jest happier

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Switch element-web to ESM

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update testcontainers imports

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix modernizr cjs

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix modernizr cjs ignore files

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Move modernizr sonar exclusion to exclude everything

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update playwright tests for esm compat

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add pnpm-link utility

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Test matrix-web-i18n

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Discard changes to src/vector/index.ts

* Update playwright-common

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Use catalogs

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve pnpm-link script

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Use pnpm import to regenerate lockfile from yarn.lock

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2026-02-11 10:35:29 +00:00
committed by GitHub
parent 9360f0e5e2
commit ffd4270051
51 changed files with 21521 additions and 21944 deletions

View File

@@ -249,7 +249,7 @@ Together, the options might look like this in your config:
Note that `index.html` also has an og:image meta tag that is set to an image hosted on element.io. This is the image used if
links to your copy of Element appear in some websites like Facebook, and indeed Element itself. This has to be static in the HTML
and an absolute URL (and HTTP rather than HTTPS), so it's not possible for this to be an option in config.json. If you'd like to
change it, you can build Element, but run `RIOT_OG_IMAGE_URL="http://example.com/logo.png" yarn build`. Alternatively, you can edit
change it, you can build Element, but run `RIOT_OG_IMAGE_URL="http://example.com/logo.png" pnpm build`. Alternatively, you can edit
the `og:image` meta tag in `index.html` directly each time you download a new version of Element.
## SSO setup

View File

@@ -4,14 +4,14 @@
> DEPRECATED. Use [Element web module api](https://github.com/element-hq/element-modules/tree/main/packages/element-web-module-api) instead.
The module system in Element Web is a way to add or modify functionality of Element Web itself, bundled at compile time
for the app. This means that modules are loaded as part of the `yarn build` process but have an effect on user experience
for the app. This means that modules are loaded as part of the `pnpm build` process but have an effect on user experience
at runtime.
## Installing modules
If you already have a module you want to install, such as our [ILAG Module](https://github.com/element-hq/element-web-ilag-module),
then copy `build_config.sample.yaml` to `build_config.yaml` in the same directory. In your new `build_config.yaml` simply
add the reference to the module as described by the sample file, using the same syntax you would for `yarn add`:
add the reference to the module as described by the sample file, using the same syntax you would for `pnpm add`:
```yaml
modules:
@@ -19,7 +19,7 @@ modules:
- "@vector-im/element-web-ilag-module@latest"
```
Then build the app as you normally would: `yarn build` or `yarn dist` (if compatible on your platform). If you are building
Then build the app as you normally would: `pnpm build` or `pnpm dist` (if compatible on your platform). If you are building
the Docker image then ensure your `build_config.yaml` ends up in the build directory. Usually this works fine if you use
the current directory as the build context (the `.` in `docker build -t my-element-web .`).
@@ -41,9 +41,9 @@ The following requirements are key for any module:
1. The module must depend on `@matrix-org/react-sdk-module-api` (usually as a dev dependency).
2. The module's `main` entrypoint must have a `default` export for the `RuntimeModule` instance, supporting a constructor
which takes a single parameter: a `ModuleApi` instance. This instance is passed to `super()`.
3. The module must be deployed in a way where `yarn add` can access it, as that is how the build system will try to
3. The module must be deployed in a way where `pnpm add` can access it, as that is how the build system will try to
install it. Note that while this is often NPM, it can also be a GitHub/GitLab repo or private NPM registry.
Be careful when using git dependencies in yarn classic, many lifecycle scripts will not be executed which may mean
Be careful when using git dependencies in pnpm classic, many lifecycle scripts will not be executed which may mean
that your module is not built and thus may fail to be imported.
... and that's pretty much it. As with any code, please be responsible and call things in line with the documentation.

View File

@@ -43,7 +43,7 @@ Follow the Playwright installation instructions:
- **System dependencies:** <https://playwright.dev/docs/browsers#install-system-dependencies>
```sh
yarn playwright install --with-deps
pnpm playwright install --with-deps
```
### 2. Container Runtime
@@ -56,7 +56,7 @@ Element Web E2E tests require an instance running on `http://localhost:8080` (co
You can either:
- **Run manually:** `yarn start` in a separate terminal (not working for screenshot tests running in a docker environment).
- **Run manually:** `pnpm start` in a separate terminal (not working for screenshot tests running in a docker environment).
- **Auto-start:** Playwright will start the webserver automatically if it's not already running
## Running the Tests
@@ -68,19 +68,19 @@ Our main Playwright tests run against a full Element Web instance with Synapse/D
**Run all E2E tests:**
```sh
yarn run test:playwright
pnpm run test:playwright
```
**Run a specific test file:**
```sh
yarn run test:playwright playwright/e2e/register/register.spec.ts
pnpm run test:playwright playwright/e2e/register/register.spec.ts
```
**Run tests interactively with Playwright UI:**
```sh
yarn run test:playwright:open
pnpm run test:playwright:open
```
**Run screenshot tests only:**
@@ -89,7 +89,7 @@ yarn run test:playwright:open
> This command run the playwright tests in a docker environment.
```sh
yarn run test:playwright:screenshots
pnpm run test:playwright:screenshots
```
For more information about visual testing, see [Visual Testing](playwright#visual-testing).
@@ -387,7 +387,7 @@ This command runs only tests tagged with `@screenshot` in the Docker environment
When you need to update screenshot baselines (e.g., after intentional UI changes):
```sh
yarn run test:playwright:screenshots
pnpm run test:playwright:screenshots
```
**Important:** Always use this command to update screenshots rather than running tests locally with `--update-snapshots`.

View File

@@ -50,7 +50,7 @@ We are aiming for a set of common strings to be shared then some more localised
1. Check if the import `import { _t } from ".../languageHandler";` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add `_t()` to your string passing the translation key you come up with based on the rules above. If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `yarn i18n` to add the keys to `src/i18n/strings/en_EN.json`
1. Run `pnpm i18n` to add the keys to `src/i18n/strings/en_EN.json`
1. Modify the new entries in `src/i18n/strings/en_EN.json` with the English (UK) translations for the added keys.
## Editing existing strings