|
| 1 | +# JupyterLite deployment |
| 2 | + |
| 3 | +This directory contains everything needed to build the local `git2cpp` source code as an |
| 4 | +[Emscripten-forge](https://emscripten-forge.org/) package and create a local JupyterLite deployment |
| 5 | +that can run it in a [terminal](https://github.com/jupyterlite/terminal). |
| 6 | + |
| 7 | +It works on Linux and macOS but not Windows. |
| 8 | + |
| 9 | +It uses a separate `micromamba` environment defined in `deploy-environment.yml`. To set this up use: |
| 10 | +```bash |
| 11 | +micromamba create -f deploy-environment.yml |
| 12 | +micromamba activate git2cpp-deploy |
| 13 | +``` |
| 14 | + |
| 15 | +Then to build `git2cpp` and create the JupyterLite deployment use: |
| 16 | +```bash |
| 17 | +make |
| 18 | +``` |
| 19 | + |
| 20 | +This performs the following steps: |
| 21 | + |
| 22 | + 1. Clones the `emscripten-forge/recipes` repository. |
| 23 | + 2. Modifies the `git2cpp` recipe (using `modify_recipe.py`) to build from the local `git2cpp` source code in `../src/`. |
| 24 | + 3. Builds the package from the recipe using `pixi`. |
| 25 | + 4. Builds the JupyterLite deployment in the `dist/` directory using the locally-built package. |
| 26 | + |
| 27 | +The built package will be in the `em-forge-recipes/output/emscripten-wasm32` directory with a name |
| 28 | +something like `git2cpp-0.0.3-h2072262_3.tar.bz2`. If you compare this with the latest |
| 29 | +Emscripten-forge package on `https://prefix.dev/channels/emscripten-forge-dev/packages/git2cpp`, |
| 30 | +the local package should have the same version number and the build number should be one higher. |
| 31 | + |
| 32 | +To serve the JupyterLite deployment use: |
| 33 | +```bash |
| 34 | +make serve |
| 35 | +``` |
| 36 | +and open a web browser at the URL http://localhost:8080/. Start a terminal and run the |
| 37 | +`cockle-config` command (typing `coc`, then the tab key then enter should suffice). Amongst the |
| 38 | +displayed information should be the `git2cpp` package showing that it is from a local directory |
| 39 | +such as `file:///something-or-other/git2cpp/lite-deploy/em-forge-recipes/output` rather than from |
| 40 | +`prefix.dev` such as `https://repo.prefix.dev/emscripten-forge-dev`. |
| 41 | + |
| 42 | +After making changes to `git2cpp` source code, to rebuild the package and deployment use: |
| 43 | +```bash |
| 44 | +make rebuild |
| 45 | +``` |
| 46 | +and then re-serve using: |
| 47 | +```bash |
| 48 | +make serve |
| 49 | +``` |
0 commit comments