expo 58.0.1 → 58.0.3

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.
Files changed (33) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/winter/runtime.native.js +0 -2
  3. package/build/winter/runtime.native.js.map +1 -1
  4. package/bundledNativeModules.json +77 -77
  5. package/ios/Expo/ExpoReactNativeFactory.swift +2 -2
  6. package/ios/ExpoObjC/AppDelegates/EXReactRootViewFactory.mm +16 -2
  7. package/ios/ExpoObjC/include/Expo/EXReactRootViewFactory.h +2 -1
  8. package/package.json +17 -18
  9. package/scripts/spm/__tests__/app-target.test.js +105 -1
  10. package/scripts/spm/__tests__/autolink-gate.test.js +188 -0
  11. package/scripts/spm/__tests__/classify.test.js +17 -19
  12. package/scripts/spm/__tests__/diagnostics.test.js +705 -132
  13. package/scripts/spm/__tests__/manifests.test.js +1086 -75
  14. package/scripts/spm/__tests__/metadata.test.js +120 -0
  15. package/scripts/spm/__tests__/plugin.test.js +2549 -346
  16. package/scripts/spm/app-target.js +44 -1
  17. package/scripts/spm/autolink-gate.js +40 -0
  18. package/scripts/spm/classify.js +54 -77
  19. package/scripts/spm/diagnostics.js +540 -147
  20. package/scripts/spm/flavored-frameworks.js +80 -125
  21. package/scripts/spm/manifests.js +523 -205
  22. package/scripts/spm/metadata.js +152 -0
  23. package/scripts/spm/plugin.js +592 -277
  24. package/scripts/spm/podspec.js +56 -19
  25. package/src/async-require/__tests__/loadBundle.test.ios.ts +2 -2
  26. package/src/winter/__tests__/{TextDecoderStream.test.ios.ts → TextDecoderStream.test.native.ts} +23 -2
  27. package/src/winter/runtime.native.ts +0 -2
  28. package/template.tgz +0 -0
  29. package/build/winter/TextDecoder.d.ts +0 -13
  30. package/build/winter/TextDecoder.js +0 -357
  31. package/build/winter/TextDecoder.js.map +0 -1
  32. package/src/winter/TextDecoder.ts +0 -427
  33. package/src/winter/__tests__/TextDecoder.test.native.ts +0 -549
@@ -10,7 +10,7 @@ buildscript {
10
10
  }
11
11
 
12
12
  group = 'host.exp.exponent'
13
- version = '58.0.1'
13
+ version = '58.0.3'
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.1"
24
+ versionName "58.0.3"
25
25
  consumerProguardFiles("proguard-rules.pro")
26
26
  }
