Skip to content

fix: repair the build, make lint pass, de-flake CI - #7

Open
Daggle24 wants to merge 2 commits into
kobie3717:mainfrom
Biznder:pr/ci-green
Open

Daggle24 wants to merge 2 commits into
kobie3717:mainfrom
Biznder:pr/ci-green

Conversation

@Daggle24

Copy link
Copy Markdown

What does this change?

Two commits that make main build and CI green:

  1. index.ts re-exports getRateLimitStats, timeUntilNext, RateLimitStats and GlobalRateLimitStats from middleware.js, but those symbols don't exist anywhere in the codebase — tsc and the tsup DTS build fail on a clean checkout, which also breaks npm install from a git URL (the prepare script). It also re-exports the trigger-router utilities, which exist in middleware/triggerRouter.ts but were never surfaced through middleware.ts. This commit surfaces the real ones and drops the four phantoms.
  2. Lint fixes (the (string & {}) idiom in session-key.ts → (string & Record<never, never>), same type without the banned syntax; the intentional require('express') in admin.ts needed no-var-requires disabled alongside no-require-imports; two unused test imports) and one flaky assertion: health.uptime is Date.now() - startTime in ms, legitimately 0 within the same millisecond, so >= 0 instead of > 0.

Why is it needed?

CI has been failing on every push to main since June (build + lint). This restores the green baseline so subsequent PRs can be judged by their own diff.

How was it tested?

npx tsc --noEmit, npm run lint (0 problems), npm run build, npx vitest run (226 passed) — the same four steps ci.yml runs, on Node 22.

Any breaking changes?

The four removed exports never compiled, so nothing that builds today can be importing them. If they were meant as a planned API, happy to implement them instead — say the word.

Daggle24 added 2 commits July 30, 2026 12:44
index.ts re-exported getRateLimitStats, timeUntilNext, RateLimitStats and
GlobalRateLimitStats from middleware.js, but those symbols do not exist
anywhere in the codebase, so tsc and the tsup DTS build fail on a clean
checkout. It also re-exported the trigger router utilities, which exist in
middleware/triggerRouter.ts but were never surfaced through middleware.ts.

- middleware.ts: re-export findTrigger/advancedOperatorsSearch and the
  trigger router types
- index.ts: drop the four phantom rate-limit stats exports

npx tsc --noEmit, npm run build and vitest (226 passed) are green.
CI has been red on every push since June: three lint errors and two unused
imports, plus one genuinely flaky assertion.

- session-key.ts: the '(string & {})' autocomplete-preserving idiom trips
  @typescript-eslint/ban-types; '(string & Record<never, never>)' is the
  same type without the banned syntax
- admin.ts: the intentional runtime require() disabled no-require-imports
  but the rule that actually fires is no-var-requires — disable both
- expiring-map/health-monitor tests: drop unused imports
- webhook test: uptime is Date.now() - startTime in ms and is legitimately
  0 within the same millisecond, so assert >= 0 instead of > 0

eslint, tsc --noEmit and the full vitest suite (305) are green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant