From 78b6de90640ff19d8cbb88b95845f1aece6accbb Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:00:14 -0800 Subject: [PATCH 01/25] feat: add directory with extensions --- extensions/src/data_bridge/index.ts | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 extensions/src/data_bridge/index.ts diff --git a/extensions/src/data_bridge/index.ts b/extensions/src/data_bridge/index.ts new file mode 100644 index 0000000..182807e --- /dev/null +++ b/extensions/src/data_bridge/index.ts @@ -0,0 +1,73 @@ +import { + JupyterFrontEnd, + JupyterFrontEndPlugin, +} from "@jupyterlab/application"; + +import { NotebookPanel } from "@jupyterlab/notebook"; + +/** + * Initialization data for the materials-designer-bridge extension. + */ +const plugin: JupyterFrontEndPlugin = { + id: "materials-designer-bridge:plugin", + description: + "Extension to pass materials data between Materials Designer and Jupyter Lite instance", + autoStart: true, + activate: async (app: JupyterFrontEnd) => { + console.log( + "MD Extension. JupyterLab extension materials-designer-bridge is activated!" + ); + + console.log(app.shell); + + // @ts-ignore + window.sendDataToHost = (materials: any) => { + window.parent.postMessage( + { + type: "from-iframe-to-host", + materials: materials, + }, + "*" + ); + }; + + // @ts-ignore + window.requestMaterialsFromHost = () => { + window.parent.postMessage( + { + type: "from-iframe-to-host", + requestMaterials: true, + }, + "*" + ); + }; + + //TODO: set type for materials + window.addEventListener("message", async (event) => { + if (event.data.type === "from-host-to-iframe") { + let materials = event.data.materials; + const materialsJson = JSON.stringify(materials); + const code = ` + import json + materials = json.loads('${materialsJson}') + `; + + const currentWidget = app.shell.currentWidget; + + if (currentWidget instanceof NotebookPanel) { + const notebookPanel = currentWidget; + const kernel = notebookPanel.sessionContext.session?.kernel; + if (kernel) { + kernel.requestExecute({ code: code }); + } else { + console.error("No active kernel found"); + } + } else { + console.error("Current active widget is not a notebook"); + } + } + }); + }, +}; + +export default plugin; From 3e05c9e36144fa484f5ef8aafe1da0e050ad17bf Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:04:33 -0800 Subject: [PATCH 02/25] update: generalize to pass any data --- extensions/src/data_bridge/index.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/extensions/src/data_bridge/index.ts b/extensions/src/data_bridge/index.ts index 182807e..cd8aadc 100644 --- a/extensions/src/data_bridge/index.ts +++ b/extensions/src/data_bridge/index.ts @@ -6,26 +6,24 @@ import { import { NotebookPanel } from "@jupyterlab/notebook"; /** - * Initialization data for the materials-designer-bridge extension. + * Initialization data for the data-bridge extension. */ const plugin: JupyterFrontEndPlugin = { - id: "materials-designer-bridge:plugin", + id: "data-bridge:plugin", description: - "Extension to pass materials data between Materials Designer and Jupyter Lite instance", + "Extension to pass JSON data between host page and Jupyter Lite instance", autoStart: true, activate: async (app: JupyterFrontEnd) => { - console.log( - "MD Extension. JupyterLab extension materials-designer-bridge is activated!" - ); + console.log("JupyterLab extension data-bridge is activated!"); console.log(app.shell); // @ts-ignore - window.sendDataToHost = (materials: any) => { + window.sendDataToHost = (data: any) => { window.parent.postMessage( { type: "from-iframe-to-host", - materials: materials, + data: data, }, "*" ); @@ -42,14 +40,14 @@ const plugin: JupyterFrontEndPlugin = { ); }; - //TODO: set type for materials + //TODO: set type for data window.addEventListener("message", async (event) => { if (event.data.type === "from-host-to-iframe") { - let materials = event.data.materials; - const materialsJson = JSON.stringify(materials); + let data = event.data.data; + const dataJson = JSON.stringify(data); const code = ` import json - materials = json.loads('${materialsJson}') + data = json.loads('${dataJson}') `; const currentWidget = app.shell.currentWidget; From ca2a339c63fd01fd14e93b46d11f90cf1f5382d1 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:00:01 -0800 Subject: [PATCH 03/25] feat: add setup script --- setup.sh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..164cfb3 --- /dev/null +++ b/setup.sh @@ -0,0 +1,72 @@ +PYTHON_VERSION="3.8.6" +NODE_VERSION="14.19" +EXTENSION_NAME="data_bridge" +COOKIECUTTER_TEMPLATE_PATH="$HOME/.cookiecutters/extension-cookiecutter-ts" +GITHUB_TEMPLATE_URL="https://github.com/jupyterlab/extension-cookiecutter-ts" + +kind="frontend" +author_name="Mat3ra" +author_email="info@mat3ra.com" +labextension_name=$EXTENSION_NAME +python_name=$EXTENSION_NAME +project_short_description="A JupyterLab extension that allows you to send data between notebook and host page" +has_settings=n +has_binder=n +test=n +repository="https://github.com/exabyte-io/jupyter-lite" + +# Ensure Python and Node.js are installed and switch to the correct versions +if [ ! -d "$HOME/.pyenv/versions/$PYTHON_VERSION" ]; then + pyenv install $PYTHON_VERSION +fi +pyenv local $PYTHON_VERSION + +python -m venv .venv +source .venv/bin/activate + +nvm install $NODE_VERSION +nvm use $NODE_VERSION + +pip install cookiecutter + +# Create directory if it doesn't exist +if [ ! -d "extensions/dist" ]; then + mkdir -p extensions/dist +fi +cd extensions/dist + +if [ ! -d "$COOKIECUTTER_TEMPLATE_PATH" ]; then + + cookiecutter $GITHUB_TEMPLATE_URL\ + kind="$kind" \ + author_name="$author_name" \ + author_email="$author_email" \ + labextension_name="$labextension_name" \ + python_name="$python_name" \ + project_short_description="$project_short_description" \ + has_settings="$has_settings" \ + has_binder="$has_binder" \ + test="$test" \ + repository="$repository" + echo "Created extension using cookiecutter template." +else + cookiecutter $COOKIECUTTER_TEMPLATE_PATH \ + kind="$kind" \ + author_name="$author_name" \ + author_email="$author_email" \ + labextension_name="$labextension_name" \ + python_name="$python_name" \ + project_short_description="$project_short_description" \ + has_settings="$has_settings" \ + has_binder="$has_binder" \ + test="$test" \ + repository="$repository" + echo "Created extension using cached cookiecutter template." +fi + +# Ensure the source and destination directories for copying exist +if [ -f "../src/$EXTENSION_NAME/index.ts" ] && [ -d "./$EXTENSION_NAME/src" ]; then + cp "../src/$EXTENSION_NAME/index.ts" "./$EXTENSION_NAME/src/index.ts" +else + echo "Source file or destination directory not found. Skipping copy." +fi From 507564d32e0134fa882fb85f54cd60490a495883 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:18:46 -0800 Subject: [PATCH 04/25] update: export nvm --- setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.sh b/setup.sh index 164cfb3..3d0236a 100644 --- a/setup.sh +++ b/setup.sh @@ -24,6 +24,9 @@ pyenv local $PYTHON_VERSION python -m venv .venv source .venv/bin/activate +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm install $NODE_VERSION nvm use $NODE_VERSION From 8afe601dfceb43b57e99dae3448548dc58656f06 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:22:09 -0800 Subject: [PATCH 05/25] chore: optimize repetition --- setup.sh | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/setup.sh b/setup.sh index 3d0236a..a85eb24 100644 --- a/setup.sh +++ b/setup.sh @@ -15,6 +15,21 @@ has_binder=n test=n repository="https://github.com/exabyte-io/jupyter-lite" +COOKIECUTTER_OPTIONS=( + "$GITHUB_TEMPLATE_URL" + "--no-input" + "kind=$kind" + "author_name=$author_name" + "author_email=$author_email" + "labextension_name=$labextension_name" + "python_name=$python_name" + "project_short_description=\"$project_short_description\"" + "has_settings=$has_settings" + "has_binder=$has_binder" + "test=$test" + "repository=$repository" +) + # Ensure Python and Node.js are installed and switch to the correct versions if [ ! -d "$HOME/.pyenv/versions/$PYTHON_VERSION" ]; then pyenv install $PYTHON_VERSION @@ -38,38 +53,21 @@ if [ ! -d "extensions/dist" ]; then fi cd extensions/dist +# Use cookiecutter with the template path if it exists, otherwise use the URL if [ ! -d "$COOKIECUTTER_TEMPLATE_PATH" ]; then - - cookiecutter $GITHUB_TEMPLATE_URL\ - kind="$kind" \ - author_name="$author_name" \ - author_email="$author_email" \ - labextension_name="$labextension_name" \ - python_name="$python_name" \ - project_short_description="$project_short_description" \ - has_settings="$has_settings" \ - has_binder="$has_binder" \ - test="$test" \ - repository="$repository" + cookiecutter "${COOKIECUTTER_OPTIONS[@]}" echo "Created extension using cookiecutter template." else - cookiecutter $COOKIECUTTER_TEMPLATE_PATH \ - kind="$kind" \ - author_name="$author_name" \ - author_email="$author_email" \ - labextension_name="$labextension_name" \ - python_name="$python_name" \ - project_short_description="$project_short_description" \ - has_settings="$has_settings" \ - has_binder="$has_binder" \ - test="$test" \ - repository="$repository" + COOKIECUTTER_OPTIONS[0]="$COOKIECUTTER_TEMPLATE_PATH" + cookiecutter "${COOKIECUTTER_OPTIONS[@]}" echo "Created extension using cached cookiecutter template." fi -# Ensure the source and destination directories for copying exist -if [ -f "../src/$EXTENSION_NAME/index.ts" ] && [ -d "./$EXTENSION_NAME/src" ]; then - cp "../src/$EXTENSION_NAME/index.ts" "./$EXTENSION_NAME/src/index.ts" +# Copy the index.ts file if both source and destination directories exist +SRC_FILE="../src/$EXTENSION_NAME/index.ts" +DEST_DIR="./$EXTENSION_NAME/src" +if [ -f "$SRC_FILE" ] && [ -d "$DEST_DIR" ]; then + cp "$SRC_FILE" "$DEST_DIR/index.ts" else echo "Source file or destination directory not found. Skipping copy." fi From 30a5820dec267c8f8e22514e83d9bdb0b80d7764 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:31:26 -0800 Subject: [PATCH 06/25] fix: a typo --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index a85eb24..5674c23 100644 --- a/setup.sh +++ b/setup.sh @@ -23,7 +23,7 @@ COOKIECUTTER_OPTIONS=( "author_email=$author_email" "labextension_name=$labextension_name" "python_name=$python_name" - "project_short_description=\"$project_short_description\"" + "project_short_description=$project_short_description" "has_settings=$has_settings" "has_binder=$has_binder" "test=$test" From f3310090f5d49893f1286fa8999970772e83d6b4 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:31:50 -0800 Subject: [PATCH 07/25] update: add extension building --- setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.sh b/setup.sh index 5674c23..b09bfea 100644 --- a/setup.sh +++ b/setup.sh @@ -71,3 +71,13 @@ if [ -f "$SRC_FILE" ] && [ -d "$DEST_DIR" ]; then else echo "Source file or destination directory not found. Skipping copy." fi + +cd $EXTENSION_NAME + +# Install dependencies +jlpm add @jupyterlab/application +jlpm add @jupyterlab/notebook + +# Build the extension +jlpm run build +jupyter labextension list From e26a94f26aafb9b9e086ce70b97caec089616eb9 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:54:49 -0800 Subject: [PATCH 08/25] update: install extension --- setup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index b09bfea..8ee481c 100644 --- a/setup.sh +++ b/setup.sh @@ -1,5 +1,5 @@ -PYTHON_VERSION="3.8.6" -NODE_VERSION="14.19" +PYTHON_VERSION="3.10" +NODE_VERSION="18" EXTENSION_NAME="data_bridge" COOKIECUTTER_TEMPLATE_PATH="$HOME/.cookiecutters/extension-cookiecutter-ts" GITHUB_TEMPLATE_URL="https://github.com/jupyterlab/extension-cookiecutter-ts" @@ -45,7 +45,7 @@ export NVM_DIR="$HOME/.nvm" nvm install $NODE_VERSION nvm use $NODE_VERSION -pip install cookiecutter +pip install cookiecutter jupyterlab==4 jupyterlite-core # Create directory if it doesn't exist if [ ! -d "extensions/dist" ]; then @@ -58,7 +58,7 @@ if [ ! -d "$COOKIECUTTER_TEMPLATE_PATH" ]; then cookiecutter "${COOKIECUTTER_OPTIONS[@]}" echo "Created extension using cookiecutter template." else - COOKIECUTTER_OPTIONS[0]="$COOKIECUTTER_TEMPLATE_PATH" + # COOKIECUTTER_OPTIONS[0]="$COOKIECUTTER_TEMPLATE_PATH" cookiecutter "${COOKIECUTTER_OPTIONS[@]}" echo "Created extension using cached cookiecutter template." fi @@ -80,4 +80,7 @@ jlpm add @jupyterlab/notebook # Build the extension jlpm run build + +# Install the extension +jupyter labextension install . jupyter labextension list From 89cc9c58672ddeffa0bc2d7fb4a2fa887388b8b5 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:55:17 -0800 Subject: [PATCH 09/25] chore: get to top level --- setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.sh b/setup.sh index 8ee481c..db8588b 100644 --- a/setup.sh +++ b/setup.sh @@ -84,3 +84,5 @@ jlpm run build # Install the extension jupyter labextension install . jupyter labextension list + +cd ../../ From 3adffef33ff4a2b48946f3747ee73275b9c64aa3 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:55:48 -0800 Subject: [PATCH 10/25] chore: get to top level --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index db8588b..b6afc58 100644 --- a/setup.sh +++ b/setup.sh @@ -85,4 +85,4 @@ jlpm run build jupyter labextension install . jupyter labextension list -cd ../../ +cd ../../../ From 6150ab82e1b474774c4ff2b6d0f9eb53f525e76a Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:43:13 -0800 Subject: [PATCH 11/25] update: install extenison via requirement.txt --- setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index b6afc58..e9e0791 100644 --- a/setup.sh +++ b/setup.sh @@ -77,12 +77,12 @@ cd $EXTENSION_NAME # Install dependencies jlpm add @jupyterlab/application jlpm add @jupyterlab/notebook +jlpm add @exabyte-io/code.js # Build the extension jlpm run build -# Install the extension -jupyter labextension install . -jupyter labextension list - cd ../../../ + +# add to requirements.txt +echo "./extensions/dist/$EXTENSION_NAME" >> requirements.txt From 964346bf84f4a82268af73208110ae95afb71022 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 16:43:41 -0800 Subject: [PATCH 12/25] update: material -> data --- extensions/src/data_bridge/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/src/data_bridge/index.ts b/extensions/src/data_bridge/index.ts index cd8aadc..a826fd8 100644 --- a/extensions/src/data_bridge/index.ts +++ b/extensions/src/data_bridge/index.ts @@ -16,8 +16,6 @@ const plugin: JupyterFrontEndPlugin = { activate: async (app: JupyterFrontEnd) => { console.log("JupyterLab extension data-bridge is activated!"); - console.log(app.shell); - // @ts-ignore window.sendDataToHost = (data: any) => { window.parent.postMessage( @@ -30,11 +28,11 @@ const plugin: JupyterFrontEndPlugin = { }; // @ts-ignore - window.requestMaterialsFromHost = () => { + window.requestDataFromHost = () => { window.parent.postMessage( { type: "from-iframe-to-host", - requestMaterials: true, + requestData: true, }, "*" ); From 00dd3a54958068319a9f0b33eb399c6d1571557b Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:00:34 -0800 Subject: [PATCH 13/25] update: build extension in GHA --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 77fa9fe..64c1e8b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,6 +18,9 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Setup extension + run: | + sh ./setup.sh - name: Install the dependencies run: | python -m pip install -r requirements.txt From 204ec36d6c4bc14c1d98119d4afd870b33b0dd92 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:04:11 -0800 Subject: [PATCH 14/25] update: build extension in GHA 1 --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 64c1e8b..df164e7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: python-version: '3.10' - name: Setup extension run: | - sh ./setup.sh + bash ./setup.sh - name: Install the dependencies run: | python -m pip install -r requirements.txt From afca55df166fba71883eda7503491434138e0818 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:17:04 -0800 Subject: [PATCH 15/25] update: bump jupyterlab to 4.0.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 678147c..d220149 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Core modules (mandatory) jupyterlite-core==0.1.3 -jupyterlab~=3.5.1 +jupyterlab~=4.0.6 # Python kernel (optional) jupyterlite-pyodide-kernel==0.1.3 From d521216b9e5ddd7c467f7853237844f70ca7a0b1 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:53:42 -0800 Subject: [PATCH 16/25] update: add jl develop --- setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e9e0791..7d13171 100644 --- a/setup.sh +++ b/setup.sh @@ -73,6 +73,8 @@ else fi cd $EXTENSION_NAME +pip install -ve . +jupyter labextension develop --overwrite . # Install dependencies jlpm add @jupyterlab/application @@ -85,4 +87,6 @@ jlpm run build cd ../../../ # add to requirements.txt -echo "./extensions/dist/$EXTENSION_NAME" >> requirements.txt +LINE="./extensions/dist/$EXTENSION_NAME" +FILE='requirements.txt' +grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE" From 408853126341b86aeb8e390e9f9faada8736c588 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:56:56 -0800 Subject: [PATCH 17/25] chore: update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b661992..c581d82 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,4 @@ dmypy.json # jupyterlite *.doit.db _output +.idea From 7752201a68f90df26a047bcc1e672e1d41f22216 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:18:43 -0800 Subject: [PATCH 18/25] update: setup.sh --- setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.sh b/setup.sh index 7d13171..f6d1d29 100644 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,9 @@ +#!/bin/bash +# This script creates a JupyterLab extension using the cookiecutter template +# and updates the requirements.txt file to make it installable in the current +# JupyterLab environment. +# It assumes that pyenv and nvm are installed and configured correctly. + PYTHON_VERSION="3.10" NODE_VERSION="18" EXTENSION_NAME="data_bridge" @@ -90,3 +96,10 @@ cd ../../../ LINE="./extensions/dist/$EXTENSION_NAME" FILE='requirements.txt' grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE" + +# Install extension +[[ ! -z $INSTALL ]] && python -m pip install -r requirements.txt + +# Build JupyterLite +[[ ! -z $BUILD ]] && jupyter lite build --contents content --output-dir dist + From 64ca7a5d532a2a4fce62068337ecc944d883a85c Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:41:18 -0800 Subject: [PATCH 19/25] chore: update gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index c581d82..04f04a3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ __pycache__/ build/ develop-eggs/ dist/ +# To commit the pre-buit extension sources +!extensions/dist/ downloads/ eggs/ .eggs/ @@ -115,3 +117,5 @@ dmypy.json *.doit.db _output .idea +.venv +.yarn From 506f722346c52dd1fe5193d4edc5a1b1eb98f472 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:41:32 -0800 Subject: [PATCH 20/25] chore: update README --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f8d0424..d77c25e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ JupyterLite deployed as a static site to GitHub Pages, for demo purposes. JupyterLite is being tested against modern web browsers: -- Firefox 90+ -- Chromium 89+ +- Firefox 90+ +- Chromium 89+ ## Deploy your JupyterLite website on GitHub Pages @@ -25,5 +25,13 @@ Check out the guide on the JupyterLite documentation: https://jupyterlite.readth For more info, keep an eye on the JupyterLite documentation: -- How-to Guides: https://jupyterlite.readthedocs.io/en/latest/howto/index.html -- Reference: https://jupyterlite.readthedocs.io/en/latest/reference/index.html +- How-to Guides: https://jupyterlite.readthedocs.io/en/latest/howto/index.html +- Reference: https://jupyterlite.readthedocs.io/en/latest/reference/index.html + +## Additional Notes + +From Team Mat3ra: + +- `data_bridge` extensions is built using the `setup.sh` +- pass `INSTALL=1 BUILD=1` to also build and install the jupyter lite with extension +- requires `pyenv` and `npm` installed From aa869f7e898e42ce3f3c145c29cfc9e283b9685c Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:48:39 -0800 Subject: [PATCH 21/25] chore: update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d77c25e..769f730 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,5 @@ From Team Mat3ra: - `data_bridge` extensions is built using the `setup.sh` - pass `INSTALL=1 BUILD=1` to also build and install the jupyter lite with extension +- `requirements.txt` is updated as part of the above to include the extension - requires `pyenv` and `npm` installed From 4ab01cb163579aede25e80d369e8074e8cf1d9f1 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:50:01 -0800 Subject: [PATCH 22/25] chore: revert dist exclusion --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 04f04a3..4936b85 100644 --- a/.gitignore +++ b/.gitignore @@ -23,8 +23,6 @@ __pycache__/ build/ develop-eggs/ dist/ -# To commit the pre-buit extension sources -!extensions/dist/ downloads/ eggs/ .eggs/ From fa567e1e0d45af9938e465766107ddb7b7e91baf Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Mon, 29 Jan 2024 20:57:44 -0800 Subject: [PATCH 23/25] Update index.ts --- extensions/src/data_bridge/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/src/data_bridge/index.ts b/extensions/src/data_bridge/index.ts index a826fd8..99be898 100644 --- a/extensions/src/data_bridge/index.ts +++ b/extensions/src/data_bridge/index.ts @@ -38,7 +38,7 @@ const plugin: JupyterFrontEndPlugin = { ); }; - //TODO: set type for data + // TODO: set type for data window.addEventListener("message", async (event) => { if (event.data.type === "from-host-to-iframe") { let data = event.data.data; From 61ec2e490f1511fc2402ea375ccbb38518c7c376 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Mon, 29 Jan 2024 21:00:23 -0800 Subject: [PATCH 24/25] Update index.ts --- extensions/src/data_bridge/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/src/data_bridge/index.ts b/extensions/src/data_bridge/index.ts index 99be898..d54f59a 100644 --- a/extensions/src/data_bridge/index.ts +++ b/extensions/src/data_bridge/index.ts @@ -7,6 +7,7 @@ import { NotebookPanel } from "@jupyterlab/notebook"; /** * Initialization data for the data-bridge extension. + * Similar to https://jupyterlite.readthedocs.io/en/latest/howto/configure/advanced/iframe.html */ const plugin: JupyterFrontEndPlugin = { id: "data-bridge:plugin", @@ -47,7 +48,8 @@ const plugin: JupyterFrontEndPlugin = { import json data = json.loads('${dataJson}') `; - + // Similar to https://jupyterlab.readthedocs.io/en/stable/api/classes/application.LabShell.html#currentWidget + // https://jupyterlite.readthedocs.io/en/latest/reference/api/ts/interfaces/jupyterlite_application.ISingleWidgetShell.html#currentwidget const currentWidget = app.shell.currentWidget; if (currentWidget instanceof NotebookPanel) { From dfa0f556651bf2ec23a646822291ba203dcbe099 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Mon, 29 Jan 2024 21:01:12 -0800 Subject: [PATCH 25/25] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 769f730..a876f56 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ JupyterLite deployed as a static site to GitHub Pages, for demo purposes. JupyterLite is being tested against modern web browsers: -- Firefox 90+ -- Chromium 89+ +- Firefox 90+ +- Chromium 89+ ## Deploy your JupyterLite website on GitHub Pages @@ -25,14 +25,14 @@ Check out the guide on the JupyterLite documentation: https://jupyterlite.readth For more info, keep an eye on the JupyterLite documentation: -- How-to Guides: https://jupyterlite.readthedocs.io/en/latest/howto/index.html -- Reference: https://jupyterlite.readthedocs.io/en/latest/reference/index.html +- How-to Guides: https://jupyterlite.readthedocs.io/en/latest/howto/index.html +- Reference: https://jupyterlite.readthedocs.io/en/latest/reference/index.html ## Additional Notes From Team Mat3ra: -- `data_bridge` extensions is built using the `setup.sh` -- pass `INSTALL=1 BUILD=1` to also build and install the jupyter lite with extension -- `requirements.txt` is updated as part of the above to include the extension -- requires `pyenv` and `npm` installed +- `data_bridge` extensions is built using the `setup.sh` +- pass `INSTALL=1 BUILD=1` to also build and install the jupyter lite with extension +- `requirements.txt` is updated as part of the above to include the extension +- requires `pyenv` and `npm` installed