Move to using @rive-app/canvas as the backing renderer and update scripts accordingly.

This commit is contained in:
Zach Plata
2022-04-18 12:46:27 -07:00
committed by Zachary Plata
parent 1da73aac05
commit 563dca3608
11 changed files with 24 additions and 19 deletions

View File

@@ -2,18 +2,18 @@
set -e
# Run the build and copy to the rive-react-webgl build for npm release
# Run the build and copy to each react-variant build for npm release
npm run build
cp -r ./dist ./npm/rive-react-webgl
cp -r ./dist ./npm/rive-react-canvas
cp -r ./dist ./npm/react-webgl
cp -r ./dist ./npm/react-canvas
echo Replacing the webgl with canvas references
pushd ./npm/rive-react-canvas/dist
echo "Replacing the canvas with webgl references in react-webgl"
pushd ./npm/react-webgl/dist
if [[ "$OSTYPE" == "darwin"* ]]; then
find . -type f -name "*.ts" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/webgl/@rive-app\/canvas/g'
find . -type f -name "*.js" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/webgl/@rive-app\/canvas/g'
find . -type f -name "*.ts" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/canvas/@rive-app\/webgl/g'
find . -type f -name "*.js" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/canvas/@rive-app\/webgl/g'
else
find . -type f -name "*.ts" -print0 | xargs -0 sed -i -e 's/@rive-app\/webgl/@rive-app\/canvas/g'
find . -type f -name "*.js" -print0 | xargs -0 sed -i -e 's/@rive-app\/webgl/@rive-app\/canvas/g'
find . -type f -name "*.ts" -print0 | xargs -0 sed -i -e 's/@rive-app\/canvas/@rive-app\/webgl/g'
find . -type f -name "*.js" -print0 | xargs -0 sed -i -e 's/@rive-app\/canvas/@rive-app\/webgl/g'
fi
popd

View File

@@ -5,7 +5,7 @@ const renderer = npmPackageSplit[npmPackageSplit.length - 1];
const package = require(path + '/package.json');
function trimNpmPackage() {
package.name = `${package.name}-${renderer}`;
package.name = `@rive-app/react-${renderer}`;
package.description = `React wrapper around the @rive-app/${renderer} library`;
const webDependencyName = `@rive-app/${renderer}`;
const canvasDep = package.dependencies[webDependencyName];