Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename override-tools to react-native-platform-override (#4993)
* Rename override-tools to react-native-windows-override Fixes #4859 This chnage: 1. Matches better with other packages 2. Allows unambiguously mapping bin name to package name, allowing us to reccomend npx usage instead of Yarn, which has odd cwd behavior. We also need to update out gitignore file which no longer was allowing checking in VS Code project settings. * Use public react-native-platform-override instead of react-native-windows-override * Update descriptions, reduce some hardcoding * Remove some more duplication * Missing file * Remove require-time dependency to be called from the package bin. I.e. allow scripts to still work * More path hardening * Simplify logic a bit more * Fic string
- Loading branch information
1 parent
1a96ee7
commit 85b01cb
Showing
36 changed files
with
113 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
change/@office-iss-react-native-win32-2020-05-25-08-45-02-rename-override-tools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "none", | ||
"comment": "Rename override-tools to react-native-platform-override", | ||
"packageName": "@office-iss/react-native-win32", | ||
"email": "ngerlem@microsoft.com", | ||
"dependentChangeType": "none", | ||
"date": "2020-05-25T15:44:40.322Z" | ||
} |
8 changes: 8 additions & 0 deletions
8
change/react-native-platform-override-2020-05-25-08-45-02-rename-override-tools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Rename override-tools to react-native-platform-override", | ||
"packageName": "react-native-platform-override", | ||
"email": "ngerlem@microsoft.com", | ||
"dependentChangeType": "patch", | ||
"date": "2020-05-25T15:45:02.599Z" | ||
} |
8 changes: 8 additions & 0 deletions
8
change/react-native-windows-2020-05-25-08-45-02-rename-override-tools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "none", | ||
"comment": "Rename override-tools to react-native-platform-override", | ||
"packageName": "react-native-windows", | ||
"email": "ngerlem@microsoft.com", | ||
"dependentChangeType": "none", | ||
"date": "2020-05-25T15:44:45.971Z" | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
packages/react-native-platform-override/src/PackageUtils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* @format | ||
*/ | ||
|
||
import * as path from 'path'; | ||
|
||
/** | ||
* Try to find the currently installed React Native version by searching for and | ||
* reading it's package.json. | ||
*/ | ||
export async function getInstalledRNVersion(): Promise<string> { | ||
const rnPackage = require('react-native/package.json'); | ||
const version = rnPackage.version; | ||
|
||
if (typeof version !== 'string') { | ||
throw new Error('Unexpected formt of React Native package.json'); | ||
} | ||
|
||
return version; | ||
} | ||
|
||
/** | ||
* Return an object representing the package.json of this package | ||
*/ | ||
export function getNpmPackage(): any { | ||
const npmPackageDir = path.join( | ||
path.dirname(require.main.filename), | ||
'package.json', | ||
); | ||
|
||
return require(npmPackageDir); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters