From d1b0bad7f727ca4f01240f5869e3bfd39cb8e20d Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 12 Sep 2026 11:43:14 -0400 Subject: [PATCH] chore(lotus): clear pre-existing lint/prettier debt ahead of the CI gate `pnpm lint:eslint` and `pnpm prettier:check` were never run by fork CI (#5), and lotus HEAD failed both: a missing return type in lotusDecorations, a type-only import in lotusWidget, and formatting drift in lotusAudioInject, lotusFocus, lotusWidget and .gitea/workflows/ci.yml. No behaviour change. Both gates now pass clean so they can be turned on. Refs #5 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- .gitea/workflows/ci.yml | 16 ++++++++-------- src/lotus/lotusAudioInject.ts | 5 ++++- src/lotus/lotusDecorations.ts | 2 +- src/lotus/lotusFocus.ts | 3 +-- src/lotus/lotusWidget.ts | 19 +++++++++++++------ 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 526965ed..5d6719ad 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,13 +16,13 @@ name: CI on: push: branches: [lotus] - tags: ['v*'] + tags: ["v*"] pull_request: branches: [lotus] env: # element-call's build:full sets 16384 already; keep parity for safety. - NODE_OPTIONS: '--max-old-space-size=16384' + NODE_OPTIONS: "--max-old-space-size=16384" # Stamp the build so analytics/rageshakes aren't labelled "dev". VITE_APP_VERSION: ${{ github.ref_name }} @@ -37,10 +37,10 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: '.node-version' # Node 24 + node-version-file: ".node-version" # Node 24 # registry-url wires up the Gitea-scoped registry + auth for publish - registry-url: 'https://code.lotusguild.org/api/packages/LotusGuild/npm/' - scope: '@lotusguild' + registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/" + scope: "@lotusguild" - name: Enable corepack (pnpm from packageManager field) run: corepack enable @@ -88,9 +88,9 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version-file: '.node-version' - registry-url: 'https://code.lotusguild.org/api/packages/LotusGuild/npm/' - scope: '@lotusguild' + node-version-file: ".node-version" + registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/" + scope: "@lotusguild" - name: Enable corepack run: corepack enable diff --git a/src/lotus/lotusAudioInject.ts b/src/lotus/lotusAudioInject.ts index cc25a667..c385d7ed 100644 --- a/src/lotus/lotusAudioInject.ts +++ b/src/lotus/lotusAudioInject.ts @@ -240,7 +240,10 @@ async function playInjectedClip( const durationMs = Number.isFinite(buffer.duration) ? buffer.duration * 1000 + 500 : MAX_CLIP_MS; - const guard = setTimeout(cleanup, Math.min(MAX_CLIP_MS, Math.max(0, durationMs))); + const guard = setTimeout( + cleanup, + Math.min(MAX_CLIP_MS, Math.max(0, durationMs)), + ); source.addEventListener("ended", () => clearTimeout(guard)); source.start(); diff --git a/src/lotus/lotusDecorations.ts b/src/lotus/lotusDecorations.ts index ed7216e5..acb656bb 100644 --- a/src/lotus/lotusDecorations.ts +++ b/src/lotus/lotusDecorations.ts @@ -84,7 +84,7 @@ export function startLotusDecorations(): () => void { emit(); }; w.lazyActions.on(LotusWidgetActions.Decorations, handler); - unregister = () => + unregister = (): void => w.lazyActions.off(LotusWidgetActions.Decorations, handler); } registrations += 1; diff --git a/src/lotus/lotusFocus.ts b/src/lotus/lotusFocus.ts index 3868497e..85973764 100644 --- a/src/lotus/lotusFocus.ts +++ b/src/lotus/lotusFocus.ts @@ -38,6 +38,5 @@ export function startLotusFocus(vm: CallViewModel): () => void { }; w.lazyActions.on(LotusWidgetActions.FocusParticipant, handler); - return () => - w.lazyActions.off(LotusWidgetActions.FocusParticipant, handler); + return () => w.lazyActions.off(LotusWidgetActions.FocusParticipant, handler); } diff --git a/src/lotus/lotusWidget.ts b/src/lotus/lotusWidget.ts index 77d7d7ba..764cba3f 100644 --- a/src/lotus/lotusWidget.ts +++ b/src/lotus/lotusWidget.ts @@ -17,7 +17,7 @@ Please see LICENSE in the repository root for full details. import { logger } from "matrix-js-sdk/lib/logger"; import { widget } from "../widget"; -import { LotusWidgetActions } from "./lotusActions"; +import { type LotusWidgetActions } from "./lotusActions"; export { LotusWidgetActions } from "./lotusActions"; @@ -33,7 +33,9 @@ export function lotusParam(name: string): string | null { // Match EC's own ParamParser precedence: the hash fragment wins over the // query string. So seed from the fragment first, then fill gaps from query. const hash = window.location.hash.replace(/^#\/?/, ""); - const hashQuery = hash.includes("?") ? hash.slice(hash.indexOf("?") + 1) : ""; + const hashQuery = hash.includes("?") + ? hash.slice(hash.indexOf("?") + 1) + : ""; cachedParams = new URLSearchParams(hashQuery); for (const [k, v] of new URLSearchParams(window.location.search)) { if (!cachedParams.has(k)) cachedParams.append(k, v); @@ -53,11 +55,16 @@ export function lotusFlag(name: string): boolean { * rejection when the host hasn't (yet) registered a handler for it. Returns * true if the widget transport was available to attempt the send. */ -export function lotusSendToHost(action: LotusWidgetActions, data: unknown): boolean { +export function lotusSendToHost( + action: LotusWidgetActions, + data: unknown, +): boolean { const api = widget?.api; if (!api) return false; - void api.transport.send(action, data as Record).catch((e) => { - logger.debug(`[lotus] host did not ack ${action}`, e); - }); + void api.transport + .send(action, data as Record) + .catch((e) => { + logger.debug(`[lotus] host did not ack ${action}`, e); + }); return true; }