expo-dev-client 0.6.3 → 0.7.0
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 +6 -0
- package/README.md +7 -3
- package/android/build.gradle +1 -1
- package/e2e/DevLauncher.e2e.ts +24 -9
- package/e2e/config.json +1 -1
- package/package.json +6 -6
- package/plugin/build/withDevClient.js +9 -9
- package/plugin/build/withGeneratedAndroidScheme.d.ts +2 -3
- package/plugin/build/withGeneratedAndroidScheme.js +13 -5
- package/plugin/build/withGeneratedIosScheme.d.ts +2 -3
- package/plugin/build/withGeneratedIosScheme.js +13 -6
- package/plugin/src/withDevClient.ts +3 -3
- package/plugin/src/withGeneratedAndroidScheme.ts +16 -4
- package/plugin/src/withGeneratedIosScheme.ts +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.7.0 — 2021-12-03
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- [plugin] Fix android adding duplicate schemes. ([#15057](https://github.com/expo/expo/pull/15057) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
|
|
13
19
|
## 0.6.3 — 2021-10-21
|
|
14
20
|
|
|
15
21
|
_This version does not introduce any user-facing changes._
|
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,
|
|
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.
|
|
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).
|
package/android/build.gradle
CHANGED
package/e2e/DevLauncher.e2e.ts
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { element, expect, waitFor, by, device } from 'detox';
|
|
2
2
|
|
|
3
|
-
const MenuTimeout =
|
|
4
|
-
const LauncherMainScreenTimeout =
|
|
5
|
-
const LocalAppTimeout =
|
|
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
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-dev-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Expo Development Client",
|
|
5
5
|
"main": "build/DevClient.js",
|
|
6
6
|
"types": "build/DevClient.d.ts",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"homepage": "https://docs.expo.dev/clients/introduction/",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@expo/config-plugins": "^4.0.2",
|
|
35
|
-
"expo-dev-launcher": "0.
|
|
36
|
-
"expo-dev-menu": "0.8.
|
|
35
|
+
"expo-dev-launcher": "0.9.0",
|
|
36
|
+
"expo-dev-menu": "0.8.5",
|
|
37
37
|
"expo-dev-menu-interface": "0.4.1",
|
|
38
38
|
"expo-manifests": "~0.2.2",
|
|
39
39
|
"expo-updates-interface": "~0.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"expo-module-scripts": "^2.0.0",
|
|
43
|
-
"expo-test-runner": "0.0.
|
|
43
|
+
"expo-test-runner": "0.0.7"
|
|
44
44
|
},
|
|
45
45
|
"jest": {
|
|
46
|
-
"preset": "expo-module-scripts
|
|
46
|
+
"preset": "expo-module-scripts"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "33c06f161723dc5b6099b9d7eded686bd92c7bbf"
|
|
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 =
|
|
15
|
-
const withGeneratedIosScheme_1 =
|
|
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.
|
|
54
|
-
config = withGeneratedIosScheme_1.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
15
|
-
|
|
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 {
|
|
2
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
16
|
-
|
|
19
|
+
|
|
20
|
+
if (!IOSConfig.Scheme.hasScheme(scheme, infoPlist)) {
|
|
21
|
+
infoPlist = IOSConfig.Scheme.appendScheme(scheme, infoPlist);
|
|
22
|
+
}
|
|
23
|
+
return infoPlist;
|
|
17
24
|
}
|