Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the resolution of project tsconfig paths by correctly setting the root path context for rstest. The changes ensure that TypeScript configuration files are properly located and path mappings work correctly in monorepo scenarios.
- Adds proper root path configuration to Rsbuild instances
- Automatically detects and configures tsconfig paths for projects
- Updates test fixtures to validate TypeScript path mapping functionality
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/tests/core/rsbuild.test.ts | Adds rootPath configuration to test cases and enables DEBUG environment |
| packages/core/tests/core/snapshots/rsbuild.test.ts.snap | Updates snapshots to reflect correct path resolution with packages/core context |
| packages/core/src/utils/constants.ts | Adds TS_CONFIG_FILE constant for tsconfig.json filename |
| packages/core/src/core/rstest.ts | Implements automatic tsconfig detection and path configuration |
| packages/core/src/core/rsbuild.ts | Sets root path in Rsbuild configuration |
| packages/core/src/core/plugins/basic.ts | Configures webpack context to use correct root path |
| e2e/projects/fixtures/packages/node/tsconfig.json | Adds TypeScript configuration with path mapping for testing |
| e2e/projects/fixtures/packages/node/test/index.test.ts | Updates import to use path mapping and adds type assertion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| TestResult, | ||
| } from '../types'; | ||
| import { castArray, getAbsolutePath } from '../utils/helper'; | ||
| import { castArray, getAbsolutePath, TS_CONFIG_FILE } from '../utils'; |
There was a problem hiding this comment.
The import statement imports TS_CONFIG_FILE from '../utils' but the constant is defined in '../utils/constants'. This should import from '../utils/constants' or re-export the constant from '../utils/index'.
| import { castArray, getAbsolutePath, TS_CONFIG_FILE } from '../utils'; | |
| import { castArray, getAbsolutePath } from '../utils'; | |
| import { TS_CONFIG_FILE } from '../utils/constants'; |
Summary
resolve project's tsconfig path correctly.
Related Links
fix: #539
Checklist