Skip to content

TS17: port the browser tests, scripts and build config to TypeScript - #31

Merged
Finesssee merged 1 commit into
mainfrom
port/ts17-scripts
Oct 11, 2026
Merged

Finesssee merged 1 commit into
mainfrom
port/ts17-scripts

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

TS17 of the TypeScript port: the browser tests, scripts and build config move to strict TypeScript, types only.

What moved

  • tests/: smoke, ui, arena-browser, dev-ui, e2e-local, chrome, build-versions, upload-workerd, seed-local, and tests/port/port-check.test (.mjs to .ts)
  • scripts/: og-image, devtools, release, test-all, live-chat-e2e, install-hooks, build-characters, lib/zip-read, lib/png-io (.mjs to .ts)
  • vite.config.js to vite.config.ts (site.config.js stays JavaScript)

Each file is listed in one strict program:

  • tsconfig.strict.json: Node-only scripts and runners.
  • tsconfig.strict-tests.json: Playwright code that imports no Worker module (dev-ui, og-image, live-chat-e2e), and the character build. The Worker types declare Buffer as any there, which hides its methods in tsconfig.strict.json.
  • tsconfig.strict-tests-shared.json: browser tests that import a Worker module (smoke, ui, arena-browser, e2e-local).

Every as, ! and Loose has its reason on the same line or the line above. Page callbacks in smoke, e2e-local, live-chat-e2e and arena-browser reach their page globals through a module-scoped declare const window, so they need no cast.

References are updated in package.json scripts, .githooks/pre-commit and pre-push, deploy.yml (node scripts/release.ts), .coderabbit.yaml, AGENTS.md (8179 bytes), DESIGN.md, docs, comments in cloudflare.config.ts, server/ and src/, and the path strings in tests. tests/dev-release.test.ts now imports the types from scripts/release.ts instead of keeping its own copies.

port-check

node scripts/port-check.ts --base origin/main
34 files compared, 0 different; 155 build output files compared, 0 different

The served hash in the built overlay.html is overlay.js?v=15ab3b21f0, the same as main's.

Checks

  • bun run check: pass (format, lint, typecheck, 359 unit tests pass, 0 fail; the pre-commit hook ran it again with gitleaks)
  • bun run test:port: 101 pass, 0 fail
  • bun run test:all: all 11 steps pass (smoke, ui, dev-ui, arena browser and e2e local in headed Chrome). Run with MINI_PORT=5287, because another worktree's dev server held the default port 5199. The first run on 5199 failed at the harness step for that reason. The last push after that run added only comments and declare lines, and port-check on the final head still shows 0 different.

Left as is

  • tests/upload-workerd.ts imports miniflare, which package.json doesn't declare (same as before; no dependency added).
  • src/served/overlay.ts still says vite.config.js in a comment. Changing it would change the served code hash.
  • A comment in public/_headers still says vite.config.js. public/ ships as written, so this comment stays until a change that isn't a port.
  • The fixture strings in tests/port/port-check.test.ts still name .js and .mjs files on purpose.
  • seCall in scripts/devtools.ts casts a URLSearchParams as unknown as string inside a template literal. Without the cast, oxlint's restrict-template-expressions flags it, and a runtime change wasn't allowed in a port.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nesszer/pixfray/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ab34510-19e4-4217-9986-906d48e1ac00

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Renames tests/smoke, ui, arena-browser, dev-ui, e2e-local, chrome, build-versions, upload-workerd and
seed-local, scripts/*.mjs (og-image, devtools, release, test-all, live-chat-e2e, install-hooks,
build-characters, lib/zip-read, lib/png-io), tests/port/port-check.test.mjs and vite.config.js to .ts with
types only, lists them in the strict programs, and updates package.json, the hooks, deploy.yml and the docs.
@Finesssee
Finesssee merged commit 2d6907d into main Oct 11, 2026
5 checks passed
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