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

[codemod] v6.0.0/sx-prop produces strange changes #43230

Closed
LukasTy opened this issue Aug 8, 2024 · 2 comments · Fixed by #43291
Closed

[codemod] v6.0.0/sx-prop produces strange changes #43230

LukasTy opened this issue Aug 8, 2024 · 2 comments · Fixed by #43291
Assignees
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod v6.x

Comments

@LukasTy
Copy link
Member

LukasTy commented Aug 8, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Run npx @mui/codemod@next v6.0.0/sx-prop docs or npx @mui/codemod@next v6.0.0/sx-prop packages on the latest mui-x master branch
  2. Observe strange diffs like this:
Screenshot 2024-08-08 at 11 05 42 Screenshot 2024-08-08 at 15 35 36

Current behavior

The codemod "duplicates" the existing sx declaration without any meaningful need to do it.

Expected behavior

The existing sx prop would be left as is in such case.

Context

No response

Your environment

npx @mui/envinfo
System:
    OS: macOS 14.5
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    pnpm: 9.6.0 - ~/.nvm/versions/node/v18.20.2/bin/pnpm
  Browsers:
    Chrome: 127.0.6533.89
    Edge: 127.0.2651.86
    Safari: 17.5
  npmPackages:
    @emotion/react: ^11.13.0 => 11.13.0 
    @emotion/styled: ^11.13.0 => 11.13.0 
    @mui/icons-material: ^5.16.5 => 5.16.5 
    @mui/internal-markdown: ^1.0.8 => 1.0.8 
    @mui/internal-test-utils: ^1.0.5 => 1.0.5 
    @mui/material: ^5.16.5 => 5.16.5 
    @mui/monorepo: github:mui/material-ui#4a82b6b0e0395db8fa0a0d49b6b76de4516b1579 => 6.0.0-beta.4 
    @mui/utils: ^5.16.5 => 5.16.5 
    @types/react: ^18.3.3 => 18.3.3 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 
    typescript: ^5.5.4 => 5.5.4 

Search keywords: codemod, sx-prop

@LukasTy LukasTy added bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 8, 2024
@mnajdova
Copy link
Member

mnajdova commented Aug 9, 2024

Looks like a bug, cc @siriwatknp

@siriwatknp
Copy link
Member

Looks like a bug, cc @siriwatknp

Yes, I'm working on it.

@siriwatknp siriwatknp added v6.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod v6.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants