Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2c4fc43
Update gutenberg ref
derekblank Sep 7, 2022
accaa15
Update React Native CLI and metro babel preset versions
derekblank Sep 7, 2022
b21e029
Bump React Native version on React-CoreModules.podspec.json
derekblank Sep 7, 2022
791e3dd
Update metro-babel and react-native-cli dependencies
derekblank Sep 8, 2022
358898e
Updates bin/generate-podspecs.sh - In React Native >=0.69.4 the ./scr…
Sep 8, 2022
44469f5
Update generate-podspecs.sh to exclude React-encore.podspec as it fai…
Sep 9, 2022
e529bd4
Update FBReactNativeSpec
Sep 9, 2022
ad8bf23
Update third-party podspecs
derekblank Sep 9, 2022
a6b4554
Update bin/generate-podspecs.sh to generate React-Codegen
Sep 19, 2022
06df1af
Update package-lock.json
Sep 19, 2022
3d4c4a4
Add React-Codegen podspec
Sep 19, 2022
0eb314c
Update FBReactNativeSpec
Sep 19, 2022
c6a510a
Update FBReactNativeSpec to commit hash
Sep 19, 2022
fd123b5
Add Git path and React native version to React-Codegen
Sep 19, 2022
d8ca669
Update FBReactNativeSpec
Sep 19, 2022
7389040
Update FBReactNativeSpec
Sep 19, 2022
6cc9227
Update generate-podspecs.sh
Sep 20, 2022
b11f4c5
Update FBReactNativeSpec
Sep 20, 2022
d37b3a5
Update FBReactNativeSpec
Sep 20, 2022
81a4e80
Update bundles
Sep 20, 2022
89081b5
Update FBReactNativeSpec
Sep 20, 2022
a609673
Update FBReactNativeSpec
Sep 20, 2022
912efeb
Update FBReactNativeSpec
Sep 20, 2022
47c7d35
Update FBReactNativeSpec
Sep 20, 2022
e7aae9f
Update gutenberg ref
derekblank Oct 6, 2022
bac8a00
Update third-party podspecs
derekblank Oct 7, 2022
43de89c
Update gutenberg ref
derekblank Oct 10, 2022
aae5874
Update gutenberg ref
derekblank Oct 11, 2022
2635b11
Update gutenberg ref
derekblank Oct 12, 2022
bc88051
Update gutenberg ref
derekblank Oct 13, 2022
1505998
Update Gutenberg ref
Oct 14, 2022
2efb790
Update package-lock
Oct 14, 2022
68eabd4
Update Gutenberg ref
Oct 14, 2022
8e1f7bb
Update bundles
Oct 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions bin/generate-podspecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ done
# Change to the React Native directory to get relative paths for the RN podspecs
cd "$NODE_MODULES_DIR/react-native"

RN_PODSPECS=$(find * -type f -name "*.podspec" -not -path "third-party-podspecs/*" -not -path "*Fabric*" -print)
RN_DIR="./"
SCRIPTS_PATH="./scripts/"
CODEGEN_REPO_PATH="../packages/react-native-codegen"
CODEGEN_NPM_PATH="../react-native-codegen"
SRCS_DIR=${SRCS_DIR:-$(cd "./Libraries" && pwd)}
RN_VERSION=$(cat ./package.json | grep -m 1 version | sed 's/[^0-9.]//g')

RN_PODSPECS=$(find * -type f -name "*.podspec" -not -name "React-rncore.podspec" -not -path "third-party-podspecs/*" -not -path "*Fabric*" -print)
TMP_DEST=$(mktemp -d)

for podspec in $RN_PODSPECS
Expand All @@ -109,6 +116,8 @@ do

echo "Generating podspec for $pod with path $path"
pod ipc spec "$podspec" > "$TMP_DEST/$pod.podspec.json"
# Removes message [Codegen] Found at the beginning of the file
sed -i '' -e '/\[Codegen\] Found/d' "$TMP_DEST/$pod.podspec.json"
cat "$TMP_DEST/$pod.podspec.json" | jq > "$DEST/$pod.podspec.json"

