Skip to content

Commit

Permalink
chore(react-native): remove deprecated options for v17 (#19537)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi authored Oct 13, 2023
1 parent 6e2dba9 commit 6e599d7
Show file tree
Hide file tree
Showing 39 changed files with 4 additions and 582 deletions.
8 changes: 0 additions & 8 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -6610,14 +6610,6 @@
"isExternal": false,
"disableCollapsible": false
},
{
"id": "download",
"path": "/nx-api/expo/executors/download",
"name": "download",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "run",
"path": "/nx-api/expo/executors/run",
Expand Down
9 changes: 0 additions & 9 deletions docs/generated/manifests/nx-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,6 @@
"path": "/nx-api/expo/executors/build-list",
"type": "executor"
},
"/nx-api/expo/executors/download": {
"description": "Download an EAS build",
"file": "generated/packages/expo/executors/download.json",
"hidden": false,
"name": "download",
"originalFilePath": "/packages/expo/src/executors/download/schema.json",
"path": "/nx-api/expo/executors/download",
"type": "executor"
},
"/nx-api/expo/executors/run": {
"description": "Run the Android app binary locally or run the iOS app binary locally",
"file": "generated/packages/expo/executors/run.json",
Expand Down
9 changes: 0 additions & 9 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,15 +731,6 @@
"path": "expo/executors/build-list",
"type": "executor"
},
{
"description": "Download an EAS build",
"file": "generated/packages/expo/executors/download.json",
"hidden": false,
"name": "download",
"originalFilePath": "/packages/expo/src/executors/download/schema.json",
"path": "expo/executors/download",
"type": "executor"
},
{
"description": "Run the Android app binary locally or run the iOS app binary locally",
"file": "generated/packages/expo/executors/run.json",
Expand Down
66 changes: 0 additions & 66 deletions docs/generated/packages/expo/executors/download.json

This file was deleted.

7 changes: 0 additions & 7 deletions docs/generated/packages/expo/executors/run.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@
"description": "Device name or UDID to build the app on. The value is not required if you have a single device connected.",
"alias": "d"
},
"sync": {
"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": {
"type": "number",
"description": "Port to start the Metro bundler on",
Expand Down
6 changes: 0 additions & 6 deletions docs/generated/packages/expo/executors/start.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@
"offline": {
"type": "boolean",
"description": "Allows this command to run while offline"
},
"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
}
},
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Specify starting on platform\" %}\nThe `ios`, `android` and `web` option allows you to start the server on different platforms.\n\nOpens your app in Expo Go in a currently running iOS simulator on your computer:\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"ios\": true\n }\n }\n```\n\nOpens your app in Expo Go on a connected Android device\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"android\": true\n }\n }\n```\n\nOpens your app in a web browser:\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"web\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Specify the host\" %}\nThe `host` option allows you to specify the type of host to use. `lan` uses the local network; `tunnel` ues any network by tunnel through ngrok; `localhost` connects to the dev server over localhost.\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"host\": \"localhost\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `clear` option allows you to remove Metro bundler cache.\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"clear\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
Expand Down
27 changes: 0 additions & 27 deletions docs/generated/packages/react-native/executors/build-android.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,13 @@
{ "name": "Build Android with a specific mode", "keys": ["mode"] }
],
"properties": {
"apk": {
"type": "boolean",
"description": "Generate apk file(s) rather than a bundle (`.aab`).",
"x-deprecated": "Use `tasks` option instead, e.g. `tasks=['bundleRelease']` to generate aab, `tasks=['assembleDebug']` to generate apk. Will be removed in Nx 17."
},
"debug": {
"type": "boolean",
"description": "Generate a debug build instead of a release build.",
"x-deprecated": "Use `mode` option instead, e.g. `mode='debug'`. Deprecated from @react-native-community/cli. Will be removed in Nx 17."
},
"gradleTask": {
"type": "string",
"description": "Override default gradle task incase of multi build variants",
"x-deprecated": "Use `tasks` option instead, e.g. `tasks=['assembleDebug']`. Will be removed in Nx 17."
},
"mode": {
"type": "string",
"description": "Specify your app's build variant",
"default": "debug",
"examples": ["debug", "release"],
"x-priority": "important"
},
"packager": {
"type": "boolean",
"description": "Launch packager while building",
"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.",
Expand Down Expand Up @@ -85,12 +64,6 @@
"type": "boolean",
"description": "Explicitly select build type and flavour to use before running a build"
},
"sync": {
"type": "boolean",
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
"default": true,
"x-deprecated": "Add sync-deps to dependsOn instead"
},
"resetCache": {
"type": "boolean",
"description": "Resets metro cache.",
Expand Down
18 changes: 0 additions & 18 deletions docs/generated/packages/react-native/executors/build-ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,10 @@
],
"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": {
"type": "boolean",
"description": "Resets metro cache.",
"default": false
},
"packager": {
"type": "boolean",
"description": "Launch packager while building",
"default": true,
"x-deprecated": "Run `nx run <project>:start` instead. Will be removed in Nx 17."
}
},
"required": [],
Expand Down
12 changes: 0 additions & 12 deletions docs/generated/packages/react-native/executors/run-android.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@
{ "name": "Run Android without metro cache", "keys": ["resetCache"] }
],
"properties": {
"variant": {
"type": "string",
"description": "Specify your app's build variant (e.g. `debug`, `release`).",
"default": "debug",
"examples": ["debug", "release"],
"x-deprecated": "Deprecated from @react-native-community/cli, use mode instead, e.g. mode=debug. Will be remove in Nx 17."
},
"jetifier": {
"type": "boolean",
"description": "Run Jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet.",
"x-deprecated": "Deprecated from @react-native-community/cli. Will be remove in Nx 17."
},
"appId": {
"type": "string",
"description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used."
Expand Down
7 changes: 0 additions & 7 deletions docs/generated/packages/react-native/executors/run-ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
{ "name": "Run iOS on a device with udid", "keys": ["udid"] }
],
"properties": {
"xcodeConfiguration": {
"type": "string",
"description": "Explicitly set the Xcode configuration to use.",
"default": "Debug",
"examples": ["Debug", "Release"],
"x-deprecated": "Use `mode` instead. Deprecated from @react-native-community/cli. Will be removed in Nx 17."
},
"simulator": {
"type": "string",
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
Expand Down
6 changes: 0 additions & 6 deletions docs/generated/packages/react-native/executors/storybook.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
"type": "string",
"description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with `**/*...` must be escaped with quotes",
"default": "**/*.stories.@(js|jsx|ts|tsx|md)"
},
"silent": {
"type": "boolean",
"description": "Silences output.",
"default": false,
"x-deprecated": "No longer used. It will be silent as default."
}
},
"required": ["searchDir", "outputFile", "pattern"],
Expand Down
1 change: 0 additions & 1 deletion docs/shared/reference/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@
- [update](/nx-api/expo/executors/update)
- [build](/nx-api/expo/executors/build)
- [build-list](/nx-api/expo/executors/build-list)
- [download](/nx-api/expo/executors/download)
- [run](/nx-api/expo/executors/run)
- [start](/nx-api/expo/executors/start)
- [sync-deps](/nx-api/expo/executors/sync-deps)
Expand Down
10 changes: 0 additions & 10 deletions packages/expo/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
"schema": "./src/executors/build-list/schema.json",
"description": "List all EAS builds for your Expo project"
},
"download": {
"implementation": "./src/executors/download/download.impl",
"schema": "./src/executors/download/schema.json",
"description": "Download an EAS build"
},
"run": {
"implementation": "./src/executors/run/run.impl",
"schema": "./src/executors/run/schema.json",
Expand Down Expand Up @@ -77,11 +72,6 @@
"schema": "./src/executors/build-list/schema.json",
"description": "List all EAS builds for your Expo project"
},
"download": {
"implementation": "./src/executors/download/compat",
"schema": "./src/executors/download/schema.json",
"description": "Download an EAS build"
},
"run": {
"implementation": "./src/executors/run/compat",
"schema": "./src/executors/run/schema.json",
Expand Down
1 change: 0 additions & 1 deletion packages/expo/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { expoInitGenerator } from './src/generators/init/init';
export { expoApplicationGenerator } from './src/generators/application/application';
export { withNxMetro } from './plugins/with-nx-metro';
export { withNxWebpack } from './plugins/with-nx-webpack';
2 changes: 0 additions & 2 deletions packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
"fs-extra": "^11.1.0",
"metro-config": "0.76.7",
"metro-resolver": "0.76.7",
"node-fetch": "^2.6.7",
"tar-fs": "^2.1.1",
"tslib": "^2.3.0",
"tsconfig-paths": "^4.1.2",
"tsconfig-paths-webpack-plugin": "^4.0.0",
Expand Down
4 changes: 0 additions & 4 deletions packages/expo/plugins/with-nx-metro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import { getResolveRequest } from './metro-resolver';
interface WithNxOptions {
debug?: boolean;
extensions?: string[];
/**
* @deprecated TODO(v17) in the metro.config.js, pass in to the getDefaultConfig instead: getDefaultConfig(__dirname)
*/
projectRoot?: string;
watchFolders?: string[];
}

Expand Down
23 changes: 2 additions & 21 deletions packages/expo/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { ExecutorContext, names, output } from '@nx/devkit';
import { normalize, sep, resolve as pathResolve, dirname } from 'path';
import { ExecutorContext, names } from '@nx/devkit';
import { resolve as pathResolve } from 'path';
import { ChildProcess, fork } from 'child_process';

import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
import { unzipBuild } from '../download/download.impl';

import { ExpoEasBuildOptions } from './schema';
import { removeSync } from 'fs-extra';

export interface ReactNativeBuildOutput {
success: boolean;
Expand All @@ -22,22 +18,7 @@ export default async function* buildExecutor(
context.projectsConfigurations.projects[context.projectName].root;

try {
// remove the output app if it already existed
if (options.local && options.output) {
removeSync(options.output);
if (options.output.endsWith('.tar.gz')) {
// remove unzipped app if it already existed
removeSync(options.output.replace('.tar.gz', '.app'));
}
}

await runCliBuild(context.root, projectRoot, options);

// unzip the build if it's a tar.gz
if (options.local && options.output && options.output.endsWith('.tar.gz')) {
const outputDirectory = dirname(options.output);
await unzipBuild(options.output, outputDirectory);
}
yield { success: true };
} finally {
if (childProcess) {
Expand Down
5 changes: 0 additions & 5 deletions packages/expo/src/executors/download/compat.ts

This file was deleted.

Loading

1 comment on commit 6e599d7

@vercel
Copy link

@vercel vercel bot commented on 6e599d7 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.