Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,379 changes: 482 additions & 897 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@gridsuite/commons-ui": "0.257.0",
"@gridsuite/commons-ui": "0.261.0",
"@hookform/resolvers": "^4.1.3",
"@mui/icons-material": "^6.5.0",
"@mui/lab": "6.0.1-beta.36",
"@mui/material": "^6.5.0",
"@mui/icons-material": "^7.3.11",
"@mui/lab": "7.0.1-beta.25",
"@mui/material": "^7.3.11",
"@mui/x-date-pickers": "^7.29.4",
"@mui/x-tree-view": "^8.21.0",
"@reduxjs/toolkit": "^2.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { Grid2 as Grid, Typography } from '@mui/material';
import { Grid, Typography } from '@mui/material';
import { ReactElement } from 'react';
import { FormattedMessage } from 'react-intl';

Expand Down
5 changes: 2 additions & 3 deletions src/module-mui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// https://mui.com/material-ui/customization/theming/#typescript
import type { CSSObject } from '@mui/styled-engine';
import { Theme as MuiTheme, ThemeOptions as MuiThemeOptions } from '@mui/material/styles/createTheme';

// https://mui.com/x/react-date-pickers/quickstart/#theme-augmentation
import type {} from '@mui/x-date-pickers/themeAugmentation';

