From 06fef8af86f78a74ec6c188cdd35321f33394013 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 15:40:28 -0700 Subject: [PATCH 1/6] fix: type-check only Cloudflare Worker sources --- tsconfig.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 902bbe2..fab1ffd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,9 +3,13 @@ "target": "ES2021", "module": "ES2022", "lib": ["ES2021"], - "types": ["@cloudflare/workers-types", "node"], + "types": ["@cloudflare/workers-types"], "moduleResolution": "node", "noEmit": true, "strict": true - } + }, + "include": [ + "src/index.ts", + "src/filters.ts" + ] } From 54b97c844f76d26fab237479243579ff56bfc6dc Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 15:40:32 -0700 Subject: [PATCH 2/6] fix: keep tests compatible with strict TypeScript --- src/filters.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.test.ts b/src/filters.test.ts index d5814c0..cd7e769 100644 --- a/src/filters.test.ts +++ b/src/filters.test.ts @@ -1,4 +1,4 @@ -import assert from 'node:assert/strict'; +import * as assert from 'node:assert/strict'; import test from 'node:test'; import { evaluateImmediateFilter, From 8d3a1b70c4a478aa8dbbd1cc403423fd217d80a7 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 15:41:19 -0700 Subject: [PATCH 3/6] ci: validate Worker changes before merge --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..10aae4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Validate Worker + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + test-and-typecheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + - name: Type-check Cloudflare Worker + run: npm run typecheck From 2d376aef229f8c67506d27bbf0464b552ae29b94 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 16:08:09 -0700 Subject: [PATCH 4/6] fix: type-check Node CLI and tests separately --- tsconfig.node.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tsconfig.node.json diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..72c92ee --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2021", + "module": "ES2022", + "lib": ["ES2021"], + "types": ["node"], + "moduleResolution": "node", + "noEmit": true, + "strict": true, + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/matrix-login.ts", + "src/**/*.test.ts" + ] +} From 213e23abc08d04e2a41a76e4548bccfbccb26ca4 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 16:08:27 -0700 Subject: [PATCH 5/6] fix: type-check Node CLI and tests separately --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 01fc417..c1caa02 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev": "wrangler dev", "tail": "wrangler tail", "matrix-login": "tsx src/matrix-login.ts", - "typecheck": "tsc --noEmit", + "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.node.json --noEmit", "test": "tsx --test src/*.test.ts" }, "keywords": [ @@ -22,6 +22,7 @@ "devDependencies": { "@cloudflare/workers-types": "^4.0.0", "@types/node": "^20.0.0", + "@types/prompts": "^2.4.9", "prompts": "^2.4.2", "tsx": "^4.0.0", "typescript": "^5.0.0", From e88ed8645fb1e65d57efd959adfa1b7c0a5f5d8b Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 17 Jul 2026 16:09:28 -0700 Subject: [PATCH 6/6] fix: type Matrix login prompts --- src/matrix-login.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix-login.ts b/src/matrix-login.ts index f0b7a47..da94a17 100644 --- a/src/matrix-login.ts +++ b/src/matrix-login.ts @@ -2,7 +2,7 @@ // src/matrix-login.ts // Script to login to Matrix and get a stable access token -import prompts from 'prompts'; +import prompts, { type PromptObject } from 'prompts'; interface MatrixLoginResponse { access_token: string; @@ -31,7 +31,7 @@ async function main() { try { // Get user input using prompts library - const questions = [ + const questions: PromptObject[] = [ { type: 'text', name: 'homeserver',