Obtain wasm packages from emscripten-forge when building deployment #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the configuration and packaging of wasm command files to occur when building a deployment (static website) rather than being hard-coded in the
cockle
source code and the wasm files being packed in the NPM package. The process is similar to that performed for python xeus kernels in JupyterLite except that the code here is TypeScript rather than Python. There is an input JSON fileconfig-cockle-base.json
containing configuration for compulsory wasm packages (cockle_fs
,coreutils
andgrep
) which ships withcockle
, and this can be added with an extra config file to add optional wasm packages such aslua
. A JSON config file is placed alongside the wasm files when a deployment is created, andShellImpl
reads this config file to configure the variousWasmCommandRunner
objects.Probably lots of the internal details will change. The JSON file formats should be in schemas, and the
prepare_wasm
node tool script should be more robust. It would be simpler for end-users if instead of using a bespoke JSON file a normalmicromamba
environment file could be used (as with python xeus), but for this we would need some other way to also configure which emscripten-forge packages contain which wasm modules and which commands. These could probably be embedded in the emscripten-forge packages in some way.After merging this will need a new
cockle
release before it can be tried out in JupyterLite.