Skip to content

Commit ac3dbf9

Browse files
authored
fix: expo optional dependencies import (#2118)
1 parent 6dddb36 commit ac3dbf9

File tree

7 files changed

+123
-50
lines changed

7 files changed

+123
-50
lines changed

examples/ExpoMessaging/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@
1212
"@react-navigation/elements": "^1.3.12",
1313
"@react-navigation/native": "6.1.1",
1414
"@react-navigation/stack": "6.3.10",
15-
"expo": "~48.0.11",
15+
"expo": "~48.0.15",
1616
"expo-av": "~13.2.1",
1717
"expo-blur": "~12.2.2",
1818
"expo-file-system": "~15.2.2",
1919
"expo-image-manipulator": "~11.1.1",
2020
"expo-image-picker": "~14.1.1",
2121
"expo-media-library": "~15.2.3",
22-
"expo-splash-screen": "~0.18.1",
22+
"expo-splash-screen": "~0.18.2",
2323
"expo-status-bar": "~1.4.2",
24+
"expo-document-picker": "11.2.2",
25+
"expo-sharing": "11.2.2",
26+
"expo-haptics": "12.2.1",
27+
"expo-clipboard": "4.1.2",
2428
"react": "18.2.0",
2529
"react-dom": "18.2.0",
26-
"react-native": "0.71.6",
30+
"react-native": "0.71.8",
2731
"react-native-gesture-handler": "~2.9.0",
2832
"react-native-quick-sqlite": "^8.0.2",
2933
"react-native-reanimated": "~2.14.4",

examples/ExpoMessaging/yarn.lock

Lines changed: 76 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,10 +1093,10 @@
10931093
mv "~2"
10941094
safe-json-stringify "~1"
10951095

1096-
1097-
version "0.7.0"
1098-
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.7.0.tgz#2a16873ced05c1f3b7f3990d7b410e9853600f45"
1099-
integrity sha512-9gjr3pRgwWzUDW/P7B4tA0QevKb+hCrvTmVc3Ce5w7CjdM3zNoBcro8vwviRHqkiB1IifG7zQh0PPStSbK+FRQ==
1096+
1097+
version "0.7.1"
1098+
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.7.1.tgz#8b2e32867452b4dad006759dd438b5f7fc4bc047"
1099+
integrity sha512-414sC4phJA5p96+bgPsyaPNwsepcOsGeErxFXp9OhqwgiQpw+H0uN9mVrvNIKLDHMVWHrW9bAFUEcpoL6VkzbQ==
11001100
dependencies:
11011101
"@babel/runtime" "^7.20.0"
11021102
"@expo/code-signing-certificates" "0.0.5"
@@ -1109,7 +1109,7 @@
11091109
"@expo/osascript" "^2.0.31"
11101110
"@expo/package-manager" "~1.0.0"
11111111
"@expo/plist" "^0.0.20"
1112-
"@expo/prebuild-config" "6.0.0"
1112+
"@expo/prebuild-config" "6.0.1"
11131113
"@expo/rudder-sdk-node" "1.1.1"
11141114
"@expo/spawn-async" "1.5.0"
11151115
"@expo/xcpretty" "^4.2.1"
@@ -1168,7 +1168,28 @@
11681168
node-forge "^1.2.1"
11691169
nullthrows "^1.1.1"
11701170

1171-
"@expo/[email protected]", "@expo/config-plugins@~6.0.0":
1171+
1172+
version "6.0.2"
1173+
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-6.0.2.tgz#cf07319515022ba94d9aa9fa30e0cff43a14256f"
1174+
integrity sha512-Cn01fXMHwjU042EgO9oO3Mna0o/UCrW91MQLMbJa4pXM41CYGjNgVy1EVXiuRRx/upegHhvltBw5D+JaUm8aZQ==
1175+
dependencies:
1176+
"@expo/config-types" "^48.0.0"
1177+
"@expo/json-file" "~8.2.37"
1178+
"@expo/plist" "^0.0.20"
1179+
"@expo/sdk-runtime-versions" "^1.0.0"
1180+
"@react-native/normalize-color" "^2.0.0"
1181+
chalk "^4.1.2"
1182+
debug "^4.3.1"
1183+
find-up "~5.0.0"
1184+
getenv "^1.0.0"
1185+
glob "7.1.6"
1186+
resolve-from "^5.0.0"
1187+
semver "^7.3.5"
1188+
slash "^3.0.0"
1189+
xcode "^3.0.1"
1190+
xml2js "0.4.23"
1191+
1192+
"@expo/config-plugins@~6.0.0":
11721193
version "6.0.1"
11731194
resolved "https://registry.yarnpkg.com/@expo/config-plugins/-/config-plugins-6.0.1.tgz#827cb34c51f725d8825b0768df6550c1cf81d457"
11741195
integrity sha512-6mqZutxeibXFeqFfoZApFUEH2n1RxGXYMHCdJrDj4eXDBBFZ3aJ0XBoroZcHHHvfRieEsf54vNyJoWp7JZGj8g==
@@ -1339,10 +1360,10 @@
13391360
base64-js "^1.2.3"
13401361
xmlbuilder "^14.0.0"
13411362

1342-
1343-
version "6.0.0"
1344-
resolved "https://registry.yarnpkg.com/@expo/prebuild-config/-/prebuild-config-6.0.0.tgz#c8e7f634f3ecf2272673f371c47d5d22950129a4"
1345-
integrity sha512-UW0QKAoRelsalVMhAG1tmegwS+2tbefvUi6/0QiKPlMLg8GFDQ5ZnzsSmuljD0SzT5yGg8oSpKYhnrXJ6pRmIQ==
1363+
1364+
version "6.0.1"
1365+
resolved "https://registry.yarnpkg.com/@expo/prebuild-config/-/prebuild-config-6.0.1.tgz#e3a5bbf5892859e71ac6a2408b1cc8ba6ca3f58f"
1366+
integrity sha512-WK3FDht1tdXZGCvtG5s7HSwzhsc7Tyu2DdqV9jVUsLtGD42oqUepk13mEWlU9LOTBgLsoEueKjoSK4EXOXFctw==
13461367
dependencies:
13471368
"@expo/config" "~8.0.0"
13481369
"@expo/config-plugins" "~6.0.0"
@@ -3346,6 +3367,11 @@ expo-blur@~12.2.2:
33463367
resolved "https://registry.yarnpkg.com/expo-blur/-/expo-blur-12.2.2.tgz#b7f94499255afbd3468302d02f3c4e39a0e562d5"
33473368
integrity sha512-SvGbEZbB0VFNGqCW7FcqzWOEb3lrRgBnQKGrsKo49KwhMyHTYjYVYWnmrk9l8Tr7lIaNnd55QD6dPAzcXjZYMg==
33483369

3370+
3371+
version "4.1.2"
3372+
resolved "https://registry.yarnpkg.com/expo-clipboard/-/expo-clipboard-4.1.2.tgz#0844566ae8ad1cf72854dc1bbd704c3b09c5d391"
3373+
integrity sha512-YSuIs4CV+3gypl7X74sp2ruwAVuhnOngsWs7EGkcvRdX0BBrZZMk3GXGw9a59sU6SW4wGWAfwrhyCT41GUaN+A==
3374+
33493375
expo-constants@~14.2.0, expo-constants@~14.2.1:
33503376
version "14.2.1"
33513377
resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-14.2.1.tgz#b5b6b8079d2082c31ccf2cbc7cf97a0e83c229c3"
@@ -3354,6 +3380,11 @@ expo-constants@~14.2.0, expo-constants@~14.2.1:
33543380
"@expo/config" "~8.0.0"
33553381
uuid "^3.3.2"
33563382

3383+
3384+
version "11.2.2"
3385+
resolved "https://registry.yarnpkg.com/expo-document-picker/-/expo-document-picker-11.2.2.tgz#707ff994a1c0b38505e12b2c9fe6b67715e6f41c"
3386+
integrity sha512-EeonRKxkK9E20LEAh93IvlwFjNkUCJKnhBEama9PmIDYWW7RyANZ8eP9C2PupThTDbivzRDNp7Ec7dIeyDAWjw==
3387+
33573388
expo-file-system@~15.2.0, expo-file-system@~15.2.2:
33583389
version "15.2.2"
33593390
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-15.2.2.tgz#a1ddf8aabf794f93888a146c4f5187e2004683a3"
@@ -3368,6 +3399,11 @@ expo-font@~11.1.1:
33683399
dependencies:
33693400
fontfaceobserver "^2.1.0"
33703401

3402+
3403+
version "12.2.1"
3404+
resolved "https://registry.yarnpkg.com/expo-haptics/-/expo-haptics-12.2.1.tgz#9705c245663fcf317ca19adc2e8bbcb5270562e7"
3405+
integrity sha512-XRZtmIQi901Q4+/cZnVrULRFOqShsgCuSP0SCbVEhnq8sK0OA4jgun12O93Pu5aGvTyoqsAcIArE8tX+8AEqRA==
3406+
33713407
expo-image-loader@~4.1.0:
33723408
version "4.1.1"
33733409
resolved "https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-4.1.1.tgz#efadbb17de1861106864820194900f336dd641b6"
@@ -3408,36 +3444,41 @@ [email protected]:
34083444
find-up "^5.0.0"
34093445
fs-extra "^9.1.0"
34103446

3411-
3412-
version "1.2.6"
3413-
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.2.6.tgz#921abc8031fe0e5474ee48905071902b9627d051"
3414-
integrity sha512-vyleKepkP8F6L+D55B/E4FbZ8x9pdy3yw/mdbGBkDkrmo2gmeMjOM1mKLSszOkLIqet05O7Wy8m0FZHZTo0VBg==
3447+
3448+
version "1.2.7"
3449+
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.2.7.tgz#c80627b13a8f1c94ae9da8eea41e1ef1df5788c8"
3450+
integrity sha512-sulqn2M8+tIdxi6QFkKppDEzbePAscgE2LEHocYoQOgHxJpeT7axE0Hkzc+81EeviQilZzGeFZMtNMGh3c9yJg==
34153451
dependencies:
34163452
compare-versions "^3.4.0"
34173453
invariant "^2.2.4"
34183454

3419-
expo-splash-screen@~0.18.1:
3420-
version "0.18.1"
3421-
resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.18.1.tgz#e090b045a7f8c5d9597b7a96910caa4eae1fcf3b"
3422-
integrity sha512-1di1kuh14likGUs3fyVZWAqEMxhmdAjpmf9T8Qk5OzUa5oPEMEDYB2e2VprddWnJNBVVe/ojBDSCY8w56/LS0Q==
3455+
3456+
version "11.2.2"
3457+
resolved "https://registry.yarnpkg.com/expo-sharing/-/expo-sharing-11.2.2.tgz#7d9e387f1a902e6dd6838c22d9599dae9e7432cf"
3458+
integrity sha512-4Lhm1eS/CFIzX+JPuxMUTWBt9rv/WdvJvpQ9y+71bL/9w9dhvsdt9tv0SsNZATz4hk0tbrYD8ZEUsgiHiT1KkQ==
3459+
3460+
expo-splash-screen@~0.18.2:
3461+
version "0.18.2"
3462+
resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.18.2.tgz#dde246204da875785ba40c7143a70013cdefdbb6"
3463+
integrity sha512-fsiKmyn/lbJtV6Uor6wSvl21fScOidFzmB/HHShQJJOu2TBN/vqMvhPu/r0bF5NVk8Wi64r98hiWY1EEsbW03w==
34233464
dependencies:
34243465
"@expo/configure-splash-screen" "^0.6.0"
3425-
"@expo/prebuild-config" "6.0.0"
3466+
"@expo/prebuild-config" "6.0.1"
34263467

34273468
expo-status-bar@~1.4.2:
34283469
version "1.4.4"
34293470
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.4.4.tgz#6874ccfda5a270d66f123a9f220735a76692d114"
34303471
integrity sha512-5DV0hIEWgatSC3UgQuAZBoQeaS9CqeWRZ3vzBR9R/+IUD87Adbi4FGhU10nymRqFXOizGsureButGZIXPs7zEA==
34313472

3432-
expo@~48.0.11:
3433-
version "48.0.11"
3434-
resolved "https://registry.yarnpkg.com/expo/-/expo-48.0.11.tgz#afd43c7a5ddce3d02a3f27263c95f8d01e1fb84d"
3435-
integrity sha512-KX1RCHhdhdT4DjCeRqYJpZXhdCTuqxHHdNIRoFkmCgkUARYlZbB+Y1U8/KMz8fBAlFoEq99cF/KyRr87VAxRCw==
3473+
expo@~48.0.15:
3474+
version "48.0.17"
3475+
resolved "https://registry.yarnpkg.com/expo/-/expo-48.0.17.tgz#000773a2675e5bf95688a84fbc625c105f8b8af9"
3476+
integrity sha512-5T1CsMUlfI+xFB89GOU+/xtSSbSBBFVTqwgheAU0cQolfbs+YyJCMTKU5vN45N5OK+ym7p/LKPa6DQAxYPF8YQ==
34363477
dependencies:
34373478
"@babel/runtime" "^7.20.0"
3438-
"@expo/cli" "0.7.0"
3479+
"@expo/cli" "0.7.1"
34393480
"@expo/config" "8.0.2"
3440-
"@expo/config-plugins" "6.0.1"
3481+
"@expo/config-plugins" "6.0.2"
34413482
"@expo/vector-icons" "^13.0.0"
34423483
babel-preset-expo "~9.3.2"
34433484
cross-spawn "^6.0.5"
@@ -3448,7 +3489,7 @@ expo@~48.0.11:
34483489
expo-font "~11.1.1"
34493490
expo-keep-awake "~12.0.1"
34503491
expo-modules-autolinking "1.2.0"
3451-
expo-modules-core "1.2.6"
3492+
expo-modules-core "1.2.7"
34523493
fbemitter "^3.0.0"
34533494
getenv "^1.0.0"
34543495
invariant "^2.2.4"
@@ -5994,10 +6035,10 @@ react-native-gesture-handler@~2.9.0:
59946035
lodash "^4.17.21"
59956036
prop-types "^15.7.2"
59966037

5997-
react-native-gradle-plugin@^0.71.17:
5998-
version "0.71.17"
5999-
resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.71.17.tgz#cf780a27270f0a32dca8184eff91555d7627dd00"
6000-
integrity sha512-OXXYgpISEqERwjSlaCiaQY6cTY5CH6j73gdkWpK0hedxtiWMWgH+i5TOi4hIGYitm9kQBeyDu+wim9fA8ROFJA==
6038+
react-native-gradle-plugin@^0.71.18:
6039+
version "0.71.18"
6040+
resolved "https://registry.yarnpkg.com/react-native-gradle-plugin/-/react-native-gradle-plugin-0.71.18.tgz#20ef199bc85be32e45bb6cc069ec2e7dcb1a74a6"
6041+
integrity sha512-7F6bD7B8Xsn3JllxcwHhFcsl9aHIig47+3eN4IHFNqfLhZr++3ElDrcqfMzugM+niWbaMi7bJ0kAkAL8eCpdWg==
60016042

60026043
react-native-lightbox@^0.7.0:
60036044
version "0.7.0"
@@ -6074,10 +6115,10 @@ react-native-web@~0.18.7:
60746115
postcss-value-parser "^4.2.0"
60756116
styleq "^0.1.2"
60766117

6077-
6078-
version "0.71.6"
6079-
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.71.6.tgz#e8f07baf55abd1015eaa7040ceaa4aa632c2c04f"
6080-
integrity sha512-gHrDj7qaAaiE41JwaFCh3AtvOqOLuRgZtHKzNiwxakG/wvPAYmG73ECfWHGxjxIx/QT17Hp37Da3ipCei/CayQ==
6118+
6119+
version "0.71.8"
6120+
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.71.8.tgz#4314145341c49448cf7465b93ced52a433a5e191"
6121+
integrity sha512-ftMAuhpgTkbHU9brrqsEyxcNrpYvXKeATY+if22Nfhhg1zW+6wn95w9otwTnA3xHkljPCbng8mUhmmERjGEl7g==
60816122
dependencies:
60826123
"@jest/create-cache-key-function" "^29.2.1"
60836124
"@react-native-community/cli" "10.2.2"
@@ -6104,7 +6145,7 @@ [email protected]:
61046145
promise "^8.3.0"
61056146
react-devtools-core "^4.26.1"
61066147
react-native-codegen "^0.71.5"
6107-
react-native-gradle-plugin "^0.71.17"
6148+
react-native-gradle-plugin "^0.71.18"
61086149
react-refresh "^0.4.0"
61096150
react-shallow-renderer "^16.15.0"
61106151
regenerator-runtime "^0.13.2"

package/expo-package/src/optionalDependencies/Video.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ try {
44
const audioVideoPackage = require('expo-av');
55
VideoComponent = audioVideoPackage.Video;
66
AudioComponent = audioVideoPackage.Audio;
7-
} catch (_) {
8-
console.warn(
7+
} catch (e) {
8+
// do nothing
9+
}
10+
11+
if (!VideoComponent || !AudioComponent) {
12+
console.log(
913
'Audio Video library is currently not installed. To allow in-app audio or video playback, install the "expo-av" package.',
1014
);
1115
}

package/expo-package/src/optionalDependencies/pickDocument.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ let DocumentPicker;
22

33
try {
44
DocumentPicker = require('expo-document-picker');
5-
} catch (error) {
6-
console.log('expo-document-picker is not installed');
5+
} catch (e) {
6+
// do nothing
7+
}
8+
9+
if (!DocumentPicker) {
10+
console.log(
11+
'expo-document-picker is not installed. Install this library if you want to enable file picker support.',
12+
);
713
}
814

915
export const pickDocument = DocumentPicker

package/expo-package/src/optionalDependencies/setClipboardString.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
let Clipboard: { setString: (string: string) => void } | undefined;
22

33
try {
4-
Clipboard = require('expo-clipboard').default;
4+
Clipboard = require('expo-clipboard');
55
} catch (e) {
66
// do nothing
7-
console.log('expo-clipboard is not installed');
7+
}
8+
9+
if (!Clipboard) {
10+
console.log(
11+
'expo-clipboard is not installed. Install this library if you want to enable copy to clipboard support.',
12+
);
813
}
914

1015
export const setClipboardString = Clipboard

package/expo-package/src/optionalDependencies/shareImage.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ let Sharing;
22

33
try {
44
Sharing = require('expo-sharing').default;
5-
} catch (error) {
6-
console.log('expo-sharing is not installed');
5+
} catch (e) {
6+
// do nothing
7+
}
8+
9+
if (!Sharing) {
10+
console.log(
11+
'expo-sharing is not installed. Installing this package will allow your users to share attachments from the gallery using the native sharing interface on their devices.',
12+
);
713
}
814

915
export const shareImage = Sharing

package/expo-package/src/optionalDependencies/triggerHaptic.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
let Haptics;
22

33
try {
4-
Haptics = require('expo-haptics').default;
5-
} catch (error) {
6-
console.log('expo-haptics is not installed');
4+
Haptics = require('expo-haptics');
5+
} catch (e) {
6+
// do nothing
7+
}
8+
9+
if (!Haptics) {
10+
console.log(
11+
'expo-haptics is not installed. Installing this package will enable haptic feedback when scaling images in the image gallery if the scaling hits the higher or lower limits for its value.',
12+
);
713
}
814

915
type HapticFeedbackTypes =
@@ -39,4 +45,5 @@ export const triggerHaptic = Haptics
3945
Haptics.selectionAsync();
4046
}
4147
}
42-
: () => {};
48+
: // eslint-disable-next-line @typescript-eslint/no-empty-function
49+
() => {};

0 commit comments

Comments
 (0)