Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes typing issues in the auth fixture by replacing dynamic imports with static imports and adding proper TypeScript type definitions. The changes improve type safety and align with the project's engineering guidelines documented in AGENTS.md.
Key Changes
- Replaced dynamic
import()andrequire()calls with static top-level imports for@playwright/test,playwright, anddotenvmodules - Added explicit TypeScript type definitions for auth fixtures, replacing generic
unknownandanytypes with concrete types - Added type tests to verify that fixtures like
pageare properly typed - Moved
dotenvfrom devDependencies to regular dependencies to support the static import approach
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/auth/type-tests/authTest-page-type.test.ts |
New type test file to verify auth fixture typing, specifically ensuring the page fixture is correctly typed as Page and not any |
packages/auth/tsconfig.type-tests.json |
New TypeScript configuration for type tests, extending build config with type test inclusions |
packages/auth/src/fixtures/createAuthTest.ts |
Major refactor replacing dynamic imports with static imports, removing generic types (AnyTestType, AnyExpect) in favor of concrete Playwright types, and improving overall type safety |
packages/auth/src/runner/validateProfileState.ts |
Changed from dynamic await import("playwright") to static import { chromium, firefox, webkit } from "playwright" |
packages/auth/src/runner/setupProfileState.ts |
Changed from dynamic await import("playwright") to static import { chromium, firefox, webkit } from "playwright" |
packages/auth/src/cli/dotenv.ts |
Removed dynamic import with error handling and replaced with static import dotenv from "dotenv" |
packages/auth/package.json |
Moved dotenv from devDependencies to dependencies (^16.4.7) and updated typecheck script to include type-tests |
package-lock.json |
Updated dotenv from dev-only to regular dependency (resolved to 16.6.1, within semver range) |
examples/vite-react-auth/package.json |
Removed setup:env script as dotenv is now a direct dependency and loaded via CLI |
AGENTS.md |
Added new engineering guidelines discouraging dynamic import queries and dynamic imports for fixed module specifiers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.