From 9dd8e82604e3aef2bd32d428c23b38306f168a42 Mon Sep 17 00:00:00 2001 From: Will Hunt <2072976+Half-Shot@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:48:24 +0100 Subject: [PATCH] Fix Module API api docs not regenerating on build (#34429) * Always overwrite module API files * Report if the module API changes unexpected in CI * Update docs * Add command to the matrix * actually filter by project --- .github/workflows/static_analysis.yaml | 14 ++++++++++++++ packages/module-api/element-web-module-api.api.md | 10 +++++----- packages/module-api/vite.config.ts | 3 ++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 8b6257419c..f05a7c8ca1 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -43,6 +43,11 @@ jobs: - name: Rethemendex Check command: "rethemendex" assert-diff: true + - name: Module API Docs Check + command: "build" + install: normal + project: "@element-hq/element-web-module-api" + assert-diff: true - name: Docs install: layered command: "docs:build" @@ -74,6 +79,15 @@ jobs: run: pnpm nx run-many -t "$CMD" -p env: CMD: ${{ matrix.command }} + if: matrix.project == '' + + - name: Run ${{ matrix.command }} on ${{ matrix.project }} + run: pnpm nx run -t "$CMD" -p "$PROJECT" + env: + CMD: ${{ matrix.command }} + PROJECT: ${{ matrix.project }} + + if: matrix.project - name: Assert no changes run: git diff --exit-code diff --git a/packages/module-api/element-web-module-api.api.md b/packages/module-api/element-web-module-api.api.md index 6557e89ac2..14bd20f0ea 100644 --- a/packages/module-api/element-web-module-api.api.md +++ b/packages/module-api/element-web-module-api.api.md @@ -180,8 +180,8 @@ export type CustomLoginComponentProps = { serverConfig: CustomLoginComponentPropsServerConfig; fragmentAfterLogin?: string; children?: ReactNode; - onLoggedIn(data: AccountAuthInfo): void; - onServerConfigChange(config: CustomLoginComponentPropsServerConfig): void; + onLoggedIn(this: void, data: AccountAuthInfo): void; + onServerConfigChange(this: void, config: CustomLoginComponentPropsServerConfig): void; }; // @alpha @@ -231,7 +231,7 @@ export type DialogHandle = { ok: boolean; model: M | null; }>; - close(): void; + close(this: void): void; }; // @public @@ -241,8 +241,8 @@ export interface DialogOptions { // @public export type DialogProps = { - onSubmit(model: M): void; - onCancel(): void; + onSubmit(this: void, model: M): void; + onCancel(this: void): void; }; // @alpha @deprecated (undocumented) diff --git a/packages/module-api/vite.config.ts b/packages/module-api/vite.config.ts index 08e85ec536..85e24c4a8e 100644 --- a/packages/module-api/vite.config.ts +++ b/packages/module-api/vite.config.ts @@ -31,7 +31,8 @@ export default defineConfig({ bundleTypes: { configPath: "./api-extractor.json", invokeOptions: { - localBuild: !!process.env.CI, + // Always overwrite element-web-module-api.api.md + localBuild: true, typescriptCompilerFolder: resolve(require.resolve("@typescript/old"), "../.."), }, },