diff --git a/.jupyterlite.doit.db b/.jupyterlite.doit.db deleted file mode 100644 index 6914761e..00000000 Binary files a/.jupyterlite.doit.db and /dev/null differ diff --git a/praxis/web-client/package.json b/praxis/web-client/package.json index 7dbc348e..5371c63a 100644 --- a/praxis/web-client/package.json +++ b/praxis/web-client/package.json @@ -11,7 +11,7 @@ "build:all": "npm run jupyterlite:build && ng build", "build": "ng build", "build:browser": "ng build --configuration=browser", - "build:gh-pages": "ng build --configuration=gh-pages && cp src/assets/jupyterlite/jupyter-lite.gh-pages.json dist/web-client/browser/assets/jupyterlite/jupyter-lite.json", + "build:gh-pages": "ng build --configuration=gh-pages && python3 ../../scripts/patch_jupyterlite_config.py dist/web-client/browser/assets/jupyterlite/jupyter-lite.json /praxis/assets/jupyterlite/", "watch": "ng build --watch --configuration development", "test": "ng test", "generate-api": "node node_modules/openapi-typescript-codegen/bin/index.js --input ./src/assets/api/openapi.json --output ./src/app/core/api-generated --client fetch --useUnionTypes --request ./src/app/core/http/custom-request.ts", diff --git a/scripts/patch_jupyterlite_config.py b/scripts/patch_jupyterlite_config.py new file mode 100644 index 00000000..5b099aca --- /dev/null +++ b/scripts/patch_jupyterlite_config.py @@ -0,0 +1,35 @@ +import json +import sys +import os + +def patch_config(file_path, base_url): + print(f"Patching {file_path} with baseUrl={base_url}") + + if not os.path.exists(file_path): + print(f"Error: File {file_path} does not exist.") + sys.exit(1) + + try: + with open(file_path, 'r') as f: + data = json.load(f) + + if 'jupyter-config-data' not in data: + data['jupyter-config-data'] = {} + + data['jupyter-config-data']['baseUrl'] = base_url + + with open(file_path, 'w') as f: + json.dump(data, f, indent=2) + + print("Successfully patched configuration.") + + except Exception as e: + print(f"Error patching file: {e}") + sys.exit(1) + +if __name__ == "__main__": + if len(sys.argv) != 3: + print("Usage: python patch_jupyterlite_config.py ") + sys.exit(1) + + patch_config(sys.argv[1], sys.argv[2])