diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 00000000..ea9f5e38 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,34 @@ +# ================================================================ +# Prismatica (opposite-osiris) — astro check on every pull request +# ================================================================ +# The web image runs `astro build`, which strips types and never typechecks, so a +# missing import ships as a runtime ReferenceError (5333085: themeIcon). The check +# lives here, not in the Dockerfile: a type-only error blocks the merge, never a build. +# Runs in the Dockerfile's own base image so Node and pnpm match it exactly. +# ================================================================ + +name: Typecheck + +on: + pull_request: + +permissions: + contents: read + +jobs: + astro-check: + name: 🔎 astro check + runs-on: ubuntu-latest + container: node:22-alpine + env: + TRACK_BINOCLE_IN_DOCKER: "1" + steps: + - uses: actions/checkout@v4 + + - name: Install + run: | + corepack enable && corepack prepare pnpm@11.5.1 --activate + pnpm install --frozen-lockfile --ignore-scripts --config.node-linker=hoisted + + - name: astro check + run: node_modules/.bin/astro check diff --git a/src/lib/email-validation.ts b/src/lib/email-validation.ts index afcbf562..5592cf25 100644 --- a/src/lib/email-validation.ts +++ b/src/lib/email-validation.ts @@ -1,8 +1,10 @@ import { validateEmail } from '../hooks/useAuth'; +export type FieldValidationState = 'idle' | 'warning' | 'error' | 'success'; + export type EmailValidationResult = { valid: boolean; - state: 'idle' | 'warning' | 'error' | 'success'; + state: FieldValidationState; message: string; }; diff --git a/src/scripts/main.ts b/src/scripts/main.ts index 630f425c..70887d54 100644 --- a/src/scripts/main.ts +++ b/src/scripts/main.ts @@ -1284,7 +1284,7 @@ function messageMentions(message: string, ...needles: string[]): boolean { -import { validateEmailFormat, type EmailValidationResult } from '../lib/email-validation'; +import { validateEmailFormat, type EmailValidationResult, type FieldValidationState } from '../lib/email-validation'; function emailValidationResult(field: HTMLInputElement): EmailValidationResult { return validateEmailFormat(field.value.trim(), field.required, field.validity.valid);