-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Generate API docs for Toolpad Core #3536
Merged
Merged
Changes from 69 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
bebb82e
Improve bundling, try to fix MUI/Next integration bugs
apedroferreira 03786bd
Fix import in template
apedroferreira fd68ff0
fix it more
apedroferreira 4d04649
Re-add icon imports
apedroferreira 8630f2a
Always clean or it gets messy
apedroferreira 235116a
Basic layout - a start
apedroferreira 1311f6f
Remove unused icon
apedroferreira 8f6c9db
Basic header, sidebar in progress
apedroferreira e6d436b
Header with branding + navigation with nesting
apedroferreira 4807db7
Grammar
apedroferreira 926102f
Much better test
apedroferreira f0c6180
Update created app files
apedroferreira 4175348
Scaffolding fixes
apedroferreira 8f19dde
Add DashboardLayout tests
apedroferreira f44f5a0
Remove this thing I guess
apedroferreira d250929
Nevermind
apedroferreira 06da40c
Fix dependencies if they're broken
apedroferreira f0a17e4
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira 3dab0a8
Review fixes, make everything more generic, use playground folder
apedroferreira eb8a6f1
Build with babel, create development tools
apedroferreira b8fdf8d
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira 229dffc
Update create-toolpad-app for core
apedroferreira 1c777d3
Review suggestions and add DashboardLayout demo to docs
apedroferreira 9efd2f5
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira c31fe20
Fix this example
apedroferreira 7fd54d4
Dedupe
apedroferreira c6819a5
Use new navigation system
apedroferreira c4da025
Better component name
apedroferreira e105c15
DashboardLayout docs, missing API reference
apedroferreira 0327c4f
Update
apedroferreira 4b59fc0
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira cbc3045
Reuse theme in docs
apedroferreira 6508899
Fix core publish
apedroferreira 34e9255
Rerun install
apedroferreira fa9b64f
Fix tests and other errors
apedroferreira c21a36e
Set exports too
apedroferreira 83e99e2
whoops
apedroferreira effcabf
Merge branch 'master' into add-layout-component
apedroferreira 0de2030
Try Netlify deploy with imports from root
apedroferreira dd39264
Stupid VSCode setting
apedroferreira 65acf1d
Linters
apedroferreira 67f724b
Attempt to fix netlify build
apedroferreira 4b033f7
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira 6da38cb
Try to fix OOM in Circle CI
apedroferreira 1c4f46b
Another attempt to fix OOM in CI
apedroferreira a154f6f
Add Toolpad Core contributing instructions
apedroferreira c939d98
Try Jan's changes and some other but keep playground
apedroferreira b56c288
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira 69f2db0
Another attempt
apedroferreira 661c6ad
More cleanup before trying to remove playground
apedroferreira 291c78f
Update lockfile
apedroferreira c355188
Retry filter option to try to keep playground alive
apedroferreira 701187e
Try with correct option
apedroferreira fef1864
Dedupe again
apedroferreira deb85ea
ugh
apedroferreira b3346b9
Maybe this
apedroferreira f7a9cbb
Revert last failed attempts
apedroferreira 31a4af8
Try older pnpm patch version
apedroferreira 1c996a7
Try latest pnpm minor version
apedroferreira 631afc1
Try pnpm 9
apedroferreira 5682085
Properly try previous minor version
apedroferreira ce8102e
Try latesg pnpm commit ( I think)
apedroferreira 22cfa4f
gh
apedroferreira 8fa6300
Fix mismatched packages
apedroferreira 8ac56cb
Playing around with pnpm had somehow broken the lockfile permanently
apedroferreira 09a4741
Final cleanup
apedroferreira 52283d7
api docs generation (WIP)
apedroferreira dcdffd3
Fix some more stuff, trying to figure out mess with path aliases...
apedroferreira 7d7fff1
Rest of the stuff, also fixes aliases
apedroferreira 4e7d81c
Many review improvements, provide some themes too
apedroferreira dbc0e1b
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira 59e4121
Remove more leftovers
apedroferreira 9e26e6e
Review fixes, prep to split into another PR
apedroferreira 6277b31
Add TODO comments
apedroferreira 7b963c7
Merge branch 'add-layout-component' into generate-core-api-docs
apedroferreira f684a4c
Save progress
apedroferreira 64e83c1
dfegrstd
apedroferreira 5e93460
Get it mostly right just need to fix API pages and a few more things
apedroferreira 1ae8c50
Final things
apedroferreira bdbe1e5
Merge remote-tracking branch 'upstream/master' into generate-core-api…
apedroferreira c5a37b0
Continue rebasing
apedroferreira 1077f8e
Cleanup attempt
apedroferreira 355bad7
Cleanup/fix some more
apedroferreira 52f3706
Some more cleanup
apedroferreira 20d8954
Move logo back inside component
apedroferreira 56045b5
Clean up props
apedroferreira 79f8a38
Dependency fixes
apedroferreira 2744ba7
Probably almost ready
apedroferreira 0ff9260
Merge remote-tracking branch 'upstream/master' into generate-core-api…
apedroferreira f01e7d3
Fix prop types generation
apedroferreira 01eaf42
Merge remote-tracking branch 'upstream/master' into generate-core-api…
apedroferreira da1b4ce
Build API docs again
apedroferreira a2dcaff
Small spacing fix
apedroferreira 8502820
keep spacing after all i guess
apedroferreira 0d162c6
Update previews
apedroferreira 9b46b1d
remove docs alias
Janpot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Enforce pnpm | ||
|
||
engine-strict = true | ||
auto-install-peers = true | ||
engine-strict=true | ||
auto-install-peers=true | ||
strict-peer-dependencies=false | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
const path = require('path'); | ||
|
||
const errorCodesPath = path.resolve(__dirname, './docs/public/static/error-codes.json'); | ||
const missingError = process.env.MUI_EXTRACT_ERROR_CODES === 'true' ? 'write' : 'annotate'; | ||
|
||
function resolveAliasPath(relativeToBabelConf) { | ||
const resolvedPath = path.relative(process.cwd(), path.resolve(__dirname, relativeToBabelConf)); | ||
return `./${resolvedPath.replace('\\', '/')}`; | ||
} | ||
|
||
const productionPlugins = [ | ||
['babel-plugin-react-remove-properties', { properties: ['data-mui-test'] }], | ||
]; | ||
|
||
module.exports = function getBabelConfig(api) { | ||
const useESModules = api.env(['regressions', 'stable', 'rollup']); | ||
|
||
const defaultAlias = { | ||
'@toolpad/core': resolveAliasPath('./packages/toolpad-core/src'), | ||
docs: resolveAliasPath('./node_modules/@mui/monorepo/docs'), | ||
'docs-toolpad': resolveAliasPath('./docs'), | ||
test: resolveAliasPath('./test'), | ||
'@mui-internal/api-docs-builder': resolveAliasPath( | ||
'./node_modules/@mui/monorepo/packages/api-docs-builder', | ||
), | ||
}; | ||
|
||
const presets = [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
bugfixes: true, | ||
browserslistEnv: process.env.BABEL_ENV || process.env.NODE_ENV, | ||
debug: process.env.MUI_BUILD_VERBOSE === 'true', | ||
modules: useESModules ? false : 'commonjs', | ||
}, | ||
], | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
]; | ||
|
||
const plugins = [ | ||
[ | ||
'babel-plugin-macros', | ||
{ | ||
muiError: { | ||
errorCodesPath, | ||
missingError, | ||
}, | ||
}, | ||
], | ||
'babel-plugin-optimize-clsx', | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
useESModules, | ||
// any package needs to declare 7.4.4 as a runtime dependency. default is ^7.0.0 | ||
version: '^7.4.4', | ||
}, | ||
], | ||
[ | ||
'babel-plugin-transform-react-remove-prop-types', | ||
{ | ||
mode: 'unsafe-wrap', | ||
}, | ||
], | ||
]; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
plugins.push(...productionPlugins); | ||
} | ||
|
||
return { | ||
assumptions: { | ||
noDocumentAll: true, | ||
}, | ||
presets, | ||
plugins, | ||
ignore: [/@babel[\\|/]runtime/], // Fix a Windows issue. | ||
overrides: [ | ||
{ | ||
exclude: /\.test\.(js|ts|tsx)$/, | ||
plugins: ['@babel/plugin-transform-react-constant-elements'], | ||
}, | ||
], | ||
env: { | ||
coverage: { | ||
plugins: [ | ||
'babel-plugin-istanbul', | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: defaultAlias, | ||
}, | ||
], | ||
], | ||
}, | ||
development: { | ||
plugins: [ | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: defaultAlias, | ||
}, | ||
], | ||
], | ||
}, | ||
rollup: { | ||
plugins: [ | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
alias: defaultAlias, | ||
}, | ||
], | ||
], | ||
}, | ||
test: { | ||
sourceMaps: 'both', | ||
plugins: [ | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: defaultAlias, | ||
}, | ||
], | ||
], | ||
}, | ||
benchmark: { | ||
plugins: [ | ||
...productionPlugins, | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
alias: defaultAlias, | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const LANGUAGES: string[]; | ||
|
||
export const LANGUAGES_SSR: string[]; | ||
|
||
export const LANGUAGES_IN_PROGRESS: string[]; | ||
|
||
export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
docs/data/toolpad/core/components/app-provider/app-provider.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
productId: toolpad-core | ||
title: App Provider | ||
components: AppProvider | ||
--- | ||
|
||
# App Provider | ||
|
||
<p class="description">The app provider component provides the necessary context for a Toolpad application.</p> |
70 changes: 70 additions & 0 deletions
70
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DashboardIcon from '@mui/icons-material/Dashboard'; | ||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; | ||
import BarChartIcon from '@mui/icons-material/BarChart'; | ||
import DescriptionIcon from '@mui/icons-material/Description'; | ||
import LayersIcon from '@mui/icons-material/Layers'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
import theme from '../theme'; | ||
|
||
const NAVIGATION = [ | ||
{ | ||
kind: 'header', | ||
title: 'Main items', | ||
}, | ||
{ | ||
title: 'Dashboard', | ||
icon: <DashboardIcon />, | ||
}, | ||
{ | ||
title: 'Orders', | ||
icon: <ShoppingCartIcon />, | ||
}, | ||
{ | ||
kind: 'divider', | ||
}, | ||
{ | ||
kind: 'header', | ||
title: 'Analytics', | ||
}, | ||
{ | ||
title: 'Reports', | ||
icon: <BarChartIcon />, | ||
children: [ | ||
{ | ||
title: 'Sales', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Traffic', | ||
icon: <DescriptionIcon />, | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Integrations', | ||
icon: <LayersIcon />, | ||
}, | ||
]; | ||
|
||
export default function DashboardLayoutBasic() { | ||
return ( | ||
<AppProvider theme={theme} navigation={NAVIGATION}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems to me that a space is supposed to be present from https://docs.npmjs.com/cli/v9/configuring-npm/npmrc.
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.
Oh ok I was changing these for consistency as I had seen different spacing in different places, will make all of them include the spacing then.