From 4f7fb2d751a24ba87e611c95be7b93189196033a Mon Sep 17 00:00:00 2001 From: San Nguyen Date: Mon, 27 May 2024 02:51:56 +0900 Subject: [PATCH] fix: custom build dir do not need frontend and dist (#1020) * fix: custom build dir do not need frontend and dist Signed-off-by: San Nguyen * fix e2e test Signed-off-by: San Nguyen * test previous values Signed-off-by: San Nguyen * fix tests Signed-off-by: San Nguyen * no format index.html Signed-off-by: San Nguyen * remove envrc Signed-off-by: San Nguyen --------- Signed-off-by: San Nguyen --- backend/chainlit/server.py | 4 ++-- .../public/build/{frontend/dist => }/assets/.PLACEHOLDER | 0 .../custom_build/public/build/{frontend/dist => }/index.html | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename cypress/e2e/custom_build/public/build/{frontend/dist => }/assets/.PLACEHOLDER (100%) rename cypress/e2e/custom_build/public/build/{frontend/dist => }/index.html (100%) diff --git a/backend/chainlit/server.py b/backend/chainlit/server.py index e2c33c026d..c932a25bba 100644 --- a/backend/chainlit/server.py +++ b/backend/chainlit/server.py @@ -153,9 +153,9 @@ def get_build_dir(local_target: str, packaged_target: str): packaged_build_dir = os.path.join(BACKEND_ROOT, packaged_target, "dist") if config.ui.custom_build and os.path.exists( - os.path.join(APP_ROOT, config.ui.custom_build, packaged_target, "dist") + os.path.join(APP_ROOT, config.ui.custom_build) ): - return os.path.join(APP_ROOT, config.ui.custom_build, packaged_target, "dist") + return os.path.join(APP_ROOT, config.ui.custom_build) elif os.path.exists(local_build_dir): return local_build_dir elif os.path.exists(packaged_build_dir): diff --git a/cypress/e2e/custom_build/public/build/frontend/dist/assets/.PLACEHOLDER b/cypress/e2e/custom_build/public/build/assets/.PLACEHOLDER similarity index 100% rename from cypress/e2e/custom_build/public/build/frontend/dist/assets/.PLACEHOLDER rename to cypress/e2e/custom_build/public/build/assets/.PLACEHOLDER diff --git a/cypress/e2e/custom_build/public/build/frontend/dist/index.html b/cypress/e2e/custom_build/public/build/index.html similarity index 100% rename from cypress/e2e/custom_build/public/build/frontend/dist/index.html rename to cypress/e2e/custom_build/public/build/index.html