Skip to content

fix: resolve project's tsconfig path correctly#540

Merged
9aoy merged 2 commits intomainfrom
tsconfig-path
Sep 3, 2025
Merged

fix: resolve project's tsconfig path correctly#540
9aoy merged 2 commits intomainfrom
tsconfig-path

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Sep 3, 2025

Summary

resolve project's tsconfig path correctly.

Related Links

fix: #539

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings September 3, 2025 08:38
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 3, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 317e6dc
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68b8014b3721880008df13f5
😎 Deploy Preview https://deploy-preview-540--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
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 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';
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

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'.

Suggested change
import { castArray, getAbsolutePath, TS_CONFIG_FILE } from '../utils';
import { castArray, getAbsolutePath } from '../utils';
import { TS_CONFIG_FILE } from '../utils/constants';

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 8e52325 into main Sep 3, 2025
16 checks passed
@9aoy 9aoy deleted the tsconfig-path branch September 3, 2025 09:16
@9aoy 9aoy mentioned this pull request Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: can't resolve project's tsconfig path correctly

2 participants