expo 58.0.16 → 58.0.19
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/android/build.gradle +2 -2
- package/bundledNativeModules.json +36 -36
- package/package.json +19 -18
- package/scripts/spm/README.md +65 -8
- package/scripts/spm/__tests__/app-target.test.js +3 -2
- package/scripts/spm/__tests__/cli.test.js +17 -2
- package/scripts/spm/__tests__/commands.test.js +95 -0
- package/scripts/spm/__tests__/diagnostics.test.js +212 -9
- package/scripts/spm/__tests__/direct.test.js +387 -0
- package/scripts/spm/__tests__/flavored-frameworks.test.js +312 -0
- package/scripts/spm/__tests__/helpers.js +9 -0
- package/scripts/spm/__tests__/manifests.test.js +142 -50
- package/scripts/spm/__tests__/plugin.test.js +1425 -35
- package/scripts/spm/__tests__/precompiled-sources.test.js +139 -0
- package/scripts/spm/__tests__/script-phases.test.js +326 -0
- package/scripts/spm/app-target.js +4 -3
- package/scripts/spm/classify.js +8 -6
- package/scripts/spm/cli.js +11 -4
- package/scripts/spm/commands.js +49 -0
- package/scripts/spm/diagnostics.js +118 -12
- package/scripts/spm/direct.js +215 -0
- package/scripts/spm/flavored-frameworks.js +190 -30
- package/scripts/spm/manifests.js +64 -10
- package/scripts/spm/plugin.js +501 -80
- package/scripts/spm/script-phases.js +54 -0
- package/src/__tests__/tsconfig-base-export.test.node.ts +23 -0
- package/template.tgz +0 -0
package/android/build.gradle
CHANGED
|
@@ -10,7 +10,7 @@ buildscript {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
group = 'host.exp.exponent'
|
|
13
|
-
version = '58.0.
|
|
13
|
+
version = '58.0.19'
|
|
14
14
|
|
|
15
15
|
expoModule {
|
|
16
16
|
// We can't prebuild the module because it depends on the generated files.
|
|
@@ -21,7 +21,7 @@ android {
|
|
|
21
21
|
namespace "expo.core"
|
|
22
22
|
defaultConfig {
|
|
23
23
|
versionCode 1
|
|
24
|
-
versionName "58.0.
|
|
24
|
+
versionName "58.0.19"
|
|
25
25
|
consumerProguardFiles("proguard-rules.pro")
|
|
26
26
|
}
|
|
27
27
|
testOptions {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@expo/dom-webview": "~58.0.2",
|
|
3
|
-
"@expo/fingerprint": "~0.21.
|
|
4
|
-
"@expo/metro-runtime": "~58.0.
|
|
3
|
+
"@expo/fingerprint": "~0.21.6",
|
|
4
|
+
"@expo/metro-runtime": "~58.0.15",
|
|
5
5
|
"@expo/vector-icons": "^15.0.2",
|
|
6
|
-
"@expo/ui": "~58.0.
|
|
6
|
+
"@expo/ui": "~58.0.23",
|
|
7
7
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
8
8
|
"@react-native-community/datetimepicker": "9.2.1",
|
|
9
9
|
"@react-native-masked-view/masked-view": "0.3.2",
|
|
@@ -16,41 +16,41 @@
|
|
|
16
16
|
"eslint-config-expo": "~58.0.4",
|
|
17
17
|
"expo-analytics-amplitude": "~11.3.0",
|
|
18
18
|
"expo-app-auth": "~11.1.0",
|
|
19
|
-
"expo-app-intents": "~0.5.
|
|
19
|
+
"expo-app-intents": "~0.5.12",
|
|
20
20
|
"expo-app-loader-provider": "~8.0.0",
|
|
21
|
-
"expo-app-metrics": "~58.0.
|
|
21
|
+
"expo-app-metrics": "~58.0.14",
|
|
22
22
|
"expo-apple-authentication": "~58.0.2",
|
|
23
23
|
"expo-application": "~58.1.2",
|
|
24
|
-
"expo-asset": "~58.0.
|
|
25
|
-
"expo-audio": "~58.0.
|
|
26
|
-
"expo-auth-session": "~58.0.
|
|
24
|
+
"expo-asset": "~58.0.18",
|
|
25
|
+
"expo-audio": "~58.0.10",
|
|
26
|
+
"expo-auth-session": "~58.0.14",
|
|
27
27
|
"expo-background-fetch": "~58.0.11",
|
|
28
28
|
"expo-background-task": "~58.0.11",
|
|
29
29
|
"expo-battery": "~58.0.3",
|
|
30
30
|
"expo-blur": "~58.0.5",
|
|
31
31
|
"expo-brightness": "~58.0.2",
|
|
32
|
-
"expo-brownfield": "~58.0.
|
|
32
|
+
"expo-brownfield": "~58.0.16",
|
|
33
33
|
"expo-build-properties": "~58.0.11",
|
|
34
34
|
"expo-calendar": "~58.0.6",
|
|
35
|
-
"expo-camera": "~58.0.
|
|
35
|
+
"expo-camera": "~58.0.12",
|
|
36
36
|
"expo-cellular": "~58.0.3",
|
|
37
37
|
"expo-checkbox": "~58.0.2",
|
|
38
|
-
"expo-clipboard": "~58.0.
|
|
39
|
-
"expo-constants": "~58.0.
|
|
40
|
-
"expo-contacts": "~58.0.
|
|
38
|
+
"expo-clipboard": "~58.0.4",
|
|
39
|
+
"expo-constants": "~58.0.13",
|
|
40
|
+
"expo-contacts": "~58.0.9",
|
|
41
41
|
"expo-crypto": "~58.0.7",
|
|
42
|
-
"expo-dev-client": "~58.0.
|
|
42
|
+
"expo-dev-client": "~58.0.15",
|
|
43
43
|
"expo-device": "~58.0.5",
|
|
44
44
|
"expo-document-picker": "~58.0.4",
|
|
45
45
|
"expo-eas-client": "~58.0.2",
|
|
46
|
-
"expo-file-system": "~58.0.
|
|
47
|
-
"expo-font": "~58.0.
|
|
46
|
+
"expo-file-system": "~58.0.11",
|
|
47
|
+
"expo-font": "~58.0.10",
|
|
48
48
|
"expo-gl": "~58.0.3",
|
|
49
|
-
"expo-glass-effect": "~58.0.
|
|
49
|
+
"expo-glass-effect": "~58.0.5",
|
|
50
50
|
"expo-google-app-auth": "~8.3.0",
|
|
51
51
|
"expo-haptics": "~58.0.7",
|
|
52
|
-
"expo-hinge": "~58.0.
|
|
53
|
-
"expo-image": "~58.0.
|
|
52
|
+
"expo-hinge": "~58.0.2",
|
|
53
|
+
"expo-image": "~58.0.17",
|
|
54
54
|
"expo-image-loader": "~58.0.3",
|
|
55
55
|
"expo-image-manipulator": "~58.0.15",
|
|
56
56
|
"expo-image-picker": "~58.0.10",
|
|
@@ -58,47 +58,47 @@
|
|
|
58
58
|
"expo-insights": "~58.0.11",
|
|
59
59
|
"expo-keep-awake": "~58.0.3",
|
|
60
60
|
"expo-linear-gradient": "~58.0.3",
|
|
61
|
-
"expo-linking": "~58.0.
|
|
61
|
+
"expo-linking": "~58.0.14",
|
|
62
62
|
"expo-local-authentication": "~58.0.2",
|
|
63
63
|
"expo-localization": "~58.0.5",
|
|
64
|
-
"expo-location": "~58.0.
|
|
64
|
+
"expo-location": "~58.0.19",
|
|
65
65
|
"expo-mail-composer": "~58.0.3",
|
|
66
66
|
"expo-manifests": "~58.0.1",
|
|
67
67
|
"expo-maps": "~58.0.10",
|
|
68
68
|
"expo-mcp": "~0.2.1",
|
|
69
|
-
"expo-media-library": "~58.0.
|
|
69
|
+
"expo-media-library": "~58.0.12",
|
|
70
70
|
"expo-mesh-gradient": "~58.0.3",
|
|
71
71
|
"expo-module-template": "~58.0.8",
|
|
72
|
-
"expo-modules-core": "~58.0.
|
|
72
|
+
"expo-modules-core": "~58.0.26",
|
|
73
73
|
"expo-navigation-bar": "~58.0.4",
|
|
74
|
-
"expo-network": "~58.0.
|
|
75
|
-
"expo-notifications": "~58.1.
|
|
76
|
-
"expo-observe": "~58.0.
|
|
74
|
+
"expo-network": "~58.0.4",
|
|
75
|
+
"expo-notifications": "~58.1.6",
|
|
76
|
+
"expo-observe": "~58.0.16",
|
|
77
77
|
"expo-print": "~58.0.7",
|
|
78
78
|
"expo-live-photo": "~58.0.6",
|
|
79
|
-
"expo-router": "~58.0.
|
|
80
|
-
"expo-screen-capture": "~58.0.
|
|
79
|
+
"expo-router": "~58.0.26",
|
|
80
|
+
"expo-screen-capture": "~58.0.6",
|
|
81
81
|
"expo-screen-orientation": "~58.0.3",
|
|
82
82
|
"expo-secure-store": "~58.0.2",
|
|
83
83
|
"expo-sensors": "~58.0.4",
|
|
84
|
-
"expo-server": "~58.0.
|
|
85
|
-
"expo-sharing": "~58.0.
|
|
84
|
+
"expo-server": "~58.0.6",
|
|
85
|
+
"expo-sharing": "~58.0.20",
|
|
86
86
|
"expo-sms": "~58.0.2",
|
|
87
87
|
"expo-speech": "~58.0.3",
|
|
88
|
-
"expo-splash-screen": "~58.0.
|
|
89
|
-
"expo-sqlite": "~58.0.
|
|
90
|
-
"expo-status-bar": "~58.0.
|
|
88
|
+
"expo-splash-screen": "~58.0.11",
|
|
89
|
+
"expo-sqlite": "~58.0.14",
|
|
90
|
+
"expo-status-bar": "~58.0.4",
|
|
91
91
|
"expo-store-review": "~58.0.2",
|
|
92
92
|
"expo-symbols": "~58.0.4",
|
|
93
93
|
"expo-system-ui": "~58.0.6",
|
|
94
94
|
"expo-task-manager": "~58.0.12",
|
|
95
95
|
"expo-tracking-transparency": "~58.0.2",
|
|
96
|
-
"expo-updates": "~58.0.
|
|
96
|
+
"expo-updates": "~58.0.18",
|
|
97
97
|
"expo-video-thumbnails": "~58.0.2",
|
|
98
98
|
"expo-video": "~58.0.12",
|
|
99
99
|
"expo-web-browser": "~58.0.6",
|
|
100
|
-
"expo-widgets": "~58.0.
|
|
101
|
-
"jest-expo": "~58.0.
|
|
100
|
+
"expo-widgets": "~58.0.23",
|
|
101
|
+
"jest-expo": "~58.0.12",
|
|
102
102
|
"lottie-react-native": "~7.5.0",
|
|
103
103
|
"react": "19.3.0",
|
|
104
104
|
"react-dom": "19.3.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.19",
|
|
4
4
|
"description": "The Expo SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo"
|
|
@@ -194,6 +194,7 @@
|
|
|
194
194
|
"./scripts/*": "./scripts/*.js",
|
|
195
195
|
"./bin/*": "./bin/*",
|
|
196
196
|
"./package.json": "./package.json",
|
|
197
|
+
"./tsconfig.base": "./tsconfig.base.json",
|
|
197
198
|
"./*.json": "./*.json",
|
|
198
199
|
"./*": {
|
|
199
200
|
"types": "./*.d.ts",
|
|
@@ -211,36 +212,36 @@
|
|
|
211
212
|
},
|
|
212
213
|
"dependencies": {
|
|
213
214
|
"@babel/runtime": "^7.20.0",
|
|
214
|
-
"@expo/cli": "^58.1.
|
|
215
|
-
"@expo/config": "~58.0.
|
|
216
|
-
"@expo/config-plugins": "~58.0.
|
|
215
|
+
"@expo/cli": "^58.1.15",
|
|
216
|
+
"@expo/config": "~58.0.8",
|
|
217
|
+
"@expo/config-plugins": "~58.0.10",
|
|
217
218
|
"@expo/devtools": "~58.0.2",
|
|
218
219
|
"@expo/dom-webview": "~58.0.2",
|
|
219
|
-
"@expo/fingerprint": "^0.21.
|
|
220
|
-
"@expo/local-build-cache-provider": "^58.0.
|
|
221
|
-
"@expo/log-box": "^58.0.
|
|
220
|
+
"@expo/fingerprint": "^0.21.6",
|
|
221
|
+
"@expo/local-build-cache-provider": "^58.0.8",
|
|
222
|
+
"@expo/log-box": "^58.0.13",
|
|
222
223
|
"@expo/log-box-utils": "^58.0.2",
|
|
223
224
|
"@expo/metro": "~58.0.0",
|
|
224
|
-
"@expo/metro-config": "~58.0.
|
|
225
|
+
"@expo/metro-config": "~58.0.17",
|
|
225
226
|
"@ungap/structured-clone": "^1.3.0",
|
|
226
|
-
"babel-preset-expo": "~58.0.
|
|
227
|
-
"expo-asset": "~58.0.
|
|
228
|
-
"expo-constants": "~58.0.
|
|
229
|
-
"expo-file-system": "~58.0.
|
|
230
|
-
"expo-font": "~58.0.
|
|
227
|
+
"babel-preset-expo": "~58.0.20",
|
|
228
|
+
"expo-asset": "~58.0.18",
|
|
229
|
+
"expo-constants": "~58.0.13",
|
|
230
|
+
"expo-file-system": "~58.0.11",
|
|
231
|
+
"expo-font": "~58.0.10",
|
|
231
232
|
"expo-keep-awake": "~58.0.3",
|
|
232
|
-
"expo-modules-autolinking": "~58.0.
|
|
233
|
-
"expo-modules-cli": "~0.3.
|
|
234
|
-
"expo-modules-core": "~58.0.
|
|
233
|
+
"expo-modules-autolinking": "~58.0.15",
|
|
234
|
+
"expo-modules-cli": "~0.3.2",
|
|
235
|
+
"expo-modules-core": "~58.0.26",
|
|
235
236
|
"pretty-format": "^29.7.0",
|
|
236
237
|
"react-refresh": "^0.14.2",
|
|
237
238
|
"whatwg-url-minimum": "^0.2.0"
|
|
238
239
|
},
|
|
239
240
|
"devDependencies": {
|
|
240
|
-
"@expo/metro-runtime": "58.0.
|
|
241
|
+
"@expo/metro-runtime": "58.0.15",
|
|
241
242
|
"@types/node": "^22.14.0",
|
|
242
243
|
"@types/react": "~19.3.0",
|
|
243
|
-
"expo-updates": "58.0.
|
|
244
|
+
"expo-updates": "58.0.18",
|
|
244
245
|
"npm-run-all2": "^8.0.4",
|
|
245
246
|
"react": "19.3.0",
|
|
246
247
|
"react-dom": "19.3.0",
|
package/scripts/spm/README.md
CHANGED
|
@@ -36,18 +36,23 @@ returns, so `spm add` and `spm update` always receive both real paths. Expo's
|
|
|
36
36
|
prebuild command builds Debug and Release by default; do not use a single-flavor
|
|
37
37
|
prebuild for an app that consumes the SwiftPM plugin.
|
|
38
38
|
|
|
39
|
-
Lookup runs for **every** resolved pod
|
|
40
|
-
with a `spm.config.json` product is
|
|
41
|
-
moment its artifact exists — no
|
|
42
|
-
|
|
39
|
+
Lookup runs for **every** resolved pod except ExpoModulesJSI (see below), not
|
|
40
|
+
just the core frameworks. Any module with a `spm.config.json` product is
|
|
41
|
+
consumed as a precompiled framework the moment its artifact exists — no
|
|
42
|
+
`Package.swift` is generated for it, and none is needed. The exception is a
|
|
43
|
+
module the app lists in its `buildFromSource` autolinking option (see below).
|
|
44
|
+
Path 3 is the
|
|
45
|
+
published-package case: a module shipping
|
|
43
46
|
`prebuilds/output/<flavor>/xcframeworks` is picked up with no local build.
|
|
44
47
|
|
|
45
48
|
React Native normalizes the declared pairs into immutable app-local Debug and
|
|
46
49
|
Release slots. Xcode then selects, exact-links, embeds, and signs the right slot
|
|
47
50
|
for each configuration. Configurations containing `debug` or `development` use
|
|
48
51
|
Debug; all others use Release. Adding, removing, or changing a flavored Expo
|
|
49
|
-
framework requires `
|
|
50
|
-
refreshes invariant source/codegen
|
|
52
|
+
framework requires `node <path to react-native>/scripts/setup-apple-spm.js update`,
|
|
53
|
+
run from the app root; build-time `spm sync` only refreshes invariant source/codegen
|
|
54
|
+
output. The command runs React Native's script directly, because Expo apps do not use
|
|
55
|
+
`@react-native-community/cli`, the wrapper that provides `react-native spm`.
|
|
51
56
|
|
|
52
57
|
## SwiftPM graph
|
|
53
58
|
|
|
@@ -64,6 +69,57 @@ ExpoModulesCore module map itself declares `use React`, so these invariant
|
|
|
64
69
|
carriers are needed even when a module does not import React directly. The
|
|
65
70
|
plugin does not infer runtime React or Hermes products.
|
|
66
71
|
|
|
72
|
+
## ExpoModulesJSI
|
|
73
|
+
|
|
74
|
+
ExpoModulesJSI is never linked as a precompiled framework, even when a Debug and
|
|
75
|
+
Release pair exists, because it must be compiled against the app's React Native.
|
|
76
|
+
npm ships only its headers, `ExpoModulesJSIHeaders`, found with the lookup above
|
|
77
|
+
in `headers/xcframeworks`. The plugin wraps them in a generated
|
|
78
|
+
`ExpoModulesJSIHeaders` package that every Expo source package depends on, and
|
|
79
|
+
adds the app target build phase "Build ExpoModulesJSI". Before the app's sources
|
|
80
|
+
compile, the phase finds the installed `expo-modules-jsi` and runs its
|
|
81
|
+
`apple/scripts/build-swiftpm-app-phase.sh`, which builds the framework into the
|
|
82
|
+
build folder, then copies it to where the app links and embeds it. When the
|
|
83
|
+
headers carry an `expo-package.json` version stamp, sync fails if that version differs
|
|
84
|
+
from the installed `expo-modules-jsi` or from the copy the phase builds.
|
|
85
|
+
|
|
86
|
+
## Modules built from their checked-in Package.swift
|
|
87
|
+
|
|
88
|
+
The plugin decides each module in this order:
|
|
89
|
+
|
|
90
|
+
1. When a precompiled artifact exists, the module is linked precompiled, unless
|
|
91
|
+
the app lists it in `buildFromSource`.
|
|
92
|
+
2. Otherwise, when its `Package.swift` depends on the `ExpoModulesCoreHeaders`
|
|
93
|
+
product, the plugin builds it from that manifest as it stands. The manifest
|
|
94
|
+
compiles against the `ExpoModulesCoreHeaders` and `ExpoModulesJSIHeaders`
|
|
95
|
+
xcframeworks.
|
|
96
|
+
3. Otherwise its `Package.swift` is mirrored into a generated package, or a
|
|
97
|
+
pure-Swift module gets a generated package over its sources.
|
|
98
|
+
|
|
99
|
+
A manifest built as it stands is linked at `<outDir>/direct/<npm package name>`,
|
|
100
|
+
a symlink to the module root, next to the `ExpoModulesCoreHeaders` package the
|
|
101
|
+
plugin emits in `direct/`. Link names are not flattened, so a scoped package
|
|
102
|
+
lands at `direct/@scope/pkg`. SwiftPM resolves the manifest's relative paths
|
|
103
|
+
from the link, not from the module's real directory, so the path to the headers
|
|
104
|
+
package depends on that depth: `../ExpoModulesCoreHeaders` for an unscoped
|
|
105
|
+
package, `../../ExpoModulesCoreHeaders` for a scoped one.
|
|
106
|
+
|
|
107
|
+
`buildFromSource` is the option CocoaPods reads, from
|
|
108
|
+
`"expo": { "autolinking": { "buildFromSource": [...] } }` or its `"ios"`
|
|
109
|
+
section in the app's package.json. Each entry is a regular expression that must
|
|
110
|
+
match the whole pod name or npm package name. Under SwiftPM the entries are
|
|
111
|
+
JavaScript regular expressions, so Ruby-only syntax differs: `(?i)` fails the
|
|
112
|
+
sync with an error that names the invalid entry, and `\A` matches a literal `A`.
|
|
113
|
+
An entry that is a
|
|
114
|
+
module's pod name or npm package name, character for character, names it
|
|
115
|
+
exactly; any other entry is a pattern. An exact entry for ExpoModulesCore fails
|
|
116
|
+
the sync, because every module built from source compiles against the
|
|
117
|
+
precompiled ExpoModulesCore. A module named exactly that has an artifact but no
|
|
118
|
+
way to be built from source is reported with the reason, and the report asks to
|
|
119
|
+
remove the entry so the artifact is used. A module that only a pattern matches,
|
|
120
|
+
ExpoModulesCore included, is linked precompiled in that case, and one warning
|
|
121
|
+
names each such module and its entry.
|
|
122
|
+
|
|
67
123
|
## Unsupported modules
|
|
68
124
|
|
|
69
125
|
A module the plugin cannot contribute aborts autolinking. Dropping it would not
|
|
@@ -73,8 +129,9 @@ surfaces as a build error, naming the fix:
|
|
|
73
129
|
|
|
74
130
|
- **A prebuildable product with no built artifact** — the module declares a
|
|
75
131
|
product in its `spm.config.json`, so it needs no `Package.swift`; the artifact
|
|
76
|
-
is simply missing.
|
|
77
|
-
|
|
132
|
+
is simply missing. From the Expo repository root,
|
|
133
|
+
`node tools/bin/expotools.js prebuild <package>` (both flavors, so omit
|
|
134
|
+
`--flavor`) fixes it. This is the preferred route for a mixed-language module: the prebuild
|
|
78
135
|
pipeline compiles Swift, Objective-C, and C++ targets into one XCFramework, so
|
|
79
136
|
no source split is required.
|
|
80
137
|
- **Mixed Swift and Objective-C/C++ sources with neither manifest** — SwiftPM
|
|
@@ -5,6 +5,7 @@ const os = require('os');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
7
|
const { readPodfileProperties, resolveAppTarget } = require('../app-target');
|
|
8
|
+
const { spmUpdateCommand } = require('../commands');
|
|
8
9
|
|
|
9
10
|
// The real project of apps/minimal-swiftpm: the entitlements derivation reads an
|
|
10
11
|
// Xcode project, so mocking one out would only assert our own fixture back.
|
|
@@ -207,7 +208,7 @@ describe('the entitlements file', () => {
|
|
|
207
208
|
const appRoot = makeApp({ marker: { target: 'renamed' } });
|
|
208
209
|
expect(resolveAppTarget(appRoot).entitlementPath).toBeNull();
|
|
209
210
|
expect(warnings()).toContain('"renamed"');
|
|
210
|
-
expect(warnings()).toContain(
|
|
211
|
+
expect(warnings()).toContain(spmUpdateCommand());
|
|
211
212
|
// The project parsed fine; only the target was missing.
|
|
212
213
|
expect(warnings()).not.toContain('could not be read');
|
|
213
214
|
});
|
|
@@ -423,7 +424,7 @@ describe('the Podfile properties', () => {
|
|
|
423
424
|
expect(message.startsWith('[expo-spm-plugin] ')).toBe(true);
|
|
424
425
|
expect(message).not.toContain('WARNING');
|
|
425
426
|
expect(message).toContain('leave each gated product to its own default');
|
|
426
|
-
expect(message).toContain(
|
|
427
|
+
expect(message).toContain(spmUpdateCommand());
|
|
427
428
|
});
|
|
428
429
|
|
|
429
430
|
// An unset property leaves its gate at that gate's own default, so no fallback is
|
|
@@ -116,22 +116,37 @@ describe('resolveExpoModules', () => {
|
|
|
116
116
|
expect(resolve({ modules, extraDependencies, coreFeatures: [] })).toEqual({
|
|
117
117
|
modules,
|
|
118
118
|
extraDependencies,
|
|
119
|
+
buildFromSource: [],
|
|
119
120
|
});
|
|
120
121
|
});
|
|
121
122
|
|
|
122
123
|
// Every caller reads `extraDependencies.length`, so it is an array in every shape
|
|
123
124
|
// the CLI answers with.
|
|
124
125
|
it('reports no extra pods when the app declares none', () => {
|
|
125
|
-
expect(resolve({ modules: [] })).toEqual({
|
|
126
|
+
expect(resolve({ modules: [] })).toEqual({
|
|
127
|
+
modules: [],
|
|
128
|
+
extraDependencies: [],
|
|
129
|
+
buildFromSource: [],
|
|
130
|
+
});
|
|
126
131
|
expect(resolve({ modules: [], extraDependencies: null })).toEqual({
|
|
127
132
|
modules: [],
|
|
128
133
|
extraDependencies: [],
|
|
134
|
+
buildFromSource: [],
|
|
129
135
|
});
|
|
130
136
|
});
|
|
131
137
|
|
|
138
|
+
// The same option CocoaPods reads from this output, in autolinking_manager.rb.
|
|
139
|
+
it("returns the app's buildFromSource patterns", () => {
|
|
140
|
+
const configuration = { buildFromSource: ['expo-haptics', 'ExpoCamera.*'] };
|
|
141
|
+
expect(resolve({ modules: [], configuration }).buildFromSource).toEqual([
|
|
142
|
+
'expo-haptics',
|
|
143
|
+
'ExpoCamera.*',
|
|
144
|
+
]);
|
|
145
|
+
});
|
|
146
|
+
|
|
132
147
|
it('reads the legacy top-level array as modules alone', () => {
|
|
133
148
|
const modules = [{ packageName: 'expo-camera', pods: [] }];
|
|
134
149
|
|
|
135
|
-
expect(resolve(modules)).toEqual({ modules, extraDependencies: [] });
|
|
150
|
+
expect(resolve(modules)).toEqual({ modules, extraDependencies: [], buildFromSource: [] });
|
|
136
151
|
});
|
|
137
152
|
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const { configureSpmUpdateCommand, spmUpdateCommand } = require('../commands');
|
|
8
|
+
|
|
9
|
+
describe('spmUpdateCommand', () => {
|
|
10
|
+
afterEach(() => configureSpmUpdateCommand());
|
|
11
|
+
|
|
12
|
+
it("runs React Native's setup script from the app's node_modules by default", () => {
|
|
13
|
+
expect(spmUpdateCommand()).toBe(
|
|
14
|
+
'node node_modules/react-native/scripts/setup-apple-spm.js update'
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('runs the script of a hoisted react-native, relative to the app root', () => {
|
|
19
|
+
configureSpmUpdateCommand({
|
|
20
|
+
appRoot: '/repo/apps/mobile',
|
|
21
|
+
reactNativeRoot: '/repo/node_modules/react-native',
|
|
22
|
+
});
|
|
23
|
+
expect(spmUpdateCommand()).toBe(
|
|
24
|
+
'node ../../node_modules/react-native/scripts/setup-apple-spm.js update'
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('runs the script of a hoisted react-native when the app root is reached through a symlink', () => {
|
|
29
|
+
const root = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'expo-spm-commands-')));
|
|
30
|
+
try {
|
|
31
|
+
const reactNativeRoot = path.join(root, 'deep', 'repo', 'node_modules', 'react-native');
|
|
32
|
+
fs.mkdirSync(reactNativeRoot, { recursive: true });
|
|
33
|
+
fs.mkdirSync(path.join(root, 'deep', 'repo', 'apps', 'mobile'), { recursive: true });
|
|
34
|
+
fs.symlinkSync(path.join(root, 'deep', 'repo'), path.join(root, 'link'));
|
|
35
|
+
|
|
36
|
+
configureSpmUpdateCommand({
|
|
37
|
+
appRoot: path.join(root, 'link', 'apps', 'mobile'),
|
|
38
|
+
reactNativeRoot,
|
|
39
|
+
});
|
|
40
|
+
expect(spmUpdateCommand()).toBe(
|
|
41
|
+
'node ../../node_modules/react-native/scripts/setup-apple-spm.js update'
|
|
42
|
+
);
|
|
43
|
+
} finally {
|
|
44
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('keeps the name of a react-native that is itself a symlink, as pnpm installs it', () => {
|
|
49
|
+
const root = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'expo-spm-commands-')));
|
|
50
|
+
try {
|
|
51
|
+
const store = path.join(root, 'node_modules', '.pnpm', 'react-native@0.88.0', 'node_modules');
|
|
52
|
+
fs.mkdirSync(path.join(store, 'react-native'), { recursive: true });
|
|
53
|
+
fs.symlinkSync(
|
|
54
|
+
path.join(store, 'react-native'),
|
|
55
|
+
path.join(root, 'node_modules', 'react-native')
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
configureSpmUpdateCommand({
|
|
59
|
+
appRoot: root,
|
|
60
|
+
reactNativeRoot: path.join(root, 'node_modules', 'react-native'),
|
|
61
|
+
});
|
|
62
|
+
expect(spmUpdateCommand()).toBe(
|
|
63
|
+
'node node_modules/react-native/scripts/setup-apple-spm.js update'
|
|
64
|
+
);
|
|
65
|
+
} finally {
|
|
66
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('returns to the default when configured with nothing', () => {
|
|
71
|
+
configureSpmUpdateCommand({
|
|
72
|
+
appRoot: '/repo/apps/mobile',
|
|
73
|
+
reactNativeRoot: '/repo/node_modules/react-native',
|
|
74
|
+
});
|
|
75
|
+
configureSpmUpdateCommand();
|
|
76
|
+
expect(spmUpdateCommand()).toBe(
|
|
77
|
+
'node node_modules/react-native/scripts/setup-apple-spm.js update'
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('rerunSpmUpdate', () => {
|
|
83
|
+
afterEach(() => configureSpmUpdateCommand());
|
|
84
|
+
|
|
85
|
+
it('names the command of the react-native configured after it was loaded', () => {
|
|
86
|
+
const { rerunSpmUpdate } = require('../diagnostics');
|
|
87
|
+
configureSpmUpdateCommand({
|
|
88
|
+
appRoot: '/repo/apps/mobile',
|
|
89
|
+
reactNativeRoot: '/repo/node_modules/react-native',
|
|
90
|
+
});
|
|
91
|
+
expect(rerunSpmUpdate()).toBe(
|
|
92
|
+
'Then run `node ../../node_modules/react-native/scripts/setup-apple-spm.js update` from your app directory again.'
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
});
|