-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-core): fix importing of mui packages that do not support ES…
…M yet (#3608) * Use material root import instead of specific components to support ESM * Use material root import instead of specific components to support ESM in scheduler material ui package * Transform icons-material to add extension to a file * Add bootstrap4 styles to exports * Modify x-date-pickers import path * Fix rrule import error * Fix bundled icons-material imports * Update yarn.lock * Rollback dependencies * Refactor rollup config Co-authored-by: Lykoi18 <[email protected]>
- Loading branch information
Showing
11 changed files
with
119 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import license from 'rollup-plugin-license'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import modify from 'rollup-plugin-modify'; | ||
import { banner, external, stubProcess } from '../../tools/rollup-utils'; | ||
import pkg from './package.json'; | ||
|
||
export default { | ||
const commonPlugins = [ | ||
resolve({ | ||
extensions: ['.js', '.jsx'], | ||
}), | ||
babel({ | ||
runtimeHelpers: true, | ||
exclude: 'node_modules/**', | ||
}), | ||
license({ | ||
banner, | ||
}), | ||
]; | ||
|
||
const commonConfig = { | ||
input: 'src/index.js', | ||
output: [ | ||
{ | ||
file: pkg.main, format: 'cjs', sourcemap: true, intro: stubProcess, | ||
}, | ||
{ file: pkg.module, format: 'es', sourcemap: true }, | ||
], | ||
external: external(__dirname), | ||
plugins: [ | ||
resolve({ | ||
extensions: ['.js', '.jsx'], | ||
}), | ||
babel({ | ||
runtimeHelpers: true, | ||
exclude: 'node_modules/**', | ||
}), | ||
license({ | ||
banner, | ||
}), | ||
], | ||
plugins: commonPlugins, | ||
}; | ||
|
||
export default [ | ||
{ | ||
...commonConfig, | ||
output: { | ||
file: pkg.main, format: 'cjs', sourcemap: true, intro: stubProcess, | ||
}, | ||
}, | ||
{ | ||
...commonConfig, | ||
output: { | ||
file: pkg.module, format: 'es', sourcemap: true, | ||
}, | ||
plugins: [ | ||
...commonPlugins, | ||
modify({ | ||
find: /import (\w+) from '@mui\/icons-material\/(.+)';/, | ||
replace: (match, name, path) => `import ${name}Pkg from '@mui/icons-material/${path}.js'; const ${name} = ${name}Pkg.default;`, | ||
}), | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import license from 'rollup-plugin-license'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import modify from 'rollup-plugin-modify'; | ||
import { banner, external, stubProcess } from '../../tools/rollup-utils'; | ||
import pkg from './package.json'; | ||
|
||
export default { | ||
const commonPlugins = [ | ||
resolve({ | ||
extensions: ['.js', '.jsx'], | ||
}), | ||
babel({ | ||
runtimeHelpers: true, | ||
exclude: 'node_modules/**', | ||
}), | ||
license({ | ||
banner, | ||
}), | ||
]; | ||
|
||
const commonConfig = { | ||
input: 'src/index.js', | ||
output: [ | ||
{ | ||
file: pkg.main, format: 'cjs', sourcemap: true, intro: stubProcess, | ||
}, | ||
{ file: pkg.module, format: 'es', sourcemap: true }, | ||
], | ||
external: external(__dirname), | ||
plugins: [ | ||
resolve({ | ||
extensions: ['.js', '.jsx'], | ||
}), | ||
babel({ | ||
runtimeHelpers: true, | ||
exclude: 'node_modules/**', | ||
}), | ||
license({ | ||
banner, | ||
}), | ||
], | ||
plugins: commonPlugins, | ||
}; | ||
|
||
export default [ | ||
{ | ||
...commonConfig, | ||
output: { | ||
file: pkg.main, format: 'cjs', sourcemap: true, intro: stubProcess, | ||
}, | ||
}, | ||
{ | ||
...commonConfig, | ||
output: { | ||
file: pkg.module, format: 'es', sourcemap: true, | ||
}, | ||
plugins: [ | ||
...commonPlugins, | ||
modify({ | ||
find: /import (\w+) from '@mui\/icons-material\/(.+)';/, | ||
replace: (match, name, path) => `import ${name}Pkg from '@mui/icons-material/${path}.js'; const ${name} = ${name}Pkg.default;`, | ||
}), | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,6 @@ | |
}, | ||
"dependencies": { | ||
"moment": "^2.24.0", | ||
"rrule": "2.6.4" | ||
"rrule": "2.7.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15829,11 +15829,6 @@ lru-queue@^0.1.0: | |
dependencies: | ||
es5-ext "~0.10.2" | ||
|
||
luxon@^1.21.3: | ||
version "1.27.0" | ||
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.27.0.tgz#ae10c69113d85dab8f15f5e8390d0cbeddf4f00f" | ||
integrity sha512-VKsFsPggTA0DvnxtJdiExAucKdAnwbCCNlMM5ENvHlxubqWd0xhZcdb4XgZ7QFNhaRhilXCFxHuoObP5BNA4PA== | ||
|
||
lz-string@^1.4.4: | ||
version "1.4.4" | ||
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" | ||
|
@@ -15844,6 +15839,13 @@ macos-release@^2.2.0: | |
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.5.0.tgz#067c2c88b5f3fb3c56a375b2ec93826220fa1ff2" | ||
integrity sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g== | ||
|
||
[email protected]: | ||
version "0.25.2" | ||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9" | ||
integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg== | ||
dependencies: | ||
sourcemap-codec "^1.4.4" | ||
|
||
[email protected]: | ||
version "0.25.3" | ||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" | ||
|
@@ -17687,6 +17689,13 @@ osenv@^0.1.4, osenv@^0.1.5: | |
os-homedir "^1.0.0" | ||
os-tmpdir "^1.0.0" | ||
|
||
[email protected]: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/ospec/-/ospec-3.1.0.tgz#d36b8e10110f58f63a463df2390a7a73fe9579a8" | ||
integrity sha512-+nGtjV3vlADp+UGfL51miAh/hB4awPBkQrArhcgG4trAaoA2gKt5bf9w0m9ch9zOr555cHWaCHZEDiBOkNZSxw== | ||
dependencies: | ||
glob "^7.1.3" | ||
|
||
ow@^0.17.0: | ||
version "0.17.0" | ||
resolved "https://registry.yarnpkg.com/ow/-/ow-0.17.0.tgz#4f938999fed6264c9048cd6254356e0f1e7f688c" | ||
|
@@ -20692,6 +20701,14 @@ rollup-plugin-license@^0.12.1: | |
mkdirp "0.5.1" | ||
moment "2.24.0" | ||
|
||
rollup-plugin-modify@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/rollup-plugin-modify/-/rollup-plugin-modify-3.0.0.tgz#5326e11dfec247e8bbdd9507f3da1da1e5c7818b" | ||
integrity sha512-p/ffs0Y2jz2dEnWjq1oVC7SY37tuS+aP7whoNaQz1EAAOPg+k3vKJo8cMMWx6xpdd0NzhX4y2YF9o/NPu5YR0Q== | ||
dependencies: | ||
magic-string "0.25.2" | ||
ospec "3.1.0" | ||
|
||
rollup-plugin-sass@^1.2.2: | ||
version "1.2.2" | ||
resolved "https://registry.yarnpkg.com/rollup-plugin-sass/-/rollup-plugin-sass-1.2.2.tgz#f03cd2b1bee497dc2cc845fae2c5749611fc008f" | ||
|
@@ -20731,14 +20748,12 @@ rollup@^1.27.2: | |
"@types/node" "*" | ||
acorn "^7.1.0" | ||
|
||
rrule@2.6.4: | ||
version "2.6.4" | ||
resolved "https://registry.yarnpkg.com/rrule/-/rrule-2.6.4.tgz#7f4f31fda12bc7249bb176c891109a9bc448e035" | ||
integrity sha512-sLdnh4lmjUqq8liFiOUXD5kWp/FcnbDLPwq5YAc/RrN6120XOPb86Ae5zxF7ttBVq8O3LxjjORMEit1baluahA== | ||
rrule@2.7.1: | ||
version "2.7.1" | ||
resolved "https://registry.yarnpkg.com/rrule/-/rrule-2.7.1.tgz#2511e1aed0e96fb5acf831304cde97d2cb65d99e" | ||
integrity sha512-4p20u/1U7WqR3Nb1hOUrm0u1nSI7sO93ZUVZEZ5HeF6Gr5OlJuyhwEGRvUHq8ZfrPsq5gfa5b9dqnUs/kPqpIw== | ||
dependencies: | ||
tslib "^1.10.0" | ||
optionalDependencies: | ||
luxon "^1.21.3" | ||
tslib "^2.4.0" | ||
|
||
rst-selector-parser@^2.2.3: | ||
version "2.2.3" | ||
|
@@ -23239,7 +23254,7 @@ tslib@^2, tslib@^2.0.3, tslib@^2.2.0: | |
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" | ||
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== | ||
|
||
tslib@^2.4.1: | ||
tslib@^2.4.0, tslib@^2.4.1: | ||
version "2.4.1" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" | ||
integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== | ||
|