### Run React Native app on iOS or Android simulator Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/getting-started/create-new-app.md Executes pnpm commands to launch the React Native application on either an iOS or Android simulator. These commands are used after project setup and dependency installation to start the development server and deploy the app to a virtual device. ```bash # Run the app on iOS simulator pnpm ios ``` ```bash # Run the app on Android simulator pnpm android ``` -------------------------------- ### Install Maestro via pnpm script Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/testing/end-to-end-testing.mdx This command utilizes a pnpm script to execute a curl command, which downloads and installs Maestro. It simplifies the setup process by abstracting the direct curl command. ```bash pnpm install-maestro ``` -------------------------------- ### Install pnpm globally Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/getting-started/create-new-app.md Installs the pnpm package manager globally on your system using npm. pnpm is a prerequisite for initializing new projects with the `create-obytes-app` starter. ```bash npm install -g pnpm ``` -------------------------------- ### Conventional Commit Real-World Examples Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/getting-started/rules-and-conventions.mdx Provides practical examples of conventional commit messages, demonstrating how to apply different types (fix, feat) and scopes (ui, api) to describe changes effectively. ```txt fix(ui): fix input width feat(ui): add button variants feat(api): add usePost query hook ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/obytes/react-native-template-obytes/blob/master/README-project.md This command sequence clones the project repository from GitHub and installs all necessary dependencies using pnpm, preparing the environment for development. ```sh git clone https://github.com/user/repo-name cd ./repo-name pnpm install ``` -------------------------------- ### Example React Native Component Unit Test Structure Source: https://github.com/obytes/react-native-template-obytes/blob/master/prompts/write-unit-tests.md This code snippet provides a template for structuring unit tests for a React Native component. It demonstrates the use of Jest's setup/teardown hooks (`beforeAll`, `beforeEach`, `afterEach`) and how to group tests by functionality (Rendering, Interactions, State Management) using `describe` blocks. It also showcases common assertions and user interaction simulations with React Native Testing Library. ```tsx import React from 'react'; import { cleanup, screen, setup, waitFor } from '@/lib/test-utils'; afterEach(cleanup); const onSubmitMock: jest.Mock = jest.fn(); describe('ComponentName', () => { // Setup section beforeAll(() => { // Global setup }); beforeEach(() => { // Reset mocks and state jest.clearAllMocks(); }); // Test cases grouped by functionality describe('Rendering', () => { test('renders correctly with default props', async () => { setup(); expect(await screen.findByTestId('component-name')).toBeOnTheScreen(); }); test('renders correctly with custom props', async () => {}); }); describe('Interactions', () => { test('handles user input correctly', async () => { const { user } = setup(); const input = screen.getByTestId('input-id'); await user.type(input, 'test'); expect(input).toHaveValue('test'); }); test('triggers appropriate callbacks', async () => {}); }); describe('State Management', () => { test('updates state correctly', async () => {}); test('handles side effects', async () => {}); }); }); ``` -------------------------------- ### Astro Starlight CLI Management Commands Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/README.md A comprehensive list of command-line interface operations for developing, building, and managing an Astro Starlight project. These commands are executed from the project root and cover dependency installation, local development server, production build, and build preview. ```APIDOC npm install - Action: Installs project dependencies. npm run dev - Action: Starts local development server at `localhost:3000`. npm run build - Action: Builds your production site to `./dist/`. npm run preview - Action: Previews your build locally, before deploying. npm run astro ... - Action: Run CLI commands like `astro add`, `astro check`. npm run astro -- --help - Action: Get help using the Astro CLI. ``` -------------------------------- ### Initialize new React Native project with create-obytes-app Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/getting-started/create-new-app.md Uses `npx` to execute the `create-obytes-app` command, creating a new Expo app named `MyApp` and installing all necessary dependencies. This command sets up the project structure based on the Obytes starter template. ```bash npx create-obytes-app@latest MyApp ``` -------------------------------- ### Start Application with Specific Environment and Clear Cache Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/getting-started/environment-vars-config.mdx Provides a command to launch the application while explicitly setting the `APP_ENV` to 'production' and clearing the cache. This ensures the application starts with the correct environment-specific configurations and a clean state. ```bash APP_ENV=production pnpm start -cc ``` -------------------------------- ### Install Sentry React Native SDK Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/recipes/sentry-setup.mdx Installs the official Sentry SDK for React Native applications using `npx expo install`. This command adds the necessary `@sentry/react-native` package to your project dependencies, enabling Sentry's error monitoring capabilities. ```bash npx expo install @sentry/react-native ``` -------------------------------- ### Example Usage of Modal Component (React Native TSX) Source: https://github.com/obytes/react-native-template-obytes/blob/master/docs/src/content/docs/ui-and-theme/components.mdx Illustrates how to integrate and control the `Modal` component in a React Native application. This example demonstrates using the `useModal` hook to present the modal and configuring its title and snap points. ```tsx import * as React from 'react'; import { Modal, useModal, View, Button, Text } from '@/components/ui'; const MyComponent = () => { const modal = useModal(); return (