Skip to content

Commit d8a7e10

Browse files
committed
fix(mobile): align expo sdk 55 build deps
1 parent 179dd82 commit d8a7e10

10 files changed

Lines changed: 400 additions & 533 deletions

apps/mobile/package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@
6161
"dayjs": "1.11.19",
6262
"dnum": "2.17.0",
6363
"es-toolkit": "1.44.0",
64-
"expo": "55.0.13",
64+
"expo": "~55.0.15",
6565
"expo-apple-authentication": "55.0.13",
6666
"expo-application": "55.0.14",
67-
"expo-background-task": "55.0.14",
67+
"expo-background-task": "~55.0.16",
6868
"expo-blur": "55.0.14",
6969
"expo-build-properties": "55.0.13",
7070
"expo-clipboard": "55.0.13",
71-
"expo-constants": "55.0.13",
72-
"expo-dev-client": "55.0.24",
73-
"expo-device": "55.0.14",
71+
"expo-constants": "~55.0.14",
72+
"expo-dev-client": "~55.0.27",
73+
"expo-device": "~55.0.15",
7474
"expo-document-picker": "55.0.13",
7575
"expo-file-system": "55.0.16",
7676
"expo-glass-effect": "55.0.10",
@@ -80,15 +80,14 @@
8080
"expo-image-manipulator": "55.0.15",
8181
"expo-image-picker": "~55.0.18",
8282
"expo-linear-gradient": "55.0.13",
83-
"expo-linking": "55.0.12",
83+
"expo-linking": "~55.0.13",
8484
"expo-localization": "55.0.13",
8585
"expo-media-library": "55.0.14",
86-
"expo-modules-core": "55.0.22",
8786
"expo-network": "55.0.13",
88-
"expo-notifications": "55.0.18",
87+
"expo-notifications": "~55.0.19",
8988
"expo-secure-store": "55.0.13",
9089
"expo-sharing": "55.0.18",
91-
"expo-splash-screen": "55.0.17",
90+
"expo-splash-screen": "~55.0.18",
9291
"expo-sqlite": "55.0.15",
9392
"expo-status-bar": "55.0.5",
9493
"expo-store-review": "~55.0.13",
@@ -151,7 +150,6 @@
151150
},
152151
"devDependencies": {
153152
"@babel/core": "7.29.0",
154-
"@expo/config-plugins": "55.0.8",
155153
"@follow/configs": "workspace:*",
156154
"@types/react": "19.2.14",
157155
"babel-plugin-inline-import": "3.0.0",

apps/mobile/plugins/android-trust-user-certs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
const { AndroidConfig, withAndroidManifest } = require("@expo/config-plugins")
2-
const { Paths } = require("@expo/config-plugins/build/android")
1+
const { AndroidConfig, withAndroidManifest } = require("expo/config-plugins")
32
const path = require("pathe")
43
const fs = require("node:fs")
54

@@ -17,7 +16,7 @@ const withTrustLocalCerts = (config) => {
1716
async function setCustomConfigAsync(config, androidManifest) {
1817
const src_file_pat = path.join(__dirname, "network_security_config.xml")
1918
const res_file_path = path.join(
20-
await Paths.getResourceFolderAsync(config.modRequest.projectRoot),
19+
await AndroidConfig.Paths.getResourceFolderAsync(config.modRequest.projectRoot),
2120
"xml",
2221
"network_security_config.xml",
2322
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
function buildMarkers(comment, tag) {
2+
return {
3+
start: `${comment} @generated begin ${tag}`,
4+
end: `${comment} @generated end ${tag}`,
5+
}
6+
}
7+
8+
function findAnchorIndex(lines, anchor) {
9+
if (typeof anchor === "string") {
10+
return lines.findIndex((line) => line.includes(anchor))
11+
}
12+
return lines.findIndex((line) => anchor.test(line))
13+
}
14+
15+
function mergeContents({ src, anchor, newSrc, offset = 0, tag, comment = "//" }) {
16+
const { start, end } = buildMarkers(comment, tag)
17+
const block = [start, newSrc.trimEnd(), end].join("\n")
18+
19+
const startIndex = src.indexOf(start)
20+
const endIndex = src.indexOf(end)
21+
if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
22+
return {
23+
contents: `${src.slice(0, startIndex)}${block}${src.slice(endIndex + end.length)}`,
24+
}
25+
}
26+
27+
const lines = src.split("\n")
28+
const anchorIndex = findAnchorIndex(lines, anchor)
29+
if (anchorIndex === -1) {
30+
throw new Error(`Failed to find anchor for generated block: ${tag}`)
31+
}
32+
33+
const insertAt = Math.min(lines.length, anchorIndex + offset + 1)
34+
lines.splice(insertAt, 0, block)
35+
36+
return {
37+
contents: lines.join("\n"),
38+
}
39+
}
40+
41+
module.exports = {
42+
mergeContents,
43+
}

apps/mobile/plugins/with-android-jdk-21.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { withGradleProperties } = require("@expo/config-plugins")
1+
const { withGradleProperties } = require("expo/config-plugins")
22

33
function setGradleProperty(config, key, value) {
44
return withGradleProperties(config, (config) => {

apps/mobile/plugins/with-follow-app-delegate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const { withAppDelegate } = require("@expo/config-plugins")
2-
const { mergeContents } = require("@expo/config-plugins/build/utils/generateCode")
1+
const { withAppDelegate } = require("expo/config-plugins")
2+
3+
const { mergeContents } = require("./merge-contents")
34

45
const withFollowAppDelegate = (config) => {
56
return withAppDelegate(config, async (config) => {

apps/mobile/plugins/with-follow-assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - [spacedrive](https://github.com/spacedriveapp/spacedrive/blob/main/apps/mobile/scripts/withRiveAssets.js)
88
*/
99

10-
const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins")
10+
const { withDangerousMod, withXcodeProject, IOSConfig } = require("expo/config-plugins")
1111
const fs = require("node:fs")
1212
const path = require("pathe")
1313
const { execSync } = require("node:child_process")

apps/mobile/plugins/with-follow-ios-resources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins")
1+
const { withDangerousMod, withXcodeProject, IOSConfig } = require("expo/config-plugins")
22
const fs = require("node:fs")
33
const path = require("pathe")
44

apps/mobile/plugins/with-rnfb-build-properties.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const { withPodfile, withPodfileProperties } = require("@expo/config-plugins")
2-
const { mergeContents } = require("@expo/config-plugins/build/utils/generateCode")
1+
const { withPodfile, withPodfileProperties } = require("expo/config-plugins")
2+
3+
const { mergeContents } = require("./merge-contents")
34

45
const STATIC_FRAMEWORK_TAG = "follow-rnfb-static-framework"
56
const RNFB_IOS_COMPAT_TAG = "follow-rnfb-ios-compat"

apps/mobile/src/components/native/webview/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EventBus } from "@follow/utils/event-bus"
22
import type { NativeModule } from "expo"
3-
import { requireNativeModule } from "expo-modules-core"
3+
import { requireNativeModule } from "expo"
44

55
import { htmlUrl } from "./constants"
66

0 commit comments

Comments
 (0)