expo-dev-client 0.6.2 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,24 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.7.2 — 2021-12-15
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 0.7.1 — 2021-12-03
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
21
+ ## 0.7.0 — 2021-12-03
22
+
23
+ ### 🐛 Bug fixes
24
+
25
+ - [plugin] Fix android adding duplicate schemes. ([#15057](https://github.com/expo/expo/pull/15057) by [@EvanBacon](https://github.com/EvanBacon))
26
+
27
+ ## 0.6.3 — 2021-10-21
28
+
29
+ _This version does not introduce any user-facing changes._
30
+
13
31
  ## 0.6.2 — 2021-10-15
14
32
 
15
33
  _This version does not introduce any user-facing changes._
@@ -22,23 +40,7 @@ _This version does not introduce any user-facing changes._
22
40
 
23
41
  ### 🛠 Breaking changes
24
42
 
25
- - Added a native dependency on the `expo-manifests` package. ([#14461](https://github.com/expo/expo/pull/14461) by [@esamelson](https://github.com/esamelson))
26
- - This is a breaking change for projects **without `react-native-unimodules` or `expo-modules-core` installed**. In order to upgrade from `expo-dev-client@0.5.1` or below to this version in such projects, the following changes must be made:
27
- - In `ios/Podfile`, change the deployment target to `platform :ios, '12.0'` and add the following lines inside the main target:
28
- ```ruby
29
- pod 'EXJSONUtils', path: '../node_modules/expo-json-utils/ios', :configurations => :debug
30
- pod 'EXManifests', path: '../node_modules/expo-manifests/ios', :configurations => :debug
31
- ```
32
- - In `android/settings.gradle`, add the following lines:
33
- ```groovy
34
- include ':expo-json-utils'
35
- project(':expo-json-utils').projectDir = new File('../node_modules/expo-json-utils/android')
36
-
37
- ```
38
- include ':expo-manifests'
39
- project(':expo-manifests').projectDir = new File('../node_modules/expo-manifests/android')
40
- ```
41
- - No additional setup is necessary for projects already using `react-native-unimodules` or `expo-modules-core`.
43
+ - Added a native dependency on the `expo-manifests` package. **Projects without `react-native-unimodules` or `expo-modules-core` installed will need to follow the upgrade guide [here](https://docs.expo.dev/clients/upgrading/) when upgrading from an older version of this package.** ([#14461](https://github.com/expo/expo/pull/14461) by [@esamelson](https://github.com/esamelson))
42
44
  - Replace Android DevLauncherManifest class with `expo-manifests`. ([#14462](https://github.com/expo/expo/pull/14462) by [@esamelson](https://github.com/esamelson))
43
45
 
44
46
  ### 🐛 Bug fixes
package/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # expo-dev-client
2
2
 
3
- `expo-dev-client` is an npm package installable in any Expo or React Native project. Once installed, any Debug builds of your application will gain an extensible debug menu and the ability to load projects from Expo CLI. Release builds of your application will not change other than the addition of a few header files. Your debug builds can be shared with anyone on your team who needs to work on or review your application. Your team can develop the JavaScript portion of your application with expo-cli and your custom client without waiting for your native code to build until the
3
+ `expo-dev-client` is an npm package installable in any Expo or React Native project. Once installed, Debug builds of your application will gain an extensible debug menu and the ability to load projects from Expo CLI. Release builds of your application will not change other than the addition of a few header files. Your debug builds can be shared with anyone on your team who needs to work on or review your application. Your team can develop the JavaScript portion of your application with expo-cli and your custom client without waiting for your native code to build until the
4
4
  next time you need to upgrade, install a new module, or otherwise change the native code in your project.
5
5
 
6
6
  ## Documentation
7
7
 
8
- You can find the documentation under [https://docs.expo.io/clients/introduction](https://docs.expo.io/clients/introduction).
8
+ You can find the documentation under [https://docs.expo.io/clients/introduction](https://docs.expo.dev/clients/introduction).
9
+
10
+ ## Issues
11
+
12
+ If you encounter any issues using this package in your project, please [report your issue here](https://github.com/expo/expo/issues/new?template=dev_client_bug_report.yml).
9
13
 
10
14
  ## Contributing
11
15
 
12
- Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
16
+ Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
@@ -23,7 +23,7 @@ android {
23
23
  minSdkVersion safeExtGet('minSdkVersion', 21)
24
24
  targetSdkVersion safeExtGet('targetSdkVersion', 30)
25
25
  versionCode 1
26
- versionName "0.6.2"
26
+ versionName "0.7.2"
27
27
 
28
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29
29
  }
@@ -1,8 +1,28 @@
1
1
  import { element, expect, waitFor, by, device } from 'detox';
2
2
 
3
- const MenuTimeout = 50000;
4
- const LauncherMainScreenTimeout = 30000;
5
- const LocalAppTimeout = 60000;
3
+ const MenuTimeout = 70 * 1000;
4
+ const LauncherMainScreenTimeout = 50 * 1000;
5
+ const LocalAppTimeout = 80 * 1000;
6
+
7
+ const sleep = (duration: number) =>
8
+ new Promise<void>((resolve) => setTimeout(() => resolve(), duration));
9
+
10
+ async function pressMenuButton(buttonString: string) {
11
+ let button = element(by.text(buttonString));
12
+
13
+ await waitFor(button).toBeVisible().withTimeout(MenuTimeout);
14
+
15
+ // When we open the dev-menu, we will see an animation.
16
+ // Unfortunately, if we try to click to button before the
17
+ // animation finishes, it may not work. We might click different a button.
18
+ // So try to wait for the animation to finish.
19
+ await sleep(1000);
20
+
21
+ button = element(by.text(buttonString));
22
+ await waitFor(button).toBeVisible();
23
+
24
+ await button.tap();
25
+ }
6
26
 
7
27
  function getInvocationManager() {
8
28
  // @ts-ignore
@@ -90,12 +110,7 @@ describe('DevLauncher', () => {
90
110
 
91
111
  await openMenu();
92
112
 
93
- const backToLauncher = element(by.text('Back to Launcher'));
94
-
95
- await waitFor(backToLauncher)
96
- .toBeVisible()
97
- .withTimeout(MenuTimeout);
98
- await backToLauncher.tap();
113
+ await pressMenuButton('Back to Launcher');
99
114
 
100
115
  await waitFor(element(by.id('DevLauncherMainScreen')))
101
116
  .toBeVisible()
package/e2e/config.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "maxWorkers": 1,
3
3
  "testEnvironment": "./environments",
4
4
  "testRunner": "jest-circus/runner",
5
- "testTimeout": 120000,
5
+ "testTimeout": 180000,
6
6
  "testRegex": "\\.e2e\\.ts$",
7
7
  "reporters": ["detox/runners/jest/streamlineReporter"],
8
8
  "verbose": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-client",
3
- "version": "0.6.2",
3
+ "version": "0.7.2",
4
4
  "description": "Expo Development Client",
5
5
  "main": "build/DevClient.js",
6
6
  "types": "build/DevClient.d.ts",
@@ -31,19 +31,19 @@
31
31
  "license": "MIT",
32
32
  "homepage": "https://docs.expo.dev/clients/introduction/",
33
33
  "dependencies": {
34
- "@expo/config-plugins": "^3.1.0",
35
- "expo-dev-launcher": "0.8.3",
36
- "expo-dev-menu": "0.8.3",
37
- "expo-dev-menu-interface": "0.4.1",
34
+ "@expo/config-plugins": "^4.0.2",
35
+ "expo-dev-launcher": "0.9.1",
36
+ "expo-dev-menu": "0.8.6",
37
+ "expo-dev-menu-interface": "0.4.2",
38
38
  "expo-manifests": "~0.2.2",
39
- "expo-updates-interface": "~0.4.0"
39
+ "expo-updates-interface": "~0.5.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "expo-module-scripts": "^2.0.0",
43
- "expo-test-runner": "0.0.6"
43
+ "expo-test-runner": "0.0.7"
44
44
  },
45
45
  "jest": {
46
- "preset": "expo-module-scripts/ios"
46
+ "preset": "expo-module-scripts"
47
47
  },
48
- "gitHead": "0c95f1a98b42c44ebb7824d96187f9775f5d415b"
48
+ "gitHead": "58a32c58b6532ec0e14df10b772fa33f7657fbcc"
49
49
  }
@@ -11,8 +11,8 @@ const app_plugin_2 = __importDefault(require("expo-dev-menu/app.plugin"));
11
11
  const fs_1 = __importDefault(require("fs"));
12
12
  const path_1 = __importDefault(require("path"));
13
13
  const constants_1 = require("./constants");
14
- const withGeneratedAndroidScheme_1 = __importDefault(require("./withGeneratedAndroidScheme"));
15
- const withGeneratedIosScheme_1 = __importDefault(require("./withGeneratedIosScheme"));
14
+ const withGeneratedAndroidScheme_1 = require("./withGeneratedAndroidScheme");
15
+ const withGeneratedIosScheme_1 = require("./withGeneratedIosScheme");
16
16
  const pkg = require('expo-dev-client/package.json');
17
17
  const REACT_NATIVE_CONFIG_JS = `// File created by expo-dev-client/app.plugin.js
18
18
 
@@ -23,8 +23,8 @@ module.exports = {
23
23
  };
24
24
  `;
25
25
  function withReactNativeConfigJs(config) {
26
- config = config_plugins_1.withDangerousMod(config, ['android', addReactNativeConfigAsync]);
27
- config = config_plugins_1.withDangerousMod(config, ['ios', addReactNativeConfigAsync]);
26
+ config = (0, config_plugins_1.withDangerousMod)(config, ['android', addReactNativeConfigAsync]);
27
+ config = (0, config_plugins_1.withDangerousMod)(config, ['ios', addReactNativeConfigAsync]);
28
28
  return config;
29
29
  }
30
30
  const addReactNativeConfigAsync = async (config) => {
@@ -47,11 +47,11 @@ const addReactNativeConfigAsync = async (config) => {
47
47
  return config;
48
48
  };
49
49
  function withDevClient(config) {
50
- config = app_plugin_2.default(config);
51
- config = app_plugin_1.default(config);
50
+ config = (0, app_plugin_2.default)(config);
51
+ config = (0, app_plugin_1.default)(config);
52
52
  config = withReactNativeConfigJs(config);
53
- config = withGeneratedAndroidScheme_1.default(config);
54
- config = withGeneratedIosScheme_1.default(config);
53
+ config = (0, withGeneratedAndroidScheme_1.withGeneratedAndroidScheme)(config);
54
+ config = (0, withGeneratedIosScheme_1.withGeneratedIosScheme)(config);
55
55
  return config;
56
56
  }
57
- exports.default = config_plugins_1.createRunOncePlugin(withDevClient, pkg.name, pkg.version);
57
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withDevClient, pkg.name, pkg.version);
@@ -1,5 +1,4 @@
1
- import { AndroidManifest } from '@expo/config-plugins';
1
+ import { AndroidManifest, ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
- declare const _default: import("@expo/config-plugins").ConfigPlugin<void>;
4
- export default _default;
3
+ export declare const withGeneratedAndroidScheme: ConfigPlugin;
5
4
  export declare function setGeneratedAndroidScheme(config: Pick<ExpoConfig, 'scheme' | 'slug'>, androidManifest: AndroidManifest): AndroidManifest;
@@ -3,14 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.setGeneratedAndroidScheme = void 0;
6
+ exports.setGeneratedAndroidScheme = exports.withGeneratedAndroidScheme = void 0;
7
7
  const config_plugins_1 = require("@expo/config-plugins");
8
- const android_plugins_1 = require("@expo/config-plugins/build/plugins/android-plugins");
9
8
  const getDefaultScheme_1 = __importDefault(require("./getDefaultScheme"));
10
- exports.default = android_plugins_1.createAndroidManifestPlugin(setGeneratedAndroidScheme, 'withGeneratedAndroidScheme');
9
+ const withGeneratedAndroidScheme = (config) => {
10
+ return (0, config_plugins_1.withAndroidManifest)(config, (config) => {
11
+ config.modResults = setGeneratedAndroidScheme(config, config.modResults);
12
+ return config;
13
+ });
14
+ };
15
+ exports.withGeneratedAndroidScheme = withGeneratedAndroidScheme;
11
16
  function setGeneratedAndroidScheme(config, androidManifest) {
12
17
  // Generate a cross-platform scheme used to launch the dev client.
13
- const scheme = getDefaultScheme_1.default(config);
14
- return config_plugins_1.AndroidConfig.Scheme.appendScheme(scheme, androidManifest);
18
+ const scheme = (0, getDefaultScheme_1.default)(config);
19
+ if (!config_plugins_1.AndroidConfig.Scheme.hasScheme(scheme, androidManifest)) {
20
+ androidManifest = config_plugins_1.AndroidConfig.Scheme.appendScheme(scheme, androidManifest);
21
+ }
22
+ return androidManifest;
15
23
  }
16
24
  exports.setGeneratedAndroidScheme = setGeneratedAndroidScheme;
@@ -1,5 +1,4 @@
1
- import { IOSConfig, InfoPlist } from '@expo/config-plugins';
1
+ import { IOSConfig, InfoPlist, ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
- declare const _default: import("@expo/config-plugins").ConfigPlugin<void>;
4
- export default _default;
3
+ export declare const withGeneratedIosScheme: ConfigPlugin;
5
4
  export declare function setGeneratedIosScheme(config: Pick<ExpoConfig, 'scheme' | 'slug'>, infoPlist: InfoPlist): IOSConfig.InfoPlist;
@@ -3,15 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.setGeneratedIosScheme = void 0;
6
+ exports.setGeneratedIosScheme = exports.withGeneratedIosScheme = void 0;
7
7
  const config_plugins_1 = require("@expo/config-plugins");
8
- const ios_plugins_1 = require("@expo/config-plugins/build/plugins/ios-plugins");
9
8
  const getDefaultScheme_1 = __importDefault(require("./getDefaultScheme"));
10
- exports.default = ios_plugins_1.createInfoPlistPlugin(setGeneratedIosScheme, 'withGeneratedIosScheme');
9
+ const withGeneratedIosScheme = (config) => {
10
+ return (0, config_plugins_1.withInfoPlist)(config, (config) => {
11
+ config.modResults = setGeneratedIosScheme(config, config.modResults);
12
+ return config;
13
+ });
14
+ };
15
+ exports.withGeneratedIosScheme = withGeneratedIosScheme;
11
16
  function setGeneratedIosScheme(config, infoPlist) {
12
17
  // Generate a cross-platform scheme used to launch the dev client.
13
- const scheme = getDefaultScheme_1.default(config);
14
- const result = config_plugins_1.IOSConfig.Scheme.appendScheme(scheme, infoPlist);
15
- return result;
18
+ const scheme = (0, getDefaultScheme_1.default)(config);
19
+ if (!config_plugins_1.IOSConfig.Scheme.hasScheme(scheme, infoPlist)) {
20
+ infoPlist = config_plugins_1.IOSConfig.Scheme.appendScheme(scheme, infoPlist);
21
+ }
22
+ return infoPlist;
16
23
  }
17
24
  exports.setGeneratedIosScheme = setGeneratedIosScheme;
@@ -8,8 +8,8 @@ import fs from 'fs';
8
8
  import path from 'path';
9
9
 
10
10
  import { InstallationPage } from './constants';
11
- import withGeneratedAndroidScheme from './withGeneratedAndroidScheme';
12
- import withGeneratedIosScheme from './withGeneratedIosScheme';
11
+ import { withGeneratedAndroidScheme } from './withGeneratedAndroidScheme';
12
+ import { withGeneratedIosScheme } from './withGeneratedIosScheme';
13
13
 
14
14
  const pkg = require('expo-dev-client/package.json');
15
15
 
@@ -37,7 +37,7 @@ const addReactNativeConfigAsync: Mod = async (config) => {
37
37
  `Could not add expo-dev-client dependencies to existing file ${filename}. See expo-dev-client installation instructions to add them manually: ${InstallationPage}`
38
38
  );
39
39
  }
40
- } catch (error) {
40
+ } catch (error: any) {
41
41
  if (error.code === 'ENOENT') {
42
42
  // The file doesn't exist, so we create it.
43
43
  fs.writeFileSync(filename, REACT_NATIVE_CONFIG_JS);
@@ -1,10 +1,19 @@
1
- import { AndroidConfig, AndroidManifest } from '@expo/config-plugins';
2
- import { createAndroidManifestPlugin } from '@expo/config-plugins/build/plugins/android-plugins';
1
+ import {
2
+ AndroidConfig,
3
+ AndroidManifest,
4
+ ConfigPlugin,
5
+ withAndroidManifest,
6
+ } from '@expo/config-plugins';
3
7
  import { ExpoConfig } from '@expo/config-types';
4
8
 
5
9
  import getDefaultScheme from './getDefaultScheme';
6
10
 
7
- export default createAndroidManifestPlugin(setGeneratedAndroidScheme, 'withGeneratedAndroidScheme');
11
+ export const withGeneratedAndroidScheme: ConfigPlugin = (config) => {
12
+ return withAndroidManifest(config, (config) => {
13
+ config.modResults = setGeneratedAndroidScheme(config, config.modResults);
14
+ return config;
15
+ });
16
+ };
8
17
 
9
18
  export function setGeneratedAndroidScheme(
10
19
  config: Pick<ExpoConfig, 'scheme' | 'slug'>,
@@ -12,5 +21,8 @@ export function setGeneratedAndroidScheme(
12
21
  ): AndroidManifest {
13
22
  // Generate a cross-platform scheme used to launch the dev client.
14
23
  const scheme = getDefaultScheme(config);
15
- return AndroidConfig.Scheme.appendScheme(scheme, androidManifest);
24
+ if (!AndroidConfig.Scheme.hasScheme(scheme, androidManifest)) {
25
+ androidManifest = AndroidConfig.Scheme.appendScheme(scheme, androidManifest);
26
+ }
27
+ return androidManifest;
16
28
  }
@@ -1,10 +1,14 @@
1
- import { IOSConfig, InfoPlist } from '@expo/config-plugins';
2
- import { createInfoPlistPlugin } from '@expo/config-plugins/build/plugins/ios-plugins';
1
+ import { IOSConfig, InfoPlist, withInfoPlist, ConfigPlugin } from '@expo/config-plugins';
3
2
  import { ExpoConfig } from '@expo/config-types';
4
3
 
5
4
  import getDefaultScheme from './getDefaultScheme';
6
5
 
7
- export default createInfoPlistPlugin(setGeneratedIosScheme, 'withGeneratedIosScheme');
6
+ export const withGeneratedIosScheme: ConfigPlugin = (config) => {
7
+ return withInfoPlist(config, (config) => {
8
+ config.modResults = setGeneratedIosScheme(config, config.modResults);
9
+ return config;
10
+ });
11
+ };
8
12
 
9
13
  export function setGeneratedIosScheme(
10
14
  config: Pick<ExpoConfig, 'scheme' | 'slug'>,
@@ -12,6 +16,9 @@ export function setGeneratedIosScheme(
12
16
  ): IOSConfig.InfoPlist {
13
17
  // Generate a cross-platform scheme used to launch the dev client.
14
18
  const scheme = getDefaultScheme(config);
15
- const result = IOSConfig.Scheme.appendScheme(scheme, infoPlist);
16
- return result;
19
+
20
+ if (!IOSConfig.Scheme.hasScheme(scheme, infoPlist)) {
21
+ infoPlist = IOSConfig.Scheme.appendScheme(scheme, infoPlist);
22
+ }
23
+ return infoPlist;
17
24
  }