Skip to content

Commit

Permalink
Merge branch 'main' into docs/cleanup-from-deprecated-options
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee authored Aug 9, 2023
2 parents 3d2b8f2 + 4fcd778 commit 061fea1
Show file tree
Hide file tree
Showing 36 changed files with 1,992 additions and 2,873 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: "master"
ref: "main"
persist-credentials: false

- name: "Setup Node v16"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
Expand All @@ -29,9 +29,9 @@ jobs:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand All @@ -48,7 +48,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
Expand All @@ -70,7 +70,7 @@ jobs:
uses: microsoft/setup-msbuild@v1.3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ And then:

```sh
cd /my/new/react-native/project/
yarn link "@react-native-community/cli-platform-ios" "@react-native-community/cli-platform-android" "@react-native-community/cli" "@react-native-community/cli-server-api" "@react-native-community/cli-types" "@react-native-community/cli-tools" "@react-native-community/cli-debugger-ui" "@react-native-community/cli-hermes" "@react-native-community/cli-plugin-metro" "@react-native-community/cli-clean" "@react-native-community/cli-doctor" "react-native-community/cli-config"
yarn link "@react-native-community/cli-platform-ios" "@react-native-community/cli-platform-android" "@react-native-community/cli" "@react-native-community/cli-server-api" "@react-native-community/cli-types" "@react-native-community/cli-tools" "@react-native-community/cli-debugger-ui" "@react-native-community/cli-hermes" "@react-native-community/cli-plugin-metro" "@react-native-community/cli-clean" "@react-native-community/cli-doctor" "@react-native-community/cli-config"
```

