@react-native-community/cli-config
Advanced tools
Comparing version 12.0.0-alpha.4 to 12.0.0-alpha.5
@@ -41,2 +41,21 @@ "use strict"; | ||
// Try our best to figure out what version of React Native we're running. This is | ||
// currently being used to get our deeplinks working, so it's only worried with | ||
// the major and minor version. | ||
function getReactNativeVersion(reactNativePath) { | ||
try { | ||
let semver = _cliTools().version.current(reactNativePath); | ||
if (semver) { | ||
// Retain only these version, since they correspond with our documentation. | ||
return `${semver.major}.${semver.minor}`; | ||
} | ||
} catch (e) { | ||
// If we don't seem to be in a well formed project, give up quietly. | ||
if (!(e instanceof _cliTools().UnknownProjectError)) { | ||
throw e; | ||
} | ||
} | ||
return 'unknown'; | ||
} | ||
/** | ||
@@ -53,3 +72,5 @@ * Loads CLI configuration | ||
}, | ||
reactNativeVersion: 'unknown', | ||
get reactNativeVersion() { | ||
return getReactNativeVersion(initialConfig.reactNativePath); | ||
}, | ||
dependencies: userConfig.dependencies, | ||
@@ -73,18 +94,2 @@ commands: userConfig.commands, | ||
}; | ||
// Try our best to figure out what version of React Native we're running. This is | ||
// currently being used to get our deeplinks working, so it's only worried with | ||
// the major and minor version. | ||
try { | ||
let semver = _cliTools().version.current(initialConfig.reactNativePath); | ||
if (semver) { | ||
// Retain only these version, since they correspond with our documentation. | ||
initialConfig.reactNativeVersion = `${semver.major}.${semver.minor}`; | ||
} | ||
} catch (e) { | ||
// If we don't seem to be in a well formed project, give up quietly. | ||
if (!(e instanceof _cliTools().UnknownProjectError)) { | ||
throw e; | ||
} | ||
} | ||
const finalConfig = Array.from(new Set([...Object.keys(userConfig.dependencies), ...(0, _findDependencies.default)(projectRoot)])).reduce((acc, dependencyName) => { | ||
@@ -91,0 +96,0 @@ const localDependencyRoot = userConfig.dependencies[dependencyName] && userConfig.dependencies[dependencyName].root; |
{ | ||
"name": "@react-native-community/cli-config", | ||
"version": "12.0.0-alpha.4", | ||
"version": "12.0.0-alpha.5", | ||
"license": "MIT", | ||
@@ -11,3 +11,3 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@react-native-community/cli-tools": "12.0.0-alpha.4", | ||
"@react-native-community/cli-tools": "12.0.0-alpha.5", | ||
"chalk": "^4.1.2", | ||
@@ -25,7 +25,7 @@ "cosmiconfig": "^5.1.0", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "12.0.0-alpha.4", | ||
"@react-native-community/cli-types": "12.0.0-alpha.5", | ||
"@types/cosmiconfig": "^5.0.3", | ||
"@types/glob": "^7.1.1" | ||
}, | ||
"homepage": "https://github.com/react-native-community/cli/tree/master/packages/cli-config", | ||
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-config", | ||
"repository": { | ||
@@ -36,3 +36,3 @@ "type": "git", | ||
}, | ||
"gitHead": "bd0963dbe23b079b50dd2b07f80f305b3bc92f3a" | ||
"gitHead": "3569633e1bbda4858195feb8537d7b9969b2040e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63834
626
+ Added@react-native-community/cli-tools@12.0.0-alpha.5(transitive)
- Removed@react-native-community/cli-tools@12.0.0-alpha.4(transitive)