Files
react/compiler/scripts/build-packages-forget-feedback.sh
Joe Savona 48e0c70292 Rename babel plugin
ghstack-source-id: bb66913e2d3c814696311371ed655f3da03d1199
Pull Request resolved: https://github.com/facebook/react-forget/pull/2926
2024-05-02 14:12:33 -07:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Script to build packages for Forget Feedback (eg when you need to add a new package to the
# testapp)
set -eo pipefail
cwd=`basename $(pwd)`
if [ $cwd != "react-forget" ]; then
echo "Error: This script must be run from the top level react-forget directory. Exiting"
exit 1
fi
# ----------------------- Build packages
yarn install --silent
rm -rf forget-feedback/dist
mkdir forget-feedback/dist
packages=("babel-plugin-react-compiler" "eslint-plugin-react-compiler" "react-forget-runtime")
for package in ${packages[@]}; do
echo "Building" $package
yarn workspace $package run build
done
echo "Copying artifacts to local forget-feedback directory..."
for package in ${packages[@]}; do
for dir in packages/$package/; do
if [ -d $dir/dist ]; then
package_name=$(basename $dir)
cp -R $dir/dist/. ./forget-feedback/dist/$package_name
cp $dir/package.json ./forget-feedback/dist/$package_name
fi
done
done