### Install Packages and Pods Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Commands to install project dependencies and native iOS pods. It also includes steps for setting up environment files for staging and production, and configuring keystore properties for Android. ```bash npm install npx pod-install cd ios && pod install cp env.example .env.staging cp env.example .env cp android/example-keystore.properties android/keystore.properties npm run add-example-model ``` -------------------------------- ### Setup Pre-commit Hooks Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Instructions for setting up Husky for pre-commit hooks and GitGuardian for secret detection. This involves running a post-install script and configuring an API key. ```bash npm run postinstall ``` -------------------------------- ### Run with Staging Environment Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Example of how to run the application using the staging environment by overriding the API_URL environment variable. ```bash API_URL=http://example.com npm start -- --reset-cache ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Ensures the latest version of Xcode command line tools are installed, which is a prerequisite for using fastlane. ```sh xcode-select --install ``` -------------------------------- ### Fluent Syntax Examples for Labels Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Demonstrates correct and incorrect ways to define labels in Fluent syntax, emphasizing matching content and updating labels when content changes. ```Fluent ABOUT-COLLECTION-PROJECTS = ABOUT COLLECTION PROJECTS ``` ```Fluent ABOUT-COLLECTION-AND-UMBRELLA-PROJECTS = ABOUT COLLECTION AND UMBRELLA PROJECTS ``` -------------------------------- ### Install Dependencies and Commit Changes Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Installs project dependencies using npm, which also updates the package-lock.json file to reflect the new version. Subsequently, it commits these changes to the repository. ```bash npm install ``` ```bash Commit changes ``` -------------------------------- ### Configure Fastlane for Deployment Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Shell commands to set up fastlane for deployment. This involves copying example configuration files and filling in necessary credentials and tokens, such as GitHub personal access tokens and keystore properties. ```bash cp android/example-keystore.properties android/keystore.properties cp fastlane/example-Appfile fastlane/Appfile ``` -------------------------------- ### Initialize i18next in Test Files Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Example of how to initialize i18next within a test file if it depends on localized text. This is done using `beforeAll` to await initialization. ```javascript beforeAll( async ( ) => { await initI18next( ); } ); ``` -------------------------------- ### Run Build Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Commands to start the React Native application, with an option to reset the cache to avoid build issues. It also includes commands to run the app on iOS and Android simulators. ```bash npm start -- --reset-cache npm run ios npm run android ``` -------------------------------- ### Run E2E Tests (Detox) Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Executes End-to-End tests using Detox. Requires setting E2E_TEST_USERNAME and E2E_TEST_PASSWORD in a .env file. Ensure Detox environment setup is complete. ```bash npm run e2e ``` -------------------------------- ### Adding New Strings in Fluent Syntax Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Provides examples of adding new translatable strings to the `strings.ftl` file using Fluent syntax, including simple labels and multi-line text. ```Fluent # Header for a paragraph describing projects ABOUT-PROJECTS = ABOUT ``` ```Fluent # Text describing what projects are projects-description = Projects are really great, probably iNat's best feature. ``` -------------------------------- ### Example Branch Naming Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/CONTRIBUTING.md When creating a new branch for an issue, prefix the branch name with the issue number followed by a descriptive name. This helps in tracking and managing contributions. ```bash 123-login-with-locale-crash ``` -------------------------------- ### Example Commit Message with Details Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/CONTRIBUTING.md For more complex changes, include developer-relevant details on subsequent lines after the main commit message. This provides context for the changes made. ```git Fix broken photo sharing in iOS 18 * Switch to fork of photo-sharing-library-x * Minor UI touch-ups ``` -------------------------------- ### Build and Push Release to GitHub Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Executes a Fastlane command to build the application and push the release to GitHub. ```ruby bundle exec fastlane release ``` -------------------------------- ### Tagging and Releasing with Fastlane Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md This snippet demonstrates the core Fastlane commands for managing the release process. It includes creating git tags, generating GitHub releases with associated builds, and uploading builds for various testing stages. ```zsh fastlane tag ``` ```zsh fastlane release ``` ```zsh fastlane internal ``` ```zsh fastlane beta ``` ```zsh fastlane prod ``` -------------------------------- ### Prepare App Store Release Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Prepares the application for an App Store release using Fastlane. This command prompts for custom release notes specific to the App Store submission, summarizing changes since the last App Store release. ```ruby bundle exec fastlane prod ``` -------------------------------- ### Build and Run Android E2E Tests Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Builds the Android APK for testing purposes and installs/runs it on a named emulator. Ensure the emulator name matches the configuration in `.detoxrc.js`. ```bash npm run e2e:build:android && npm run e2e:test:android ``` -------------------------------- ### Run fastlane beta action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'beta' action within fastlane, used for distributing beta versions of the app. ```sh [bundle exec] fastlane beta ``` -------------------------------- ### Example Commit Message with Issue Closing Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/CONTRIBUTING.md Commit messages should use the imperative mood and can optionally close a GitHub issue by including 'Closes #issue_number' on a subsequent line. This links the commit to the issue it resolves. ```git Fix broken photo sharing in iOS 18 Closes #1234 ``` -------------------------------- ### Manage App Store Release Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Initiates a staged release of the application on App Store Connect and marks the GitHub release as the latest non-pre-release version. This process is manual and involves attaching the latest build to the new version in App Store Connect and submitting it for review. ```bash Start the staged release in App Store Connect ``` ```bash Mark the Github release as the latest non-pre-release ``` -------------------------------- ### Build Android app with fastlane Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Builds the Android application using fastlane. ```sh [bundle exec] fastlane android build ``` -------------------------------- ### Build iOS app with fastlane Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Builds the iOS application using fastlane. ```sh [bundle exec] fastlane ios build ``` -------------------------------- ### Fluent Syntax for Pluralization Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Demonstrates how to handle pluralization in Fluent syntax using selectors for different counts. ```Fluent x-observations = { $count } { $count -> [one] observation *[other] observations } ``` -------------------------------- ### Run fastlane build action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'build' action within fastlane, used for building the application. ```sh [bundle exec] fastlane build ``` -------------------------------- ### Run Tests Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Commands to execute tests using Jest. This includes running all tests, running tests matching a specific path pattern, and running individual tests matching a pattern. ```bash # Run all tests npm test # Run test paths matching a pattern npm test MyObs # Run individual tests matching a pattern. Note the -- to pass arguments to jest npm test -- -t accessibility ``` -------------------------------- ### Create Git Tag and Bump Build Number Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Uses Fastlane to create a Git tag for the release and automatically bumps the build number. The script will prompt the user to enter the release notes. ```ruby bundle exec fastlane tag ``` -------------------------------- ### Run fastlane download_app_store_reviews action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'download_app_store_reviews' action within fastlane to fetch reviews from the App Store. ```sh [bundle exec] fastlane download_app_store_reviews ``` -------------------------------- ### Fluent Syntax for Unique and Descriptive Keys Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Shows how to use double-dashes in Fluent keys to append context and ensure uniqueness, aiding translators. ```Fluent Unknown--place = Unknown ``` ```Fluent Unknown--taxon = Unknown ``` -------------------------------- ### Fluent Syntax with Comments Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Illustrates the use of comments in Fluent syntax to provide context for translators, especially for ambiguous strings. ```Fluent # Label for a button that changes a selected date Change-date = Change date ``` -------------------------------- ### Run fastlane prod action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'prod' action within fastlane, typically used for production deployment. ```sh [bundle exec] fastlane prod ``` -------------------------------- ### Distribute to External Test Groups Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Uses Fastlane to distribute the application builds to external testing groups on TestFlight and the Google Play Store. ```ruby bundle exec fastlane beta ``` -------------------------------- ### Run fastlane release action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'release' action within fastlane, used for managing application releases. ```sh [bundle exec] fastlane release ``` -------------------------------- ### Distribute to Internal Test Groups Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Uses Fastlane to distribute the application builds to internal testing groups on TestFlight and the Google Play Store. ```ruby bundle exec fastlane internal ``` -------------------------------- ### Run Tests with npm Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/CONTRIBUTING.md Before submitting changes, ensure all tests are passing by running the test suite using npm. This is a mandatory step for merging pull requests. ```bash npm test ``` -------------------------------- ### Manage Translations with Crowdin CLI Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Commands to upload new translation strings and download updated translations using the Crowdin CLI. It also includes a script to process downloaded translation files and stage them for commit. ```bash crowdin upload --token YOUR_ACCESS_TOKEN --project-id YOUR_PROJECT_ID crowdin download --token YOUR_ACCESS_TOKEN --project-id YOUR_PROJECT_ID npm run translate git add src/i18n/l10n/* git commit -a -m "Updated translations" ``` -------------------------------- ### Fluent Syntax Avoiding Variables Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md Illustrates replacing variables with separate strings for better translation management and static code analysis. ```Fluent quality-grade-with-label--research = Quality Grade: Research ``` ```Fluent quality-grade-with-label--needs-id = Quality Grade: Needs ID ``` ```Fluent quality-grade-with-label--casual = Quality Grade: Casual ``` -------------------------------- ### Run fastlane tag action Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/fastlane/README.md Executes the 'tag' action within fastlane, typically used for version tagging. ```sh [bundle exec] fastlane tag ``` -------------------------------- ### Create and Manage Sentinel Files for Debugging Source: https://github.com/inaturalist/inaturalistreactnative/blob/main/README.md TypeScript functions for implementing a sentinel file system to track user interaction flows. This system helps debug issues by logging stages of a flow and identifying points of failure when flows are abandoned. ```typescript await createSentinelFile( "Camera" ); await logStage( "Camera", "save_photos_to_photo_library_start", {} ); await logStage( "Camera", "save_photos_to_photo_library_complete", {} ); await deleteSentinelFile( "Camera" ); ```