Skip to content

Commit

Permalink
feat(react-native): upgrade react-native to 0.72.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jul 8, 2023
1 parent 38fa586 commit 2287cc0
Show file tree
Hide file tree
Showing 90 changed files with 1,567 additions and 860 deletions.
6 changes: 4 additions & 2 deletions docs/generated/packages/expo/documents/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ nx start my-app
To generate a new library run:

```shell
npx nx g @nx/react-native:lib your-lib-name
npx nx g @nx/expo:lib your-lib-name
```

### Generating Components

To generate a new component inside library run:

```shell
npx nx g @nx/react-native:component your-component-name --project=your-lib-name --export
npx nx g @nx/expo:component your-component-name --project=your-lib-name --export
```

Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`
Expand Down Expand Up @@ -269,6 +269,8 @@ Below table is a map between expo commands and Nx commands:
| `expo install` | `nx install <app-name>` |
| `eas build` | `nx build <app-name>` |
| `eas build:list` | `nx build-list <app-name>` |
| `eas update` | `nx update <app-name>` |
| `eas submit` | `nx submit <app-name>` |

## More Documentation

Expand Down
3 changes: 2 additions & 1 deletion docs/generated/packages/expo/executors/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
},
"output": {
"type": "string",
"description": "Output path for local build"
"description": "Output path for local build",
"examples": ["../../dist/MyApp.tar.gz", "../../dist"]
},
"wait": {
"type": "boolean",
Expand Down
1 change: 1 addition & 0 deletions docs/generated/packages/expo/executors/run.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"type": "boolean",
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
"default": true,
"x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
"x-priority": "internal"
},
"port": {
Expand Down
1 change: 1 addition & 0 deletions docs/generated/packages/expo/executors/start.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
"x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
"default": true
}
},
Expand Down
20 changes: 14 additions & 6 deletions docs/generated/packages/react-native/executors/build-android.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@
"packager": {
"type": "boolean",
"description": "Launch packager while building",
"default": true
"default": true,
"x-deprecated": "Run `nx run <project>:start` instead. Will be removed in Nx 17."
},
"port": {
"type": "number",
"description": "The port where the packager server is listening on.",
"default": 8081
},
"tasks": {
"type": "array",
"items": { "type": "string" },
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments.",
"examples": [
"assembleDebug",
Expand All @@ -71,8 +74,12 @@
"default": false
},
"extraParams": {
"type": "string",
"description": "Custom params passed to gradle build command"
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Custom params passed to gradle build command",
"examples": ["-x lint -x test"]
},
"interactive": {
"type": "boolean",
Expand All @@ -81,7 +88,8 @@
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"default": true
"default": true,
"x-deprecated": "Add sync-deps to dependsOn instead"
},
"resetCache": {
"type": "boolean",
Expand Down
16 changes: 9 additions & 7 deletions docs/generated/packages/react-native/executors/build-ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
"presets": [
{ "name": "Build iOS for a simulator", "keys": ["simulator"] },
{ "name": "Build iOS for a device", "keys": ["device"] },
{ "name": "Build iOS for a device with udid", "keys": ["udid"] },
{
"name": "Run `pod install` before building iOS app",
"keys": ["install"]
}
{ "name": "Build iOS for a device with udid", "keys": ["udid"] }
],
"properties": {
"simulator": {
Expand Down Expand Up @@ -72,17 +68,22 @@
"description": "Explicitly select which scheme and configuration to use before running a build"
},
"extraParams": {
"type": "string",
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Custom params that will be passed to xcodebuild command."
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"x-deprecated": "Add pod-install to dependsOn in project.json for this target instead",
"default": true
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
"default": true
},
"resetCache": {
Expand All @@ -93,7 +94,8 @@
"packager": {
"type": "boolean",
"description": "Launch packager while building",
"default": true
"default": true,
"x-deprecated": "Run `nx run <project>:start` instead. Will be removed in Nx 17."
}
},
"required": [],
Expand Down
12 changes: 11 additions & 1 deletion docs/generated/packages/react-native/executors/pod-install.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
"type": "object",
"properties": {
"buildFolder": {
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory",
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory.",
"type": "string",
"default": "./build"
},
"repoUpdate": {
"description": "Force running `pod repo update` before install.",
"type": "boolean",
"default": false
},
"deployment": {
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
"type": "boolean",
"default": false
}
},
"required": ["buildFolder"],
Expand Down
12 changes: 9 additions & 3 deletions docs/generated/packages/react-native/executors/run-android.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@
"default": 8081
},
"tasks": {
"type": "array",
"items": { "type": "string" },
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments.",
"examples": [
"assembleDebug",
Expand All @@ -95,7 +97,10 @@
"default": false
},
"extraParams": {
"type": "string",
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Custom params passed to gradle build command"
},
"interactive": {
Expand All @@ -105,6 +110,7 @@
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"x-deprecated": "Add sync-deps to dependsOn for this target in project.json instead",
"default": true
},
"resetCache": {
Expand Down
15 changes: 8 additions & 7 deletions docs/generated/packages/react-native/executors/run-ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
"presets": [
{ "name": "Run iOS on a simulator", "keys": ["simulator"] },
{ "name": "Run iOS on a device", "keys": ["device"] },
{ "name": "Run iOS on a device with udid", "keys": ["udid"] },
{
"name": "Run `pod install` before building iOS app",
"keys": ["install"]
}
{ "name": "Run iOS on a device with udid", "keys": ["udid"] }
],
"properties": {
"xcodeConfiguration": {
Expand Down Expand Up @@ -81,17 +77,22 @@
"description": "Explicitly select which scheme and configuration to use before running a build"
},
"extraParams": {
"type": "string",
"oneOf": [
{ "type": "array", "items": { "type": "string" } },
{ "type": "string" }
],
"description": "Custom params that will be passed to xcodebuild command."
},
"install": {
"type": "boolean",
"description": "Runs `pod install` for native modules before building iOS app.",
"default": true
"default": true,
"x-deprecated": "Add `pod-install` to dependsOn for this target in project.json instead."
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"x-deprecated": "Add `sync-deps` to dependsOn for this target in project.json instead.",
"default": true
},
"resetCache": {
Expand Down
6 changes: 4 additions & 2 deletions docs/shared/packages/expo/expo-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ nx start my-app
To generate a new library run:

```shell
npx nx g @nx/react-native:lib your-lib-name
npx nx g @nx/expo:lib your-lib-name
```

### Generating Components

To generate a new component inside library run:

```shell
npx nx g @nx/react-native:component your-component-name --project=your-lib-name --export
npx nx g @nx/expo:component your-component-name --project=your-lib-name --export
```

Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`
Expand Down Expand Up @@ -269,6 +269,8 @@ Below table is a map between expo commands and Nx commands:
| `expo install` | `nx install <app-name>` |
| `eas build` | `nx build <app-name>` |
| `eas build:list` | `nx build-list <app-name>` |
| `eas update` | `nx update <app-name>` |
| `eas submit` | `nx submit <app-name>` |

