Merge upstream v1.12.26 - reconnect the fork to Element Web (management #0099)
The repo had no upstream ancestry: a whole tree arrived in one commit in May, so
every update meant re-applying our patches by hand onto a fresh checkout, and a file
Element moved would take our lines with it silently.
The real base was found by measuring tree distance across develop rather than trusting
the changelog: deadd548, not the v1.12.17 tag. With that set as a temporary graft, this
merge computed as a proper three-way merge - 32 conflicts instead of 1757.
Resolutions, each decided rather than defaulted:
- 24 GitHub workflows stay deleted; we build on GitLab CI.
- MImageBody.tsx is gone upstream, migrated to MVVM. Our ClamAV error label moved into
ImageBodyViewModel.computeErrorLabel, ahead of the DecryptError branch, matching what
VideoBodyViewModel and FileBodyViewModel already do.
- Upstream extracted the room list item body into RoomListItemContent. Our call
participants list and its getInitials helper moved there; both sides' CSS classes and
both sides' props are kept.
- matrix-js-sdk follows upstream at 42.2.0 - our git ref pin was a workaround for a
stale ref, and following upstream is the point of this merge.
- Element Call stays ours. Checked before deciding: @element-hq/element-call-embedded
is referenced nowhere in the tree, while webpack.config.ts needs
@sorb/threadnet-call-embedded, so taking upstream's line would have deleted the noise
suppression from #0054 without a word.
The lockfile was regenerated with pnpm 11.20.0, which upstream now requires through
devEngines. CI already runs corepack enable, and onFail: download makes it fetch that
version by itself.
Not yet accepted: this needs a build and the ClamAV functional test - send an encrypted
file, receive a rejected one - before it goes near main.
This commit is contained in:
+31
-19
@@ -14,13 +14,13 @@ Please see LICENSE files in the repository root for full details.
|
||||
// This tool is a helpful substitute to `pnpm link` as that modifies the package.json & pnpm-lock.yaml files.
|
||||
|
||||
import * as fs from "node:fs/promises";
|
||||
import { join, dirname } from "node:path";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const configPath = join(__dirname, "..", ".link-config");
|
||||
const nodeModulesPath = join(__dirname, "..", "node_modules");
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const configPath = path.join(__dirname, "..", ".link-config");
|
||||
const nodeModulesPath = path.join(__dirname, "..", "node_modules");
|
||||
|
||||
try {
|
||||
if (process.env.PLAYWRIGHT_COMMON_DOCKER) process.exit(0); // Skip in docker env
|
||||
@@ -28,28 +28,40 @@ try {
|
||||
const configFile = await fs.readFile(configPath, "utf-8");
|
||||
for (const line of configFile.trim().split("\n")) {
|
||||
if (!line || line.startsWith("#")) continue;
|
||||
const [dependency, path] = line.split("=");
|
||||
const dependencyPath = join(nodeModulesPath, dependency);
|
||||
const [dependency, targetPath, dir] = line.split("=");
|
||||
const nodeModules = dir ? path.join(dir, "node_modules") : nodeModulesPath;
|
||||
const dependencyPath = path.join(nodeModules, dependency);
|
||||
|
||||
try {
|
||||
const stat = await fs.stat(dependencyPath);
|
||||
if (stat.isSymbolicLink()) {
|
||||
const linkPath = await fs.readlink(dependencyPath);
|
||||
if (linkPath === path) {
|
||||
// already done
|
||||
continue;
|
||||
try {
|
||||
const stat = await fs.lstat(dependencyPath);
|
||||
console.log(`Existing is ${stat.isSymbolicLink() ? "symlink" : "directory"}`);
|
||||
if (stat.isSymbolicLink()) {
|
||||
const linkPath = await fs.readlink(dependencyPath);
|
||||
if (linkPath === targetPath) {
|
||||
// already done
|
||||
continue;
|
||||
} else {
|
||||
await fs.unlink(dependencyPath);
|
||||
}
|
||||
} else {
|
||||
await fs.unlink(dependencyPath);
|
||||
await fs.rm(dependencyPath, { recursive: true });
|
||||
}
|
||||
} catch (e: any) {
|
||||
// fs.lstat throws ENOENT if the path doesn't exist (on Windows)
|
||||
if (e.code === "ENOENT") {
|
||||
console.log("Received ENOENT error on dependency path - assuming it doesn't exist");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
await fs.rm(dependencyPath, { recursive: true });
|
||||
}
|
||||
|
||||
console.log(`Linking ${dependency} to ${path}`);
|
||||
await fs.symlink(path, dependencyPath);
|
||||
console.log(`Linking ${dependency} to ${targetPath}`);
|
||||
await fs.symlink(targetPath, dependencyPath, "junction"); // use a junction type to avoid EPERM errors on Windows
|
||||
|
||||
const pkgJson = await fs.readFile(join(path, "package.json"), "utf-8");
|
||||
const pkgManager = JSON.parse(pkgJson)["packageManager"]?.split("@").at(0) ?? "yarn";
|
||||
const pkgJson = JSON.parse(await fs.readFile(path.join(targetPath, "package.json"), "utf-8"));
|
||||
const pkgManager =
|
||||
pkgJson.devEngines?.packageManager?.name ?? pkgJson.packageManager?.split("@").at(0) ?? "yarn";
|
||||
// pnpm install may have wiped out the `node_modules` dir so we have to restore it
|
||||
execSync(`${pkgManager} install --ignore-scripts --frozen-lockfile`, {
|
||||
cwd: dependencyPath,
|
||||
|
||||
Reference in New Issue
Block a user