-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Type check docs in CI #4560
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { | |
type AuthResponse, | ||
} from '@toolpad/core/SignInPage'; | ||
import { createTheme } from '@mui/material/styles'; | ||
// @ts-ignore | ||
import { useColorSchemeShim } from 'docs/src/modules/components/ThemeContext'; | ||
Comment on lines
+9
to
10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Source are in JavaScript. |
||
import { getDesignTokens, inputsCustomizations } from './customTheme'; | ||
|
||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,10 @@ const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); | |
|
||
const require = createRequire(import.meta.url); | ||
|
||
// @ts-ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy mui/mui-x#11514 |
||
const withDocsInfra = require('@mui/monorepo/docs/nextConfigDocsInfra'); | ||
|
||
const pkg = require('../package.json'); | ||
const { findPages } = require('./src/modules/utils/find'); | ||
const { findPages } = require('./src/modules/utils/find.js'); | ||
|
||
const WORKSPACE_ROOT = path.resolve(currentDirectory, '../'); | ||
const MONOREPO_PATH = path.resolve(currentDirectory, '../node_modules/@mui/monorepo'); | ||
|
@@ -44,6 +44,7 @@ export default withDocsInfra({ | |
TOOLPAD_CORE_VERSION: toolpadCorePkg.version, | ||
TOOLPAD_STUDIO_VERSION: toolpadStudioPkg.version, | ||
}, | ||
// @ts-ignore | ||
webpack: (config, options) => { | ||
return { | ||
...config, | ||
|
@@ -126,11 +127,14 @@ export default withDocsInfra({ | |
const pages = findPages(); | ||
const map = {}; | ||
|
||
// @ts-ignore | ||
function traverse(pages2, userLanguage) { | ||
const prefix = userLanguage === 'en' ? '' : `/${userLanguage}`; | ||
|
||
// @ts-ignore | ||
pages2.forEach((page) => { | ||
if (!page.children) { | ||
// @ts-ignore | ||
map[`${prefix}${page.pathname.replace(/^\/api-docs\/(.*)/, '/api/$1')}`] = { | ||
page: page.pathname, | ||
query: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,16 +441,6 @@ function JsonSchemaNameValueDisplay({ | |
); | ||
} | ||
|
||
interface HeadingProps { | ||
hash: string; | ||
level: 'h2' | 'h3'; | ||
title: string; | ||
} | ||
|
||
function Heading({ hash, level: Level, title }: HeadingProps) { | ||
return <SectionTitle title={title} id={hash} level={Level} />; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was wrong: https://mui.com/toolpad/studio/reference/file-schema/ ![]() |
||
} | ||
|
||
interface JsonSchemaDisplayProps { | ||
name: string; | ||
hash: string; | ||
|
@@ -461,7 +451,7 @@ interface JsonSchemaDisplayProps { | |
function JsonSchemaDisplay({ name, hash, schema, idPrefix = '' }: JsonSchemaDisplayProps) { | ||
return ( | ||
<React.Fragment> | ||
<Heading hash={hash} level="h3" title={name} /> | ||
<SectionTitle hash={hash} level="h3" title={name} /> | ||
<Typography>{schema.description}</Typography> | ||
<Wrapper> | ||
<JsonSchemaValueDisplay schema={schema} idPrefix={idPrefix} /> | ||
|
@@ -525,7 +515,7 @@ export default function SchemaReference(props: SchemaReferenceProps) { | |
{toc.map((tocNode) => { | ||
return ( | ||
<React.Fragment key={tocNode.hash}> | ||
<Heading hash={tocNode.hash} level="h2" title={tocNode.text} /> | ||
<SectionTitle hash={tocNode.hash} level="h2" title={tocNode.text} /> | ||
<Typography>{tocNode.introduction}</Typography> | ||
{tocNode.children.map((tocItemNode) => { | ||
invariant(typeof tocItemNode.content !== 'boolean', 'Invalid top level schema'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// @ts-check | ||
const fs = require('fs'); | ||
|
||
const pluginName = 'babel-plugin-jsx-preview'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"moduleResolution": "bundler", | ||
"allowJs": true, | ||
"isolatedModules": true, | ||
/* files are emitted by babel */ | ||
"noEmit": true, | ||
"noUnusedLocals": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"types": ["react", "node"], | ||
"incremental": true, | ||
"noImplicitAny": true, | ||
"jsx": "preserve" | ||
"moduleResolution": "bundler" | ||
}, | ||
"include": ["docs-env.d.ts", "pages/**/*", "src/**/*", "data/**/*", "next.config.mjs"], | ||
"exclude": ["docs/.next", "docs/export"] | ||
"include": ["next-env.d.ts", "next.config.mjs", "docs-env.d.ts", "src", "pages/**/*.ts*", "data"], | ||
"exclude": ["docs/.next", "docs/export", "node_modules"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy script naming convention from main repo.