






















@@ -48,6 +48,13 @@ const DEPRECATED_TEST_BARREL_ALLOWED_REFERENCE_FILES = new Set([
4848"src/plugins/contracts/plugin-entry-guardrails.test.ts",
4949"src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts",
5050]);
51+const MATRIX_RUNTIME_DEPS = [
52+"@matrix-org/matrix-sdk-crypto-wasm",
53+"@matrix-org/matrix-sdk-crypto-nodejs",
54+"fake-indexeddb",
55+"matrix-js-sdk",
56+"music-metadata",
57+] as const;
51585259function collectPluginSdkPackageExports(): string[] {
5360const packageJson = JSON.parse(readFileSync(resolve(REPO_ROOT, "package.json"), "utf8")) as {
@@ -173,10 +180,12 @@ function collectGenericCoreOwnerNameLeaks(): Array<{ file: string; match: string
173180function readRootPackageJson(): {
174181dependencies?: Record<string, string>;
175182optionalDependencies?: Record<string, string>;
183+files?: string[];
176184} {
177185return JSON.parse(readFileSync(resolve(REPO_ROOT, "package.json"), "utf8")) as {
178186dependencies?: Record<string, string>;
179187optionalDependencies?: Record<string, string>;
188+files?: string[];
180189};
181190}
182191@@ -722,16 +731,13 @@ describe("plugin-sdk package contract guardrails", () => {
722731});
723732724733it("keeps Matrix dependencies local to the Matrix plugin", () => {
725-const rootRuntimeDeps = collectRuntimeDependencySpecs(readRootPackageJson());
734+const rootPackageJson = readRootPackageJson();
735+const rootRuntimeDeps = collectRuntimeDependencySpecs(rootPackageJson);
726736const matrixPackageJson = readMatrixPackageJson();
727737const matrixRuntimeDeps = collectRuntimeDependencySpecs(matrixPackageJson);
728738729-for (const dep of [
730-"@matrix-org/matrix-sdk-crypto-wasm",
731-"@matrix-org/matrix-sdk-crypto-nodejs",
732-"fake-indexeddb",
733-"matrix-js-sdk",
734-]) {
739+expect(rootPackageJson.files).toContain("!dist/extensions/matrix/**");
740+for (const dep of MATRIX_RUNTIME_DEPS) {
735741expect(matrixRuntimeDeps.get(dep)).toBeTypeOf("string");
736742expect(matrixRuntimeDeps.get(dep)).not.toBe("");
737743expect(rootRuntimeDeps.has(dep)).toBe(false);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。