From d238b8c52941f69d3572aaa8ba2de2f56d646a47 Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Tue, 28 Nov 2023 11:30:03 -0700 Subject: [PATCH] ci(docker): Add support for vue3 www generation --- docker/scripts/generate_www.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker/scripts/generate_www.py b/docker/scripts/generate_www.py index db16e54f..5cb55b6a 100755 --- a/docker/scripts/generate_www.py +++ b/docker/scripts/generate_www.py @@ -1,12 +1,23 @@ #!/usr/bin/env python +import os import json import subprocess +CLIENT_TYPE = os.environ.get("TRAME_CLIENT_TYPE", "vue2") + def run(apps_path, out_path): # Generate www content - cmd = ["python", "-m", "trame.tools.www", "--output", out_path] + cmd = [ + "python", + "-m", + "trame.tools.www", + "--output", + out_path, + "--client-type", + CLIENT_TYPE, + ] subprocess.run(cmd) # Generate app files index.html => {app_name}.html @@ -16,6 +27,7 @@ def run(apps_path, out_path): for app_name, config in apps_dict.items(): # handle custom modules for www web_modules = config.get("www_modules") + client_type = config.get("client_type", CLIENT_TYPE) if web_modules is not None: cmd = [ "python", @@ -23,6 +35,8 @@ def run(apps_path, out_path): "trame.tools.www", "--output", out_path, + "--client-type", + client_type, *web_modules, ] subprocess.run(cmd)