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

@mui/x-codemod v6.0.0/data-grid/preset-safe doesn't work with satisfies / Typescript >= v4.9 #10870

Closed
scamden opened this issue Nov 1, 2023 · 6 comments
Assignees
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod typescript

Comments

@scamden
Copy link

scamden commented Nov 1, 2023

Steps to reproduce

Link to live example: (required)

Steps:

  1. Make a tsx file with a datagrid
  2. Use satisifes on a type in that file
  3. Run the code mod

Current behavior

code mod says unknown node type when it hits the satisfies AST node.

Expected behavior

codemod runs and transforms the code

Context

"typescript": "5.0.4"

Your environment

npx @mui/envinfo



  System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 313.03 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nodenv/versions/18.12.1/bin/node
    Yarn: 1.22.19 - ~/Library/pnpm/yarn
    npm: 8.5.1 - ~/.nodenv/versions/18.12.1/bin/npm
    pnpm: 6.32.11 - ~/.nodenv/versions/18.12.1/bin/pnpm
  Managers:
    Cargo: 1.63.0 - ~/.cargo/bin/cargo
    Homebrew: 4.1.13 - /opt/homebrew/bin/brew
    pip3: 22.2.2 - ~/.pyenv/shims/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 15.0.0 - /usr/bin/gcc
    Git: 2.40.0 - /opt/homebrew/bin/git
    Clang: 15.0.0 - /usr/bin/clang
    Curl: 8.1.2 - /usr/bin/curl
  Servers:
    Apache: 2.4.56 - /usr/sbin/apachectl
  Virtualization:
    VirtualBox: 7.0.8 - /usr/local/bin/vboxmanage
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
  IDEs:
    VSCode: 1.83.1 - /opt/homebrew/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 15.0.1/15A507 - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.19.2 - /opt/homebrew/bin/go
    Perl: 5.30.3 - /usr/bin/perl
    Python: 3.9.9 - /Users/scamden/.pyenv/shims/python
    Python3: 3.9.9 - /Users/scamden/.pyenv/shims/python3
    Ruby: 2.6.10 - /usr/bin/ruby
    Rust: 1.63.0 - /Users/scamden/.cargo/bin/rustc
  Databases:
    PostgreSQL: 14.8 - /opt/homebrew/opt/postgresql@14/bin/postgres
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 118.0.5993.117
    Safari: 17.0.

Search keywords: typescript codemod satisifies data-grid

@scamden scamden added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 1, 2023
@MBilalShafi MBilalShafi added package: codemod Specific to @mui/codemod bug 🐛 Something doesn't work typescript and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 2, 2023
@scamden
Copy link
Author

scamden commented Nov 3, 2023

i've already done the rest of the migration manually so there's no rush for us, but just thought i'd mention. it also balks on the new instantiation expressions fyi

@MBilalShafi MBilalShafi self-assigned this Nov 7, 2023
@Janpot
Copy link
Member

Janpot commented Mar 22, 2024

Just ran into the same problem for the v7 migration with

npx @mui/x-codemod v7.0.0/data-grid/preset-safe <path>

@MBilalShafi
Copy link
Member

MBilalShafi commented Mar 27, 2024

This issue is related to mui/material-ui#34680 which is blocked due to an issue with a linked dependency

@Janpot Another small thing, you might want to use the @latest with the package name, sometimes the package resolution doesn't work properly if we don't do it, it's a bug with npx (PR for the docs fix)

npx @mui/x-codemod@latest v7.0.0/data-grid/preset-safe <path>

@siriwatknp
Copy link
Member

FYI, I'm fixing the tests in mui/material-ui#34680 and will merge it this week. The next release of codemod (v6.0.0-alpha.3) should work with TS >= 4.9

@MBilalShafi
Copy link
Member

Fixed by #12305

Copy link

github-actions bot commented Jul 2, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@scamden: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

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 typescript
Projects
None yet
Development

No branches or pull requests

4 participants