Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 67 additions & 0 deletions plugins/tutor-contrib-frontend-base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
frontend-base plugin for `Tutor <https://docs.tutor.overhang.io>`__
====================================================================

This is a very simple plugin. It's only job is to enable the `frontend-base
<https://github.com/openedx/frontend-base>`__ core apps already present in
Tutor via `tutor-mfe <https://github.com/overhangio/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.
58 changes: 58 additions & 0 deletions plugins/tutor-contrib-frontend-base/setup.py
Original file line number Diff line number Diff line change
@@ -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",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"
Empty file.
Original file line number Diff line number Diff line change
@@ -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