diff --git a/.gitignore b/.gitignore index 20217598bc..ddb00318dd 100644 --- a/.gitignore +++ b/.gitignore @@ -140,12 +140,8 @@ out/ # typescript tsbuildinfo *.tsbuildinfo -lodashReplacer.js -lodashReplacer.cjs -muiReplacer.js -muiReplacer.cjs -ajvReplacer.js -ajvReplacer.cjs +*Replacer.js +*Replacer.cjs # Need this due to shadcn default utils folder is lib !packages/shadcn/src/lib diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e5994f66..d71951dd44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ should change the heading of the (upcoming) version to include a major version b --> +# 6.0.0-beta.10 + +## @rjsf/mui + +- Fixed build process to remove the `tsc-alias` replacer that was adding `/index.js` onto the `@mui/Xxxx` imports since MUI 7 has proper ESM support + # 6.0.0-beta.9 ## @rjsf/antd diff --git a/packages/mui/package.json b/packages/mui/package.json index 8126ca8846..4180cc2be4 100644 --- a/packages/mui/package.json +++ b/packages/mui/package.json @@ -39,8 +39,7 @@ "src" ], "scripts": { - "compileReplacer": "tsc -p tsconfig.replacer.json && move-file muiReplacer.js muiReplacer.cjs", - "build:ts": "npm run compileReplacer && rimraf ./lib && tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json", + "build:ts": "rimraf ./lib && tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json", "build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs", "build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/mui.esm.js --sourcemap --packages=external --format=esm", "build:umd": "rollup dist/mui.esm.js --format=umd --file=dist/mui.umd.js --name=@rjsf/mui", diff --git a/packages/mui/tsconfig.build.json b/packages/mui/tsconfig.build.json index dc55f9f1a3..71d6c843d2 100644 --- a/packages/mui/tsconfig.build.json +++ b/packages/mui/tsconfig.build.json @@ -11,12 +11,6 @@ ], "tsc-alias": { "resolveFullPaths": true, - "verbose": true, - "replacers": { - "lodash": { - "enabled": true, - "file": "muiReplacer.cjs" - } - } + "verbose": true } } diff --git a/packages/mui/tsconfig.replacer.json b/packages/mui/tsconfig.replacer.json deleted file mode 100644 index f10cb10822..0000000000 --- a/packages/mui/tsconfig.replacer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es2017", - "outDir": "./", - "skipLibCheck": true, - }, - "files": [ - "../../tsc-alias-replacer/muiReplacer.ts" - ], - "exclude": [ - "./src", - "./test" - ] -} diff --git a/tsc-alias-replacer/muiReplacer.ts b/tsc-alias-replacer/muiReplacer.ts deleted file mode 100644 index 2851ed4b69..0000000000 --- a/tsc-alias-replacer/muiReplacer.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AliasReplacerArguments } from 'tsc-alias'; - -/** A `tsc-alias` replacer that fixes up the imports `from '@mui/xxxx'` to be `from `@mui/xxxx/index.js` - * - * @param orig - The original import name - */ -export default function muiReplacer({ orig }: AliasReplacerArguments): string { - if (orig.startsWith("from '@mui/material/")) { - const origMinusEndQuote = orig.substring(0, orig.length - 1); - // console.log(origMinusEndQuote); - return `${origMinusEndQuote}/index.js'`; - } - - return orig; -}