File tree Expand file tree Collapse file tree 12 files changed +90
-4
lines changed Expand file tree Collapse file tree 12 files changed +90
-4
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,19 @@ module.exports = function getBabelConfig(api) {
8888 mode : 'unsafe-wrap' ,
8989 } ,
9090 ] ,
91+ [
92+ 'transform-inline-environment-variables' ,
93+ {
94+ include : [
95+ 'MUI_VERSION' ,
96+ 'MUI_MAJOR_VERSION' ,
97+ 'MUI_MINOR_VERSION' ,
98+ 'MUI_PATCH_VERSION' ,
99+ 'MUI_PRERELEASE_LABEL' ,
100+ 'MUI_PRERELEASE_NUMBER' ,
101+ ] ,
102+ } ,
103+ ] ,
91104 ] ;
92105
93106 if ( process . env . NODE_ENV === 'production' ) {
Original file line number Diff line number Diff line change 132132 "babel-plugin-module-resolver" : " ^5.0.0" ,
133133 "babel-plugin-optimize-clsx" : " ^2.6.2" ,
134134 "babel-plugin-react-remove-properties" : " ^0.3.0" ,
135+ "babel-plugin-transform-inline-environment-variables" : " ^0.4.4" ,
135136 "babel-plugin-transform-react-remove-prop-types" : " ^0.4.24" ,
136137 "chalk" : " ^5.3.0" ,
137138 "compression-webpack-plugin" : " ^11.1.0" ,
Original file line number Diff line number Diff line change @@ -476,6 +476,8 @@ export * from './useAutocomplete';
476476export { default as GlobalStyles } from './GlobalStyles' ;
477477export * from './GlobalStyles' ;
478478
479+ export * from './version' ;
480+
479481/**
480482 * @deprecated will be removed in v5.beta, please use StyledEngineProvider from @mui/material/styles instead
481483 */
Original file line number Diff line number Diff line change @@ -417,3 +417,5 @@ export * from './generateUtilityClass';
417417export { default as generateUtilityClasses } from './generateUtilityClasses' ;
418418
419419export { default as Unstable_TrapFocus } from './Unstable_TrapFocus' ;
420+
421+ export * from './version' ;
Original file line number Diff line number Diff line change 66import { expect } from 'chai' ;
77import * as MaterialUI from './index' ;
88
9+ const versionExports = [
10+ 'version' ,
11+ 'major' ,
12+ 'minor' ,
13+ 'patch' ,
14+ 'preReleaseLabel' ,
15+ 'preReleaseNumber' ,
16+ ] ;
17+
918describe ( 'material-ui' , ( ) => {
1019 it ( 'should have exports' , ( ) => {
1120 expect ( typeof MaterialUI ) . to . equal ( 'object' ) ;
1221 } ) ;
1322
1423 it ( 'should not have undefined exports' , ( ) => {
15- Object . keys ( MaterialUI ) . forEach ( ( exportKey ) =>
16- expect ( Boolean ( MaterialUI [ exportKey ] ) ) . to . equal ( true ) ,
17- ) ;
24+ Object . keys ( MaterialUI )
25+ . filter ( ( exportKey ) => ! versionExports . includes ( exportKey ) )
26+ . forEach ( ( exportKey ) => expect ( Boolean ( MaterialUI [ exportKey ] ) ) . to . equal ( true ) ) ;
1827 } ) ;
1928
2029 it ( 'should reexport certain members from @mui/base' , ( ) => {
Original file line number Diff line number Diff line change 1+ export const version = process . env . MUI_VERSION ;
2+ export const major = Number ( process . env . MUI_MAJOR_VERSION ) ;
3+ export const minor = Number ( process . env . MUI_MINOR_VERSION ) ;
4+ export const patch = Number ( process . env . MUI_PATCH_VERSION ) ;
5+ export const preReleaseLabel = process . env . MUI_PRERELEASE_LABEL || null ;
6+ export const preReleaseNumber = Number ( process . env . MUI_PRERELEASE_NUMBER ) || null ;
7+
8+ export default version ;
Original file line number Diff line number Diff line change @@ -181,3 +181,5 @@ export * from './Unstable_Grid';
181181
182182export { default as Stack } from './Stack' ;
183183export * from './Stack' ;
184+
185+ export * from './version' ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export { default as unstable_createCssVarsTheme } from './cssVars/createCssVarsT
6666export { default as responsivePropType } from './responsivePropType' ;
6767export { default as RtlProvider } from './RtlProvider' ;
6868export * from './RtlProvider' ;
69+ export * from './version' ;
6970
7071/** ----------------- */
7172/** Layout components */
Original file line number Diff line number Diff line change 1+ export const version = process . env . MUI_VERSION ;
2+ export const major = Number ( process . env . MUI_MAJOR_VERSION ) ;
3+ export const minor = Number ( process . env . MUI_MINOR_VERSION ) ;
4+ export const patch = Number ( process . env . MUI_PATCH_VERSION ) ;
5+ export const preReleaseLabel = process . env . MUI_PRERELEASE_LABEL || null ;
6+ export const preReleaseNumber = Number ( process . env . MUI_PRERELEASE_NUMBER ) || null ;
7+
8+ export default version ;
You can’t perform that action at this time.
0 commit comments