Skip to content

Conversation

@romradchenko
Copy link
Owner

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and require() calls with static top-level imports for @playwright/test, playwright, and dotenv modules
  • Added explicit TypeScript type definitions for auth fixtures, replacing generic unknown and any types with concrete types
  • Added type tests to verify that fixtures like page are properly typed
  • Moved dotenv from 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.

@romradchenko romradchenko merged commit 9aebe63 into main Dec 30, 2025
9 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.

2 participants