27
27
  testOptions {
@@ -6,8 +6,6 @@ import './setupReactNativeEnvironment';
6
6
  import '../../types';
7
7
  import { installFormDataPatch } from './FormData';
8
8
  import { installGlobal as install } from './installGlobal';
9
- // https://encoding.spec.whatwg.org/#textdecoder
10
- install('TextDecoder', ()=>require('./TextDecoder').TextDecoder);
11
9
  // https://encoding.spec.whatwg.org/#interface-textdecoderstream
12
10
  install('TextDecoderStream', ()=>require('./TextDecoderStream').TextDecoderStream);
13
11
  // https://encoding.spec.whatwg.org/#interface-textencoderstream
@@ -1 +1 @@
1
- {"version":3,"sources":["winter/runtime.native.ts"],"sourcesContent":[null],"names":["installFormDataPatch","installGlobal","install","require","TextDecoder","TextDecoderStream","TextEncoderStream","URL","URLSearchParams","DOMException","ImportMetaRegistry","default","FormData","Symbol","asyncIterator","for","useRnFetch","process","env","EXPO_PUBLIC_USE_RN_FETCH","globalThis","Headers","Error","fetch"],"mappings":"AAAA,wFAAwF;AACxF,wBAAwB;AAExB,+FAA+F;AAC/F,iGAAiG;AACjG,OAAO,gCAAgC;AACvC,OAAO,cAAc;AACrB,SAASA,oBAAoB,QAAQ,aAAa;AAClD,SAASC,iBAAiBC,OAAO,QAAQ,kBAAkB;AAE3D,gDAAgD;AAChDA,QAAQ,eAAe,IAAMC,QAAQ,iBAAiBC,WAAW;AACjE,gEAAgE;AAChEF,QAAQ,qBAAqB,IAAMC,QAAQ,uBAAuBE,iBAAiB;AACnF,gEAAgE;AAChEH,QAAQ,qBAAqB,IAAMC,QAAQ,uBAAuBG,iBAAiB;AACnF,mCAAmC;AACnCJ,QAAQ,OAAO,IAAMC,QAAQ,SAASI,GAAG;AACzC,+CAA+C;AAC/CL,QAAQ,mBAAmB,IAAMC,QAAQ,SAASK,eAAe;AACjE,mDAAmD;AACnDN,QAAQ,gBAAgB,IAAMC,QAAQ,kBAAkBM,YAAY;AACpE,sCAAsC;AACtC,kDAAkD;AAElDP,QAAQ,4BAA4B,IAAMC,QAAQ,wBAAwBO,kBAAkB;AAE5F,8EAA8E;AAC9ER,QAAQ,mBAAmB,IAAMC,QAAQ,2BAA2BQ,OAAO;AAE3EX,qBAAqBY;AAErB,6CAA6C;AAC7C,+EAA+E;AAC/EC,OAAOC,aAAa,KAAKD,OAAOE,GAAG,CAAC;AAEpC,MAAMC,aACJC,QAAQC,GAAG,CAACC,wBAAwB,KAAK,OAAOF,QAAQC,GAAG,CAACC,wBAAwB,KAAK;AAE3F,IAAI,CAACH,YAAY;IACf,sEAAsE;IACtE,sEAAsE;IACtE,IAAI,CAACI,WAAWC,OAAO,EAAE;QACvB,MAAM,IAAIC,MACR;IAEJ;IACApB,QAAQ,SAAS,IAAMC,QAAQ,WAAWoB,KAAK;AACjD"}
1
+ {"version":3,"sources":["winter/runtime.native.ts"],"sourcesContent":[null],"names":["installFormDataPatch","installGlobal","install","require","TextDecoderStream","TextEncoderStream","URL","URLSearchParams","DOMException","ImportMetaRegistry","default","FormData","Symbol","asyncIterator","for","useRnFetch","process","env","EXPO_PUBLIC_USE_RN_FETCH","globalThis","Headers","Error","fetch"],"mappings":"AAAA,wFAAwF;AACxF,wBAAwB;AAExB,+FAA+F;AAC/F,iGAAiG;AACjG,OAAO,gCAAgC;AACvC,OAAO,cAAc;AACrB,SAASA,oBAAoB,QAAQ,aAAa;AAClD,SAASC,iBAAiBC,OAAO,QAAQ,kBAAkB;AAE3D,gEAAgE;AAChEA,QAAQ,qBAAqB,IAAMC,QAAQ,uBAAuBC,iBAAiB;AACnF,gEAAgE;AAChEF,QAAQ,qBAAqB,IAAMC,QAAQ,uBAAuBE,iBAAiB;AACnF,mCAAmC;AACnCH,QAAQ,OAAO,IAAMC,QAAQ,SAASG,GAAG;AACzC,+CAA+C;AAC/CJ,QAAQ,mBAAmB,IAAMC,QAAQ,SAASI,eAAe;AACjE,mDAAmD;AACnDL,QAAQ,gBAAgB,IAAMC,QAAQ,kBAAkBK,YAAY;AACpE,sCAAsC;AACtC,kDAAkD;AAElDN,QAAQ,4BAA4B,IAAMC,QAAQ,wBAAwBM,kBAAkB;AAE5F,8EAA8E;AAC9EP,QAAQ,mBAAmB,IAAMC,QAAQ,2BAA2BO,OAAO;AAE3EV,qBAAqBW;AAErB,6CAA6C;AAC7C,+EAA+E;AAC/EC,OAAOC,aAAa,KAAKD,OAAOE,GAAG,CAAC;AAEpC,MAAMC,aACJC,QAAQC,GAAG,CAACC,wBAAwB,KAAK,OAAOF,QAAQC,GAAG,CAACC,wBAAwB,KAAK;AAE3F,IAAI,CAACH,YAAY;IACf,sEAAsE;IACtE,sEAAsE;IACtE,IAAI,CAACI,WAAWC,OAAO,EAAE;QACvB,MAAM,IAAIC,MACR;IAEJ;IACAnB,QAAQ,SAAS,IAAMC,QAAQ,WAAWmB,KAAK;AACjD"}
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "@expo/dom-webview": "~58.0.2",
3
- "@expo/fingerprint": "~0.21.2",
4
- "@expo/metro-runtime": "~58.0.10",
3
+ "@expo/fingerprint": "~0.21.3",
4
+ "@expo/metro-runtime": "~58.0.11",
5
5
  "@expo/vector-icons": "^15.0.2",
6
- "@expo/ui": "~58.0.10",
6
+ "@expo/ui": "~58.0.12",
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,93 +16,93 @@
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.4.8",
19
+ "expo-app-intents": "~0.5.1",
20
20
  "expo-app-loader-provider": "~8.0.0",
21
- "expo-app-metrics": "~58.0.10",
21
+ "expo-app-metrics": "~58.0.11",
22
22
  "expo-apple-authentication": "~58.0.2",
23
- "expo-application": "~58.0.2",
24
- "expo-asset": "~58.0.9",
25
- "expo-audio": "~58.0.3",
26
- "expo-auth-session": "~58.0.6",
27
- "expo-background-fetch": "~58.0.9",
28
- "expo-background-task": "~58.0.9",
29
- "expo-battery": "~58.0.2",
30
- "expo-blur": "~58.0.2",
31
- "expo-brightness": "~58.0.1",
32
- "expo-brownfield": "~58.0.9",
33
- "expo-build-properties": "~58.0.9",
34
- "expo-calendar": "~58.0.5",
35
- "expo-camera": "~58.0.6",
36
- "expo-cellular": "~58.0.1",
23
+ "expo-application": "~58.0.3",
24
+ "expo-asset": "~58.0.11",
25
+ "expo-audio": "~58.0.5",
26
+ "expo-auth-session": "~58.0.8",
27
+ "expo-background-fetch": "~58.0.10",
28
+ "expo-background-task": "~58.0.10",
29
+ "expo-battery": "~58.0.3",
30
+ "expo-blur": "~58.0.3",
31
+ "expo-brightness": "~58.0.2",
32
+ "expo-brownfield": "~58.0.11",
33
+ "expo-build-properties": "~58.0.10",
34
+ "expo-calendar": "~58.0.6",
35
+ "expo-camera": "~58.0.8",
36
+ "expo-cellular": "~58.0.2",
37
37
  "expo-checkbox": "~58.0.2",
38
- "expo-clipboard": "~58.0.2",
38
+ "expo-clipboard": "~58.0.3",
39
39
  "expo-constants": "~58.0.9",
40
- "expo-contacts": "~58.0.3",
41
- "expo-crypto": "~58.0.3",
42
- "expo-dev-client": "~58.0.9",
43
- "expo-device": "~58.0.4",
44
- "expo-document-picker": "~58.0.3",
40
+ "expo-contacts": "~58.0.5",
41
+ "expo-crypto": "~58.0.4",
42
+ "expo-dev-client": "~58.0.11",
43
+ "expo-device": "~58.0.5",
44
+ "expo-document-picker": "~58.0.4",
45
45
  "expo-eas-client": "~58.0.2",
46
- "expo-file-system": "~58.0.4",
47
- "expo-font": "~58.0.4",
48
- "expo-gl": "~58.0.2",
46
+ "expo-file-system": "~58.0.5",
47
+ "expo-font": "~58.0.6",
48
+ "expo-gl": "~58.0.3",
49
49
  "expo-glass-effect": "~58.0.3",
50
50
  "expo-google-app-auth": "~8.3.0",
51
- "expo-haptics": "~58.0.3",
52
- "expo-image": "~58.0.9",
53
- "expo-image-loader": "~58.0.2",
54
- "expo-image-manipulator": "~58.0.10",
55
- "expo-image-picker": "~58.0.9",
56
- "expo-intent-launcher": "~58.0.2",
57
- "expo-insights": "~58.0.10",
58
- "expo-keep-awake": "~58.0.2",
59
- "expo-linear-gradient": "~58.0.2",
60
- "expo-linking": "~58.0.9",
61
- "expo-local-authentication": "~58.0.1",
62
- "expo-localization": "~58.0.2",
63
- "expo-location": "~58.0.9",
64
- "expo-mail-composer": "~58.0.2",
51
+ "expo-haptics": "~58.0.4",
52
+ "expo-image": "~58.0.11",
53
+ "expo-image-loader": "~58.0.3",
54
+ "expo-image-manipulator": "~58.0.12",
55
+ "expo-image-picker": "~58.0.10",
56
+ "expo-intent-launcher": "~58.0.3",
57
+ "expo-insights": "~58.0.11",
58
+ "expo-keep-awake": "~58.0.3",
59
+ "expo-linear-gradient": "~58.0.3",
60
+ "expo-linking": "~58.0.10",
61
+ "expo-local-authentication": "~58.0.2",
62
+ "expo-localization": "~58.0.3",
63
+ "expo-location": "~58.0.11",
64
+ "expo-mail-composer": "~58.0.3",
65
65
  "expo-manifests": "~58.0.1",
66
- "expo-maps": "~58.0.3",
66
+ "expo-maps": "~58.0.5",
67
67
  "expo-mcp": "~0.2.1",
68
- "expo-media-library": "~58.0.4",
69
- "expo-mesh-gradient": "~58.0.2",
68
+ "expo-media-library": "~58.0.6",
69
+ "expo-mesh-gradient": "~58.0.3",
70
70
  "expo-module-template": "~58.0.5",
71
- "expo-modules-core": "~58.0.10",
72
- "expo-navigation-bar": "~58.0.3",
73
- "expo-network": "~58.0.2",
74
- "expo-notifications": "~58.0.10",
75
- "expo-observe": "~58.0.12",
76
- "expo-print": "~58.0.3",
77
- "expo-live-photo": "~58.0.2",
78
- "expo-router": "~58.0.11",
79
- "expo-screen-capture": "~58.0.4",
80
- "expo-screen-orientation": "~58.0.1",
81
- "expo-secure-store": "~58.0.1",
82
- "expo-sensors": "~58.0.1",
83
- "expo-server": "~58.0.2",
84
- "expo-sharing": "~58.0.12",
85
- "expo-sms": "~58.0.1",
86
- "expo-speech": "~58.0.2",
87
- "expo-splash-screen": "~58.0.3",
88
- "expo-sqlite": "~58.0.7",
89
- "expo-status-bar": "~58.0.2",
90
- "expo-store-review": "~58.0.1",
91
- "expo-symbols": "~58.0.3",
92
- "expo-system-ui": "~58.0.4",
93
- "expo-task-manager": "~58.0.10",
94
- "expo-tracking-transparency": "~58.0.1",
95
- "expo-updates": "~58.0.12",
96
- "expo-video-thumbnails": "~58.0.1",
97
- "expo-video": "~58.0.5",
98
- "expo-web-browser": "~58.0.3",
99
- "expo-widgets": "~58.0.10",
100
- "jest-expo": "~58.0.5",
71
+ "expo-modules-core": "~58.0.12",
72
+ "expo-navigation-bar": "~58.0.4",
73
+ "expo-network": "~58.0.3",
74
+ "expo-notifications": "~58.1.0",
75
+ "expo-observe": "~58.0.13",
76
+ "expo-print": "~58.0.4",
77
+ "expo-live-photo": "~58.0.3",
78
+ "expo-router": "~58.0.13",
79
+ "expo-screen-capture": "~58.0.5",
80
+ "expo-screen-orientation": "~58.0.2",
81
+ "expo-secure-store": "~58.0.2",
82
+ "expo-sensors": "~58.0.2",
83
+ "expo-server": "~58.0.3",
84
+ "expo-sharing": "~58.0.14",
85
+ "expo-sms": "~58.0.2",
86
+ "expo-speech": "~58.0.3",
87
+ "expo-splash-screen": "~58.0.5",
88
+ "expo-sqlite": "~58.0.9",
89
+ "expo-status-bar": "~58.0.3",
90
+ "expo-store-review": "~58.0.2",
91
+ "expo-symbols": "~58.0.4",
92
+ "expo-system-ui": "~58.0.5",
93
+ "expo-task-manager": "~58.0.11",
94
+ "expo-tracking-transparency": "~58.0.2",
95
+ "expo-updates": "~58.0.14",
96
+ "expo-video-thumbnails": "~58.0.2",
97
+ "expo-video": "~58.0.6",
98
+ "expo-web-browser": "~58.0.5",
99
+ "expo-widgets": "~58.0.12",
100
+ "jest-expo": "~58.0.7",
101
101
  "lottie-react-native": "~7.5.0",
102
102
  "react": "19.3.0",
103
103
  "react-dom": "19.3.0",
104
104
  "react-native": "0.88.0-rc.3",
105
- "react-native-web": "~0.21.0",
105
+ "react-native-web": "~0.21.3",
106
106
  "react-native-gesture-handler": "~3.2.1",
107
107
  "react-native-keyboard-controller": "1.22.4",
108
108
  "react-native-maps": "1.29.0",
@@ -116,7 +116,7 @@
116
116
  "react-native-webview": "14.0.1",
117
117
  "react-server-dom-webpack": "~19.3.0",
118
118
  "sentry-expo": "~7.0.0",
119
- "unimodules-app-loader": "~58.0.1",
119
+ "unimodules-app-loader": "~58.0.2",
120
120
  "unimodules-image-loader-interface": "~6.1.0",
121
121
  "@shopify/react-native-skia": "2.13.1",
122
122
  "@shopify/flash-list": "2.3.2",
@@ -127,7 +127,6 @@ public class ExpoReactNativeFactory: ExpoReactNativeFactoryObjC, ExpoReactNative
127
127
 
128
128
  let rootView: UIView
129
129
  if let factory = self.rootViewFactory as? ExpoReactRootViewFactory {
130
- // RCTDevMenuConfiguration is only available in react-native 0.83+
131
130
  // bundleConfiguration is only accepted in react-native 0.84+
132
131
  #if os(iOS) || os(tvOS)
133
132
  let bundleConfiguration = ExpoBundleConfiguration.configuration(
@@ -146,7 +145,8 @@ public class ExpoReactNativeFactory: ExpoReactNativeFactoryObjC, ExpoReactNative
146
145
  rootView = factory.superView(
147
146
  withModuleName: moduleName ?? defaultModuleName,
148
147
  initialProperties: initialProps,
149
- launchOptions: launchOptions ?? [:]
148
+ launchOptions: launchOptions ?? [:],
149
+ devMenuConfiguration: self.devMenuConfiguration
150
150
  )
151
151
  #endif
152
152
  } else {
@@ -60,21 +60,35 @@
60
60
  devMenuConfiguration:devMenuConfiguration];
61
61
  }
62
62
  #else
63
+ // react-native-macos routes every `viewWithModuleName:` variant, including the one called by
64
+ // `RCTReactNativeFactory`, through this one.
63
65
  - (UIView *)viewWithModuleName:(NSString *)moduleName
64
66
  initialProperties:(nullable NSDictionary *)initialProperties
65
67
  launchOptions:(nullable NSDictionary *)launchOptions
68
+ devMenuConfiguration:(nullable RCTDevMenuConfiguration *)devMenuConfiguration
66
69
  {
67
70
  if (self.reactDelegate != nil) {
68
71
  return [((id<EXReactDelegateProtocol>)self.reactDelegate) createReactRootViewWithModuleName:moduleName initialProperties:initialProperties launchOptions:launchOptions];
69
72
  }
70
- return [super viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:launchOptions];
73
+ return [super viewWithModuleName:moduleName
74
+ initialProperties:initialProperties
75
+ launchOptions:launchOptions
76
+ devMenuConfiguration:devMenuConfiguration];
71
77
  }
72
78
 
73
79
  - (UIView *)superViewWithModuleName:(NSString *)moduleName
74
80
  initialProperties:(nullable NSDictionary *)initialProperties
75
81
  launchOptions:(nullable NSDictionary *)launchOptions
82
+ devMenuConfiguration:(nullable RCTDevMenuConfiguration *)devMenuConfiguration
76
83
  {
77
- return [super viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:launchOptions];
84
+ if (devMenuConfiguration == nil) {
85
+ devMenuConfiguration = [RCTDevMenuConfiguration defaultConfiguration];
86
+ }
87
+
88
+ return [super viewWithModuleName:moduleName
89
+ initialProperties:initialProperties
90
+ launchOptions:launchOptions
91
+ devMenuConfiguration:devMenuConfiguration];
78
92
  }
79
93
  #endif
80
94
 
@@ -33,7 +33,8 @@ NS_SWIFT_NAME(ExpoReactRootViewFactory)
33
33
  #else
34
34
  - (UIView *)superViewWithModuleName:(NSString *)moduleName
35
35
  initialProperties:(nullable NSDictionary *)initialProperties
36
- launchOptions:(nullable NSDictionary *)launchOptions;
36
+ launchOptions:(nullable NSDictionary *)launchOptions
37
+ devMenuConfiguration:(nullable RCTDevMenuConfiguration *)devMenuConfiguration;
37
38
  #endif
38
39
 
39
40
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "58.0.1",
3
+ "version": "58.0.3",
4
4
  "description": "The Expo SDK",
5
5
  "keywords": [
6
6
  "expo"
@@ -201,36 +201,35 @@
201
201
  },
202
202
  "dependencies": {
203
203
  "@babel/runtime": "^7.20.0",
204
- "@expo/cli": "^58.1.0",
205
- "@expo/config": "~58.0.1",
206
- "@expo/config-plugins": "~58.0.4",
204
+ "@expo/cli": "^58.1.2",
205
+ "@expo/config": "~58.0.2",
206
+ "@expo/config-plugins": "~58.0.5",
207
207
  "@expo/devtools": "~58.0.2",
208
208
  "@expo/dom-webview": "~58.0.2",
209
- "@expo/fingerprint": "^0.21.2",
210
- "@expo/local-build-cache-provider": "^58.0.1",
211
- "@expo/log-box": "^58.0.8",
209
+ "@expo/fingerprint": "^0.21.3",
210
+ "@expo/local-build-cache-provider": "^58.0.2",
211
+ "@expo/log-box": "^58.0.9",
212
212
  "@expo/log-box-utils": "^58.0.1",
213
213
  "@expo/metro": "~58.0.0-rc.0",
214
- "@expo/metro-config": "~58.0.6",
214
+ "@expo/metro-config": "~58.0.8",
215
215
  "@ungap/structured-clone": "^1.3.0",
216
- "babel-preset-expo": "~58.0.7",
217
- "expo-asset": "~58.0.9",
216
+ "babel-preset-expo": "~58.0.9",
217
+ "expo-asset": "~58.0.11",
218
218
  "expo-constants": "~58.0.9",
219
- "expo-file-system": "~58.0.4",
220
- "expo-font": "~58.0.4",
221
- "expo-keep-awake": "~58.0.2",
222
- "expo-modules-autolinking": "~58.0.6",
223
- "expo-modules-core": "~58.0.10",
219
+ "expo-file-system": "~58.0.5",
220
+ "expo-font": "~58.0.6",
221
+ "expo-keep-awake": "~58.0.3",
222
+ "expo-modules-autolinking": "~58.0.8",
223
+ "expo-modules-core": "~58.0.12",
224
224
  "pretty-format": "^29.7.0",
225
225
  "react-refresh": "^0.14.2",
226
226
  "whatwg-url-minimum": "^0.2.0"
227
227
  },
228
228
  "devDependencies": {
229
- "@expo/dom-webview": "58.0.2",
230
- "@expo/metro-runtime": "58.0.10",
229
+ "@expo/metro-runtime": "58.0.11",
231
230
  "@types/node": "^22.14.0",
232
231
  "@types/react": "~19.3.0",
233
- "expo-updates": "58.0.12",
232
+ "expo-updates": "58.0.14",
234
233
  "npm-run-all2": "^8.0.4",
235
234
  "react": "19.3.0",
236
235
  "react-dom": "19.3.0",
@@ -4,7 +4,7 @@ const fs = require('fs');
4
4
  const os = require('os');
5
5
  const path = require('path');
6
6
 
7
- const { resolveAppTarget } = require('../app-target');
7
+ const { readPodfileProperties, resolveAppTarget } = require('../app-target');
8
8
 
9
9
  // The real project of apps/minimal-swiftpm: the entitlements derivation reads an
10
10
  // Xcode project, so mocking one out would only assert our own fixture back.
@@ -368,3 +368,107 @@ describe('the Podfile properties file', () => {
368
368
  expect(resolveAppTarget(makeApp()).podfilePropertiesPath).toBeNull();
369
369
  });
370
370
  });
