diff --git a/README.rst b/README.rst index 846cabb..0576d8d 100644 --- a/README.rst +++ b/README.rst @@ -18,6 +18,7 @@ community: =================================== ====================================================== Plugin Status (*Experimental*, *Production*, or *Deprecated*) =================================== ====================================================== +tutor-contrib-frontend-base Experimental tutor-contrib-learner-dashboard-mfe Deprecated tutor-contrib-test-legacy-js "Production" (Supported For Developers) tutor-contrib-scout-apm Experimental diff --git a/plugins/tutor-contrib-frontend-base/README.rst b/plugins/tutor-contrib-frontend-base/README.rst new file mode 100644 index 0000000..119cfca --- /dev/null +++ b/plugins/tutor-contrib-frontend-base/README.rst @@ -0,0 +1,67 @@ +frontend-base plugin for `Tutor `__ +==================================================================== + +This is a very simple plugin. It's only job is to enable the `frontend-base +`__ core apps already present in +Tutor via `tutor-mfe `__. + +Frontend-base is a unified framework that replaces ``frontend-build``, +``frontend-platform``, ``frontend-plugin-framework``, +``frontend-component-header``, and ``frontend-component-footer``. It enables +frontend apps to be loaded as direct plugins within a single shell application, +rather than as separate, independently deployed micro frontends. + +When enabled, this plugin activates the two core frontend apps that ship with +tutor-mfe: ``authn`` and ``learner-dashboard``. Because these match existing +legacy MFEs, the legacy versions are effectively disabled in favor of their +frontend-base counterparts. + +Installation +------------ + +This plugin requires the ``frontend-base`` branch of tutor-mfe, which has not +yet been released. Install it first:: + + pip install "git+https://github.com/overhangio/tutor-mfe.git@frontend-base" + +After installing the tutor-mfe ``frontend-base`` branch, the ``mfe`` and +``mfe-dev`` images need to be rebuilt:: + + tutor images build mfe mfe-dev + +Then install this plugin directly from Github:: + + pip install git+https://github.com/openedx/openedx-tutor-plugins.git#subdirectory=plugins/tutor-contrib-frontend-base + +Alternatively, you can clone the parent repository locally and install it from +the checkout:: + + git clone https://github.com/openedx/openedx-tutor-plugins.git + cd openedx-tutor-plugins/plugins/tutor-contrib-frontend-base + pip install -e . + +Usage +----- + +Once installed, enable the plugin:: + + tutor plugins enable frontend-base + +After this, restart or launch your environment:: + + tutor local launch + +After this, the frontend-base version of the Open edX frontend should be accessible. + +Uninstallation +-------------- + +To disable the plugin:: + + tutor plugins disable frontend-base + tutor local stop && tutor local start -d + +License +------- + +This software is licensed under the terms of the AGPLv3. diff --git a/plugins/tutor-contrib-frontend-base/setup.py b/plugins/tutor-contrib-frontend-base/setup.py new file mode 100644 index 0000000..2df328f --- /dev/null +++ b/plugins/tutor-contrib-frontend-base/setup.py @@ -0,0 +1,58 @@ +import io +import os +from setuptools import setup, find_packages + +HERE = os.path.abspath(os.path.dirname(__file__)) + + +def load_readme(): + with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f: + return f.read() + + +def load_about(): + about = {} + with io.open( + os.path.join(HERE, "tutor_frontend_base", "__about__.py"), + "rt", + encoding="utf-8", + ) as f: + exec(f.read(), about) # pylint: disable=exec-used + return about + + +ABOUT = load_about() + + +setup( + name="tutor-contrib-frontend-base", + version=ABOUT["__version__"], + url="https://github.com/openedx/openedx-tutor-plugins", + project_urls={ + "Code": "https://github.com/openedx/openedx-tutor-plugins", + "Issue tracker": "https://github.com/openedx/openedx-tutor-plugins/issues", + }, + license="AGPLv3", + author="Adolfo R. Brandes", + description="frontend-base plugin for Tutor", + long_description=load_readme(), + packages=find_packages(exclude=["tests*"]), + include_package_data=True, + python_requires=">=3.11", + install_requires=["tutor>=21.0.0", "tutor-mfe>=21.0.0"], + extras_require={"dev": ["tutor[dev]>=21.0.0"]}, + entry_points={ + "tutor.plugin.v1": [ + "frontend-base = tutor_frontend_base.plugin" + ] + }, + classifiers=[ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + ], +) diff --git a/plugins/tutor-contrib-frontend-base/tutor_frontend_base/__about__.py b/plugins/tutor-contrib-frontend-base/tutor_frontend_base/__about__.py new file mode 100644 index 0000000..3dc1f76 --- /dev/null +++ b/plugins/tutor-contrib-frontend-base/tutor_frontend_base/__about__.py @@ -0,0 +1 @@ +__version__ = "0.1.0" diff --git a/plugins/tutor-contrib-frontend-base/tutor_frontend_base/__init__.py b/plugins/tutor-contrib-frontend-base/tutor_frontend_base/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/plugins/tutor-contrib-frontend-base/tutor_frontend_base/plugin.py b/plugins/tutor-contrib-frontend-base/tutor_frontend_base/plugin.py new file mode 100644 index 0000000..e1e464b --- /dev/null +++ b/plugins/tutor-contrib-frontend-base/tutor_frontend_base/plugin.py @@ -0,0 +1,8 @@ +from tutormfe.hooks import FRONTEND_APPS + + +@FRONTEND_APPS.add() +def _enable_core_apps(apps): + apps["authn"]["enabled"] = True + apps["learner-dashboard"]["enabled"] = True + return apps