If you would like to hack on MUI Toolpad or want to run the latest version, you can follow these steps:
- git
- node.js
- Docker
- docker-compose
-
Start a local database:
docker-compose -f ./docker-compose.dev.yml up -d
You can skip this step if you already have a development database available by other means. Use the following command to stop the running container:
docker-compose -f ./docker-compose.dev.yml down
-
Install dependencies and start building the project in watch mode:
yarn install yarn dev
-
Create a
.env
file in the root of the projectTOOLPAD_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
-
Now you can run the MUI Toolpad cli to start the application
yarn cli
-
Open
http://localhost:3000/
in your browser.
-
Changes that you make to the prisma model will be automatically compiled, but you'll have to push them to the db manually, either by restarting the
yarn cli
command, or by runningyarn prisma db push
-
In some cases, after the schema changes, the app may not start up and you may see the message:
⚠️ There might be data loss when applying the changes:
This means your database is out of sync with the prisma schema and can't be synchronized without data loss. You can synchronise the database manually using:
yarn prisma db push --accept-data-loss
-
Build packages
yarn release:build
-
Cut a new release
yarn release:version <prerelease/patch/minor/major>
-
Publish release
yarn release:publish
CI builds and pushes an image per commit. We can tag some of these images with a version number using the method of https://stackoverflow.com/a/70526615
For testing purposes, it is possible to try out publishing
-
Start local npm registry
npx verdaccio
-
You may have to increase max allowed uploaded body size. To do so, locate your verdaccio config file and add:
max_body_size: 100mb # Or whatever size is needed
-
Publish packages using the command
yarn release:publish:dry-run
-
packages can be installed by appending
--registry=http://localhost:4873/
toyarn
/npm
commands, or by providing environment variablenpm_config_registry=http://localhost:4873/
(The latter seems to be needed fornpx
, as innpm_config_registry=http://localhost:4873/ npx @mui/toolpad
)