declare module '@mui/material/styles/createTheme' {
export * from '@mui/material/styles/createTheme';
declare module '@mui/material/styles' {
export * from '@mui/material/styles';
Comment on lines +13 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

npm run type-check

Repository: gridsuite/gridadmin-app

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching module-mui.d.ts:\n'
fd -a 'module-mui\.d\.ts$' . || true

printf '\nRelevant content:\n'
for f in $(fd 'module-mui\.d\.ts$' .); do
  echo "--- $f"
  cat -n "$f"
done

printf '\nDependency versions:\n'
node - <<'JS'
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
const deps = {...(pkg.dependencies||{}), ...(pkg.devDependencies||{})};
for (const [k,v] of Object.entries(deps)) {
  if (/^(`@mui`\/|typescript)$/.test(k)) console.log(`${k}: ${v}`);
}
JS

Repository: gridsuite/gridadmin-app

Length of output: 1894


🌐 Web query:

TypeScript module augmentation export reexport error @mui/material/styles Theme TypeScript

💡 Result:

When working with TypeScript module augmentation for Material UI (MUI), "export" or "re-export" errors—or scenarios where augmentations fail to apply—typically stem from how TypeScript handles module resolution and ambient declarations [1][2][3]. Key causes and solutions include: 1. Missing Import in Declaration Files: If your module augmentation resides in a .d.ts file or a file that is not directly importing the target module, TypeScript may ignore the declaration [1][2]. You must import the target module (e.g., '@mui/material/styles') within your declaration file to ensure TypeScript recognizes the module for augmentation [1][2]. Example: import '@mui/material/styles'; declare module '@mui/material/styles' { interface Theme { status: { danger: string; }; } } 2. Issues with Re-exports and Overriding: TypeScript can sometimes treat re-exports in a way that overrides existing interfaces rather than merging with them [4]. If you are distributing a library containing theme overrides, ensure your augmentation is correctly targeting the original source module (e.g., '@mui/material/styles') rather than a file that re-exports it [4][3]. 3. Library Distribution Challenges: When isolating a theme into a separate library, downstream applications may not automatically pick up the augmentations defined in your package [5][6]. To ensure these types propagate: - Ensure the file containing the declare module block is included in the package's exports or types field in package.json. - Consumers may need to reference the declaration file, sometimes by importing an empty type from the package in their tsconfig.json or a global declaration file (e.g., import type {} from '@your-org/theme-lib/types/mui';) [5][7]. 4. Performance and Circular Dependencies: In newer MUI versions, certain paths (like @mui/material/stylesOptimized) exist to avoid circular dependencies [8]. If you are experiencing persistent issues with type resolution, ensure that your import paths for createTheme and module augmentation match consistently throughout your project [8]. General Troubleshooting Steps: - Verify that your augmentation file is actually being included in the TypeScript compilation (check your tsconfig.json include property). - If using VS Code, restart the TypeScript server (Ctrl/Cmd + Shift + P -> "TypeScript: Restart TS server") to clear cached type definitions. - Always prefer importing the exact module you intend to augment, rather than relying on re-exported paths, to ensure predictable merge behavior [3].

Citations:


Remove the self-re-export from the @mui/material/styles augmentation.

MUI’s Theme and ThemeOptions are already exported from this module. TypeScript module augmentations should merge declarations only; keep export * from '@mui/material/styles' outside this block if it is needed at all.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/module-mui.d.ts` around lines 13 - 14, Remove the self-referential export
from the declare module '`@mui/material/styles`' augmentation, leaving only
declaration-merging content in that block. If the module re-export is required
elsewhere, move it outside the augmentation rather than retaining it inside.


type ThemeExtension = {
arrow: CSSObject;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/announcements/add-announcement-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { useCallback, useMemo } from 'react';
import { Box, Grid2 as Grid, Stack } from '@mui/material';
import { Box, Grid, Stack } from '@mui/material';
import { type DateOrTimeView } from '@mui/x-date-pickers';
import { useIntl } from 'react-intl';
import * as yup from 'yup';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/announcements/announcements-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type { UUID } from 'node:crypto';
import { useCallback, useMemo, useRef, useState } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { Box, Divider, Grid2 as Grid, Stack, Typography } from '@mui/material';
import { Box, Divider, Grid, Stack, Typography } from '@mui/material';
import { snackWithFallback, useSnackMessage } from '@gridsuite/commons-ui';
import type { ColDef, GetRowIdParams, ValueFormatterFunc } from 'ag-grid-community';
import { type GridTableRef } from '../../components/Grid';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/common/multi-chip-cell-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { useRef, useState, useEffect } from 'react';
import { Chip, Grid2 as Grid, Tooltip } from '@mui/material';
import { Chip, Grid, Tooltip } from '@mui/material';
import { mergeSx, type MuiStyles } from '@gridsuite/commons-ui';

const maxChipWidth = 100;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/groups/groups-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { FunctionComponent, useCallback, useRef, useState } from 'react';
import { Grid2 as Grid, Stack } from '@mui/material';
import { Grid, Stack } from '@mui/material';
import { GridTableRef } from '../../components/Grid';
import { GroupInfos } from '../../services';
import { RowClickedEvent } from 'ag-grid-community';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/groups/modification/group-modification-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { useMemo, type FunctionComponent } from 'react';
import { Grid2 as Grid } from '@mui/material';
import { Grid } from '@mui/material';
import * as yup from 'yup';
import { NAME_EMPTY, TextInput } from '@gridsuite/commons-ui';
import TableSelection from '../../common/table-selection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { FunctionComponent, useEffect, useState } from 'react';
import HighlightOffIcon from '@mui/icons-material/HighlightOff';
import FolderIcon from '@mui/icons-material/Folder';
import { Grid2 as Grid, IconButton, Tooltip } from '@mui/material';
import { Grid, IconButton, Tooltip } from '@mui/material';
import { useIntl } from 'react-intl';
import { DirectoryItemSelector, ElementAttributes, ElementType, TreeViewFinderNodeProps } from '@gridsuite/commons-ui';
import { useController, useWatch } from 'react-hook-form';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { ElementType, IntegerInput, TextInput } from '@gridsuite/commons-ui';
import { Grid2 as Grid } from '@mui/material';
import { Grid } from '@mui/material';
import ConfigurationSelection, { ConfigSelectionProps } from './configuration-selection';
import { FormattedMessage } from 'react-intl';
import React, { FunctionComponent } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/profiles/profiles-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { FunctionComponent, useCallback, useRef, useState } from 'react';
import { Grid2 as Grid, Stack } from '@mui/material';
import { Grid, Stack } from '@mui/material';
import { GridTableRef } from '../../components/Grid';
import { UserProfile } from '../../services';
import { RowClickedEvent } from 'ag-grid-community';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/users/modification/user-modification-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { useCallback, useMemo, type FunctionComponent } from 'react';
import { Grid2 as Grid, IconButton, Tooltip } from '@mui/material';
import { Grid, IconButton, Tooltip } from '@mui/material';
import * as yup from 'yup';
import { AutocompleteInput, NAME_EMPTY, snackWithFallback, TextInput, useSnackMessage } from '@gridsuite/commons-ui';
import TableSelection from '../../common/table-selection';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/users/users-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { FunctionComponent, useCallback, useRef, useState } from 'react';
import { Grid2 as Grid, Stack } from '@mui/material';
import { Grid, Stack } from '@mui/material';
import { GridTableRef } from '../../components/Grid';
import { UserInfos } from '../../services';
import { RowClickedEvent } from 'ag-grid-community';
Expand Down
Loading