This repository was archived by the owner on Jun 26, 2025. It is now read-only.
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the project to use TypeScript project references, updating configurations and import paths to ensure consistent type definitions across different environments.
- Updated webpack configuration to generate separate configs per entry point and enabled project references for ts-loader.
- Adjusted import paths in workers, frame evaluators, and test runner files to use consolidated type definitions.
- Removed ts-jest in favor of Babel and updated corresponding Jest and ESLint configurations.
Reviewed Changes
Copilot reviewed 16 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.cjs | Refactored webpack config to support multiple entry points and project references. |
| packages/workers/src/worker-test-evaluator.ts | Updated import paths to use centralized type definitions. |
| packages/workers/src/worker-test-evaluator.test.ts | Adjusted import reference to match new file structure. |
| packages/main/src/test-runner.ts | Updated type imports to reference shared types across projects. |
| packages/frame-evaluators/src/frame-test-evaluator.ts | Updated import paths to centralized type definitions. |
| packages/frame-evaluators/src/frame-test-evaluator.test.ts | Adjusted import reference to match new file structure. |
| jest.config.mjs | Commented out ts-jest configuration in favor of Babel. |
| eslint.config.mjs | Expanded ignored paths to include package build directories. |
| babel.config.mjs | Added new Babel configuration for transpiling TypeScript. |
Files not reviewed (5)
- base-tsconfig.json: Language not supported
- package.json: Language not supported
- packages/frame-evaluators/tsconfig.json: Language not supported
- packages/main/tsconfig.json: Language not supported
- packages/workers/tsconfig.json: Language not supported
3fb960e to
6a69b50
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the project setup to use TypeScript project references and updates related configurations and imports to support multiple environments. Key changes include:
- Updating webpack.config.cjs to generate multiple entrypoints for ts-loader using project references.
- Adjusting import paths in WorkerTestEvaluator, FrameTestEvaluator, and TestRunner to use shared types from a centralized location.
- Removing ts-jest from jest.config.mjs in favor of Babel, and updating ESLint and Babel configurations accordingly.
Reviewed Changes
Copilot reviewed 16 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.cjs | Refactored to dynamically generate entrypoints and module rules. |
| packages/workers/src/worker-test-evaluator.ts | Updated import paths to reference shared type definitions. |
| packages/workers/src/worker-test-evaluator.test.ts | Corrected the import path for WorkerTestEvaluator testing. |
| packages/main/src/test-runner.ts | Updated type imports to rely on centralized type definitions. |
| packages/frame-evaluators/src/frame-test-evaluator.ts | Updated import paths for consistency with shared types. |
| packages/frame-evaluators/src/frame-test-evaluator.test.ts | Adjusted import path for FrameTestEvaluator testing. |
| jest.config.mjs | Removed ts-jest and added configuration for jest-puppeteer. |
| eslint.config.mjs | Extended ignore patterns to include build directories in packages. |
| babel.config.mjs | Added a new Babel config to support TypeScript transpilation. |
Files not reviewed (5)
- base-tsconfig.json: Language not supported
- package.json: Language not supported
- packages/frame-evaluators/tsconfig.json: Language not supported
- packages/main/tsconfig.json: Language not supported
- packages/workers/tsconfig.json: Language not supported
Comments suppressed due to low confidence (1)
webpack.config.cjs:23
- [nitpick] Consider using path.join() or adjusting the template string to avoid generating double slashes in the file path, which might lead to issues on some file systems.
[name]: `${path}/${name}.ts`,
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In order to make sure that scripts running in different environments (i.e. worker vs frame) see the correct types, it's necessary to split the code into different projects (i.e. different tsconfig.jsons). To see the kind of weird errors not doing this generates, see https://github.com/ojeytonwilliams/test-runner/actions/runs/14102608999/job/39501924355. Notably
tschad no issue with the lack of overlap, since it was using different type definitions to Jest.Since it was necessary to split the project up, it made sense to use references, but this came with a set of challenges
To address the first issue I simply removed
ts-jest. In retrospect I can't see a reason to use it over Babel. We're type checking withtsc, so there's nothing to be gained by usingts-jest. Also, Babel works.I've currently hacked a way around the ts-loader problem by providing one config per entrypoint. TypeStrong/ts-loader#647 seems to have some smarter approaches, so I will try using
instanceand see if that is enough.Specifying a
outDir, means that there's only ever a single TS file for Jest to import, so it is happy.