Skip to content
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

feat(core): import warns when source and destination directories are different #27875

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Sep 11, 2024

This PR adds a warning when the user choose different source and destination roots. This is a problem for Nx workspaces using path options in project.json, and possibly other config files such as tsconfig.json, jest.config.ts, etc.

Note: Also included a guard that the destination directory isn't an absolute path like /tmp/foo, because the behavior will not work as expected.

The message when the source is an Nx workspace:
Screenshot 2024-09-11 at 9 32 54 AM

The message when the source is not an Nx workspace:
Screenshot 2024-09-11 at 9 30 44 AM

@jaysoo jaysoo requested a review from a team as a code owner September 11, 2024 13:31
Copy link

vercel bot commented Sep 11, 2024

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Sep 11, 2024 1:48pm

@jaysoo jaysoo force-pushed the feat/import-warn-on-different-dirs branch from 89746ad to 989d96a Compare September 11, 2024 13:33
@jaysoo jaysoo force-pushed the feat/import-warn-on-different-dirs branch from 989d96a to 1d61d67 Compare September 11, 2024 13:39
@jaysoo jaysoo merged commit 8b177bd into master Sep 11, 2024
6 checks passed
@jaysoo jaysoo deleted the feat/import-warn-on-different-dirs branch September 11, 2024 19:27
FrozenPandaz pushed a commit that referenced this pull request Sep 12, 2024
…different (#27875)

This PR adds a warning when the user choose different source and
destination roots. This is a problem for Nx workspaces using path
options in `project.json`, and possibly other config files such as
`tsconfig.json`, `jest.config.ts`, etc.

Note: Also included a guard that the destination directory isn't an
absolute path like `/tmp/foo`, because the behavior will not work as
expected.

The message when the source is an Nx workspace:
<img width="1392" alt="Screenshot 2024-09-11 at 9 32 54 AM"
src="https://github.com/user-attachments/assets/c8ebedba-fd66-4dbf-ada9-eacf86bd67fc">

The message when the source is not an Nx workspace:
<img width="1392" alt="Screenshot 2024-09-11 at 9 30 44 AM"
src="https://github.com/user-attachments/assets/ade9fbd1-4d5d-4d0c-93f6-eaad176af333">

(cherry picked from commit 8b177bd)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants