fix(mobile): align expo sdk 55 build deps

This commit is contained in:
DIYgod 2026-04-15 08:39:04 +08:00
parent 179dd82a6e
commit d8a7e10f4c
10 changed files with 400 additions and 533 deletions

View File

@ -61,16 +61,16 @@
"dayjs": "1.11.19",
"dnum": "2.17.0",
"es-toolkit": "1.44.0",
"expo": "55.0.13",
"expo": "~55.0.15",
"expo-apple-authentication": "55.0.13",
"expo-application": "55.0.14",
"expo-background-task": "55.0.14",
"expo-background-task": "~55.0.16",
"expo-blur": "55.0.14",
"expo-build-properties": "55.0.13",
"expo-clipboard": "55.0.13",
"expo-constants": "55.0.13",
"expo-dev-client": "55.0.24",
"expo-device": "55.0.14",
"expo-constants": "~55.0.14",
"expo-dev-client": "~55.0.27",
"expo-device": "~55.0.15",
"expo-document-picker": "55.0.13",
"expo-file-system": "55.0.16",
"expo-glass-effect": "55.0.10",
@ -80,15 +80,14 @@
"expo-image-manipulator": "55.0.15",
"expo-image-picker": "~55.0.18",
"expo-linear-gradient": "55.0.13",
"expo-linking": "55.0.12",
"expo-linking": "~55.0.13",
"expo-localization": "55.0.13",
"expo-media-library": "55.0.14",
"expo-modules-core": "55.0.22",
"expo-network": "55.0.13",
"expo-notifications": "55.0.18",
"expo-notifications": "~55.0.19",
"expo-secure-store": "55.0.13",
"expo-sharing": "55.0.18",
"expo-splash-screen": "55.0.17",
"expo-splash-screen": "~55.0.18",
"expo-sqlite": "55.0.15",
"expo-status-bar": "55.0.5",
"expo-store-review": "~55.0.13",
@ -151,7 +150,6 @@
},
"devDependencies": {
"@babel/core": "7.29.0",
"@expo/config-plugins": "55.0.8",
"@follow/configs": "workspace:*",
"@types/react": "19.2.14",
"babel-plugin-inline-import": "3.0.0",

View File

@ -1,5 +1,4 @@
const { AndroidConfig, withAndroidManifest } = require("@expo/config-plugins")
const { Paths } = require("@expo/config-plugins/build/android")
const { AndroidConfig, withAndroidManifest } = require("expo/config-plugins")
const path = require("pathe")
const fs = require("node:fs")
@ -17,7 +16,7 @@ const withTrustLocalCerts = (config) => {
async function setCustomConfigAsync(config, androidManifest) {
const src_file_pat = path.join(__dirname, "network_security_config.xml")
const res_file_path = path.join(
await Paths.getResourceFolderAsync(config.modRequest.projectRoot),
await AndroidConfig.Paths.getResourceFolderAsync(config.modRequest.projectRoot),
"xml",
"network_security_config.xml",
)

View File

@ -0,0 +1,43 @@
function buildMarkers(comment, tag) {
return {
start: `${comment} @generated begin ${tag}`,
end: `${comment} @generated end ${tag}`,
}
}
function findAnchorIndex(lines, anchor) {
if (typeof anchor === "string") {
return lines.findIndex((line) => line.includes(anchor))
}
return lines.findIndex((line) => anchor.test(line))
}
function mergeContents({ src, anchor, newSrc, offset = 0, tag, comment = "//" }) {
const { start, end } = buildMarkers(comment, tag)
const block = [start, newSrc.trimEnd(), end].join("\n")
const startIndex = src.indexOf(start)
const endIndex = src.indexOf(end)
if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
return {
contents: `${src.slice(0, startIndex)}${block}${src.slice(endIndex + end.length)}`,
}
}
const lines = src.split("\n")
const anchorIndex = findAnchorIndex(lines, anchor)
if (anchorIndex === -1) {
throw new Error(`Failed to find anchor for generated block: ${tag}`)
}
const insertAt = Math.min(lines.length, anchorIndex + offset + 1)
lines.splice(insertAt, 0, block)
return {
contents: lines.join("\n"),
}
}
module.exports = {
mergeContents,
}

View File

@ -1,4 +1,4 @@
const { withGradleProperties } = require("@expo/config-plugins")
const { withGradleProperties } = require("expo/config-plugins")
function setGradleProperty(config, key, value) {
return withGradleProperties(config, (config) => {

View File

@ -1,5 +1,6 @@
const { withAppDelegate } = require("@expo/config-plugins")
const { mergeContents } = require("@expo/config-plugins/build/utils/generateCode")
const { withAppDelegate } = require("expo/config-plugins")
const { mergeContents } = require("./merge-contents")
const withFollowAppDelegate = (config) => {
return withAppDelegate(config, async (config) => {

View File

@ -7,7 +7,7 @@
* - [spacedrive](https://github.com/spacedriveapp/spacedrive/blob/main/apps/mobile/scripts/withRiveAssets.js)
*/
const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins")
const { withDangerousMod, withXcodeProject, IOSConfig } = require("expo/config-plugins")
const fs = require("node:fs")
const path = require("pathe")
const { execSync } = require("node:child_process")

View File

@ -1,4 +1,4 @@
const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins")
const { withDangerousMod, withXcodeProject, IOSConfig } = require("expo/config-plugins")
const fs = require("node:fs")
const path = require("pathe")

View File

@ -1,5 +1,6 @@
const { withPodfile, withPodfileProperties } = require("@expo/config-plugins")
const { mergeContents } = require("@expo/config-plugins/build/utils/generateCode")
const { withPodfile, withPodfileProperties } = require("expo/config-plugins")
const { mergeContents } = require("./merge-contents")
const STATIC_FRAMEWORK_TAG = "follow-rnfb-static-framework"
const RNFB_IOS_COMPAT_TAG = "follow-rnfb-ios-compat"

View File

@ -1,6 +1,6 @@
import { EventBus } from "@follow/utils/event-bus"
import type { NativeModule } from "expo"
import { requireNativeModule } from "expo-modules-core"
import { requireNativeModule } from "expo"
import { htmlUrl } from "./constants"

File diff suppressed because it is too large Load Diff