Bump @matrix-org/react-sdk-module-api from 1.0.0 to 2.0.0 (#25986)

pull/26029/head
Dominik Henneke 2023-08-18 14:03:28 +02:00 committed by GitHub
parent c026879237
commit 65f7545ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 2 deletions

View File

@ -185,9 +185,20 @@ function getModuleApiVersionFor(moduleName: string): string {
return findDepVersionInPackageJson(moduleApiDepName, pkgJsonStr); return findDepVersionInPackageJson(moduleApiDepName, pkgJsonStr);
} }
// A list of Module API versions that are supported in addition to the currently installed one
// defined in the package.json. This is necessary because semantic versioning is applied to both
// the Module-side surface of the API and the Client-side surface of the API. So breaking changes
// in the Client-side surface lead to a major bump even though the Module-side surface stays
// compatible. We aim to not break the Module-side surface so we maintain a list of compatible
// older versions.
const backwardsCompatibleMajorVersions = ["1.0.0"];
function isModuleVersionCompatible(ourApiVersion: string, moduleApiVersion: string): boolean { function isModuleVersionCompatible(ourApiVersion: string, moduleApiVersion: string): boolean {
if (!moduleApiVersion) return false; if (!moduleApiVersion) return false;
return semver.satisfies(ourApiVersion, moduleApiVersion); return (
semver.satisfies(ourApiVersion, moduleApiVersion) ||
backwardsCompatibleMajorVersions.some((version) => semver.satisfies(version, moduleApiVersion))
);
} }
function writeModulesTs(content: string): void { function writeModulesTs(content: string): void {

View File

@ -70,7 +70,7 @@
}, },
"dependencies": { "dependencies": {
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz", "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz",
"@matrix-org/react-sdk-module-api": "^1.0.0", "@matrix-org/react-sdk-module-api": "^2.0.0",
"gfm.css": "^1.1.2", "gfm.css": "^1.1.2",
"jsrsasign": "^10.5.25", "jsrsasign": "^10.5.25",
"katex": "^0.16.0", "katex": "^0.16.0",

View File

@ -216,6 +216,10 @@ module.exports = (env, argv) => {
// Same goes for js/react-sdk - we don't need two copies. // Same goes for js/react-sdk - we don't need two copies.
"matrix-js-sdk": path.resolve(__dirname, "node_modules/matrix-js-sdk"), "matrix-js-sdk": path.resolve(__dirname, "node_modules/matrix-js-sdk"),
"matrix-react-sdk": path.resolve(__dirname, "node_modules/matrix-react-sdk"), "matrix-react-sdk": path.resolve(__dirname, "node_modules/matrix-react-sdk"),
"@matrix-org/react-sdk-module-api": path.resolve(
__dirname,
"node_modules/@matrix-org/react-sdk-module-api",
),
// and matrix-events-sdk & matrix-widget-api // and matrix-events-sdk & matrix-widget-api
"matrix-events-sdk": path.resolve(__dirname, "node_modules/matrix-events-sdk"), "matrix-events-sdk": path.resolve(__dirname, "node_modules/matrix-events-sdk"),
"matrix-widget-api": path.resolve(__dirname, "node_modules/matrix-widget-api"), "matrix-widget-api": path.resolve(__dirname, "node_modules/matrix-widget-api"),

View File

@ -1636,6 +1636,13 @@
dependencies: dependencies:
"@babel/runtime" "^7.17.9" "@babel/runtime" "^7.17.9"
"@matrix-org/react-sdk-module-api@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@matrix-org/react-sdk-module-api/-/react-sdk-module-api-2.0.0.tgz#f894af429ad352d5151dc7240cc2f987d9dab780"
integrity sha512-o/M+IfB3bu4S3yTO10zMRiEtTQagV9AJ9cNmq8a/ksniCx3QLShtzWeL5FkTa8co0ab/VdxdqTlEux0aStT/dg==
dependencies:
"@babel/runtime" "^7.17.9"
"@mrmlnc/readdir-enhanced@^2.2.1": "@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1" version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"