Commit 29019295 authored by Chuck LeDuc Díaz's avatar Chuck LeDuc Díaz
Browse files

zenroom patch script

parent f27b4815
Pipeline #95939843 passed with stage
in 1 minute and 11 seconds
......@@ -10,7 +10,13 @@ Zenroom is a tiny and portable virtual machine that integrates in any applicatio
## Installation
```shell
> npm install @caelum-tech/zenroom-lib
npm install @caelum-tech/zenroom-lib
```
### For React
This library uses [Zenroom](https://www.npmjs.com/package/zenroom) 1.0.0 [which has a problem](https://www.dyne.org/using-zenroom-with-javascript-react-part3/) with [create-react-app](https://create-react-app.dev/). To fix this issue we've added [a script](https://gitlab.com/caelum-tech/lorena/zenroom-lib/blob/master/bin/zenroom_modules.sh) which patches the installed package:
```shell
./node_modules/@caelum-tech/zenroom-lib/bin/zenroom_modules.sh
```
## Usage
......
#!/usr/bin/env bash
if [ ! -h public/zenroom.wasm ]
then
pushd public
ln -s ../node_modules/zenroom/dist/lib/zenroom.wasm .
popd
fi
sed -i "s/var wasmBinaryFile = 'zenroom.wasm'/var wasmBinaryFile = '\/zenroom.wasm'/" node_modules/zenroom/dist/lib/zenroom.js
sed -i "s/wasmBinaryFile = locateFile(wasmBinaryFile);/\/\/ wasmBinaryFile = locateFile(wasmBinaryFile);/" node_modules/zenroom/dist/lib/zenroom.js
{
"name": "@caelum-tech/zenroom-lib",
"version": "1.0.1",
"version": "1.1.0",
"description": "zenroom-lib is a javascript library to interact with the Zenroom Virtual Machine",
"main": "src/index.js",
"author": "Alex Puig",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment