Skip to content

feat(codemod-sandbox): integrate OxcResolver for module resolution #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

mohebifar
Copy link
Member

📚 Description

🔗 Linked Issue

🧪 Test Plan

📄 Documentation to Update

@mohebifar mohebifar requested a review from Copilot July 20, 2025 22:33
Copy link

vercel bot commented Jul 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
codemod ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2025 10:37pm

Copy link

@Copilot 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 integrates OxcResolver to replace the previous FileSystemResolver for module resolution in codemod-sandbox. The integration adds TypeScript-aware module resolution with support for tsconfig.json path mapping and Node.js-style module resolution.

  • Replaces FileSystemResolver with OxcResolver throughout the codebase
  • Adds automatic tsconfig.json discovery functionality
  • Removes the loader abstraction layer as it's no longer needed with the new resolver

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/core/src/engine.rs Updated to use OxcResolver with tsconfig discovery
crates/codemod-sandbox/src/sandbox/resolvers/oxc_resolver.rs New OxcResolver implementation with comprehensive TypeScript support
crates/codemod-sandbox/src/utils/project_discovery.rs New utility for finding tsconfig.json files
crates/codemod-sandbox/src/sandbox/engine/execution_engine.rs Updated to remove loader dependency and use ModuleResolver generically
crates/cli/src/commands/jssg/run.rs Updated command handlers to use OxcResolver
Comments suppressed due to low confidence (2)

crates/codemod-sandbox/src/sandbox/resolvers/oxc_resolver.rs:222

  • The test uses a hardcoded /tmp path which may not exist or be writable on all systems. Consider using tempfile::TempDir for more robust cross-platform testing.
        let base_dir = PathBuf::from("/tmp");

crates/core/src/engine.rs:1376

  • [nitpick] The error message 'Failed to create OxcResolver' could be more specific about what went wrong during resolver creation, such as whether it was a tsconfig parsing issue or a filesystem error.
            .map_err(|e| Error::Other(format!("Failed to create OxcResolver: {e}")))?,

Copy link

pkg-pr-new bot commented Jul 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/codemod@1627

commit: 50e060f

@mohebifar mohebifar force-pushed the feat/oxc-resolver branch from 43e78e3 to 50e060f Compare July 20, 2025 22:37
@mohebifar mohebifar merged commit 4015a50 into main Jul 20, 2025
13 checks passed
@mohebifar mohebifar deleted the feat/oxc-resolver branch July 20, 2025 23:24
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.

1 participant