Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Do not require pod install after react-native init #24638

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions scripts/prepare-template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

PACKAGE_LOCATION=$(pwd)/react-native-$1.tgz

# Pack React Native into a `.tgz` file so we can run from source
npm pack

# Set the React Native version to point to the `.tgz` file
node scripts/set-rn-template-version.js "file:$PACKAGE_LOCATION"

# We need to generate CocoaPods project. To do so, we install depdendencies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# We need to generate CocoaPods project. To do so, we install depdendencies
# We need to generate CocoaPods project. To do so, we install dependencies

# locally and manually run `pod install`
cd template

npm install
grabbou marked this conversation as resolved.
Show resolved Hide resolved
(cd ios && pod install)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll want to pass --repo-update flag so we publish up-to-date pods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... mind elaborating a bit what that flag is doing? We have local pods (from local spec within the repo, so no need to update the whole CocoaPods repo) and we also rm -rf Pods anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot it's local, you're right


# Dependencies are installed on the client-side
rm -rf node_modules

# Do not ship a package.json that points to a `tgz`
git checkout package.json
3 changes: 3 additions & 0 deletions scripts/publish-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ artifacts.forEach(name => {
}
});

// Generate template for this version
exec(`scripts/prepare-template.sh ${releaseVersion}`);

// if version contains -rc, tag as prerelease
const tagFlag = releaseVersion.indexOf('-rc') === -1 ? '' : '--tag next';

Expand Down
10 changes: 3 additions & 7 deletions scripts/test-manual-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ success "Killing packager"
lsof -i :8081 | grep LISTEN
lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill

npm pack

PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION.tgz
success "Package bundled ($PACKAGE)"

node scripts/set-rn-template-version.js "file:$PACKAGE"
success "React Native version changed in the template"
./scripts/prepare-template.sh $PACKAGE_VERSION
node scripts/set-rn-template-version.js "file:$(pwd)/react-native-${PACKAGE_VERSION}.tgz"
success "Sucessfully prepared a template"

project_name="RNTestProject"

Expand Down
Loading