npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-platform-override

v1.9.49

Published

react-native-platform-override offers CLI tools to manage Javascript overrides in out-of-tree React Native platforms

Downloads

746

Readme

react-native-platform-override

Tools to manage "platform overrides" for out of tree React Native platforms. Facilities for inventorying changes and integrating new upstream changes are included.

Override Manifests

react-native-platform-override operates on a JSON "override manifest" placed at the root of an npm package. It is expected that these are named overrides.json.

An example override manifest

{
  "includePatterns": [
    "src/**"
  ],
  "excludePatterns": [
    "src/README.md"
  ],
  "baseVersion": "0.0.0-10b4b9505",
  "overrides": [
    {
      "type": "derived",
      "file": ".flowconfig",
      "baseFile": ".flowconfig",
      "baseVersion": "0.0.0-56cf99a96",
      "baseHash": "8eab29258f5ad573e478324f10f850b7ccfb49c7"
    },
  ]
}

| Name | Required | Description | Default | |-------------------|----------|-----------------------------------------------------------------|----------| | includePatterns | Optional | A list of globs of files to enforce are listed in the manifest. | ["**"] | | excludePatterns | Optional | Globs to be excluded from the above list. | [] | | baseVersion | Optional | The default react-native version of an override | | | overrides | Required | List of registered overrides, added by the tooling | |

Override Types

Overrides can be registered as different types, each with differing behavior.

| | | |----------|------------------------------------------------------------------------------------------------------------------| | Platform | Platform-specific logic that doesn't map to an upstream file | | Derived | An override derived from an upstream file. Changes to the original file will be merged into the override. | | Patch | An upstream file with changes made to it. Changes to the original file will be merged into the override. | | Copy | An exact copy of an upstream file or directory. Overrides of this type will remain identical to their originals. |

CLI

react-native-platform-override offers multiple commands to manipulate and verify the override manifest.

validate

Verifies that overrides are recorded and up-to-date.

| Option | Required | Description | Default | |---------------------|----------|----------------------------------------------------|---------------------------------| | --manifest <file> | Optional | Path to an override manifest to validate | Package root above cwd | | --version <v> | Optional | A version of React Native to check against | The currently installed version |

add <override>

Adds an override to the manifest, prompting for details.

| Option | Required | Description | |-------------------|----------|---------------------------| | <override> | Required | The override to add |

remove <override>

Removes an override to the manifest.

| Option | Required | Description | |-------------------|----------|---------------------------| | <override> | Required | The override to remove |

upgrade

Attempts to automatically merge new changes into out-of-date overrides.

| Option | Required | Description | Default | |---------------------|----------|------------------------------------------------------------|---------------------------------| | --manifest <file> | Optional | Path to an override manifest to validate | Package root above cwd | | --version <v> | Optional | A version of React Native to check against | The currently installed version | | --no-conflicts | Optional | Whether to allow upgraded files to contain conlict markers | --conflicts |

diff <override>

Diffs an override against its base file. It it compared to the base file of the override's current version, even if a newer verison of react-native is installed.

| Option | Required | Description | Default | |------------------------|----------|----------------------------------------------------------------------------------------------------------------|---------| | <override> | Required | The override to diff against | |

GitHub Tokens

react-native-platform-override makes requests to GitHub's API. An OAuth token may optionally be provided by using the --githubToken parameter or setting the PLATFORM_OVERRIDE_GITHUB_TOKEN environment variable.

Programmatic Use

react-native-platform-override offers a programmatic API with similar capabilities to the CLI. Take a look here for details.

E.g.

import {validateManifest} from 'react-native-platform-override';

const validationErrors = await validateManifest({manifestPath: 'src/overrides.json'});