{"_id":"@am92/ds-codemod","name":"@am92/ds-codemod","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@am92/ds-codemod","version":"1.0.0","description":"Codemod scripts for React Design System","bin":{"ds-codemod":"codemod.js","all-codemods":"run-codemods.js"},"dependencies":{"@babel/core":"^7.27.4","@babel/runtime":"^7.27.6","@babel/traverse":"^7.27.4","@mui/x-internals":"^8.6.0","jscodeshift":"0.16.1","jscodeshift-add-imports":"^1.0.11","postcss":"^8.5.6","postcss-cli":"^11.0.1","yargs":"^17.7.2"},"devDependencies":{"@types/chai":"^4.3.20","@types/jest":"^30.0.0","@types/jscodeshift":"0.12.0","@types/mocha":"^10.0.10","@types/node":"^24.0.10","chai":"^4.5.0","dayjs":"^1.11.13","moment-timezone":"^0.6.0","rimraf":"^6.0.1","typescript":"^5.8.3"},"scripts":{"ds-codemod":"./codemod.js","all-codemods":"./run-codemods.js","build":"tsc","clean":"rimraf dist","prepublishOnly":"npm run clean && npm run build","publish:patch":"npm version patch && npm publish","publish:minor":"npm version minor && npm publish","publish:major":"npm version major && npm publish"},"repository":{"type":"git","url":"git+ssh://git@github.com/heliumtank92/am92-ds-codemod.git"},"homepage":"https://github.com/heliumtank92/am92-ds-codemod#readme","contributors":[{"name":"Rithik Agarwal","email":"rithik.agarwal@freechargebiz.com","url":"https://github.com/rithik56"},{"name":"Akshat Sharma","email":"akshat.sharma@freechargebiz.com","url":"https://github.com/akshat24sharma"}],"publishConfig":{"access":"public"},"license":"MIT","keywords":["react","react-component","@am92/react-design-system","codemod","jscodeshift"],"_id":"@am92/ds-codemod@1.0.0","gitHead":"574c9364e05f78f3430246e8a10537e29cb4f983","bugs":{"url":"https://github.com/heliumtank92/am92-ds-codemod/issues"},"_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-tU4Mt7FGTnQXkfKefqvajxmZC2HdAOe0HHEDWM+O512UeJ94BjEDUOPQZ+AW7jziGEHPB4RKnQf4t0yCneEm3Q==","shasum":"f5f05aeb75112d2e2884dc788d45240638fa27eb","tarball":"https://registry.npmjs.org/@am92/ds-codemod/-/ds-codemod-1.0.0.tgz","fileCount":456,"unpackedSize":638551,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFtJ7aQy96LbhOHFFPhNcWS+ntMQsK5/UlKWSftQDOwEAiB2fP1FIdmsAtn/EKDYSI+6rD3hWxoccUTTiaEffqMHDA=="}]},"_npmUser":{"name":"ankitgandhi452","email":"ankitgandhi452@gmail.com"},"directories":{},"maintainers":[{"name":"heliumtank92","email":"heliumtank92@gmail.com"},{"name":"agarwalmehul","email":"agarwalmehul92@gmail.com"},{"name":"ankitgandhi452","email":"ankitgandhi452@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ds-codemod_1.0.0_1779950374892_0.84202250607993"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T06:39:34.719Z","1.0.0":"2026-05-28T06:39:36.188Z","modified":"2026-05-28T06:39:37.365Z"},"maintainers":[{"name":"heliumtank92","email":"heliumtank92@gmail.com"},{"name":"agarwalmehul","email":"agarwalmehul92@gmail.com"},{"name":"ankitgandhi452","email":"ankitgandhi452@gmail.com"}],"description":"Codemod scripts for React Design System","homepage":"https://github.com/heliumtank92/am92-ds-codemod#readme","keywords":["react","react-component","@am92/react-design-system","codemod","jscodeshift"],"repository":{"type":"git","url":"git+ssh://git@github.com/heliumtank92/am92-ds-codemod.git"},"contributors":[{"name":"Rithik Agarwal","email":"rithik.agarwal@freechargebiz.com","url":"https://github.com/rithik56"},{"name":"Akshat Sharma","email":"akshat.sharma@freechargebiz.com","url":"https://github.com/akshat24sharma"}],"bugs":{"url":"https://github.com/heliumtank92/am92-ds-codemod/issues"},"license":"MIT","readme":"# am92-ds-codemod\n\nAutomated codemods for migrating projects that use `@am92/react-design-system` through MUI v6 and v7 breaking changes.\n\n\n---\n\n\n## Why\n\n\nMUI v6 and v7 introduced several breaking API changes — system props moved to `sx`, grid props restructured, picker slot renames, and more. Applying these changes manually across a large codebase is error-prone and time-consuming. `@am92/ds-codemod` bundles all the necessary transformations into a single CLI tool tailored for `@am92/react-design-system` consumers.\n\n\n---\n\n\n## Prerequisites\n\n\n**New projects** can directly install `@am92/react-design-system` **v3** (beta 3 or stable v3).\n\n\n**Existing projects** should follow this upgrade order:\n\n\n1. First upgrade to the **latest v2** of `@am92/react-design-system`.\n2. Then upgrade to **v3** (beta 3 or stable v3). MUI v7 support is part of version 3.\n\n\n---\n\n\n## Installation\n\n\nInstall as a dev dependency in your project:\n\n\n```bash\nnpm i @am92/ds-codemod --save-dev\n```\n\n\n---\n\n\n## Usage\n\n\n### Run a specific codemod\n\n\n```bash\nnpx @am92/ds-codemod <codemod> <path>\n```\n\n\n- `codemod` — name of the codemod (see list below)\n- `path` — file or folder to transform (e.g. `src`)\n\n\n### Run all codemods at once\n\n\n```bash\nnpx all-codemods src\n```\n\n\n---\n\n\n## Available Codemods\n\n\n### `deprecations/all`\n\n\nRuns all deprecation codemods in one shot — migrates deprecated APIs to their updated equivalents.\n\n\n> Does **not** include theme deprecations (rarely needed; see [MUI docs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/#theme-component-variants) to migrate manually).\n\n\nReference: https://mui.com/material-ui/migration/migrating-from-deprecated-apis/\n\n\n---\n\n\n### `v6.0.0/system-props`\n\n\nMoves system props (`display`, `flexDirection`, `gap`, `p`, `color`, etc.) into the `sx` prop for `DsBox`, `DsTypography`, `DsLink`, `DsGrid`, and `DsStack`.\n\n\n**Known caveat:** When an existing `sx` prop is a callback (e.g. `theme => ({...})`), the codemod merges it into an `sx` array. Since `@am92/react-design-system` does not handle `sx` as an array, **flatten the array manually** into a single object or callback after running.\n\n\n```tsx\n// After codemod (array — needs manual fix)\n<DsStack\n sx={[\n   { flexDirection: 'row', gap: 4 },\n   theme => ({ [theme.breakpoints.up('md')]: { p: 4 } })\n ]}\n/>\n\n\n// Fixed (merge into single callback)\n<DsStack\n sx={theme => ({\n   flexDirection: 'row',\n   gap: 4,\n   [theme.breakpoints.up('md')]: { p: 4 }\n })}\n/>\n```\n\n\nReference: https://mui.com/material-ui/migration/upgrade-to-v6/\n\n\n---\n\n\n### `v6.0.0/list-item-button-prop`\n\n\nMigrates the `ListItem` component API changes introduced in MUI v6.\n\n\nReference: https://mui.com/material-ui/migration/upgrade-to-v6/#listitem\n\n\n---\n\n\n### `v7.0.0/input-label-size-normal-medium`\n\n\nStandardises the `size` prop on `InputLabel` as changed in MUI v7.\n\n\nReference: https://mui.com/material-ui/migration/upgrade-to-v7/#inputlabel-size-prop-standardized\n\n\n---\n\n\n### `v7.0.0/grid-props`\n\n\nMigrates `DsGrid` props to the Grid v2 API (e.g. `item`, `xs`, `md` → `size={{ xs, md }}`).\n\n\n> This codemod does **not** cover all Grid v2 breaking changes. Verify your layouts after running.\n\n\nReference: https://mui.com/material-ui/migration/upgrade-to-grid-v2/\n\n\n---\n\n\n### `v7.0.0/pickers/preset-safe`\n\n\nRenames picker component slots and slot types for MUI X v7.\n\n\n> Does **not** cover all DatePicker breaking changes. Review internal API usage manually.\n\n\nReferences:\n- https://mui.com/x/migration/migration-pickers-v6/\n- https://mui.com/x/migration/migration-pickers-v7/\n\n\n---\n\n\n### `v8.0.0/charts/preset-safe`\n\n\nMigrates MUI X Charts components to the v8 API.\n\n\nReference: https://mui.com/x/migration/migration-charts-v7/\n\n\n---\n\n\n## After Running Codemods\n\n\n- **Formatting changes** — safe to fix after all codemods have run (run Prettier/ESLint at the end).\n- **JS syntax errors** (e.g. unterminated strings) — must be fixed **before** running subsequent codemods.\n- **`sx` arrays** — manually flatten any `sx={[...]}` arrays introduced by `system-props` codemod (see caveat above).\n\n\n---\n\n\n## Project-specific Notes\n\n\n> **Parcel + DsDatePicker:** If your project uses Parcel and includes the `DsDatePicker` component, upgrade Parcel to **>= 2.14.2**. Earlier versions have a known issue with duplicate exports that causes build failures. See [what's new in Parcel 2.14](https://parceljs.org/blog/v2-14-0/) for details on other improvements in this release.\n\n\n---\n\n\n## Full Migration References\n\n\n| Topic | Link |\n|---|---|\n| Deprecated APIs | https://mui.com/material-ui/migration/migrating-from-deprecated-apis/ |\n| Upgrade to v6 | https://mui.com/material-ui/migration/upgrade-to-v6/ |\n| Upgrade to v7 | https://mui.com/material-ui/migration/upgrade-to-v7/ |\n| Grid v2 | https://mui.com/material-ui/migration/upgrade-to-grid-v2/ |\n| Pickers v6 → v7 | https://mui.com/x/migration/migration-pickers-v6/ |\n| Pickers v7 | https://mui.com/x/migration/migration-pickers-v7/ |\n| Charts v7 → v8 | https://mui.com/x/migration/migration-charts-v7/ |\n\n\n\n\n\n","readmeFilename":"README.md","_rev":"1-5addf1d7e83580f9addecfdc181e9483"}