Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into crud-list
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira committed Feb 25, 2025
2 parents 9f44235 + f5def45 commit 1e21054
Show file tree
Hide file tree
Showing 71 changed files with 1,153 additions and 1,344 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@toolpad/studio": "packages/toolpad-studio",
"@toolpad/studio-components": "packages/toolpad-studio-components",
"@toolpad/studio-runtime": "packages/toolpad-studio-runtime",
"@toolpad/utils": "packages/toolpad-utils"
"@toolpad/utils": "packages/toolpad-utils/build"
},
"silent": true
}
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,18 @@ module.exports = {
],
'material-ui/no-hardcoded-labels': 'off', // We are not really translating the docs/website anymore
'react-compiler/react-compiler': 'error',
'material-ui/disallow-react-api-in-server-components': 'off',
},
overrides: [
...baseline.overrides,
...baseline.overrides.map((override) => {
if (override.rules['material-ui/disallow-react-api-in-server-components']) {
return {
...override,
files: ['packages/toolpad-core/src/*/*.?(c|m)[jt]s?(x)'],
};
}
return override;
}),
{
files: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'],
extends: ['plugin:testing-library/react'],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
with:
sarif_file: results.sarif
6 changes: 4 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function getBabelConfig(api) {
'@babel/preset-env',
{
bugfixes: true,
browserslistEnv: process.env.BABEL_ENV || process.env.NODE_ENV,
browserslistEnv: api.env() || process.env.NODE_ENV,
debug: process.env.MUI_BUILD_VERBOSE === 'true',
modules: useESModules ? false : 'commonjs',
},
Expand All @@ -30,7 +30,9 @@ module.exports = function getBabelConfig(api) {
'@babel/preset-typescript',
];

const outFileExtension = '.js';
// Essentially only replace in production builds.
// When aliasing we want to keep the original extension
const outFileExtension = process.env.MUI_OUT_FILE_EXTENSION || null;

/** @type {babel.PluginItem[]} */
const plugins = [
Expand Down
1 change: 0 additions & 1 deletion docs/config.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@mui/monorepo/docs/config';
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function Content({ router }) {

Content.propTypes = {
router: PropTypes.shape({
Link: PropTypes.func,
navigate: PropTypes.func.isRequired,
pathname: PropTypes.string.isRequired,
searchParams: PropTypes.instanceOf(URLSearchParams).isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function BrandingSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function BrandingSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ const BRANDING = {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function CredentialsSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function CredentialsSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const providers = [{ id: 'credentials', name: 'Email and Password' }];
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function MagicLinkAlertSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function MagicLinkAlertSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ resolve({
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function NotificationsSignInPageError() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function NotificationsSignInPageError() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ resolve({
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function PasskeySignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function PasskeySignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const providers = [{ id: 'passkey', name: 'Passkey' }];
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default function ThemeSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ form: { noValidate: true } }}
sx={{
'& form > .MuiStack-root': {
marginTop: '2rem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function ThemeSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ form: { noValidate: true } }}
sx={{
'& form > .MuiStack-root': {
marginTop: '2rem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const THEME = createTheme({
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ form: { noValidate: true } }}
sx={{
'& form > .MuiStack-root': {
marginTop: '2rem',
Expand Down
24 changes: 9 additions & 15 deletions docs/next.config.mjs → docs/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// @ts-check
import * as fs from 'fs';
import * as path from 'path';
import * as url from 'url';
import { createRequire } from 'module';
import { LANGUAGES, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config.js';
import { LANGUAGES, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config';

const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url));

const require = createRequire(import.meta.url);

const withDocsInfra = require('@mui/monorepo/docs/nextConfigDocsInfra');

const pkg = require('../package.json');
const { findPages } = require('./src/modules/utils/find');

const WORKSPACE_ROOT = path.resolve(currentDirectory, '../');
Expand All @@ -19,8 +19,13 @@ const MONOREPO_PACKAGES = {
'@mui/docs': path.resolve(MONOREPO_PATH, './packages/mui-docs/src'),
};

const toolpadCorePkg = require('../packages/toolpad-core/package.json');
const toolpadStudioPkg = require('../packages/toolpad-studio/package.json');
function loadPkg(pkgPath: string): { version: string } {
const pkgContent = fs.readFileSync(path.resolve(WORKSPACE_ROOT, pkgPath, 'package.json'), 'utf8');
return JSON.parse(pkgContent);
}

const toolpadCorePkg = loadPkg('./packages/toolpad-core');
const toolpadStudioPkg = loadPkg('./packages/toolpad-studio');

export default withDocsInfra({
transpilePackages: [
Expand All @@ -47,17 +52,6 @@ export default withDocsInfra({
webpack: (config, options) => {
return {
...config,
// TODO, this shouldn't be needed in the first place
// Migrate everything from @mui/monorepo to @mui/docs and embed @mui/internal-markdown in @mui/docs
resolveLoader: {
...config.resolveLoader,
alias: {
...config.resolveLoader.alias,
'@mui/internal-markdown/loader': require.resolve(
'@mui/monorepo/packages/markdown/loader',
),
},
},
resolve: {
...config.resolve,
alias: {
Expand Down
32 changes: 16 additions & 16 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
"dependencies": {
"@babel/plugin-transform-object-assign": "7.25.9",
"@babel/runtime-corejs2": "7.26.0",
"@date-io/date-fns-jalali": "3.1.1",
"@docsearch/react": "3.8.3",
"@date-io/date-fns-jalali": "3.2.0",
"@docsearch/react": "3.9.0",
"@emotion/cache": "11.14.0",
"@emotion/react": "11.14.0",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.14.0",
"@mui/base": "5.0.0-beta.68",
"@mui/docs": "6.4.1",
"@mui/icons-material": "6.4.1",
"@mui/internal-markdown": "1.0.24",
"@mui/base": "5.0.0-beta.69",
"@mui/docs": "6.4.5",
"@mui/icons-material": "6.4.5",
"@mui/internal-markdown": "1.0.25",
"@mui/joy": "5.0.0-beta.51",
"@mui/lab": "6.0.0-beta.22",
"@mui/material": "6.4.1",
"@mui/material-nextjs": "6.3.1",
"@mui/styles": "6.4.1",
"@mui/system": "6.4.1",
"@mui/utils": "6.4.1",
"@mui/lab": "6.0.0-beta.28",
"@mui/material": "6.4.5",
"@mui/material-nextjs": "6.4.3",
"@mui/styles": "6.4.5",
"@mui/system": "6.4.3",
"@mui/utils": "6.4.3",
"@mui/x-data-grid-pro": "7.26.0",
"@mui/x-date-pickers": "7.27.0",
"@mui/x-date-pickers-pro": "7.27.0",
Expand All @@ -60,13 +60,13 @@
"doctrine": "3.0.0",
"exceljs": "4.4.0",
"fg-loadcss": "3.1.0",
"fs-extra": "11.2.0",
"fs-extra": "11.3.0",
"invariant": "2.2.4",
"jss": "^10.10.0",
"jss-rtl": "0.3.0",
"lodash": "4.17.21",
"lz-string": "1.5.0",
"markdown-to-jsx": "7.7.3",
"markdown-to-jsx": "7.7.4",
"next": "^15.1.7",
"nprogress": "0.2.0",
"postcss": "8.4.49",
Expand Down Expand Up @@ -98,8 +98,8 @@
"@types/babel__core": "^7.20.5",
"@types/doctrine": "0.0.9",
"@types/json-schema": "7.0.15",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@types/react-is": "^19.0.0",
"@types/react-swipeable-views": "^0.13.6",
"cpy-cli": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DocsProvider } from '@mui/docs/DocsProvider';
import { mapTranslations } from '@mui/docs/i18n';
import toolpadStudioPages from '../data/toolpad/studio/pages';
import toolpadCorePages from '../data/toolpad/core/pages';
import config from '../config';
import * as config from '../config';

// Remove the license warning from demonstration purposes
LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE);
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/core/api/app-provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"router": {
"type": {
"name": "shape",
"description": "{ navigate: func, pathname: string, searchParams: URLSearchParams }"
"description": "{ Link?: func, navigate: func, pathname: string, searchParams: URLSearchParams }"
},
"default": "null"
},
Expand Down
Loading

0 comments on commit 1e21054

Please sign in to comment.