{"id":20105080,"url":"https://github.com/jdee/react_native_util","last_synced_at":"2026-05-04T18:33:51.540Z","repository":{"id":56891238,"uuid":"185861508","full_name":"jdee/react_native_util","owner":"jdee","description":"Community utility CLI for React Native projects [work in progress]","archived":false,"fork":false,"pushed_at":"2019-05-16T03:17:48.000Z","size":388,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T04:44:52.427Z","etag":null,"topics":["cli","cocoapods","react-native","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-09T19:45:41.000Z","updated_at":"2020-10-21T12:52:30.000Z","dependencies_parsed_at":"2022-08-21T00:20:50.561Z","dependency_job_id":null,"html_url":"https://github.com/jdee/react_native_util","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Freact_native_util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Freact_native_util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Freact_native_util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Freact_native_util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdee","download_url":"https://codeload.github.com/jdee/react_native_util/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549062,"owners_count":19980474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cocoapods","react-native","ruby"],"created_at":"2024-11-13T17:45:45.877Z","updated_at":"2026-05-04T18:33:46.517Z","avatar_url":"https://github.com/jdee.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react_native_util gem\n\n[![Gem](https://img.shields.io/gem/v/react_native_util.svg?style=flat)](https://rubygems.org/gems/react_native_util)\n[![Downloads](https://img.shields.io/gem/dt/react_native_util.svg?style=flat)](https://rubygems.org/gems/react_native_util)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/jdee/react_native_util/blob/master/LICENSE)\n[![CircleCI](https://img.shields.io/circleci/project/github/jdee/react_native_util.svg)](https://circleci.com/gh/jdee/react_native_util)\n\n**Work in progress**\n\nCommunity utility CLI for React Native projects.\n\nConverts a project created with `react-native init` to use CocoaPods with the\nReact pod from node_modules. This preserves compatibility with\n`react-native link`. A converted project will still start the Metro packager\nautomatically via a Run Script build phase in the Xcode project. This is an\nalternative to performing manual surgery on a project in Xcode.\n\n## Prerequisites\n\n_macOS \u0026 Xcode required_\n\nThe react_pod command requires `yarn` from Homebrew and the `react-native-cli`.\nIf installing react_native_util from the Homebrew tap, `yarn` will be\nautomatically installed if not present. The `react-native-cli` may also be\ninstalled from Homebrew if desired:\n\n```bash\nbrew install jdee/tap/react_native_util --with-react-native-cli\n```\n\nIf running from RubyGems, please make sure these packages are installed:\n```bash\nbrew install yarn\n```\n\n```bash\nnpm install -g react-native-cli\n```\nor\n```\nbrew install react-native-cli\n```\n\n## Installation\n\n```bash\n[sudo] gem install react_native_util\n```\n\n## Install from Homebrew tap\n\n```bash\nbrew install jdee/tap/react_native_util\n```\n\nInclude react-native-cli from Homebrew:\n```bash\nbrew install jdee/tap/react_native_util --with-react-native-cli\n```\n\n## Gemfile\n\n```Ruby\ngem 'react_native_util'\n```\n\n## Fastlane\n\nSee https://github.com/jdee/fastlane-plugin-react_native_util\n```bash\nfastlane add_plugin react_native_util\n```\n\n## Usage\n\n```bash\nreact_native_util -h\nrn -h\nrn react_pod -h\n```\n\n## react_pod command\n\nConverts a React Native Xcode project to use the React pod from node_modules\ninstead of the projects in the Libraries group. This makes it easier to manage\nnative dependencies while preserving compatibility with `react-native link`.\nThe command looks for your app's package.json in the current directory and\nexpects your Xcode project to be located under the ios subdirectory and have\nthe name specified for your app in package.json. If a Podfile is found in the\nios subdirectory, the conversion will fail.\n\nThe React.xcodeproj in the Libraries group of a project created by\n`react-native init` automatically starts the Metro packager via a Run Script\nbuild phase. When the react_pod command removes the Libraries group from your\napp project, it adds an equivalent build phase to your app project so that the\npackager will automatically be started when necessary by Xcode.\n\nUse the `-u` or `--update` option to update the packager script after\nupdating React Native, in case the packager script on the React.xcodeproj changes\nafter it's removed from your project.\n\n### Options\n\n|option|description|env. var.|\n|------|-----------|---------|\n|-h, --help|Print command help||\n|-t, --trace|Print a stack trace in case of error||\n|-u, --update|Update a previously converted project||\n|--[no-]repo-update|Don't update the local podspec repo|REACT_NATIVE_UTIL_REPO_UPDATE|\n\n## Try it out\n\nConvert examples/TestApp.\n\nFirst install dependencies.\n```bash\nbundle check || bundle install\n```\n\nThen use the Rake task\n```bash\nbundle exec rake react_pod\n```\n\nor the CLI.\n```bash\ncd examples/TestApp\nbundle exec rn react_pod\n```\n\nFinally see the changes.\n```bash\ngit status\n```\n\n_Typical command output:_\n```\n2019-05-15T19:48:43-07:00 react_native_util react_pod v0.6.0\n2019-05-15T19:48:46-07:00  Darwin 18.5.0 x86_64\n2019-05-15T19:48:46-07:00  Ruby 2.6.3: ~/.rvm/rubies/ruby-2.6.3/bin/ruby\n2019-05-15T19:48:46-07:00  RubyGems 3.0.3: ~/.rvm/rubies/ruby-2.6.3/bin/gem\n2019-05-15T19:48:46-07:00  Bundler 2.0.1: ~/.rvm/gems/ruby-2.6.3/bin/bundle\n2019-05-15T19:48:46-07:00  react-native-cli: ~/.nvm/versions/node/v10.15.0/bin/react-native\n2019-05-15T19:48:46-07:00   react-native-cli: 2.0.1\n2019-05-15T19:48:46-07:00   react-native: 0.59.8\n2019-05-15T19:48:46-07:00  yarn 1.16.0: /usr/local/bin/yarn\n2019-05-15T19:48:47-07:00  cocoapods 1.6.2: ~/.rvm/gems/ruby-2.6.3/bin/pod\n2019-05-15T19:48:47-07:00  cocoapods-core: 1.6.2\n2019-05-15T19:48:47-07:00 package.json:\n2019-05-15T19:48:47-07:00  app name: \"TestApp\"\n2019-05-15T19:48:47-07:00 Found Xcode project at ~/github/$USER/react_native_util/examples/TestApp/ios/TestApp.xcodeproj\n2019-05-15T19:48:47-07:00 Dependencies:\n2019-05-15T19:48:47-07:00  react-native-webview\n2019-05-15T19:48:47-07:00 Unlinking dependencies\n[✔] react-native unlink react-native-webview success in 0.7 s\n2019-05-15T19:48:48-07:00 Generating ios/Podfile\n2019-05-15T19:48:48-07:00 Removing Libraries from TestApp\n2019-05-15T19:48:48-07:00  Removing libRCTBlob.a\n2019-05-15T19:48:48-07:00  Removing libRCTAnimation.a\n2019-05-15T19:48:48-07:00  Removing libReact.a\n2019-05-15T19:48:48-07:00  Removing libRCTActionSheet.a\n2019-05-15T19:48:48-07:00  Removing libRCTGeolocation.a\n2019-05-15T19:48:48-07:00  Removing libRCTImage.a\n2019-05-15T19:48:48-07:00  Removing libRCTLinking.a\n2019-05-15T19:48:48-07:00  Removing libRCTNetwork.a\n2019-05-15T19:48:48-07:00  Removing libRCTSettings.a\n2019-05-15T19:48:48-07:00  Removing libRCTText.a\n2019-05-15T19:48:48-07:00  Removing libRCTVibration.a\n2019-05-15T19:48:48-07:00  Removing libRCTWebSocket.a\n2019-05-15T19:48:48-07:00 Removing Libraries from TestAppTests\n2019-05-15T19:48:48-07:00  Removing libReact.a\n2019-05-15T19:48:48-07:00 Removing Libraries from TestApp-tvOS\n2019-05-15T19:48:48-07:00  Removing libReact.a\n2019-05-15T19:48:48-07:00  Removing libRCTAnimation.a\n2019-05-15T19:48:48-07:00  Removing libRCTImage-tvOS.a\n2019-05-15T19:48:48-07:00  Removing libRCTLinking-tvOS.a\n2019-05-15T19:48:48-07:00  Removing libRCTNetwork-tvOS.a\n2019-05-15T19:48:48-07:00  Removing libRCTSettings-tvOS.a\n2019-05-15T19:48:48-07:00  Removing libRCTText-tvOS.a\n2019-05-15T19:48:48-07:00  Removing libRCTWebSocket-tvOS.a\n2019-05-15T19:48:48-07:00 Removing Libraries from TestApp-tvOSTests\n2019-05-15T19:48:48-07:00  Removing libReact.a\n2019-05-15T19:48:48-07:00 Removing RCTAnimation.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing React.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTActionSheet.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTBlob.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTGeolocation.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTImage.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTLinking.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTNetwork.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTSettings.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTText.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTVibration.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing RCTWebSocket.xcodeproj from Libraries group.\n2019-05-15T19:48:48-07:00 Removing Libraries group.\n2019-05-15T19:48:48-07:00 Linking dependencies\n[✔] react-native link react-native-webview success in 0.5 s\n2019-05-15T19:48:48-07:00 Generating Pods project and ios/TestApp.xcworkspace\n2019-05-15T19:48:48-07:00 Once pod install is complete, your project will be part of this workspace.\n2019-05-15T19:48:48-07:00 From now on, you should build the workspace with Xcode instead of the project.\n2019-05-15T19:48:48-07:00 Always add the workspace and Podfile.lock to SCM.\n2019-05-15T19:48:48-07:00 It is common practice also to add the Pods directory.\n2019-05-15T19:48:48-07:00 The workspace will be automatically opened when pod install completes.\n[✔] pod install success in 10.6 s\n2019-05-15T19:48:59-07:00 Conversion complete ✅\n2019-05-15T19:48:59-07:00 $ open ios/TestApp.xcworkspace\n```\n\n## Convert your own app with Rake\n\nFrom this repo:\n\n```bash\nbundle exec rake react_pod[/path/to/your/app]\n```\n\n## Rake task\n\nAdd to Rakefile:\n```Ruby\nrequire 'react_native_util/rake'\nReactNativeUtil::Rake::ReactPodTask.new\n```\n\nCustomize:\n```Ruby\nrequire 'react_native_util/rake'\nReactNativeUtil::Rake::ReactPodTask.new(\n  :react_pod,                         # task name\n  'Convert project to use React pod', # description\n  'Update project',                   # description for :update task\n  chdir: '/path/to/rn/project',       # path to project package.json\n  repo_update: true                   # optionally disable pod repo update\n)\n```\n\nOverride `chdir` at the command line:\n```bash\nrake react_pod[/path/to/another/rn/project]\n```\n\nConvert project:\n```bash\nrake react_pod\n```\n\nUpdate converted project:\n```bash\nrake react_pod:update\n```\n\n## Ruby script\n\n```Ruby\nrequire 'react_native_util/converter'\n\nDir.chdir '/path/to/rn/project' do\n  begin\n    converter = ReactNativeUtil::Converter.new(repo_update: true)\n\n    # Convert a project to use the React pod\n    converter.convert_to_react_pod!\n\n    # Update a converted project\n    converter.update_project!\n  rescue ReactNativeUtil::BaseException =\u003e e\n    puts \"Error from ReactNativeUtil::Converter: #{e.message}\"\n  end\nend\n```\n\n## Documentation\n\nHosted [Yard](https://yardoc.org) documentation available at\nhttps://www.rubydoc.info/gems/react_native_util.\n\n## Successfully converted apps:\n\nhttps://github.com/azhavrid/movie-swiper\n([gist](https://gist.github.com/jdee/58746c8484d508fa318df8642ec99da8))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Freact_native_util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdee%2Freact_native_util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Freact_native_util/lists"}