Skip to content

Latest commit

 

History

History
119 lines (76 loc) · 2.73 KB

CONTRIBUTING.md

File metadata and controls

119 lines (76 loc) · 2.73 KB

Contributing

Local development

If you would like to hack on MUI Toolpad or want to run the latest version, you can follow these steps:

Prerequisites:

  • git
  • node.js
  • Docker
  • docker-compose

Steps:

  1. 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
  2. Install dependencies and start building the project in watch mode:

    yarn install
    yarn dev
  3. Create a .env file in the root of the project

    TOOLPAD_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
  4. Now you can run the MUI Toolpad cli to start the application

    yarn cli
  5. Open http://localhost:3000/ in your browser.

Notes for contributors:

  • 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 running

    yarn 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

Release process

release

  1. Build packages

    yarn release:build
  2. Cut a new release

    yarn release:version <prerelease/patch/minor/major>
  3. Publish release

    yarn release:publish

Releasing Docker images

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

Dryrun publish

For testing purposes, it is possible to try out publishing

  1. Start local npm registry

    npx verdaccio
  2. 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
  3. Publish packages using the command

    yarn release:publish:dry-run
  4. packages can be installed by appending --registry=http://localhost:4873/ to yarn/npm commands, or by providing environment variable npm_config_registry=http://localhost:4873/ (The latter seems to be needed for npx, as in npm_config_registry=http://localhost:4873/ npx @mui/toolpad)