diff --git a/plugins/tutor-contrib-paragon/pyproject.toml b/plugins/tutor-contrib-paragon/pyproject.toml index 8e7b708..83210a2 100644 --- a/plugins/tutor-contrib-paragon/pyproject.toml +++ b/plugins/tutor-contrib-paragon/pyproject.toml @@ -27,10 +27,11 @@ classifiers = [ ] dependencies = [ - "tutor>=19.0.0,<20.0.0", + "tutor>=19.0.0,<21.0.0", + "tutor-mfe @ git+https://github.com/overhangio/tutor-mfe.git@release", ] -optional-dependencies = { dev = ["tutor[dev]>=19.0.0,<20.0.0", "pytest>=8.3.4", "pytest-order>=1.3.0"] } +optional-dependencies = { dev = ["tutor[dev]>=19.0.0,<21.0.0", "pytest>=8.3.4", "pytest-order>=1.3.0", "requests>=2.32.2"] } # These fields will be set by hatch_build.py dynamic = ["version"] @@ -45,6 +46,9 @@ Source = "https://github.com/openedx/openedx-tutor-plugins.git#subdirectory=plug requires = ["hatchling"] build-backend = "hatchling.build" +[tool.hatch.metadata] +allow-direct-references = true + # hatch-specific configuration [tool.hatch.metadata.hooks.custom] path = ".hatch_build.py" diff --git a/plugins/tutor-contrib-paragon/tests/integration/conftest.py b/plugins/tutor-contrib-paragon/tests/integration/conftest.py index 1b0adce..45832f6 100644 --- a/plugins/tutor-contrib-paragon/tests/integration/conftest.py +++ b/plugins/tutor-contrib-paragon/tests/integration/conftest.py @@ -3,7 +3,7 @@ import pytest import subprocess -from .helpers import PARAGON_NAME, PARAGON_IMAGE +from .helpers import PARAGON_NAME, PARAGON_IMAGE, MFE_SERVICE @pytest.fixture(scope="package", autouse=True) @@ -15,7 +15,7 @@ def setup_tutor_paragon_plugin(): """ subprocess.run( - ["tutor", "plugins", "enable", PARAGON_NAME], + ["tutor", "plugins", "enable", MFE_SERVICE, PARAGON_NAME], check=True, capture_output=True, ) @@ -26,10 +26,16 @@ def setup_tutor_paragon_plugin(): capture_output=True, ) + subprocess.run( + ["tutor", "config", "save", "--set", "LMS_HOST=local.openedx.io"], + check=True, + capture_output=True, + ) + yield subprocess.run( - ["tutor", "plugins", "disable", PARAGON_NAME], + ["tutor", "plugins", "disable", PARAGON_NAME, MFE_SERVICE], check=True, capture_output=True, ) diff --git a/plugins/tutor-contrib-paragon/tests/integration/helpers.py b/plugins/tutor-contrib-paragon/tests/integration/helpers.py index 8cbc763..dd9f426 100644 --- a/plugins/tutor-contrib-paragon/tests/integration/helpers.py +++ b/plugins/tutor-contrib-paragon/tests/integration/helpers.py @@ -5,6 +5,7 @@ logger = logging.getLogger(__name__) +MFE_SERVICE = "mfe" PARAGON_NAME = "paragon" PARAGON_IMAGE = "paragon-builder" PARAGON_JOB = "paragon-build-tokens" @@ -52,3 +53,14 @@ def get_tutor_root_path(): raise RuntimeError("Failed to get Tutor root path: " + result.stderr) return result.stdout.strip() + + +def get_config_value(key: str) -> str: + """Get a configuration value from Tutor. + + Returns: + str: The value of the configuration key. + """ + result = execute_tutor_command(["config", "printvalue", key]) + assert result.returncode == 0, f"Error getting {key}: {result.stderr}" + return result.stdout.strip() diff --git a/plugins/tutor-contrib-paragon/tests/integration/plugin_functionality_test.py b/plugins/tutor-contrib-paragon/tests/integration/plugin_functionality_test.py index 16d2369..90951ea 100644 --- a/plugins/tutor-contrib-paragon/tests/integration/plugin_functionality_test.py +++ b/plugins/tutor-contrib-paragon/tests/integration/plugin_functionality_test.py @@ -10,9 +10,12 @@ import shutil import pytest import re +import requests +import time from .helpers import ( execute_tutor_command, + get_config_value, get_tutor_root_path, PARAGON_JOB, PARAGON_COMPILED_THEMES_FOLDER, @@ -145,3 +148,68 @@ def test_build_tokens_with_source_tokens_only(): assert not os.path.exists( utility_classes_css ), f"{utility_classes_css} should not exist when --source-tokens-only is used." + + +@pytest.mark.order(6) +def test_build_tokens_generates_minified_bundle(): + """ + Ensure that the build-tokens job generates the minified bundle files for hosting. + """ + theme = "light" + result = execute_tutor_command(["local", "do", PARAGON_JOB, "--themes", theme]) + assert result.returncode == 0, f"Error running build-tokens job: {result.stderr}" + + tutor_root = get_tutor_root_path() + compiled_path = os.path.join(tutor_root, PARAGON_COMPILED_THEMES_FOLDER) + + minified_theme_bundle = os.path.join( + compiled_path, "themes", theme, f"{theme}.min.css" + ) + minified_core_bundle = os.path.join(compiled_path, "core", "core.min.css") + + assert os.path.exists( + minified_core_bundle + ), f"Minified core bundle file {minified_core_bundle} does not exist." + assert os.path.exists( + minified_theme_bundle + ), f"Minified theme bundle file {minified_theme_bundle} does not exist." + + +@pytest.mark.order(7) +def test_build_tokens_hosted_files(): + """ + Verify that the compiled themes can be served through the tutor-mfe service. + + This test builds tokens, starts the required services, and checks that the + static files are accessible via HTTP requests. + """ + result = execute_tutor_command(["local", "do", PARAGON_JOB]) + assert result.returncode == 0, f"Error running build-tokens job: {result.stderr}" + + static_url_prefix = get_config_value("PARAGON_STATIC_URL_PREFIX").lstrip("/") + mfe_host = "apps.local.openedx.io" + + services_result = execute_tutor_command(["local", "start", "-d", "caddy", "mfe"]) + assert services_result.returncode == 0, "Error starting hosting services" + + time.sleep(10) + + try: + base_url = f"http://{mfe_host}/{static_url_prefix}" + test_files = ["core/core.min.css", "themes/light/light.min.css"] + + for test_file in test_files: + url = f"{base_url}{test_file}" + response = requests.get(url, timeout=2) + + assert ( + response.status_code == 200 + ), f"Expected status 200 for {url}, but got {response.status_code}. " + + content_type = response.headers.get("Content-Type", "") + assert "text/css" in content_type.lower(), ( + f"Expected 'text/css' Content-Type for {url}, but got '{content_type}'." + ) + + finally: + execute_tutor_command(["local", "stop", "caddy", "mfe"]) diff --git a/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-caddyfile b/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-caddyfile new file mode 100644 index 0000000..70f121b --- /dev/null +++ b/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-caddyfile @@ -0,0 +1,13 @@ +{% if MFE_HOST_EXTRA_FILES %} +# Paragon static files hosting +handle_path /{{ PARAGON_STATIC_URL_PREFIX }}* { + @mincss { + # Match only minified CSS files + path_regexp mincss \.min\.css$ + } + handle @mincss { + root * /paragon-statics + file_server + } +} +{% endif %} diff --git a/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-volumes b/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-volumes new file mode 100644 index 0000000..8c78fbc --- /dev/null +++ b/plugins/tutor-contrib-paragon/tutorparagon/patches/mfe-volumes @@ -0,0 +1,3 @@ +{% if MFE_HOST_EXTRA_FILES %} +- ../../{{ PARAGON_COMPILED_THEMES_PATH }}:/paragon-statics +{% endif %} diff --git a/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-development-settings b/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-development-settings new file mode 100644 index 0000000..8100f55 --- /dev/null +++ b/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-development-settings @@ -0,0 +1,5 @@ +{% if MFE_HOST_EXTRA_FILES %} +{% set PROTOCOL = 'https' if ENABLE_HTTPS else 'http' %} +{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ "localhost" ~ ":" ~ 8002 ~ "/" ~ PARAGON_STATIC_URL_PREFIX%} +{% include "paragon/settings/mfe-common-settings" %} +{% endif %} \ No newline at end of file diff --git a/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-production-settings b/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-production-settings new file mode 100644 index 0000000..1ff5a29 --- /dev/null +++ b/plugins/tutor-contrib-paragon/tutorparagon/patches/openedx-lms-production-settings @@ -0,0 +1,5 @@ +{% if MFE_HOST_EXTRA_FILES %} +{% set PROTOCOL = 'https' if ENABLE_HTTPS else 'http' %} +{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ MFE_HOST ~ "/" ~ PARAGON_STATIC_URL_PREFIX %} +{% include "paragon/settings/mfe-common-settings" %} +{% endif %} \ No newline at end of file diff --git a/plugins/tutor-contrib-paragon/tutorparagon/plugin.py b/plugins/tutor-contrib-paragon/tutorparagon/plugin.py index d7d53ec..e53ff4a 100644 --- a/plugins/tutor-contrib-paragon/tutorparagon/plugin.py +++ b/plugins/tutor-contrib-paragon/tutorparagon/plugin.py @@ -29,11 +29,11 @@ # List of enabled themes to compile and serve # Only themes listed here will be processed, even if others exist in sources ("PARAGON_ENABLED_THEMES", []), - # Whether Tutor should expose the compiled themes to be served (e.g. via nginx, cady or static server) - ("PARAGON_SERVE_COMPILED_THEMES", True), # Paragon Builder Docker image # This image is used to compile themes and should be built with `tutor images build paragon-builder` ("PARAGON_BUILDER_IMAGE", "paragon-builder:latest"), + ("PARAGON_STATIC_URL_PREFIX", "static/paragon/"), + ("MFE_HOST_EXTRA_FILES", True), # Enable MFE host extra files ] ) diff --git a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/entrypoint.sh b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/entrypoint.sh index e62a895..430031d 100644 --- a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/entrypoint.sh +++ b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/entrypoint.sh @@ -41,6 +41,33 @@ parse_args() { printf '%s\n' "$@" } +build_css_bundle() { + # This function builds a CSS bundle using PostCSS. + # It takes the path to the index.css file as an argument. + # Usage: build_css_bundle + + local index_css_file="$1" + + local bundle_directory=$(dirname "$index_css_file") + local bundle_name=$(basename "$bundle_directory") + local minified_output_file="$bundle_directory/${bundle_name}.min.css" + + if npx postcss "$index_css_file" \ + --use postcss-import \ + --use postcss-custom-media \ + --use postcss-combine-duplicated-selectors \ + --use postcss-minify \ + --no-map \ + --output "$minified_output_file"; then + + echo "Successfully created bundle: $bundle_name" + return 0 + else + echo "Failed to build CSS bundle: $bundle_name" >&2 + return 1 + fi +} + set -- $(parse_args "$@") # Executes the Paragon CLI to build themes. @@ -50,8 +77,14 @@ npx paragon build-tokens \ --build-dir "$TMP_BUILD_DIR" \ "$@" +find "$TMP_BUILD_DIR" -type f -name 'index.css' | while read -r index; do + if [ -f "$index" ]; then + build_css_bundle "$index" + fi +done + # Moves the built themes to the final volume directory. -mkdir -p "$FINAL_BUILD_DIR" +rm -rf "$FINAL_BUILD_DIR"/* cp -a "$TMP_BUILD_DIR/." "$FINAL_BUILD_DIR/" chmod -R a+rw "$FINAL_BUILD_DIR" diff --git a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package-lock.json b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package-lock.json index 00a31c6..e199300 100644 --- a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package-lock.json +++ b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package-lock.json @@ -8,7 +8,11 @@ "name": "paragon-builder", "version": "1.0.0", "dependencies": { - "@openedx/paragon": "^23.10.0" + "@openedx/paragon": "^23.10.0", + "postcss-cli": "^11.0.1", + "postcss-custom-media": "^11.0.6", + "postcss-import": "^15.0.0", + "postcss-minify": "^1.2.0" } }, "node_modules/@babel/runtime": { @@ -205,9 +209,9 @@ "license": "Apache-2.0" }, "node_modules/@csstools/cascade-layer-name-parser": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.13.tgz", - "integrity": "sha512-MX0yLTwtZzr82sQ0zOjqimpZbzjMaK/h2pmlrLK7DCzlmiZLYFpoO94WmN1akRVo6ll/TdpHb53vihHLUMyvng==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-2.0.5.tgz", + "integrity": "sha512-p1ko5eHgV+MgXFVa4STPKpvPxr6ReS8oS2jzTukjR74i5zJNyWO1ZM1m8YKBXnzDKWfBN1ztLYlHxbVemDD88A==", "funding": [ { "type": "github", @@ -220,17 +224,17 @@ ], "license": "MIT", "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.7.1", - "@csstools/css-tokenizer": "^2.4.1" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.7.1.tgz", - "integrity": "sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", "funding": [ { "type": "github", @@ -243,16 +247,16 @@ ], "license": "MIT", "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "peerDependencies": { - "@csstools/css-tokenizer": "^2.4.1" + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@csstools/css-tokenizer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.4.1.tgz", - "integrity": "sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", "funding": [ { "type": "github", @@ -265,13 +269,13 @@ ], "license": "MIT", "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" } }, "node_modules/@csstools/media-query-list-parser": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.13.tgz", - "integrity": "sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.3.tgz", + "integrity": "sha512-HAYH7d3TLRHDOUQK4mZKf9k9Ph/m8Akstg66ywKR4SFAigjs3yBiUeZtFxywiTm5moZMAp/5W/ZuFnNXXYLuuQ==", "funding": [ { "type": "github", @@ -284,11 +288,11 @@ ], "license": "MIT", "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.7.1", - "@csstools/css-tokenizer": "^2.4.1" + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, "node_modules/@formatjs/ecma402-abstract": { @@ -610,6 +614,121 @@ "react-intl": "^5.25.1 || ^6.4.0" } }, + "node_modules/@openedx/paragon/node_modules/@csstools/cascade-layer-name-parser": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.13.tgz", + "integrity": "sha512-MX0yLTwtZzr82sQ0zOjqimpZbzjMaK/h2pmlrLK7DCzlmiZLYFpoO94WmN1akRVo6ll/TdpHb53vihHLUMyvng==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.7.1", + "@csstools/css-tokenizer": "^2.4.1" + } + }, + "node_modules/@openedx/paragon/node_modules/@csstools/css-parser-algorithms": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.7.1.tgz", + "integrity": "sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^2.4.1" + } + }, + "node_modules/@openedx/paragon/node_modules/@csstools/css-tokenizer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.4.1.tgz", + "integrity": "sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + } + }, + "node_modules/@openedx/paragon/node_modules/@csstools/media-query-list-parser": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.13.tgz", + "integrity": "sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.7.1", + "@csstools/css-tokenizer": "^2.4.1" + } + }, + "node_modules/@openedx/paragon/node_modules/postcss-custom-media": { + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-9.1.5.tgz", + "integrity": "sha512-GStyWMz7Qbo/Gtw1xVspzVSX8eipgNg4lpsO3CAeY4/A1mzok+RV6MCv3fg62trWijh/lYEj6vps4o8JcBBpDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/cascade-layer-name-parser": "^1.0.2", + "@csstools/css-parser-algorithms": "^2.2.0", + "@csstools/css-tokenizer": "^2.1.1", + "@csstools/media-query-list-parser": "^2.1.1" + }, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", @@ -1076,6 +1195,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1200,6 +1332,18 @@ ], "license": "MIT" }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -1467,6 +1611,37 @@ "node": ">= 10" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", @@ -1661,6 +1836,15 @@ "node": ">=0.4.0" } }, + "node_modules/dependency-graph": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-1.0.0.tgz", + "integrity": "sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -1787,6 +1971,15 @@ "node": ">= 0.4" } }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2006,6 +2199,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2015,6 +2222,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -2081,6 +2297,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -2315,6 +2543,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -2362,7 +2602,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", - "optional": true, "engines": { "node": ">=0.10.0" } @@ -2399,7 +2638,6 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", - "optional": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -2646,6 +2884,18 @@ "graceful-fs": "^4.1.11" } }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2872,6 +3122,15 @@ "license": "MIT", "optional": true }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3211,6 +3470,96 @@ "node": ">=6.5" } }, + "node_modules/postcss-cli": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-11.0.1.tgz", + "integrity": "sha512-0UnkNPSayHKRe/tc2YGW6XnSqqOA9eqpiRMgRlV1S6HdGi16vwJBx7lviARzbV1HpQHqLLRH3o8vTcB0cLc+5g==", + "license": "MIT", + "dependencies": { + "chokidar": "^3.3.0", + "dependency-graph": "^1.0.0", + "fs-extra": "^11.0.0", + "picocolors": "^1.0.0", + "postcss-load-config": "^5.0.0", + "postcss-reporter": "^7.0.0", + "pretty-hrtime": "^1.0.3", + "read-cache": "^1.0.0", + "slash": "^5.0.0", + "tinyglobby": "^0.2.12", + "yargs": "^17.0.0" + }, + "bin": { + "postcss": "index.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-cli/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/postcss-cli/node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/postcss-cli/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/postcss-cli/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/postcss-combine-duplicated-selectors": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/postcss-combine-duplicated-selectors/-/postcss-combine-duplicated-selectors-10.0.3.tgz", @@ -3227,9 +3576,9 @@ } }, "node_modules/postcss-custom-media": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-9.1.5.tgz", - "integrity": "sha512-GStyWMz7Qbo/Gtw1xVspzVSX8eipgNg4lpsO3CAeY4/A1mzok+RV6MCv3fg62trWijh/lYEj6vps4o8JcBBpDA==", + "version": "11.0.6", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-11.0.6.tgz", + "integrity": "sha512-C4lD4b7mUIw+RZhtY7qUbf4eADmb7Ey8BFA2px9jUbwg7pjTZDl4KY4bvlUV+/vXQvzQRfiGEVJyAbtOsCMInw==", "funding": [ { "type": "github", @@ -3242,13 +3591,13 @@ ], "license": "MIT", "dependencies": { - "@csstools/cascade-layer-name-parser": "^1.0.2", - "@csstools/css-parser-algorithms": "^2.2.0", - "@csstools/css-tokenizer": "^2.1.1", - "@csstools/media-query-list-parser": "^2.1.1" + "@csstools/cascade-layer-name-parser": "^2.0.5", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "@csstools/media-query-list-parser": "^4.0.3" }, "engines": { - "node": "^14 || ^16 || >=18" + "node": ">=18" }, "peerDependencies": { "postcss": "^8.4" @@ -3277,6 +3626,45 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "license": "MIT" }, + "node_modules/postcss-load-config": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-5.1.0.tgz", + "integrity": "sha512-G5AJ+IX0aD0dygOE0yFZQ/huFFMSNneyfp0e3/bT05a8OfPC5FUoZRPfGijUdGOJNMewJiwzcHJXFafFzeKFVA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1", + "yaml": "^2.4.2" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + } + } + }, "node_modules/postcss-map": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/postcss-map/-/postcss-map-0.11.0.tgz", @@ -3333,6 +3721,32 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "license": "MIT" }, + "node_modules/postcss-reporter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-7.1.0.tgz", + "integrity": "sha512-/eoEylGWyy6/DOiMP5lmFRdmDKThqgn7D6hP2dXKJI/0rJSO1ADFNngZfDzxL0YAxFvws+Rtpuji1YIHj4mySA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "thenby": "^1.3.4" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/postcss-selector-parser": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", @@ -3367,6 +3781,15 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -3879,6 +4302,15 @@ "balanced-match": "^1.0.0" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -4412,6 +4844,12 @@ "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==", "license": "MIT" }, + "node_modules/thenby": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/thenby/-/thenby-1.3.4.tgz", + "integrity": "sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==", + "license": "Apache-2.0" + }, "node_modules/thingies": { "version": "1.21.0", "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz", @@ -4436,6 +4874,48 @@ "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -4707,6 +5187,15 @@ "@babel/runtime-corejs3": "^7.26.9" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/yaml": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", @@ -4718,6 +5207,33 @@ "engines": { "node": ">= 14.6" } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } } } } diff --git a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package.json b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package.json index 8b79b72..87d7ab6 100644 --- a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package.json +++ b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/build/paragon-builder/package.json @@ -4,6 +4,10 @@ "description": "Paragon Builder for Tutor", "private": true, "dependencies": { - "@openedx/paragon": "^23.10.0" + "@openedx/paragon": "^23.10.0", + "postcss-cli": "^11.0.1", + "postcss-import": "^15.0.0", + "postcss-custom-media": "^11.0.6", + "postcss-minify": "^1.2.0" } } diff --git a/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/settings/mfe-common-settings b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/settings/mfe-common-settings new file mode 100644 index 0000000..4ee6d30 --- /dev/null +++ b/plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/settings/mfe-common-settings @@ -0,0 +1,20 @@ +{% if not PARAGON_ENABLED_THEMES %}{% set PARAGON_ENABLED_THEMES = ['light'] %}{% endif %} +MFE_CONFIG["PARAGON_THEME_URLS"] = { + "core": { + "urls": { + "default": "{{ PARAGON_BASE_URL }}core/core.min.css" + }, + }, + "defaults": { + {% if 'light' in PARAGON_ENABLED_THEMES %}"light": "light",{% else %} + "light": "{{ PARAGON_ENABLED_THEMES | first }}",{% endif %} + {% if 'dark' in PARAGON_ENABLED_THEMES %}"dark": "dark"{% endif %} + }, + "variants": { + {% for theme in PARAGON_ENABLED_THEMES %}"{{ theme }}": { + "urls": { + "default": "{{ PARAGON_BASE_URL }}themes/{{ theme }}/{{ theme }}.min.css" + } + },{% endfor %} + } +}