Skip to content

Commit affadb6

Browse files
blakeffacebook-github-bot
authored andcommitted
core-cli-utils - Added version information
Summary: Using version information previously housed in react-native-communtiy/cli Changelog: [Internal] Reviewed By: cortinico Differential Revision: D55960009 fbshipit-source-id: 38f8b2310942a9337a7b64b51a87ae629d9bbbaf
1 parent e14e6ce commit affadb6

4 files changed

Lines changed: 63 additions & 1 deletion

File tree

packages/core-cli-utils/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ $ ./fancy-framework android clean
4747
Gradle: ....
4848
```
4949

50+
## Features
51+
- `"@react-native/core-cli-utils/version.js"` contains the platform and tooling version requirements for react-native.
52+
5053
## Contributing
5154

5255
Changes to this package can be made locally and linked against your app. Please see the [Contributing guide](https://reactnative.dev/contributing/overview#contributing-code).

packages/core-cli-utils/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"exports": {
1313
".": "./src/index.js",
14-
"./package.json": "./package.json"
14+
"./package.json": "./package.json",
15+
"./version.js": "./src/public/version.js"
1516
},
1617
"types": "./dist/index.d.ts",
1718
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/core-cli-utils#readme",

packages/core-cli-utils/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@
1212
import {tasks as android} from './private/android.js';
1313
import {tasks as apple} from './private/apple.js';
1414
import {tasks as clean} from './private/clean.js';
15+
import * as version from './public/version.js';
1516

1617
/* eslint sort-keys : "error" */
1718
export default {
19+
// Platforms
1820
android: typeof android,
1921
apple: typeof apple,
2022
clean: typeof clean,
23+
24+
// Meta
25+
version: typeof version,
2126
};
2227

2328
export type {Task} from './private/types';
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow strict-local
8+
* @format
9+
* @oncall react_native
10+
*/
11+
12+
// Usage:
13+
//
14+
// > const semver = require('semver');
15+
// > semver.satisfies(process.env.ANDROID_SDK, android.ANDROID_SDK);
16+
// true
17+
//
18+
// The version of @react-native/core-cli-utils matches a particular version
19+
// of react-native. For example:
20+
//
21+
// > npm info @react-native/core-cli-util@latest --json | jq '.version'
22+
// > "0.75.0"
23+
//
24+
// Means that:
25+
// > require('@react-native/core-cli-utils/versions.js').apple.XCODE
26+
// > ">= 12.x"
27+
//
28+
// For react-native@0.75.0 you have to have a version of XCode >= 12
29+
30+
export const android = {
31+
ANDROID_NDK: '>= 23.x',
32+
ANDROID_SDK: '>= 33.x',
33+
};
34+
35+
export const apple = {
36+
COCOAPODS: '>= 1.10.0',
37+
XCODE: '>= 12.x',
38+
};
39+
40+
export const common = {
41+
BUN: '>= 1.0.0',
42+
JAVA: '>= 17 <= 20',
43+
NODE_JS: '>= 18',
44+
NPM: '>= 4.x',
45+
RUBY: '>= 2.6.10',
46+
YARN: '>= 1.10.x',
47+
};
48+
49+
export const all = {
50+
...apple,
51+
...android,
52+
...common,
53+
};

0 commit comments

Comments
 (0)