Running the type check separately was problematic because it would run before the necessary types had been generated. Relying on the generate script's built-in type check ensures that types are checked at the correct point in the process, resolving the CI failures.
This PR includes manual changes to address issues that arose from the automated dependency updates.
The dependency updates, primarily to Vite and its internal esbuild version, introduced several breaking changes and revealed weaknesses in the CI process:
- Build Failures: An esbuild version bump caused a breaking change in its API, leading to build failures in the directive scanner.
- CI Blind Spots: The existing CI (
check-starters.yml) used workspace linking, which masked type inconsistencies and did not accurately simulate a real user's package installation. This allowed type errors related to Vite's updated plugin API to go undetected. - Brittle Test Environments: Attempts to improve CI by running
npm run checkin isolated environments failed. This was due to brokenpnpmsymlinks being copied into test directories, which prevented clean dependency installation. - Code Duplication: The setup logic for smoke tests and the E2E tests was heavily duplicated, making maintenance difficult.
A series of fixes and refactorings were implemented to resolve these issues and make the testing process more robust:
- Build Fixes: The esbuild scanner was updated to be compatible with the new API. A TypeScript error in an E2E test file related to
nullvalues was also corrected. - Tarball-Based Testing: The CI process was refactored to use tarball-based installations for E2E and smoke tests. This more accurately reflects a real user environment and successfully caught the underlying type errors.
- Test Environment Refactoring: The project-copying and environment setup logic for both smoke and E2E tests were consolidated into a single, shared, cross-platform function. This new function correctly excludes
node_modulesto ensure clean dependency installs, resolving the broken symlink issue. - Simplified Type Checking: Redundant
npm run checkcommands were removed from the test harnesses. The type check that runs as part of thenpm run generatecommand is now the single source of truth, ensuring types are checked only after they have been correctly generated.
These changes ensure the codebase is compatible with the updated dependencies and strengthen the CI process to prevent similar issues in the future.