# Add a "prepare_command" entry to each podspec so that 'pod install' will fetch sources from the correct directory
Expand All @@ -135,7 +144,50 @@ do
# They are normally generated during compile time using a Script Phase in FBReactNativeSpec added via the `use_react_native_codegen` function.
# This script is inside node_modules/react-native/scripts folder. Since we don't have the node_modules when compiling WPiOS,
# we're calling the script here manually to generate these files ahead of time.
MODULES_OUTPUT_DIR=$DEST/FBReactNativeSpec ./scripts/generate-specs.sh
SCHEMA_FILE="$TMP_DEST/schema.json"
NODE_BINARY="${NODE_BINARY:-$(command -v node || true)}"

if [ -d "$CODEGEN_REPO_PATH" ]; then
CODEGEN_PATH=$(cd "$CODEGEN_REPO_PATH" && pwd)
elif [ -d "$CODEGEN_NPM_PATH" ]; then
CODEGEN_PATH=$(cd "$CODEGEN_NPM_PATH" && pwd)
else
echo "Error: Could not determine react-native-codegen location. Try running 'yarn install' or 'npm install' in your project root." 1>&2
exit 1
fi

if [ ! -d "$CODEGEN_PATH/lib" ]; then
describe "Building react-native-codegen package"
bash "$CODEGEN_PATH/scripts/oss/build.sh"
fi

# Generate React-Codegen
# A copy of react_native_pods is done to modify the content within get_react_codegen_spec
# this enables getting the schema for React-Codegen in runtime by printing the content.
echo "Generating React-Codegen"
REACT_NATIVE_PODS_PATH="$SCRIPTS_PATH/react_native_pods.rb"
REACT_NATIVE_PODS_MODIFIED_PATH="$SCRIPTS_PATH/react_native_pods_modified.rb"
# Making a temp copy of react_native_pods.rb
cp $REACT_NATIVE_PODS_PATH $REACT_NATIVE_PODS_MODIFIED_PATH
# Modify the get_react_codegen_spec method to return the result using print and JSON.pretty
sed -i '' -e "s/:git => ''/:git => 'https:\/\/github.com\/facebook\/react-native.git', :tag => 'v$RN_VERSION'/" "$REACT_NATIVE_PODS_MODIFIED_PATH"
sed -i '' -e 's/return spec/print JSON.pretty_generate(spec)/' "$REACT_NATIVE_PODS_MODIFIED_PATH"
# Run get_react_codegen_spec and generate React-Codegen.podspec.json
ruby -r "./scripts/react_native_pods_modified.rb" -e "get_react_codegen_spec" > "$DEST/React-Codegen.podspec.json"
TMP_ReactCodeGenSpec=$(mktemp)
jq '.source_files = "third-party-podspecs/FBReactNativeSpec/**/*.{c,h,m,mm,cpp}"' "$DEST/React-Codegen.podspec.json" > "$TMP_ReactCodeGenSpec"
mv "$TMP_ReactCodeGenSpec" "$DEST/React-Codegen.podspec.json"
# Remove temp copy of react_native_pods.rb
rm $REACT_NATIVE_PODS_MODIFIED_PATH

echo "Generating schema from Flow types"
"$NODE_BINARY" "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"

echo "Generating native code from schema (iOS)"
"$NODE_BINARY" "./scripts/generate-specs-cli.js" -p "ios" -s "$SCHEMA_FILE" -o "$DEST/FBReactNativeSpec"

# Removing unneeded files
find "$DEST/FBReactNativeSpec" -type f -not -name "FBReactNativeSpec.podspec.json" -not -name "FBReactNativeSpec-generated.mm" -not -name "FBReactNativeSpec.h" -not -name "FBReactNativeSpec.h" -delete

# Removing 'script_phases' that shouldn't be needed anymore.
# Removing 'prepare_command' that includes additional steps to create intermediate folders to keep generated files which won't be needed.
Expand Down
6,416 changes: 3,208 additions & 3,208 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 387 files
Loading