## More Documentation

Expand Down
8 changes: 3 additions & 5 deletions e2e/expo/src/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ describe('expo', () => {
expect(prebuildResult.combinedOutput).toContain('Config synced');
});

// TODO(emily): expo-cli always fetches the latest version of react native
// re-enable it when expo-cli is fixed
xit('should install', async () => {
it('should install', async () => {
// run install command
const installResults = await runCLIAsync(
`install ${appName} --no-interactive --check`
`install ${appName} --no-interactive`
);
expect(installResults.combinedOutput).toContain(
'Dependencies are up to date'
'Successfully ran target install'
);
});

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@
"magic-string": "~0.26.2",
"markdown-factory": "^0.0.6",
"memfs": "^3.0.1",
"metro-resolver": "^0.74.1",
"metro-config": "0.76.5",
"metro-resolver": "0.76.5",
"mini-css-extract-plugin": "~2.4.7",
"minimatch": "3.0.5",
"next-sitemap": "^3.1.10",
Expand Down
12 changes: 0 additions & 12 deletions packages/detox/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,6 @@ describe('detox application generator', () => {
'cd ../../../my-dir/my-app/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
type: 'android.apk',
},
'android.eas': {
binaryPath: '../../../my-dir/my-app/dist/MyDirMyApp.apk',
build:
'npx nx run my-dir-my-app:download --platform android --distribution simulator --output=../../../my-dir/my-app/dist/',
type: 'android.apk',
},
'android.local': {
binaryPath: '../../../my-dir/my-app/dist/MyDirMyApp.apk',
build:
Expand All @@ -368,12 +362,6 @@ describe('detox application generator', () => {
"cd ../../../my-dir/my-app/ios && xcodebuild -workspace MyDirMyApp.xcworkspace -scheme MyDirMyApp -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
type: 'ios.app',
},
'ios.eas': {
binaryPath: '../../../my-dir/my-app/dist/MyDirMyApp.app',
build:
'npx nx run my-dir-my-app:download --platform ios --distribution simulator --output=../../../my-dir/my-app/dist/',
type: 'ios.app',
},
'ios.local': {
binaryPath: '../../../my-dir/my-app/dist/MyDirMyApp.app',
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/ios/build/Build/Products/Release-iphonesimulator/<%= appClassName %>.app"
},
<% if (framework === 'expo') { %>
"ios.eas": {
"type": "ios.app",
"build": "<%= exec %> nx run <%= appFileName %>:download --platform ios --distribution simulator --output=<%= offsetFromRoot %><%= appRoot %>/dist/",
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.app"
},
"ios.local": {
"type": "ios.app",
"build": "<%= exec %> nx run <%= appFileName %>:build --platform ios --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.tar.gz",
Expand All @@ -42,11 +37,6 @@
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/android/app/build/outputs/apk/release/app-release.apk"
},
<% if (framework === 'expo') { %>
"android.eas": {
"type": "android.apk",
"build": "<%= exec %> nx run <%= appFileName %>:download --platform android --distribution simulator --output=<%= offsetFromRoot %><%= appRoot %>/dist/",
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk"
},
"android.local": {
"type": "android.apk",
"build": "<%= exec %> nx run <%= appFileName %>:build --platform android --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk",
Expand Down Expand Up @@ -78,10 +68,6 @@
"app": "ios.debug"
},
<% if (framework === 'expo') { %>
"ios.sim.eas": {
"device": "simulator",
"app": "ios.eas"
},
"ios.sim.local": {
"device": "simulator",
"app": "ios.local"
Expand All @@ -96,10 +82,6 @@
"app": "android.debug"
},
<% if (framework === 'expo') { %>
"android.emu.eas": {
"device": "emulator",
"app": "android.eas"
},
"android.emu.local": {
"device": "emulator",
"app": "android.local"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ describe('getTargets', () => {
it('should return ios test target for expo projects', () => {
expect(expoTestTarget('ios.sim', 'test')).toEqual({
options: {
detoxConfiguration: 'ios.sim.eas',
detoxConfiguration: 'ios.sim.local',
buildTarget: 'test:build-ios',
},
configurations: {
local: {
detoxConfiguration: 'ios.sim.local',
buildTarget: 'test:build-ios:local',
},
bare: {
detoxConfiguration: 'ios.sim.debug',
buildTarget: 'test:build-ios:bare',
Expand All @@ -27,12 +23,9 @@ describe('getTargets', () => {
it('should return ios build target for expo projects', () => {
expect(expoBuildTarget('ios.sim')).toEqual({
options: {
detoxConfiguration: 'ios.sim.eas',
detoxConfiguration: 'ios.sim.local',
},
configurations: {
local: {
detoxConfiguration: 'ios.sim.local',
},
bare: {
detoxConfiguration: 'ios.sim.debug',
},
Expand Down
Loading

0 comments on commit 2287cc0

Please sign in to comment.