diff --git a/docs/next.config.ts b/docs/next.config.ts index 1d7eccc2083064..00ad740b2fe8fc 100644 --- a/docs/next.config.ts +++ b/docs/next.config.ts @@ -2,6 +2,7 @@ import * as path from 'path'; import * as url from 'url'; import * as fs from 'fs'; +import * as semver from 'semver'; // @ts-ignore import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { createRequire } from 'module'; @@ -182,6 +183,7 @@ export default withDocsInfra({ env: { // docs-infra LIB_VERSION: pkg.version, + SEARCH_INDEX: `material-ui-v${semver.major(pkg.version)}`, SOURCE_CODE_REPO: 'https://github.com/mui/material-ui', SOURCE_GITHUB_BRANCH: 'master', // #target-branch-reference GITHUB_TEMPLATE_DOCS_FEEDBACK: '4.docs-feedback.yml', diff --git a/docs/package.json b/docs/package.json index 4b678c7abf6d70..61d6110e449654 100644 --- a/docs/package.json +++ b/docs/package.json @@ -97,6 +97,7 @@ "react-virtuoso": "^4.18.3", "react-window": "^2.2.7", "rimraf": "^6.1.3", + "semver": "^7.7.4", "styled-components": "^6.3.11", "stylis": "catalog:docs", "use-count-up": "^3.0.1", @@ -123,6 +124,7 @@ "@types/react-dom": "19.2.3", "@types/react-swipeable-views": "0.13.6", "@types/react-transition-group": "4.4.12", + "@types/semver": "^7.7.1", "@types/stylis": "4.2.7", "chai": "6.2.2", "cross-fetch": "4.1.0", diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index de2b8581173903..81ee9ecfd904c1 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -323,7 +323,7 @@ export default function AppSearch(props) { initialQuery={initialQuery} appId="TZGZ85B9TB" apiKey="8177dfb3e2be72b241ffb8c5abafa899" - indexName="material-ui" + indexName={process.env.SEARCH_INDEX} searchParameters={{ facetFilters: ['version:master', facetFilterLanguage], filters, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b065f21cf64d72..6d2ea4b6a6c89f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -511,6 +511,9 @@ importers: rimraf: specifier: ^6.1.3 version: 6.1.3 + semver: + specifier: ^7.7.4 + version: 7.7.4 styled-components: specifier: ^6.3.11 version: 6.3.12(patch_hash=383c648dfdb5dfc82fbe414d54027d8c982a01c6320370f0ecfdb387e753c09f)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -584,6 +587,9 @@ importers: '@types/react-transition-group': specifier: 4.4.12 version: 4.4.12(@types/react@19.2.14) + '@types/semver': + specifier: ^7.7.1 + version: 7.7.1 '@types/stylis': specifier: 4.2.7 version: 4.2.7 @@ -5604,6 +5610,9 @@ packages: '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} + '@types/semver@7.7.1': + resolution: {integrity: sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==} + '@types/send@1.2.1': resolution: {integrity: sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==} @@ -16869,6 +16878,8 @@ snapshots: '@types/retry@0.12.0': {} + '@types/semver@7.7.1': {} + '@types/send@1.2.1': dependencies: '@types/node': 20.19.37