gl-react/scripts/build.sh
Gaëtan Renaudeau 4d4b567726 fundamentally refactor the way width/height works
in gl-react: the context no longer have {width,height} but have {glSizable} which is an object with a getGLSize function. the size is dynamically calculated in the graph & using gl.drawingBufferWidth / gl.drawingBufferHeight which allows more flexible implementations.
in gl-react-dom: nothing fundamentally changes
in gl-react-native/exponent: Surface no longer takes width/height props! instead, it is just the style object, like any usual React Native view. e.g. you can use flexbox!
2017-03-02 14:42:21 +01:00

62 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
cd `dirname $0`/..
packages=`ls packages`
projs="cookbook cookbook-rn cookbook-exp tests"
for pkg in $packages; do
echo "Building $pkg..."
cd packages/$pkg
npm link
rm -rf lib &&
babel --source-maps -d lib src &&
flow-copy-source -v src lib;
cd - 1> /dev/null
echo
done
# until i figure out better, we'll do this!!!
echo "Copying the new builds into projects..."
for pkg in $packages; do
pack=`npm pack packages/$pkg`
if [ -z $pack ]; then
exit 1;
fi;
for proj in $projs; do
mkdir -p ./$proj/node_modules
node_module=./$proj/node_modules/$pkg/
if [ -d $node_module ] && [ ! -L $node_module ]; then
echo "$pkg -> $proj"
tar -xf $pack -C ./$proj/node_modules &&
rm -rf $node_module &&
mv ./$proj/node_modules/package $node_module
fi
done
rm $pack
done
echo "Done."
echo
echo "Generating standalone builds..."
cd packages/gl-react
browserify lib/index.js \
-t [ browserify-shim ] \
--standalone GLReact > gl-react.js
cd -
cd packages/gl-react-dom
npm link gl-react
browserify lib/index.js \
-t [ browserify-shim ] \
--standalone GLReactDOM > gl-react-dom.js
cd -
echo "Done."
echo
./scripts/generate-doc.sh
cd cookbook
npm run generate-examples
cd -