mui / mui/material-ui

[codemod] `v6.0.0/styled`, `v6.0.0/sx-prop`, `v6.0.0/theme-v6` codemods fail parsing tokens

Open
#43,229 5 comments 1 reaction 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Aug 8, 2024.

package: codemod scope: all components type: enhancement
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Steps to reproduce

Link to live example: (required)

Steps:

  1. Run npx @mui/codemod@next v6.0.0/styled packages on the latest mui-x master branch
  2. Observe multiple (56) errors
Current behavior

A few example errors:

mui/mui-x/packages/x-date-pickers/tsconfig.build.json Transformation error (Missing semicolon. (4:11))
SyntaxError: Missing semicolon. (4:11)
mui/mui-x/packages/x-license/package.json Transformation error (Missing semicolon. (2:8))
SyntaxError: Missing semicolon. (2:8)
mui/mui-x/packages/x-date-pickers/src/AdapterLuxon/AdapterLuxon.ts Transformation error (Unexpected token (149:34))
SyntaxError: Unexpected token (149:34)
mui/mui-x/packages/x-data-grid/src/models/gridColumnGrouping.ts Transformation error (Unexpected token (25:25))
SyntaxError: Unexpected token (25:25)
Expected behavior

Codemod does not produce the above errors, but ignores the code that it does not need to transform.

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, styles

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.