@reactvision/react-native-visionos 0.86.2 → 0.86.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactvision/react-native-visionos",
3
- "version": "0.86.2",
3
+ "version": "0.86.3",
4
4
  "description": "React Native for visionOS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,21 +40,7 @@ def list_native_modules!(config_command)
40
40
  packages = config["dependencies"]
41
41
  ios_project_root = Pathname.new(config["project"]["ios"]["sourceDir"])
42
42
  react_native_path = Pathname.new(config["reactNativePath"])
43
- # Written next to the Podfile being installed, not next to `project.ios.sourceDir`.
44
- #
45
- # The CLI reports `project.ios.sourceDir` as the app's `ios/` folder for any app that has one,
46
- # whatever platform this install is for. On an out-of-tree platform the Podfile lives elsewhere —
47
- # `visionos/` — and React Native's codegen looks for this file under the directory it is building
48
- # from. Writing it to `ios/` therefore left the visionOS build without it, and
49
- # `findCodegenEnabledLibraries` fell back to scanning the app's package.json, where `react-native`
50
- # and the visionOS fork both declare the same turbo modules. `pod install` then died with
51
- # "declared in more than one libraries" for AccessibilityManager, Appearance, AppState,
52
- # DeviceInfo, PlatformConstants and StatusBarManager.
53
- #
54
- # `ios_project_root` is deliberately left alone above: it is also used to make podspec paths
55
- # relative, and those are correct as they stand because `ios/` and `visionos/` are siblings.
56
- codegen_output_path = Pathname.new(Pod::Config.instance.installation_root.to_s)
57
- .join("build/generated/autolinking/autolinking.json")
43
+ codegen_output_path = ios_project_root.join("build/generated/autolinking/autolinking.json")
58
44
 
59
45
  # Write autolinking react-native-config output to codegen folder
60
46
  FileUtils.mkdir_p(File.dirname(codegen_output_path))
@@ -239,8 +239,34 @@ function findExternalLibraries(
239
239
  'Searching for codegen-enabled libraries in the project dependencies.',
240
240
  true,
241
241
  );
242
+ // This package IS React Native. An out-of-tree platform requires it to be installed alongside
243
+ // upstream `react-native` — the app still builds iOS and Android from that one — and both declare
244
+ // the same turbo modules (AccessibilityManager, Appearance, AppState, DeviceInfo,
245
+ // PlatformConstants, StatusBarManager). Library identity below is the *package* name, so the two
246
+ // read as different libraries claiming the same modules and the conflict check rejects the pair,
247
+ // killing `pod install`.
248
+ //
249
+ // Upstream's copy is skipped: for this build, React Native is this package. Skipping the scan
250
+ // altogether would also silence the conflict, and was tried — it loses this package's own
251
+ // visionOS-only codegen library (FBReactNativeSpec_visionOS), and the build then fails much later
252
+ // on a missing generated header.
253
+ const selfPkgName = JSON.parse(
254
+ fs.readFileSync(
255
+ path.join(__dirname, '..', '..', '..', 'package.json'),
256
+ 'utf8',
257
+ ),
258
+ ).name;
259
+ const skipUpstreamReactNative =
260
+ selfPkgName !== 'react-native' && dependencies['react-native'] != null;
261
+
242
262
  // Handle third-party libraries
243
263
  return Object.keys(dependencies).flatMap(dependency => {
264
+ if (skipUpstreamReactNative && dependency === 'react-native') {
265
+ codegenLog(
266
+ `Skipping upstream react-native: ${selfPkgName} is React Native for this build.`,
267
+ );
268
+ return [];
269
+ }
244
270
  let configFilePath = '';
245
271
  try {
246
272
  configFilePath = require.resolve(path.join(dependency, 'package.json'), {