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
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "7.27.1",
"@babel/preset-typescript": "7.28.5",
"@mui-internal/api-docs-builder": "workspace:^",
"@mui/internal-api-docs-builder": "workspace:^",
"@mui/internal-docs-utils": "workspace:^",
"@mui/internal-scripts": "workspace:^",
"@playwright/test": "1.59.1",
Expand Down
4 changes: 1 addition & 3 deletions docs/scripts/formattedTSDemos.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const {
getPropTypesFromFile,
injectPropTypesInFile,
} = require('@mui/internal-scripts/typescript-to-proptypes');
const {
createTypeScriptProjectBuilder,
} = require('@mui-internal/api-docs-builder/utils/createTypeScriptProject');
const { createTypeScriptProjectBuilder } = require('@mui/internal-api-docs-builder');
const { default: yargs } = require('yargs');
const { hideBin } = require('yargs/helpers');
const { fixBabelGeneratorIssues, fixLineEndings } = require('@mui/internal-docs-utils');
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
"@babel/node": "7.29.0",
"@babel/plugin-transform-react-constant-elements": "7.27.1",
"@eslint/compat": "2.0.3",
"@mui-internal/api-docs-builder": "workspace:^",
"@mui-internal/api-docs-builder-core": "workspace:^",
"@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.25",
"@mui/internal-bundle-size-checker": "1.0.9-canary.75",
"@mui/internal-code-infra": "0.0.4-canary.23",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
getMuiName,
getSystemComponents,
parseFile,
} from '@mui-internal/api-docs-builder/buildApiUtils';
import findPagesMarkdown from '@mui-internal/api-docs-builder/utils/findPagesMarkdown';
findPagesMarkdown,
} from '@mui/internal-api-docs-builder';

export function getMaterialUiComponentInfo(filename: string): ComponentInfo {
const { name } = extractPackageFile(filename);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path';
import { LANGUAGES } from '@mui/internal-core-docs/constants';
import { ProjectSettings } from '@mui-internal/api-docs-builder';
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
import { ProjectSettings, findApiPages } from '@mui/internal-api-docs-builder';
import generateUtilityClass, { isGlobalState } from '@mui/utils/generateUtilityClass';
import { getMaterialUiComponentInfo } from './getMaterialUiComponentInfo';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
getMuiName,
parseFile,
fixPathname,
} from '@mui-internal/api-docs-builder/buildApiUtils';
import findPagesMarkdown from '@mui-internal/api-docs-builder/utils/findPagesMarkdown';
findPagesMarkdown,
} from '@mui/internal-api-docs-builder';

