1.9.30 • Published 6 days ago

react-native-platform-override v1.9.30

Weekly downloads
10
License
MIT
Repository
github
Last release
6 days ago

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"
    },
  ]
}
NameRequiredDescriptionDefault
includePatternsOptionalA list of globs of files to enforce are listed in the manifest.["**"]
excludePatternsOptionalGlobs to be excluded from the above list.[]
baseVersionOptionalThe default react-native version of an override
overridesRequiredList of registered overrides, added by the tooling

Override Types

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

PlatformPlatform-specific logic that doesn't map to an upstream file
DerivedAn override derived from an upstream file. Changes to the original file will be merged into the override.
PatchAn upstream file with changes made to it. Changes to the original file will be merged into the override.
CopyAn 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.

OptionRequiredDescriptionDefault
--manifest <file>OptionalPath to an override manifest to validatePackage root above cwd
--version <v>OptionalA version of React Native to check againstThe currently installed version

add <override>

Adds an override to the manifest, prompting for details.

OptionRequiredDescription
<override>RequiredThe override to add

remove <override>

Removes an override to the manifest.

OptionRequiredDescription
<override>RequiredThe override to remove

upgrade

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

OptionRequiredDescriptionDefault
--manifest <file>OptionalPath to an override manifest to validatePackage root above cwd
--version <v>OptionalA version of React Native to check againstThe currently installed version
--no-conflictsOptionalWhether 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.

OptionRequiredDescriptionDefault
<override>RequiredThe 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'});
1.9.29

6 days ago

1.9.30

6 days ago

1.9.28

7 days ago

1.9.27

22 days ago

1.9.26

1 month ago

1.9.25

1 month ago

1.9.24

2 months ago

1.9.23

2 months ago

1.9.22

2 months ago

1.9.21

2 months ago

1.9.20

3 months ago

1.9.19

3 months ago

1.9.18

3 months ago

1.9.17

6 months ago

1.9.16

7 months ago

1.9.15

7 months ago

1.9.14

9 months ago

1.9.13

9 months ago

1.9.12

10 months ago

1.9.11

10 months ago

1.9.10

11 months ago

1.9.9

11 months ago

1.9.8

11 months ago

1.9.7

12 months ago

1.9.6

12 months ago

1.9.5

1 year ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.2

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.1

2 years ago

1.8.5

1 year ago

1.8.4

1 year ago

1.8.3

1 year ago

1.6.14

2 years ago

1.7.0

2 years ago

1.6.13

2 years ago

1.6.11

2 years ago

1.6.10

2 years ago

1.6.12

2 years ago

1.6.9

2 years ago

1.6.8

2 years ago

1.6.7

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.1

2 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.18

3 years ago

1.4.15

3 years ago

1.4.17

3 years ago

1.4.16

3 years ago

1.4.14

3 years ago

1.4.13

3 years ago

1.4.12

3 years ago

1.4.11

3 years ago

1.4.10

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago