Skip to main content

Generating and Running Patches for Gesso

This guide provides instructions for applying a temporary patch to the Gesso monorepo in your project, useful when you've submitted a merge request (MR) but need to implement the changes before the official release.

Prerequisites

Ensure you have pnpm or yarn installed and are familiar with the basic operations in the Gesso monorepo. For details on pnpm patch refer to the official pnpm documentation.

Instructions

For PNPM Users

  1. Run PNPM Patch: In your project directory, execute pnpm patch. This prepares your project for the incoming patch.

  2. Modify the Gesso Monorepo: Navigate to the Gesso monorepo and make the necessary changes.

  3. Compile the Package: Compile the /dist folder of the specific package you modified in the monorepo.

  4. Copy the Compiled Package: Transfer the compiled /dist folder from the monorepo to your project directory.

  5. Commit the Patch: Run pnpm patch-commit package path (replace package path with the relevant path to your package). This creates a patch file in your project and updates your package.json.

For Yarn Users

  1. Install patch-package: If not already installed, add patch-package to your project by running yarn add patch-package postinstall-postinstall.

  2. Modify the Gesso Monorepo: Similar to the PNPM process, make your changes in the Gesso monorepo.

  3. Compile the Package: Compile the /dist folder of the modified package.

  4. Copy the Compiled Package: Copy the compiled /dist folder to your project directory.

  5. Create and Apply the Patch: Run yarn patch-package package-name (replace package-name with the name of the package you modified). This command creates a patch file and applies it to your project.

Troubleshooting

  • If you encounter issues with pnpm patch-commit or yarn patch-package, ensure that the package path or name is correct.
  • For other common issues, consult the pnpm documentation or the patch-package GitHub repository for solutions.

By following these steps, you can implement and use changes in the Gesso monorepo immediately in your project with either PNPM or Yarn, without waiting for the official merge and release.