If you would like to hack on MUI Toolpad or want to run the latest version, you can follow these steps:
If you're looking into contributing to the docs, follow the instructions down below
- git
- node.js
This will use the local version of Toolpad as built in the monorepo. This is recommended when your app is in a folder inside of the monorepo. You may even decide to temporarily move your app into the monorepo.
-
Install dependencies:
yarn install
-
Run the build in watch mode
yarn dev
-
Run Toolpad
yarn toolpad dev test/integration/backend-basic/fixture --dev
Note: It's important to note the difference between
yarn toolpad dev
and the--dev
parameter. The first instruction runs Toolpad in dev mode. The--dev
parameter is one for contributors only and runs the underlying next.js app that powers the editor in dev mode. The latter makes sure the development build of React is being used and the editor frontend application runs in watch mode.
If your application has dependencies other than @mui/toolpad
, you have to temporarily add it to the workspace:
-
update
package.json
(in the workspace root, not in your app), add your app folder toworkspaces.packages
. e.g. forexamples/qr-generator
which has a dependency onqrcode
this would be:"workspaces": { "packages": [ "packages/*", "docs", "examples/qr-generator" ] },
You may also temporarily remove/rename the
dev
/build
commands inexamples/qr-generator/package.json
to avoid them getting picked up automatically bylerna
. -
Run
yarn install
-
Make sure to start the build in watch mode again and the run the app with
yarn toolpad dev examples/qr-generator --dev
Expand instructions
In some cases you may want to link local toolpad into a project on your laptop.
- Install dependencies:
yarn install
-
Run the build in watch mode
yarn dev
-
In another folder, start a toolpad project using:
{ "name": "toolpad-local", "version": "1.0.0", "license": "MIT", "scripts": { "dev": "toolpad dev --dev", "build": "toolpad build --dev", "start": "toolpad start --dev" }, "dependencies": { "@mui/toolpad": "portal:<your-local-toolpad-monorepo>/packages/toolpad-app" }, "resolutions": { "@mui/toolpad": "portal:<your-local-toolpad-monorepo>/packages/toolpad-app", "@mui/toolpad-core": "portal:<your-local-toolpad-monorepo>/packages/toolpad-core", "@mui/toolpad-components": "portal:<your-local-toolpad-monorepo>/packages/toolpad-components", "@mui/toolpad-utils": "portal:<your-local-toolpad-monorepo>/packages/toolpad-utils" } }
-
Replace
<your-local-toolpad-monorepo>
with the path to the toolpad monorepo on your file system. Make sure to keepportal:
. -
In order to use
portal:
dependencies, we will need to use yarn 2. So start by runningyarn set version berry
and add to the
.yarnrc.yml
:nodeLinker: node-modules
-
then run
yarn install
-
-
Run start toolpad in dev mode:
yarn dev
The playwright tests can be run in one of two modes:
-
Build the production target, then run the integration tests in production mode:
yarn release:build yarn test:integration --project chromium
-
Toolpad in dev watchmode and run the integration tests in dev mode with the
TOOLPAD_NEXT_DEV
environment variable (slower)yarn dev TOOLPAD_NEXT_DEV=1 yarn test:integration --project chromium
Use the --ui
flag to run the tests interactively.
-
If you haven't already, install the project dependencies using
yarn
-
To start the documentation application in dev mode run
yarn docs:dev
If all goes well it should print
ready - started server on 0.0.0.0:3003, url: http://localhost:3003
-
Open the docs application in the browser http://localhost:3003/toolpad
-
Check out the PR branch locally with your tool of choice (GitHub Docs)
-
Run to build the project
yarn && yarn release:build
-
Run it on your project of choice
yarn toolpad dev /path/to/my/toolpad/project
Each pull request is built on CodeSandbox CI. As a result of that we have a published Toolpad package for ever pull request. To use the package from the pull request, take the following steps:
-
In the GitHub PR checks, locate the ci/codesandbox check and make sure it has successfully finished building. Click on "details" to open the CodeSandbox CI user interface.
-
In the codesandbox UI, on the right panel, locate and expand the "Packages (6)" section.
-
Right click the link named
@mui/toolpad
and copy the address -
In your
package.json
, for the@mui/toolpad
dependency, replace the version with aforementioned link. e.g."dependencies": { "@mui/toolpad": "https://pkg.csb.dev/mui/mui-toolpad/commit/<commit>/@mui/toolpad" }
-
Run
yarn --force
You'll now be able to explore your project with the Toolpad version from the GitHub PR.
Please have a look at our general guidelines for sending pull requests.
See RELEASE.md