From d39f5be7bc4ff68b25a0e0b1dabef1df81ae43fe Mon Sep 17 00:00:00 2001 From: Danyal Faheem <138459282+Danyal-Faheem@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:31:22 +0500 Subject: [PATCH] docs: patches catalog --- README.rst | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a81121d6..4c83613e 100644 --- a/README.rst +++ b/README.rst @@ -185,6 +185,8 @@ Your custom translation strings should now appear in your app. Customising MFEs ~~~~~~~~~~~~~~~~ +.. _mfe-lms-settings: + To change the MFEs logos from the default to your own logos, override the corresponding settings in the MFEs environment using patches `mfe-lms-production-settings` and `mfe-lms-development-settings`. For example, using the following plugin: :: @@ -215,6 +217,8 @@ To change the MFEs logos from the default to your own logos, override the corres If patches are the same in development and production, they can be replaced by a single `mfe-lms-common-settings` patch. +.. _mfe-docker-post-npm-install: + To install custom components for the MFEs, such as the `header `_ and `footer `_, override the components by adding a patch to ``mfe-dockerfile-post-npm-install`` in your plugin: :: @@ -263,6 +267,8 @@ In both cases above, the ``npm`` commands affect every MFE being built. If you ] ) +.. _mfe-docker-pre-npm-build: + In case you need to run additional instructions just before the build step you can use the ``mfe-dockerfile-pre-npm-build`` or ``mfe-dockerfile-pre-npm-build-*`` patches. For example, you may want to override existing env variables or define new ones. :: @@ -290,7 +296,7 @@ In case you need to run additional instructions just before the build step you c ] ) - +You can find more patches in the `patch catalog <#template-patch-catalog>`_ below. Installing from a private npm registry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -370,6 +376,103 @@ Finally, restart the platform with:: tutor local launch + +Template patch catalog +---------------------- + +This is the list of all patches used across tutor-mfe (outside of any plugin). Alternatively, you can search for patches in tutor-mfe templates by grepping the source code:: + + git clone https://github.com/overhangio/tutor-mfe + cd tutor-mfe + git grep "{{ patch" -- tutormfe/templates + +mfe-lms-development-settings +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Python-formatted LMS settings in development. Values defined here override the values from `mfe-lms-common-settings <#mfe-lms-common-settings>`_ or `mfe-lms-production-settings <#mfe-lms-production-settings>`_. For an example on the usage of this patch, check out `this section <#mfe-lms-settings>`_. + +File changed: ``apps/openedx/settings/lms/development.py`` + +mfe-lms-production-settings +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Python-formatted LMS settings in production. Values defined here override the values from `mfe-lms-common-settings <#mfe-lms-common-settings>`_. For an example on the usage of this patch, check out `this section <#mfe-lms-settings>`_. + +File changed: ``apps/openedx/settings/lms/production.py`` + +mfe-lms-common-settings +~~~~~~~~~~~~~~~~~~~~~~~ +Python-formatted LMS settings used both in production and development. + +File changed: ``apps/openedx/settings/partials/common_lms.py`` + +mfe-webpack-dev-config +~~~~~~~~~~~~~~~~~~~~~~ +Add any configurations at the end of the development webpack config file in Javascript format. + +File changed: ``tutormfe/templates/mfe/apps/mfe/webpack.dev-tutor.config.js`` + +mfe-dockerfile-pre-npm-install +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for before the npm install is initiated. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-pre-npm-install-{} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for before the npm install is initiated for a specific MFE. Add the exact MFE name at the end to only change instructions for that MFE. + +Example: ``mfe-dockerfile-pre-npm-install-learning`` will only apply any instructions specified for the learning MFE. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-post-npm-install +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for after the npm install has completed. This will apply the instructions to every MFE. For an example on the usage of this patch, check out `here <#mfe-docker-post-npm-install>`_. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-post-npm-install-{} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for after the npm install has completed for a specific MFE. Add the exact MFE name at the end to only change instructions for that MFE. For an example on the usage of this patch, check out `here <#mfe-docker-post-npm-install>`_. + +Example: ``mfe-dockerfile-post-npm-install-authn`` will only apply any instructions specified for the authn MFE. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-pre-npm-build +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for before the build step initializes. This will apply the instructions to every MFE. For an example on the usage of this patch, see `over here <#mfe-docker-pre-npm-build>`_. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-pre-npm-build-{} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for before the build step initializes for a specific MFE. Add the exact MFE name at the end to only change instructions for that MFE. For an example on the usage of this patch, see `over here <#mfe-docker-pre-npm-build>`_. + +Example: ``mfe-dockerfile-post-npm-build-learning`` will only apply any instructions specified for the learning MFE. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-post-npm-build +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for after the build step has completed. This will apply the instructions to every MFE. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-dockerfile-post-npm-build-{} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions for after the build step has completed for a specific MFE. Add the exact MFE name at the end to only change instructions for that MFE. + +Example: ``mfe-dockerfile-post-npm-build-learning`` will only apply any instructions specified for the learning MFE. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + +mfe-caddyfile +~~~~~~~~~~~~~ +Add any configurations for the mfe-caddyfile. + +File changed: ``tutormfe/templates/mfe/apps/mfe/Caddyfile`` + + Troubleshooting ---------------