Skip to content

Migrate path alias from @/ to @mc/#44

Merged
wende merged 1 commit intomainfrom
feat/mc-path-alias
Mar 20, 2026
Merged

Migrate path alias from @/ to @mc/#44
wende merged 1 commit intomainfrom
feat/mc-path-alias

Conversation

@wende
Copy link
Copy Markdown
Owner

@wende wende commented Mar 20, 2026

Summary

  • Migrate all @/ path aliases to @mc/ across 75 files
  • Update tsconfig.json paths and vitest.config.ts alias

Why

MobileClaw is embedded inside 8claw, which also uses @/ as its tsconfig path alias. Turbopack can't do context-aware resolution, so the parent app needed a fragile file-scanning workaround (buildMobileclawAliases()) that required dev server restarts whenever files were added. Using a distinct @mc/ prefix eliminates the collision — the parent config becomes a single @mc/* wildcard alias.

Test plan

  • pnpm run build — passes, no type errors
  • pnpm test — all 213 tests pass
  • Verify standalone pnpm dev resolves @mc/ correctly
  • Verify embedded mode in 8claw with simplified next.config.mjs

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mobileclaw Ready Ready Preview, Comment Mar 20, 2026 8:05pm

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical path alias collision issue that arose when the MobileClaw application was embedded within the 8claw environment. By standardizing MobileClaw's internal path alias from @/ to @mc/, the change eliminates the need for complex and error-prone build workarounds, significantly improving module resolution stability and developer experience, particularly with tools like Turbopack.

Highlights

  • Path Alias Migration: Migrated all existing @/ path aliases to a new @mc/ prefix across 75 files to prevent naming collisions.
  • Configuration Updates: Updated tsconfig.json and vitest.config.ts to reflect the new @mc/ path alias configuration.
  • Collision Resolution: Addressed a long-standing issue where MobileClaw's @/ alias conflicted with the parent 8claw application, which also used @/, leading to fragile build workarounds.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the project's import alias from @/ to @mc/. This change is reflected in tsconfig.json and vitest.config.ts configurations, and all relevant import statements across components, hooks, libraries, plugins, and test files have been updated to use the new @mc/ prefix. Additionally, a new test file, tests/parseBackendModels.test.ts, was added, adhering to the new alias convention.

MobileClaw is embedded inside 8claw which also uses @/ as its path alias.
Turbopack can't do context-aware resolution, requiring a fragile per-file
alias scanner in the parent config. Using a distinct @mc/ prefix eliminates
the collision and lets both apps coexist with a single wildcard alias.
@wende wende force-pushed the feat/mc-path-alias branch from 0ae6808 to ea10ac6 Compare March 20, 2026 20:04
@wende wende merged commit 887b67f into main Mar 20, 2026
4 checks passed
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