const migratedBaseComponents = [
'Badge',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path';
import { LANGUAGES } from '@mui/internal-core-docs/constants';
import { ProjectSettings } from '@mui-internal/api-docs-builder';
import findApiPages from '@mui-internal/api-docs-builder/utils/findApiPages';
import { ProjectSettings, findApiPages } from '@mui/internal-api-docs-builder';
import generateUtilityClass, { isGlobalState } from '@mui/utils/generateUtilityClass';
import { getSystemComponentInfo } from './getSystemComponentInfo';

Expand Down
2 changes: 1 addition & 1 deletion packages-internal/api-docs-builder-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"directory": "packages-internal/api-docs-builder-core"
},
"dependencies": {
"@mui-internal/api-docs-builder": "workspace:^",
"@mui/internal-api-docs-builder": "workspace:^",
"@mui/internal-core-docs": "workspace:^",
"@mui/internal-markdown": "workspace:^",
"docs": "workspace:^",
Expand Down
13 changes: 0 additions & 13 deletions packages-internal/api-docs-builder/index.ts

This file was deleted.

19 changes: 14 additions & 5 deletions packages-internal/api-docs-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "@mui-internal/api-docs-builder",
"name": "@mui/internal-api-docs-builder",
"version": "1.0.0",
"private": "true",
"main": "./index.ts",
"scripts": {
"test": "pnpm --workspace-root test:unit --project \"*:@mui-internal/api-docs-builder\"",
"typescript": "tsc -p tsconfig.json"
"test": "pnpm --workspace-root test:unit --project \"*:@mui/internal-api-docs-builder\"",
"typescript": "tsc -p tsconfig.json",
"build": "code-infra build --flat --skipBabelRuntimeCheck"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,5 +38,15 @@
"@types/sinon": "17.0.4",
"chai": "6.2.2",
"sinon": "21.0.3"
},
"exports": {
".": "./src/index.ts"
},
"publishConfig": {
"access": "public",
"directory": "build"
},
"engines": {
"node": ">=22"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ const defaultGetHookImports = (name: string, filename: string) => {
return [subpathImport, rootImport];
};

export default async function generateHookApi(
export async function generateHookApi(
hooksInfo: HookInfo,
project: TypeScriptProject,
projectSettings: ProjectSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import findComponents from './utils/findComponents';
import findHooks from './utils/findHooks';
import { writePrettifiedFile } from './buildApiUtils';
import generateComponentApi from './ApiBuilders/ComponentApiBuilder';
import generateHookApi from './ApiBuilders/HookApiBuilder';
import { generateHookApi } from './ApiBuilders/HookApiBuilder';
import {
CreateTypeScriptProjectOptions,
TypeScriptProjectBuilder,
Expand Down
30 changes: 30 additions & 0 deletions packages-internal/api-docs-builder/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export { buildApi } from './buildApi';
export type { ProjectSettings } from './ProjectSettings';
export type {
ComponentReactApi,
ComponentApiContent,
HookReactApi,
PropsTableItem,
PropsTranslations,
HooksTranslations,
HookApiContent,
ComponentClassDefinition,
} from './types/ApiBuilder.types';
export type { Slot } from './types/utils.types';
export * from './ApiBuilders/ComponentApiBuilder';
export * from './ApiBuilders/HookApiBuilder';
export * from './buildApiUtils';
export { default as findPagesMarkdown } from './utils/findPagesMarkdown';
export { default as findApiPages, extractApiPage } from './utils/findApiPages';
export {
createTypeScriptProject,
createTypeScriptProjectBuilder,
} from './utils/createTypeScriptProject';
export type {
TypeScriptProject,
CreateTypeScriptProjectOptions,
TypeScriptProjectBuilder,
} from './utils/createTypeScriptProject';
export { default as replaceUrl } from './utils/replaceUrl';
export { default as findComponents } from './utils/findComponents';
export * from './utils/resolveExportSpecifier';
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface MarkdownPage {
* Returns the markdowns of the documentation in a flat array.
*/
export default function findPagesMarkdown(
directory: string = path.resolve(__dirname, '../../../docs/data'),
directory: string = path.resolve(process.cwd(), 'docs/data'),
pagesMarkdown: MarkdownPage[] = [],
) {
const items = fs.readdirSync(directory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderMarkdown } from '../buildApi';
import { getSymbolDescription, getSymbolJSDocTags } from '../buildApiUtils';
import { TypeScriptProject } from './createTypeScriptProject';
import { getPropsFromComponentNode } from './getPropsFromComponentNode';
import resolveExportSpecifier from './resolveExportSpecifier';
import { resolveExportSpecifier } from './resolveExportSpecifier';
import { ProjectSettings } from '../ProjectSettings';
import { Slot } from '../types/utils.types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function shouldAliasSymbol(symbol: ts.Symbol) {
* Do not go to the root definition for TypeAlias (ie: `export type XXX = YYY`)
* Because we usually want to keep the description and tags of the aliased symbol.
*/
export default function resolveExportSpecifier(symbol: ts.Symbol, project: TypeScriptProject) {
export function resolveExportSpecifier(symbol: ts.Symbol, project: TypeScriptProject) {
let resolvedSymbol = symbol;

while (shouldAliasSymbol(resolvedSymbol)) {
Expand Down
20 changes: 20 additions & 0 deletions packages-internal/api-docs-builder/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// This config is for emitting declarations (.d.ts) only
// Actual .ts source files are transpiled via babel
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"declaration": true,
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "build",
"rootDir": "./src"
},
"include": ["./src/**/*.ts*"],
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"],
"references": [
{
"path": "../docs-utils/tsconfig.build.json"
}
]
}
4 changes: 2 additions & 2 deletions packages-internal/api-docs-builder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"esModuleInterop": true,
"types": ["node", "vitest/globals"],
"target": "ES2020",
"module": "nodenext",
"moduleResolution": "nodenext",
"module": "preserve",
"moduleResolution": "bundler",
"strict": true,
"paths": {
"@mui/internal-docs-utils": ["../docs-utils/src/index.ts"]
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/core-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"stylis": "catalog:docs"
},
"devDependencies": {
"@mui-internal/api-docs-builder": "workspace:*",
"@mui/internal-api-docs-builder": "workspace:*",
"@mui/icons-material": "workspace:*",
"@mui/material": "workspace:*",
"@types/chai": "5.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/core-docs/src/ApiPage/ApiPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import type { ComponentApiContent, PropsTranslations } from '@mui-internal/api-docs-builder';
import type { ComponentApiContent, PropsTranslations } from '@mui/internal-api-docs-builder';
import Typography from '@mui/material/Typography';
import Alert from '@mui/material/Alert';
import VerifiedRoundedIcon from '@mui/icons-material/VerifiedRounded';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import type { ComponentApiContent, PropsTranslations } from '@mui-internal/api-docs-builder';
import type { ComponentApiContent, PropsTranslations } from '@mui/internal-api-docs-builder';
import { kebabCase } from 'es-toolkit/string';
import { useRouter } from 'next/router';
import { Translate, useTranslate, useUserLanguage } from '../i18n';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import type { HookApiContent, HooksTranslations } from '@mui-internal/api-docs-builder';
import type { HookApiContent, HooksTranslations } from '@mui/internal-api-docs-builder';
import { kebabCase } from 'es-toolkit/string';
import { Translate, useTranslate, useUserLanguage } from '../i18n';
import { SectionTitle, SectionTitleProps } from '../SectionTitle';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PropsTranslations, ComponentApiContent } from '@mui-internal/api-docs-builder';
import type { PropsTranslations, ComponentApiContent } from '@mui/internal-api-docs-builder';
import { kebabCase } from 'es-toolkit/string';
import type { ClassDefinition, BaseCssTOCParams } from './types';
import type { TocItem } from '../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
PropsTranslations,
HookApiContent,
HooksTranslations,
} from '@mui-internal/api-docs-builder';
} from '@mui/internal-api-docs-builder';
import { kebabCase } from 'es-toolkit/string';
import type { BaseCssTOCParams, PropertyDefinition } from './types';
import type { TocItem } from '../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PropsTranslations, ComponentApiContent } from '@mui-internal/api-docs-builder';
import type { PropsTranslations, ComponentApiContent } from '@mui/internal-api-docs-builder';
import type { BaseCssTOCParams, SlotDefinition } from './types';
import type { TocItem } from '../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import Box from '@mui/material/Box';
import { PropsTranslations, ComponentClassDefinition } from '@mui-internal/api-docs-builder';
import { PropsTranslations, ComponentClassDefinition } from '@mui/internal-api-docs-builder';
import { SectionTitle } from '../../SectionTitle';
import { useTranslate } from '../../i18n';
import type { ClassDefinition } from '../definitions/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import Box from '@mui/material/Box';
import { PropsTableItem, PropsTranslations } from '@mui-internal/api-docs-builder';
import { PropsTableItem, PropsTranslations } from '@mui/internal-api-docs-builder';
import { useTranslate } from '../../i18n';
import {
ToggleDisplayOption,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-danger */
import * as React from 'react';
import Box from '@mui/material/Box';
import { ComponentApiContent } from '@mui-internal/api-docs-builder';
import { ComponentApiContent } from '@mui/internal-api-docs-builder';
import { useTranslate } from '../../i18n';
import { SectionTitle } from '../../SectionTitle';
import SlotsList from '../list/SlotsList';
Expand Down
13 changes: 6 additions & 7 deletions packages-internal/docs-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
"version": "3.0.3",
"author": "MUI Team",
"description": "Utilities for MUI docs. This is an internal package not meant for general use.",
"main": "./build/index.js",
"exports": {
".": "./build/index.js"
},
"types": "./build/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/mui/material-ui.git",
"directory": "packages-internal/docs-utils"
},
"scripts": {
"prebuild": "rimraf ./build",
"build": "tsc -p tsconfig.build.json",
"build": "code-infra build --flat --skip-babel-runtime-check",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

"typescript": "tsc -p tsconfig.json",
"release:publish": "pnpm build && pnpm publish --tag latest",
"release:publish:dry-run": "pnpm build && pnpm publish --tag latest --registry=\"http://localhost:4873/\""
Expand All @@ -25,6 +20,10 @@
"typescript": "^5.9.3"
},
"publishConfig": {
"access": "public"
"access": "public",
"directory": "build"
},
"exports": {
".": "./src/index.ts"
}
}
4 changes: 0 additions & 4 deletions packages-internal/docs-utils/src/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @deprecated Import if from '@mui-internal/api-docs-builder'
* @deprecated Import if from '@mui/internal-api-docs-builder'
*/
export interface ComponentClassDefinition {
key: string;
Expand Down
4 changes: 2 additions & 2 deletions packages-internal/docs-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"noEmit": true,
"module": "nodenext",
"moduleResolution": "nodenext",
"module": "esnext",
"moduleResolution": "bundler",
"types": ["node"],
"strict": true,
"esModuleInterop": true,
Expand Down
Loading
Loading