Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Oct 5, 2024
1 parent f3269ac commit 65cf4dd
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
throw /* mui-minify-error */ new Error('exists');
throw /* mui-minify-error */ new Error('will be created');
throw /* minify-error */ new Error('exists');
throw /* minify-error */ new Error('will be created');
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const foo = 'foo';
const bar = 'bar';
throw /* mui-minify-error */ new Error(`MUI: ${foo}, ${bar}`);
throw /* mui-minify-error */ new Error(`MUI: ${foo}` + `, ${bar}`);
throw /* mui-minify-error */ new Error('MUI: ' + `${foo}, ${bar}`);
throw /* minify-error */ new Error(`MUI: ${foo}, ${bar}`);
throw /* minify-error */ new Error(`MUI: ${foo}` + `, ${bar}`);
throw /* minify-error */ new Error('MUI: ' + `${foo}, ${bar}`);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Expected valid input target.\n' + 'Did you use `inputComponent`',
);
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: Expected valid input target.\n` + `Did you use \`inputComponent\``,
);
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Expected valid input target.\n' + 'Did you use inputComponent',
);
Original file line number Diff line number Diff line change
@@ -1 +1 @@
throw /* mui-minify-error */ new Error('missing');
throw /* minify-error */ new Error('missing');
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const foo = 'foo';
const bar = ['bar'];
throw /* mui-minify-error */ new Error(foo);
throw /* mui-minify-error */ new Error(...bar);
throw /* minify-error */ new Error(foo);
throw /* minify-error */ new Error(...bar);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const foo = 'foo';
const bar = ['bar'];
throw /* mui-minify-error */ new Error(foo);
throw /* mui-minify-error */ new Error(...bar);
throw /* minify-error */ new Error(foo);
throw /* minify-error */ new Error(...bar);
2 changes: 1 addition & 1 deletion packages-internal/babel-plugin-minify-errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const helperModuleImports = require('@babel/helper-module-imports');
const fs = require('fs');

const COMMENT_MARKER = 'mui-minify-error';
const COMMENT_MARKER = 'minify-error';

/**
* @typedef {import('@babel/core')} babel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export function useNumberInput(parameters: UseNumberInputParameters): UseNumberI
(otherHandlers: Partial<EventHandlers>) =>
(event: React.ChangeEvent<HTMLInputElement> & MuiCancellableEvent) => {
if (!isControlled && event.target === null) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Expected valid input target. ' +
'Did you use a custom `slots.input` and forget to forward refs? ' +
'See https://mui.com/r/input-component-ref-interface for more info.',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/useInput/useInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function useInput(parameters: UseInputParameters = {}): UseInputReturnVal
if (!isControlled) {
const element = event.target || inputRef.current;
if (element == null) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Expected valid input target. ' +
'Did you use a custom `slots.input` and forget to forward refs? ' +
'See https://mui.com/r/input-component-ref-interface for more info.',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/InputBase/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ const InputBase = React.forwardRef(function InputBase(inProps, ref) {
if (!isControlled) {
const element = event.target || inputRef.current;
if (element == null) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Expected valid input target. ' +
'Did you use a custom `inputComponent` and forget to forward refs? ' +
'See https://mui.com/r/input-component-ref-interface for more info.',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Select/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {

if (multiple) {
if (!Array.isArray(value)) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: The `value` prop must be an array ' +
'when using the `Select` component with `multiple`.',
);
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/styles/createPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ export default function createPalette(palette) {
}

if (!color.hasOwnProperty('main')) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` +
`The color object needs to have a \`main\` property or a \`${mainShade}\` property.`,
);
}

if (typeof color.main !== 'string') {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` +
`\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` +
'\n' +
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/createThemeNoVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function createThemeNoVars(options = {}, ...args) {
} = options;

if (options.vars) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: `vars` is a private field used for CSS variables support.\n' +
'Please use another name.',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/createThemeWithVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function createThemeWithVars(options = {}, ...args) {
}

if (!defaultScheme) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
// TODO: Remove this function in v6.
// eslint-disable-next-line @typescript-eslint/naming-convention
export function experimental_sx() {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' +
'For more details, see https://github.com/mui/material-ui/pull/35150.',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/makeStyles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function makeStyles() {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: makeStyles is no longer exported from @mui/material/styles.\n' +
'You have to import it from @mui/styles.\n' +
'See https://mui.com/r/migration-v4/#mui-material-styles for more details.',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/responsiveFontSizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
let { lineHeight } = style;

if (!isUnitless(lineHeight) && !disableAlign) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: Unsupported non-unitless line height with grid alignment.\n' +
'Use unitless line heights instead.',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/withStyles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function withStyles() {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: withStyles is no longer exported from @mui/material/styles.\n' +
'You have to import it from @mui/styles.\n' +
'See https://mui.com/r/migration-v4/#mui-material-styles for more details.',
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/styles/withTheme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function withTheme() {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: withTheme is no longer exported from @mui/material/styles.\n' +
'You have to import it from @mui/styles.\n' +
'See https://mui.com/r/migration-v4/#mui-material-styles for more details.',
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-system/src/colorManipulator/colorManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function decomposeColor(color) {
const type = color.substring(0, marker);

if (!['rgb', 'rgba', 'hsl', 'hsla', 'color'].includes(type)) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: Unsupported \`${color}\` color.\n` +
'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().',
);
Expand All @@ -84,7 +84,7 @@ export function decomposeColor(color) {
values[3] = values[3].slice(1);
}
if (!['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].includes(colorSpace)) {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: unsupported \`${colorSpace}\` color space.\n` +
'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function getContainerQuery(theme: CssContainerQueries, shorthand: string)
const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
if (!matches) {
if (process.env.NODE_ENV !== 'production') {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.\n` +
'For example, `@sm` or `@600` or `@40rem/sidebar`.',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-system/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {
// TODO: Remove this function in v6
// eslint-disable-next-line @typescript-eslint/naming-convention
export function experimental_sx() {
throw /* mui-minify-error */ new Error(
throw /* minify-error */ new Error(
'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' +
'For more details, see https://github.com/mui/material-ui/pull/35150.',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-utils/src/capitalize/capitalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// We only handle the first word.
export default function capitalize(string: string): string {
if (typeof string !== 'string') {
throw /* mui-minify-error */ new Error('MUI: `capitalize(string)` expects a string argument.');
throw /* minify-error */ new Error('MUI: `capitalize(string)` expects a string argument.');
}

return string.charAt(0).toUpperCase() + string.slice(1);
Expand Down

0 comments on commit 65cf4dd

Please sign in to comment.