371
+
372
+ describe('the Podfile properties', () => {
373
+ let tmp;
374
+ beforeAll(() => {
375
+ tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'expo-spm-podfile-properties-'));
376
+ });
377
+
378
+ /** Writes a Podfile.properties.json with `contents` and returns its path. */
379
+ const propertiesFile = (name, contents) => {
380
+ const file = path.join(tmp, name, 'Podfile.properties.json');
381
+ fs.mkdirSync(path.dirname(file), { recursive: true });
382
+ fs.writeFileSync(file, contents);
383
+ return file;
384
+ };
385
+
386
+ const thrownBy = (file) => {
387
+ try {
388
+ readPodfileProperties(file);
389
+ } catch (error) {
390
+ return error;
391
+ }
392
+ throw new Error(`${file} was read as properties instead of being refused`);
393
+ };
394
+
395
+ it('are the properties the file declares', () => {
396
+ const file = propertiesFile(
397
+ 'app',
398
+ JSON.stringify({ 'expo.jsEngine': 'hermes', 'expo.camera.barcode-scanner-enabled': 'false' })
399
+ );
400
+ expect(readPodfileProperties(file)).toEqual({
401
+ 'expo.jsEngine': 'hermes',
402
+ 'expo.camera.barcode-scanner-enabled': 'false',
403
+ });
404
+ expect(warn).not.toHaveBeenCalled();
405
+ });
406
+
407
+ // A file that vanished between `resolveAppTarget` finding it and this read is the
408
+ // same situation as an app that never ran CocoaPods, not a broken file.
409
+ it('are empty and silent when there is no file to read', () => {
410
+ const vanished = path.join(tmp, 'vanished', 'Podfile.properties.json');
411
+ fs.mkdirSync(path.dirname(vanished), { recursive: true });
412
+ const absent = path.join(tmp, 'absent', 'Podfile.properties.json');
413
+ for (const input of [undefined, null, '', {}, [], absent, vanished]) {
414
+ expect(readPodfileProperties(input)).toEqual({});
415
+ }
416
+ expect(warn).not.toHaveBeenCalled();
417
+ });
418
+
419
+ // The namespace is what makes a failed sync attributable to this plugin, and a
420
+ // stop is not one of this file's warnings however it is worded.
421
+ it('fail the sync with a namespaced error rather than a warning', () => {
422
+ const { message } = thrownBy(propertiesFile('namespaced', 'null'));
423
+ expect(message.startsWith('[expo-spm-plugin] ')).toBe(true);
424
+ expect(message).not.toContain('WARNING');
425
+ expect(message).toContain('leave each gated product to its own default');
426
+ expect(message).toContain('npx react-native spm update');
427
+ });
428
+
429
+ // An unset property leaves its gate at that gate's own default, so no fallback is
430
+ // neutral: a clobbered file read as no properties links or drops products against
431
+ // the app's configuration, silently.
432
+ it('fail the sync when the file is not valid JSON', () => {
433
+ const file = propertiesFile('malformed', '{ "expo.jsEngine": ');
434
+ const error = thrownBy(file);
435
+ expect(error.message).toContain(`${file} could not be read as Podfile properties`);
436
+ expect(error.message).toContain(error.cause.message);
437
+ expect(error.cause).toBeInstanceOf(Error);
438
+ expect(warn).not.toHaveBeenCalled();
439
+ });
440
+
441
+ it('fail the sync when the file cannot be read', () => {
442
+ const directory = path.join(tmp, 'unreadable', 'Podfile.properties.json');
443
+ fs.mkdirSync(directory, { recursive: true });
444
+ const error = thrownBy(directory);
445
+ expect(error.message).toContain(directory);
446
+ expect(error.message).toContain(error.cause.message);
447
+ expect(error.cause.code).toBe('EISDIR');
448
+ });
449
+
450
+ // CocoaPods writes an object; anything else is a file some other tool clobbered.
451
+ it.each([
452
+ ['[]', 'an array'],
453
+ ['"hermes"', 'a string'],
454
+ ['17', 'a number'],
455
+ ['null', 'null'],
456
+ ['true', 'a boolean'],
457
+ ])('fail the sync when the file holds %s instead of an object', (contents, held) => {
458
+ const file = propertiesFile(`not-an-object-${encodeURIComponent(contents)}`, contents);
459
+ const error = thrownBy(file);
460
+ expect(error.message).toContain(`${file} could not be read as Podfile properties`);
461
+ expect(error.message).toContain(`it holds ${held}, not an object`);
462
+ expect(error.cause).toBeUndefined();
463
+ expect(warn).not.toHaveBeenCalled();
464
+ });
465
+
466
+ // The error describes the payload's type and never renders the payload: a
467
+ // structure this deep parses fine and then overflows the stack in
468
+ // `JSON.stringify`, which would replace the diagnostic with a stack overflow.
469
+ it('fail the sync for a payload no one can print', () => {
470
+ const depth = 50_000;
471
+ const file = propertiesFile('too-deep', '['.repeat(depth) + ']'.repeat(depth));
472
+ expect(thrownBy(file).message).toContain('it holds an array, not an object');
473
+ });
474
+ });