Once you're done with testing and you'd like to get back to regular setup, run `yarn unlink` instead of `yarn link` from above command. Then `yarn install --force`.
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
[
require.resolve('@babel/preset-env'),
{
targets: {node: '16'},
targets: {node: '18'},
useBuiltIns: 'entry',
corejs: '2.x',
},
Expand Down
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ React Native CLI comes with following commands:
- [`build-ios`](/packages/cli-platform-ios/README.md#build-ios)
- [`start`](/packages/cli-plugin-metro/README.md#start)
- [`upgrade`](#upgrade)
- [`profile-hermes`](/packages/cli-platform-android/README.md#profile-hermes)
- [`profile-hermes`](/packages/cli-hermes/README.md#profile-hermes)

### `init`

Expand Down
6 changes: 3 additions & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"npmClient": "yarn",
"useWorkspaces": true,
"exact": true
"exact": true,
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@react-native-community/eslint-config": "^2.0.0",
"@types/glob": "^7.1.1",
"@types/jest": "^26.0.15",
"@types/node": "^16.0.0",
"@types/node": "^18.0.0",
"@types/node-fetch": "^2.3.7",
"@types/readable-stream": "^2.3.0",
"@types/rimraf": "^3.0.2",
Expand All @@ -49,17 +49,17 @@
"jest": "^26.6.2",
"jest-circus": "^26.6.2",
"jest-snapshot-serializer-raw": "^1.1.0",
"lerna": "^4.0.0",
"lerna": "^7.1.3",
"lint-staged": "^13.1.0",
"metro-memory-fs": "0.77.0",
"metro-memory-fs": "0.78.0",
"micromatch": "^4.0.4",
"rimraf": "^3.0.2",
"slash": "^3.0.0",
"string-length": "^2.0.0",
"typescript": "^4.9.5"
},
"resolutions": {
"@types/node": "^16.0.0"
"@types/node": "^18.0.0"
},
"lint-staged": {
"./packages/**/*.ts": [
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-clean/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-clean",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"prompts": "^2.4.0"
Expand All @@ -19,7 +19,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.7",
"@react-native-community/cli-types": "12.0.0-alpha.8",
"@types/prompts": "^2.0.9"
},
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-clean",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-config/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-config",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"cosmiconfig": "^5.1.0",
"deepmerge": "^4.3.0",
Expand All @@ -21,7 +21,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.7",
"@react-native-community/cli-types": "12.0.0-alpha.8",
"@types/cosmiconfig": "^5.0.3",
"@types/glob": "^7.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-debugger-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/cli-debugger-ui",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "./build/middleware",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions packages/cli-doctor/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@react-native-community/cli-doctor",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-config": "12.0.0-alpha.7",
"@react-native-community/cli-platform-android": "12.0.0-alpha.7",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.7",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-config": "12.0.0-alpha.8",
"@react-native-community/cli-platform-android": "12.0.0-alpha.8",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.8",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.8",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"command-exists": "^1.2.8",
"envinfo": "^7.7.2",
Expand All @@ -34,7 +34,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.7",
"@react-native-community/cli-types": "12.0.0-alpha.8",
"@types/command-exists": "^1.2.0",
"@types/envinfo": "^7.8.1",
"@types/ip": "^1.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli-doctor/src/tools/healthchecks/__tests__/jdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ describe('jdk', () => {
expect(diagnostics.needsToBeFixed).toBe(true);
});

it('returns false if JDK version is in range (JDK [11-18] version number format)', async () => {
it('returns false if JDK version is in range (JDK [17-20] version number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '14.0.4',
version: '17.0.8',
};

const diagnostics = await jdk.getDiagnostics(environmentInfo);
expect(diagnostics.needsToBeFixed).toBe(false);
});

it('returns true if JDK version is not in range (JDK < 11 version number format)', async () => {
it('returns true if JDK version is not in range (JDK < 17 version number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '1.8.0_282',
Expand All @@ -55,10 +55,10 @@ describe('jdk', () => {
expect(diagnostics.needsToBeFixed).toBe(true);
});

it('returns true if JDK version is not in range (JDK > 18 version number format)', async () => {
it('returns true if JDK version is not in range (JDK > 20 version number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '19.0.1',
version: '21.0.1',
};

const diagnostics = await jdk.getDiagnostics(environmentInfo);
Expand Down
30 changes: 19 additions & 11 deletions packages/cli-doctor/src/tools/healthchecks/xcodeEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import {promisify} from 'util';
import {HealthCheckInterface} from '../../types';

const xcodeEnvFile = '.xcode.env';
const pathSeparator = '/';

function removeLastPathComponent(pathString: string): string {
return path.dirname(pathString);
}

function pathHasXcodeEnvFile(pathString: string): boolean {
const xcodeEnvPath = pathString + pathSeparator + xcodeEnvFile;
const xcodeEnvPath = path.join(pathString, xcodeEnvFile);
return fs.existsSync(xcodeEnvPath);
}

Expand All @@ -29,11 +28,16 @@ export default {
description: 'File to customize Xcode environment',
getDiagnostics: async (_, config) => {
try {
const projectRoot = config?.root ?? findProjectRoot();
const missingXcodeEnvFile = findPodfilePaths(projectRoot).some((p) => {
const basePath = path.dirname(p);
return !pathHasXcodeEnvFile(basePath);
});
const iosFolderPath = config?.project.ios?.sourceDir ?? '';

const missingXcodeEnvFile = findPodfilePaths(iosFolderPath).some(
(podfilePath) => {
return !pathHasXcodeEnvFile(
removeLastPathComponent(path.join(iosFolderPath, podfilePath)),
);
},
);

return {
needsToBeFixed: missingXcodeEnvFile,
};
Expand All @@ -52,15 +56,19 @@ export default {
projectRoot,
'react-native/template/ios',
);
const src = templateIosPath + pathSeparator + templateXcodeEnv;
const src = path.join(templateIosPath, templateXcodeEnv);
const copyFileAsync = promisify(fs.copyFile);

findPodfilePaths(projectRoot)
.map(removeLastPathComponent)
const iosFolderPath = config?.project.ios?.sourceDir ?? '';

findPodfilePaths(iosFolderPath)
.map((podfilePath) =>
removeLastPathComponent(path.join(iosFolderPath, podfilePath)),
)
// avoid overriding existing .xcode.env
.filter(pathDoesNotHaveXcodeEnvFile)
.forEach(async (pathString: string) => {
const destFilePath = pathString + pathSeparator + xcodeEnvFile;
const destFilePath = path.join(pathString, xcodeEnvFile);
await copyFileAsync(src, destFilePath);
});
loader.succeed('.xcode.env file have been created!');
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-doctor/src/tools/versionRanges.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
// Common
NODE_JS: '>= 16',
NODE_JS: '>= 18',
YARN: '>= 1.10.x',
NPM: '>= 4.x',
RUBY: '>= 2.6.10',
JAVA: '>= 11 < 19',
JAVA: '>= 17 <= 20',
// Android
ANDROID_SDK: '>= 33.x',
ANDROID_NDK: '>= 23.x',
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-hermes/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@react-native-community/cli-hermes",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-platform-android": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-platform-android": "12.0.0-alpha.8",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"hermes-profile-transformer": "^0.0.6",
"ip": "^1.1.5"
Expand All @@ -20,7 +20,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.7",
"@react-native-community/cli-types": "12.0.0-alpha.8",
"@types/ip": "^1.1.0"
},
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-hermes",
Expand Down
8 changes: 0 additions & 8 deletions packages/cli-platform-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ Builds your app and starts it on a connected Android emulator or device.

#### Options

#### `--variant <string>`

> **DEPRECATED** – use "mode" instead
> default: 'debug'
Specify your app's build variant.

#### `--appId <string>`

Specify an `applicationId` to launch after build. If not specified, `package` from AndroidManifest.xml will be used.
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-platform-android/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@react-native-community/cli-platform-android",
"version": "12.0.0-alpha.7",
"version": "12.0.0-alpha.8",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.8",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"glob": "^7.1.3",
Expand All @@ -20,8 +20,8 @@
"native_modules.gradle"
],
"devDependencies": {
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.7",
"@react-native-community/cli-types": "12.0.0-alpha.7",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.8",
"@react-native-community/cli-types": "12.0.0-alpha.8",
"@types/fs-extra": "^8.1.0",
"@types/glob": "^7.1.1"
},
Expand Down
Loading

0 comments on commit 061fea1

Please sign in to comment.