### Install and Start Verdaccio Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/CONTRIBUTING.md Install Verdaccio globally and start the local npm registry. Verdaccio defaults to http://localhost:4873. ```bash npm install -g verdaccio verdaccio ``` -------------------------------- ### Execute Verbose Partial Install Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-install-to/README.md Run the 'install-to' command with the --verbose flag to get additional information about the installation process, including the percentage of the repository being installed. ```sh yarn install-to --verbose @my-scope/package1 ``` -------------------------------- ### Execute Partial Install Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-install-to/README.md Use the 'install-to' command followed by the package names to perform a partial installation. This command is available after the plugin is successfully installed. ```sh yarn install-to @my-scope/package1 @my-scope/package2 ``` -------------------------------- ### Installation Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-bundle-config/README.md Instructions on how to install the @rnx-kit/types-bundle-config package as a development dependency. ```APIDOC ## Installation ```sh yarn add @rnx-kit/types-bundle-config --dev ``` or if you're using npm ```sh npm add --save-dev @rnx-kit/types-bundle-config ``` ``` -------------------------------- ### Installation Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-duplicates-checker/README.md Instructions on how to install the @rnx-kit/types-plugin-duplicates-checker package as a development dependency. ```APIDOC ## Installation ### Yarn ```sh yarn add @rnx-kit/types-plugin-duplicates-checker --dev ``` ### npm ```sh npm add --save-dev @rnx-kit/types-plugin-duplicates-checker ``` ``` -------------------------------- ### Installation Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-kit-config/README.md Instructions for installing the @rnx-kit/types-kit-config package as a development dependency. ```APIDOC ## Installation ```sh yarn add @rnx-kit/types-kit-config --dev ``` or if you're using npm ```sh npm add --save-dev @rnx-kit/types-kit-config ``` ``` -------------------------------- ### Install @rnx-kit/fork-sync Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/README.md Install the fork-sync package globally using npm. ```sh npm install -g @rnx-kit/fork-sync ``` -------------------------------- ### Start rnx-cli Bundle Server Source: https://github.com/microsoft/rnx-kit/blob/main/packages/cli/README.md Starts a bundle server for a package using Metro. This command is a replacement for `react-native start`. ```sh yarn rnx-cli start ``` ```sh yarn rnx-cli start --host 127.0.0.1 --port 8812 ``` -------------------------------- ### Installation Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-host/README.md Instructions for installing the @rnx-kit/react-native-host package using Yarn or npm. ```APIDOC ## Installation ```sh yarn add @rnx-kit/react-native-host --dev ``` or if you're using npm ```sh npm add --save-dev @rnx-kit/react-native-host ``` ``` -------------------------------- ### Installation Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-cyclic-dependencies/README.md Instructions for installing the @rnx-kit/types-plugin-cyclic-dependencies package using Yarn or npm. ```APIDOC ## Installation ```sh yarn add @rnx-kit/types-plugin-cyclic-dependencies --dev ``` or if you're using npm ```sh npm add --save-dev @rnx-kit/types-plugin-cyclic-dependencies ``` ``` -------------------------------- ### npm Command Example Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/_package-run-command.mdx Use this snippet to execute npm commands. It conditionally uses 'npx' if an installed script is provided, otherwise 'npm run'. ```sh {props.installedScript ? "npx " : "npm run "} {props.args} ``` -------------------------------- ### Install @rnx-kit/lint-package Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/lint-package/README.md Install the lint-package as a development dependency. ```sh yarn add @rnx-kit/lint-package --dev ``` -------------------------------- ### Install @rnx-kit/tools-formatting with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-formatting/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/tools-formatting ``` -------------------------------- ### Install @rnx-kit/tools-formatting with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-formatting/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/tools-formatting --dev ``` -------------------------------- ### Install @rnx-kit/tools-git with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-git/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/tools-git ``` -------------------------------- ### rnx-kit bundle configuration example Source: https://github.com/microsoft/rnx-kit/blob/main/packages/cli/README.md Example configuration for the `rnx-kit` bundle command, specifying entry file, assets destination, Metro plugins, and platform-specific settings. This configuration can be used to customize the bundling process. ```json { "rnx-kit": { "bundle": { "entryFile": "entry.js", "assetsDest": "dist", "plugins": [ "@rnx-kit/metro-plugin-cyclic-dependencies-detector", [ "@rnx-kit/metro-plugin-duplicates-checker", { "ignoredModules": ["react-is"] } ], "@rnx-kit/metro-plugin-typescript" ], "targets": ["android", "ios", "macos", "windows"], "platforms": { "android": { "assetsDest": "dist/res" }, "macos": { "plugins": [ "@rnx-kit/metro-plugin-cyclic-dependencies-detector", [ "@rnx-kit/metro-plugin-duplicates-checker", { "ignoredModules": ["react-is"] } ] ] } } } } } ``` -------------------------------- ### Install @rnx-kit/react-native-lazy-index Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-lazy-index/README.md Install the package using npm. ```sh npm install --save @rnx-kit/react-native-lazy-index ``` -------------------------------- ### Start Local Development Server Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/README.md Starts a local development server that automatically refreshes the browser on most changes. Opens the website in a browser window. ```bash $ yarn start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/README.md Run this command to install all necessary project dependencies using Yarn. ```bash $ yarn ``` -------------------------------- ### Install @rnx-kit/tools-git with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-git/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/tools-git --dev ``` -------------------------------- ### Install Yarn Plugin Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-dynamic-extensions/README.md Use this command to install the dynamic extensions Yarn plugin. ```sh yarn plugin import https://raw.githubusercontent.com/microsoft/rnx-kit/main/incubator/yarn-plugin-dynamic-extensions/index.js ``` -------------------------------- ### Install @rnx-kit/tools-performance with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-performance/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/tools-performance ``` -------------------------------- ### Start Metro Bundle Server Command Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/bundling.mdx A simple command to start the Metro bundle server. Typically, no additional parameters are needed. ```sh react-native rnx-start ``` -------------------------------- ### Install Yarn Plugin Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-external-workspaces/README.md Install the plugin using the yarn plugin import command, referencing the compiled plugin file. ```sh yarn plugin import ./path/to/my/external-workspaces.cjs ``` -------------------------------- ### Install @rnx-kit/tools-performance with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-performance/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/tools-performance --dev ``` -------------------------------- ### Install @rnx-kit/metro-resolver-symlinks with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/metro-resolver-symlinks/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/metro-resolver-symlinks ``` -------------------------------- ### Install @rnx-kit/metro-config with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/metro-config/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/metro-config ``` -------------------------------- ### Install @rnx-kit/polyfills with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/polyfills/README.md Install the polyfills package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/polyfills ``` -------------------------------- ### Install @rnx-kit/test-fixtures with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/test-fixtures/README.md Install the test fixtures package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/test-fixtures ``` -------------------------------- ### Install @rnx-kit/metro-config with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/metro-config/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/metro-config --dev ``` -------------------------------- ### Install @rnx-kit/types-metro-serializer-esbuild with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-metro-serializer-esbuild/README.md Install this package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-metro-serializer-esbuild --dev ``` -------------------------------- ### Install @rnx-kit/test-fixtures with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/test-fixtures/README.md Install the test fixtures package as a development dependency using Yarn. ```sh yarn add @rnx-kit/test-fixtures --dev ``` -------------------------------- ### Usage Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-kit-config/README.md Example of how to import and use the types provided by the package. ```APIDOC ## Usage ```ts import type { KitConfig, AlignDepsConfig, Capability, } from "@rnx-kit/types-kit-config"; ``` ``` -------------------------------- ### Install @rnx-kit/polyfills with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/polyfills/README.md Install the polyfills package as a development dependency using Yarn. ```sh yarn add @rnx-kit/polyfills --dev ``` -------------------------------- ### Install @rnx-kit/types-kit-config with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-kit-config/README.md Install this package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-kit-config --dev ``` -------------------------------- ### Install @rnx-kit/console Source: https://github.com/microsoft/rnx-kit/blob/main/packages/console/README.md Install the @rnx-kit/console package as a development dependency using Yarn. ```sh yarn add @rnx-kit/console --dev ``` -------------------------------- ### Install @rnx-kit/lint-lockfile Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/lint-lockfile/README.md Install the lint-lockfile tool as a development dependency using Yarn. ```sh yarn add @rnx-kit/lint-lockfile --dev ``` -------------------------------- ### Install Yarn Plugin Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-install-to/README.md Install the plugin by referencing its bundled .cjs file. This command needs to be run from your project's root directory. ```sh yarn plugin import ./path/to/my/yarn-plugin-install-to.cjs ``` -------------------------------- ### Install with npm Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/react-native-test-app-msal/README.md Add the package as a dev dependency using npm. ```bash npm add --save-dev @rnx-kit/react-native-test-app-msal ``` -------------------------------- ### Install @rnx-kit/react-native-host with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-host/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/react-native-host ``` -------------------------------- ### Install Dependencies with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/CONTRIBUTING.md Run this command at the repository root to install all npm dependencies using Yarn Classic. ```sh yarn ``` -------------------------------- ### Install Dependencies from Verdaccio Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/CONTRIBUTING.md Install npm packages, including those from the local Verdaccio registry, using the specified registry. ```bash npm install --registry http://localhost:4873 ``` -------------------------------- ### Example Library Configuration in package.json Source: https://github.com/microsoft/rnx-kit/blob/main/packages/align-deps/README.md Illustrates a sample configuration for a library supporting React Native versions 0.69 and 0.70, with internal usage of 0.70. Includes requirements and capabilities. ```json { "name": "useful-library", "version": "1.0", ... "rnx-kit": { "kitType": "library", "alignDeps": { "requirements": { "development": ["react-native@0.70"], "production": ["react-native@0.69 || 0.70"] } "capabilities": [ "core-android", "core-ios" ] } } } ``` -------------------------------- ### Install @react-native-webapis/web-storage Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/@react-native-webapis/web-storage/README.md Install the web-storage package and its polyfill dependency using Yarn or npm. ```sh yarn add @rnx-kit/polyfills --dev yarn add @react-native-webapis/web-storage ``` ```sh npm add --save-dev @rnx-kit/polyfills npm add @react-native-webapis/web-storage ``` -------------------------------- ### Get Metro Bundler Version Source: https://github.com/microsoft/rnx-kit/blob/main/packages/tools-react-native/README.md Retrieves the version number of the installed Metro bundler. ```javascript getMetroVersion(projectRoot) ``` -------------------------------- ### Install oxlint config with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/oxlint-config/README.md Install the oxlint configuration package as a development dependency using npm. ```bash npm add --save-dev @rnx-kit/oxlint-config ``` -------------------------------- ### Exclude packages using 'ignore:' protocol Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-ignore/README.md Add a 'resolutions' section to your root package.json and use the 'ignore:' protocol to specify packages that should not be installed. For example, to ignore 'node-gyp': ```json + "resolutions": { + "node-gyp": "ignore:" + }, ``` -------------------------------- ### Verify TypeScript Installation Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/yarn-plugin-dynamic-extensions/README.md After configuring and running `yarn install`, you can verify the installation of a dependency like TypeScript by checking its version. ```sh % yarn tsc --version Version 5.7.3 ``` -------------------------------- ### GYP Build Configuration File Type Guidance Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/ai-merge-prompt.md Guidance for handling GYP build configuration files (.gyp/.gypi). Stresses preserving exact indentation, keeping trailing commas where they exist, maintaining consistent quote style, and preserving condition blocks and target definitions. ```bash # PROMPT: {"section": "file-type", "extensions": ["gyp", "gypi"], "guidance": "GYP build configuration file" } ## File Type: GYP Build Configuration (.gyp/.gypi) This is a GYP (Generate Your Projects) build file used by projects like Node.js and Chromium. Apply GYP syntax knowledge: - JSON-like Python syntax - preserve indentation exactly - Keep trailing commas where they exist - Maintain consistent quote style (single vs double) - Preserve condition blocks and target definitions --- ``` -------------------------------- ### Quick Start: Enable Performance Tracking Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/tools-performance/README.md Enables all performance tracking domains with in-memory timing and reports data on process exit. Ensure imports are present before use. ```typescript import { trackPerformance, reportPerfData } from "@rnx-kit/tools-performance"; // Enable all domains with in-memory timing trackPerformance({ strategy: "timing" }); // ... run instrumented code ... // Print the report (also prints automatically on process exit) reportPerfData(); ``` -------------------------------- ### npm Scripts for Bundling and Starting Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/bundling.mdx Assigning `rnx-bundle` and `rnx-start` commands to npm scripts for managing platform-specific bundles, an umbrella bundle script, and the server command. ```json { "scripts": { "bundle": "yarn bundle:ios && yarn bundle:android", "bundle:ios": "react-native rnx-bundle --platform ios ...", "bundle:android": "react-native rnx-bundle --platform android ...", "start": "react-native rnx-start" } } ``` -------------------------------- ### Format All Packages Source: https://github.com/microsoft/rnx-kit/blob/main/CONTRIBUTING.md Run this command to format all packages in the repository according to the project's style guide. ```sh yarn format ``` -------------------------------- ### Install @rnx-kit/lint-json Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/lint-json/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/lint-json --dev ``` -------------------------------- ### rnx-cli run Source: https://github.com/microsoft/rnx-kit/blob/main/packages/cli/README.md Launches the native app (building it first if necessary). ```APIDOC ## `rnx-cli run` ### Description Launches the native app (building it first if necessary). ### Method CLI Command ### Endpoint `rnx-cli run [options]` ### Parameters #### Query Parameters - **-p, --platform** (string) - Required - Target platform - **--solution** (string) - Optional - Path, relative to project root, of the Visual Studio solution to build (Windows only) - **--workspace** (string) - Optional - Path, relative to project root, of the Xcode workspace to build (macOS only) - **--scheme** (string) - Optional - Name of scheme to build (Apple platforms only) - **--configuration** (string) - Optional - Build configuration for building the app; 'Debug' or 'Release' - **--destination** (string) - Optional - Destination of the built app; 'device', 'emulator', or 'simulator' - **--ccache-dir** (string) - Optional - Path to Ccache config - **--ccache-home** (string) - Optional - Path to Ccache installation - **-d, --device** (string) - Optional - The name of the device to launch the app in ### Request Example ```sh yarn rnx-cli run -p ios ``` ``` -------------------------------- ### Build Package and Dependencies Locally Source: https://github.com/microsoft/rnx-kit/blob/main/CONTRIBUTING.md Navigate to a package directory and run this command to build the current package along with its dependencies. ```sh cd packages/cli yarn build --dependencies ``` -------------------------------- ### Build All Packages Source: https://github.com/microsoft/rnx-kit/blob/main/CONTRIBUTING.md Execute this command from the repo root to build all packages within the repository. ```sh yarn build ``` -------------------------------- ### Example align-deps Configuration Source: https://github.com/microsoft/rnx-kit/blob/main/packages/align-deps/README.md Configuration object showing how to define requirements and capabilities for dependency alignment. ```json { "name": "useful-library", "version": "1.0", ... "rnx-kit": { "kitType": "library", "alignDeps": { "requirements": { "development": ["react-native@0.70"], "production": ["react-native@0.69 || 0.70"] } "capabilities": [ "core-android", // `core-android` resolves to `react-native` "core-ios" // `core-ios` also resolves to `react-native` ] } } } ``` -------------------------------- ### Naive index.js for Comparison Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-lazy-index/README.md Illustrates a standard index.js where all features are imported upfront, contrasting with the lazy-loading approach. ```javascript import "@awesome-app/some-feature"; import "@awesome-app/another-feature"; import "@awesome-app/yet-another-feature"; import "@awesome-app/final-feature"; ``` -------------------------------- ### Install @rnx-kit/metro-resolver-symlinks with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/metro-resolver-symlinks/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/metro-resolver-symlinks --dev ``` -------------------------------- ### Install @rnx-kit/types-plugin-typescript with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-typescript/README.md Install this package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-plugin-typescript ``` -------------------------------- ### Install @rnx-kit/types-plugin-typescript with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-typescript/README.md Install this package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-plugin-typescript --dev ``` -------------------------------- ### Install @rnx-kit/types-plugin-cyclic-dependencies with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-cyclic-dependencies/README.md Install the package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-plugin-cyclic-dependencies ``` -------------------------------- ### Install @rnx-kit/types-plugin-cyclic-dependencies with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-cyclic-dependencies/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-plugin-cyclic-dependencies --dev ``` -------------------------------- ### Install @rnx-kit/types-node with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-node/README.md Install this package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-node ``` -------------------------------- ### Install @rnx-kit/types-metro-serializer-esbuild with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-metro-serializer-esbuild/README.md Install this package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-metro-serializer-esbuild ``` -------------------------------- ### Install @rnx-kit/types-node with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-node/README.md Install this package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-node --dev ``` -------------------------------- ### Generate Dependency Manager Configuration Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/getting-started.mdx Initialize the dependency manager configuration. Use 'app' if your package produces a bundle, otherwise use 'library'. ```bash rnx-align-deps --write ``` -------------------------------- ### Initialize Dependencies with npm Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/_align-deps-init.mdx Use this command to initialize aligned dependencies for an application or library using npm. ```sh npx rnx-align-deps --init app ``` ```sh npx rnx-align-deps --init library ``` -------------------------------- ### Install @rnx-kit/types-kit-config with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-kit-config/README.md Install this package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-kit-config ``` -------------------------------- ### Run Project Commands Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/CLAUDE.md Standard commands for building, testing, linting, and formatting the project. Use `yarn test:all` to include slow integration tests. ```bash yarn build # Compile TypeScript to lib/ yarn test # Run all tests (fast: skips slow integration tests) yarn test:all # Run all tests including slow integration tests yarn lint # Check linting (ESLint) yarn format # Check formatting (oxfmt) yarn fix # Fix everything: typecheck + format + lint:fix ``` -------------------------------- ### Install @rnx-kit/types-bundle-config with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-bundle-config/README.md Install this package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-bundle-config ``` -------------------------------- ### iOS/macOS Setup Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-host/README.md Guidance on manually linking @rnx-kit/react-native-host in your iOS/macOS project's Podfile and making necessary code changes. ```APIDOC ## Usage ### iOS/macOS To avoid accidental autolinking, `@rnx-kit/react-native-host` must be manually linked. In your `Podfile`, add the following line: ```rb pod 'ReactNativeHost', :path => '../node_modules/@rnx-kit/react-native-host' ``` Adjust the path accordingly to your project setup. If you prefer a more dynamic approach, you can also try using this script: ```rb proj_dir = Pathname.new(__dir__) proj_dir = proj_dir.parent until File.exist?("#{proj_dir}/node_modules/@rnx-kit/react-native-host/ReactNativeHost.podspec") || proj_dir.expand_path.to_s == '/' pod 'ReactNativeHost', :path => "#{proj_dir}/node_modules/@rnx-kit/react-native-host" ``` Run `pod install` at least once to make sure it gets added to your project. Then make the following changes: - Replace instances of `RCTBridgeDelegate` with `RNXHostConfig`. The latter is a superset and is backwards compatible. - Replace instantiation of `RCTBridge` with `ReactNativeHost`. `ReactNativeHost` will instantiate the appropriate modules required for your setup. It will also handle New Architecture configuration as necessary. - Instead of instantiating `RCTRootView` directly, use `-[ReactNativeHost viewWithModuleName:initialProperties:]` to create your root views. For example, if you previously had something like this: ```objc // AppDelegate.h @import React; @import UIKit; @interface AppDelegate : UIResponder @end // AppDelegate.m @implementation AppDelegate { RCTBridge *_bridge; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge moduleName:moduleName initialProperties:initialProperties]; ... } @end ``` You should instead have: ```objc // AppDelegate.h @import ReactNativeHost; @import UIKit; @interface AppDelegate : UIResponder @end // AppDelegate.m @implementation AppDelegate { ReactNativeHost *_host; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... _host = [[ReactNativeHost alloc] initWithConfig:self]; UIView *rootView = [_host viewWithModuleName:moduleName initialProperties:initialProperties]; ... } @end ``` ``` -------------------------------- ### Install @rnx-kit/types-bundle-config with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-bundle-config/README.md Install this package as a development dependency using Yarn. ```sh yarn add @rnx-kit/types-bundle-config --dev ``` -------------------------------- ### Install @rnx-kit/react-native-host with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/react-native-host/README.md Install the package as a development dependency using Yarn. ```sh yarn add @rnx-kit/react-native-host --dev ``` -------------------------------- ### C/C++ Source File Type Guidance Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/ai-merge-prompt.md Guidance for handling C/C++ source files (.cpp, .c, .h, .cc, .cxx, .hpp). This section is a placeholder and does not contain specific code examples. ```bash # PROMPT: {"section": "file-type", "extensions": ["cpp", "c", "h", "cc", "cxx", "hpp"], "guidance": "C/C++ source file" } ``` -------------------------------- ### Install ESLint Plugin with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/eslint-plugin/README.md Installs the @rnx-kit/eslint-plugin as a development dependency using npm. ```bash npm add --save-dev @rnx-kit/eslint-plugin ``` -------------------------------- ### Run Bundle Command Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/bundling.mdx Use this command from the root of your repository to bundle all packages if you are using Lerna. ```bash lerna run bundle ``` -------------------------------- ### Consume fork-sync from Verdaccio Source: https://github.com/microsoft/rnx-kit/blob/main/incubator/fork-sync/CONTRIBUTING.md Configure a project's package.json to include the fork-sync package from the local Verdaccio registry and install it. ```json { "private": true, "devDependencies": { "@rnx-kit/fork-sync": "^0.1.0" } } ``` -------------------------------- ### Install ESLint Plugin with Yarn Source: https://github.com/microsoft/rnx-kit/blob/main/packages/eslint-plugin/README.md Installs the @rnx-kit/eslint-plugin as a development dependency using Yarn. ```bash yarn add @rnx-kit/eslint-plugin --dev ``` -------------------------------- ### Install duplicates-checker with npm Source: https://github.com/microsoft/rnx-kit/blob/main/packages/types-plugin-duplicates-checker/README.md Install the duplicates-checker package as a development dependency using npm. ```sh npm add --save-dev @rnx-kit/types-plugin-duplicates-checker ``` -------------------------------- ### Initialize Dependencies with pnpm Source: https://github.com/microsoft/rnx-kit/blob/main/docsite/docs/guides/_align-deps-init.mdx Use this command to initialize aligned dependencies for an application or library using pnpm. ```sh pnpm rnx-align-deps --init app ``` ```sh pnpm rnx-align-deps --init library ```