@gfean/react-native-bundle-drop 0.10.0 → 0.11.0

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 (107) hide show
  1. package/BundleDrop.podspec +17 -20
  2. package/README.md +60 -1
  3. package/android/build.gradle +4 -0
  4. package/android/src/main/java/com/bundledrop/BundleDropFileOps.kt +20 -0
  5. package/android/src/main/java/com/bundledrop/BundleDropModule.kt +4 -1
  6. package/android/src/main/java/com/bundledrop/BundleDropNativePaths.kt +5 -1
  7. package/docs/native-fingerprint.md +211 -0
  8. package/expo/android/build.gradle +61 -56
  9. package/ios/BundleDropLocator.swift +12 -0
  10. package/ios/BundleDropModule.swift +31 -13
  11. package/ios/BundleDropReactContent.swift +54 -0
  12. package/ios/BundleDropStartupRecovery.swift +48 -2
  13. package/ios/BundleDropStartupRecoveryAdapter.swift +87 -30
  14. package/lib/CLI/cli.js +9 -0
  15. package/lib/CLI/scripts/doctor.js +18 -7
  16. package/lib/CLI/scripts/expo/configure-expo.js +8 -3
  17. package/lib/CLI/scripts/fingerprint-cli.d.ts +12 -0
  18. package/lib/CLI/scripts/fingerprint-cli.js +36 -0
  19. package/lib/CLI/scripts/native/write-runtime-identity.js +3 -1
  20. package/lib/CLI/scripts/sight-ota.js +12 -3
  21. package/lib/CLI/scripts/upload-cli.d.ts +1 -0
  22. package/lib/CLI/scripts/upload-cli.js +35 -0
  23. package/lib/context.js +9 -1
  24. package/lib/errors.d.ts +2 -1
  25. package/lib/errors.js +2 -1
  26. package/lib/expo/buildIdentity.d.ts +1 -1
  27. package/lib/expo/buildIdentity.js +3 -0
  28. package/lib/expo/runtimeVersion.d.ts +10 -0
  29. package/lib/expo/runtimeVersion.js +11 -9
  30. package/lib/fingerprint/client.d.ts +5 -0
  31. package/lib/fingerprint/client.js +21 -0
  32. package/lib/fingerprint/collect.d.ts +3 -0
  33. package/lib/fingerprint/collect.js +116 -0
  34. package/lib/fingerprint/config.d.ts +14 -0
  35. package/lib/fingerprint/config.js +60 -0
  36. package/lib/fingerprint/normalizeBuildNumber.d.ts +4 -0
  37. package/lib/fingerprint/normalizeBuildNumber.js +55 -0
  38. package/lib/fingerprint/normalizeIosBuildNumber.d.ts +4 -0
  39. package/lib/fingerprint/normalizeIosBuildNumber.js +62 -0
  40. package/lib/fingerprint/types.d.ts +29 -0
  41. package/lib/fingerprint/types.js +2 -0
  42. package/lib/fingerprint/worker.d.ts +1 -0
  43. package/lib/fingerprint/worker.js +24 -0
  44. package/lib/fs/installedReportHistory.d.ts +2 -0
  45. package/lib/fs/installedReportHistory.js +55 -0
  46. package/lib/loadConfig.d.ts +6 -2
  47. package/lib/manager/downloadAndInstall.d.ts +1 -0
  48. package/lib/manager/downloadAndInstall.js +4 -0
  49. package/lib/manager/pendingRollback.d.ts +11 -0
  50. package/lib/manager/pendingRollback.js +54 -0
  51. package/lib/manager/reporting.d.ts +1 -0
  52. package/lib/manager/reporting.js +23 -6
  53. package/lib/manager/updateState.d.ts +3 -0
  54. package/lib/manager/updateState.js +1 -0
  55. package/lib/metro.js +3 -0
  56. package/lib/native/bundleDropNative.d.ts +2 -0
  57. package/lib/native/bundleDropNative.js +15 -5
  58. package/lib/patch-engine/installFromPatchSet.js +1 -1
  59. package/lib/patch-engine/patchTransport.d.ts +2 -1
  60. package/lib/patch-engine/patchTransport.js +4 -2
  61. package/lib/runtime/service.d.ts +2 -1
  62. package/lib/runtime/service.js +77 -22
  63. package/lib/scripts/bundle.js +10 -0
  64. package/lib/scripts/canonicalArtifact.d.ts +3 -0
  65. package/lib/scripts/canonicalArtifact.js +3 -1
  66. package/lib/scripts/exportProject.js +11 -0
  67. package/lib/scripts/nativeBuildNumber.d.ts +9 -0
  68. package/lib/scripts/nativeBuildNumber.js +110 -0
  69. package/lib/scripts/runtimeCompatibilityMetadata.d.ts +10 -0
  70. package/lib/scripts/runtimeCompatibilityMetadata.js +13 -0
  71. package/package.json +25 -11
  72. package/third_party/expo-fingerprint/LICENSE +22 -0
  73. package/third_party/expo-fingerprint/NOTICE +5 -0
  74. package/third_party/expo-fingerprint/PROVENANCE.md +41 -0
  75. package/third_party/expo-fingerprint/build/Config.js +122 -0
  76. package/third_party/expo-fingerprint/build/Dedup.js +89 -0
  77. package/third_party/expo-fingerprint/build/ExpoConfig.js +93 -0
  78. package/third_party/expo-fingerprint/build/ExpoConfigLoader.js +201 -0
  79. package/third_party/expo-fingerprint/build/ExpoResolver.js +84 -0
  80. package/third_party/expo-fingerprint/build/Fingerprint.js +111 -0
  81. package/third_party/expo-fingerprint/build/Fingerprint.types.js +3 -0
  82. package/third_party/expo-fingerprint/build/Options.js +140 -0
  83. package/third_party/expo-fingerprint/build/Presets.js +62 -0
  84. package/third_party/expo-fingerprint/build/ProjectWorkflow.js +163 -0
  85. package/third_party/expo-fingerprint/build/Sort.js +46 -0
  86. package/third_party/expo-fingerprint/build/hash/FileHookTransform.js +42 -0
  87. package/third_party/expo-fingerprint/build/hash/Hash.js +264 -0
  88. package/third_party/expo-fingerprint/build/hash/ReactImportsPatcher.js +344 -0
  89. package/third_party/expo-fingerprint/build/index.js +23 -0
  90. package/third_party/expo-fingerprint/build/sourcer/AutolinkingConfig.js +130 -0
  91. package/third_party/expo-fingerprint/build/sourcer/Bare.js +231 -0
  92. package/third_party/expo-fingerprint/build/sourcer/Expo.js +376 -0
  93. package/third_party/expo-fingerprint/build/sourcer/Packages.js +54 -0
  94. package/third_party/expo-fingerprint/build/sourcer/PatchPackage.js +22 -0
  95. package/third_party/expo-fingerprint/build/sourcer/SourceSkips.js +79 -0
  96. package/third_party/expo-fingerprint/build/sourcer/Sourcer.js +58 -0
  97. package/third_party/expo-fingerprint/build/sourcer/Utils.js +129 -0
  98. package/third_party/expo-fingerprint/build/types/module.d.js +2 -0
  99. package/third_party/expo-fingerprint/build/utils/Concurrency.js +47 -0
  100. package/third_party/expo-fingerprint/build/utils/Env.js +28 -0
  101. package/third_party/expo-fingerprint/build/utils/Path.js +161 -0
  102. package/third_party/expo-fingerprint/build/utils/Predicates.js +6 -0
  103. package/third_party/expo-fingerprint/build/utils/Profile.js +41 -0
  104. package/third_party/expo-fingerprint/build/utils/Spawn.js +38 -0
  105. package/third_party/expo-fingerprint/build/utils/SpawnIPC.js +28 -0
  106. package/third_party/expo-fingerprint/scheme-1-contract.json +132 -0
  107. package/third_party/expo-fingerprint/upstream-files.json +37 -0
@@ -0,0 +1,344 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReactImportsPatchTransform = void 0;
4
+ exports.patchChunk = patchChunk;
5
+ const stream_1 = require("stream");
6
+ /**
7
+ * A transform stream that patches React import statements in Objective-C files.
8
+ */
9
+ class ReactImportsPatchTransform extends stream_1.Transform {
10
+ constructor(options) {
11
+ super();
12
+ this.readLength = 0;
13
+ this.lengthOfFilePortionContainingHeadersToTransform =
14
+ options?.lengthOfFilePortionContainingHeadersToTransform ??
15
+ ReactImportsPatchTransform.DEFAULT_LENGTH_OF_FILE_PORTION_CONTAINING_HEADERS_TO_TRANSFORM;
16
+ this.transformFn = options?.transformFn ?? patchChunk;
17
+ }
18
+ _transform(chunk, _encoding, callback) {
19
+ const remainingLength = this.lengthOfFilePortionContainingHeadersToTransform - this.readLength;
20
+ let result;
21
+ if (remainingLength <= 0) {
22
+ result = chunk.toString();
23
+ }
24
+ else if (remainingLength >= chunk.length) {
25
+ result = this.transformFn(chunk.toString());
26
+ }
27
+ else {
28
+ const portionToTransform = chunk.slice(0, remainingLength).toString();
29
+ const portionToLeave = chunk.slice(remainingLength).toString();
30
+ result = this.transformFn(portionToTransform) + portionToLeave;
31
+ }
32
+ this.push(result);
33
+ this.readLength += chunk.length;
34
+ callback();
35
+ }
36
+ }
37
+ exports.ReactImportsPatchTransform = ReactImportsPatchTransform;
38
+ ReactImportsPatchTransform.DEFAULT_LENGTH_OF_FILE_PORTION_CONTAINING_HEADERS_TO_TRANSFORM = 16 * 1024; // 16KB
39
+ /**
40
+ * Patch imports from a data chunk
41
+ * @param headerSet prebuilt React-Core header set
42
+ * @param chunk target chunk data
43
+ */
44
+ function patchChunk(chunk, headerSet = HEADER_SET) {
45
+ let transformContent = chunk.replace(/(?<=^\s*)#import\s+"(.+)"(?=\s*$)/gm, (match, headerName) => {
46
+ // `#import "RCTBridge.h"` -> `#import <React/RCTBridge.h>`
47
+ if (headerSet.has(headerName)) {
48
+ return `#import <React/${headerName}>`;
49
+ }
50
+ // `#import "React/RCTBridge.h"` -> `#import <React/RCTBridge.h>`
51
+ if (headerName.startsWith('React/')) {
52
+ const name = headerName.substring(6);
53
+ if (headerSet.has(name)) {
54
+ return `#import <React/${name}>`;
55
+ }
56
+ }
57
+ // Otherwise, return original import
58
+ return match;
59
+ });
60
+ transformContent = transformContent.replace(/(?<=^\s*)#(if|elif)\s+__has_include\("(.+)"\)(?=\s*$)/gm, (match, ifPrefix, headerName) => {
61
+ // `#if __has_include("RCTBridge.h")` -> `#if __has_include(<React/RCTBridge.h>)`
62
+ if (headerSet.has(headerName)) {
63
+ return `#${ifPrefix} __has_include(<React/${headerName}>)`;
64
+ }
65
+ // `#if __has_include("React/RCTBridge.h")` -> `#if __has_include(<React/RCTBridge.h>)`
66
+ if (headerName.startsWith('React/')) {
67
+ const name = headerName.substring(6);
68
+ if (headerSet.has(name)) {
69
+ return `#${ifPrefix} __has_include(<React/${name}>)`;
70
+ }
71
+ }
72
+ // Otherwise, return original import
73
+ return match;
74
+ });
75
+ return transformContent;
76
+ }
77
+ // Fingerprint doesn't run `pod install` so we have a snapshot of the headers in the React-Core module from react-native 0.74.
78
+ const HEADER_SET = new Set([
79
+ 'CoreModulesPlugins.h',
80
+ 'FBXXHashUtils.h',
81
+ 'NSTextStorage+FontScaling.h',
82
+ 'RCTAccessibilityManager+Internal.h',
83
+ 'RCTAccessibilityManager.h',
84
+ 'RCTActionSheetManager.h',
85
+ 'RCTActivityIndicatorView.h',
86
+ 'RCTActivityIndicatorViewManager.h',
87
+ 'RCTAdditionAnimatedNode.h',
88
+ 'RCTAlertController.h',
89
+ 'RCTAlertManager.h',
90
+ 'RCTAnimatedImage.h',
91
+ 'RCTAnimatedNode.h',
92
+ 'RCTAnimationDriver.h',
93
+ 'RCTAnimationPlugins.h',
94
+ 'RCTAnimationType.h',
95
+ 'RCTAnimationUtils.h',
96
+ 'RCTAppState.h',
97
+ 'RCTAppearance.h',
98
+ 'RCTAssert.h',
99
+ 'RCTAutoInsetsProtocol.h',
100
+ 'RCTBackedTextInputDelegate.h',
101
+ 'RCTBackedTextInputDelegateAdapter.h',
102
+ 'RCTBackedTextInputViewProtocol.h',
103
+ 'RCTBaseTextInputShadowView.h',
104
+ 'RCTBaseTextInputView.h',
105
+ 'RCTBaseTextInputViewManager.h',
106
+ 'RCTBaseTextShadowView.h',
107
+ 'RCTBaseTextViewManager.h',
108
+ 'RCTBlobManager.h',
109
+ 'RCTBorderCurve.h',
110
+ 'RCTBorderDrawing.h',
111
+ 'RCTBorderStyle.h',
112
+ 'RCTBridge+Inspector.h',
113
+ 'RCTBridge+Private.h',
114
+ 'RCTBridge.h',
115
+ 'RCTBridgeConstants.h',
116
+ 'RCTBridgeDelegate.h',
117
+ 'RCTBridgeMethod.h',
118
+ 'RCTBridgeModule.h',
119
+ 'RCTBridgeModuleDecorator.h',
120
+ 'RCTBridgeProxy+Cxx.h',
121
+ 'RCTBridgeProxy.h',
122
+ 'RCTBundleAssetImageLoader.h',
123
+ 'RCTBundleManager.h',
124
+ 'RCTBundleURLProvider.h',
125
+ 'RCTClipboard.h',
126
+ 'RCTColorAnimatedNode.h',
127
+ 'RCTComponent.h',
128
+ 'RCTComponentData.h',
129
+ 'RCTComponentEvent.h',
130
+ 'RCTConstants.h',
131
+ 'RCTConvert+CoreLocation.h',
132
+ 'RCTConvert+Text.h',
133
+ 'RCTConvert+Transform.h',
134
+ 'RCTConvert.h',
135
+ 'RCTCursor.h',
136
+ 'RCTCxxConvert.h',
137
+ 'RCTDataRequestHandler.h',
138
+ 'RCTDebuggingOverlay.h',
139
+ 'RCTDebuggingOverlayManager.h',
140
+ 'RCTDecayAnimation.h',
141
+ 'RCTDefines.h',
142
+ 'RCTDevLoadingView.h',
143
+ 'RCTDevLoadingViewProtocol.h',
144
+ 'RCTDevLoadingViewSetEnabled.h',
145
+ 'RCTDevMenu.h',
146
+ 'RCTDevSettings.h',
147
+ 'RCTDeviceInfo.h',
148
+ 'RCTDiffClampAnimatedNode.h',
149
+ 'RCTDisplayLink.h',
150
+ 'RCTDisplayWeakRefreshable.h',
151
+ 'RCTDivisionAnimatedNode.h',
152
+ 'RCTDynamicTypeRamp.h',
153
+ 'RCTErrorCustomizer.h',
154
+ 'RCTErrorInfo.h',
155
+ 'RCTEventAnimation.h',
156
+ 'RCTEventDispatcher.h',
157
+ 'RCTEventDispatcherProtocol.h',
158
+ 'RCTEventEmitter.h',
159
+ 'RCTExceptionsManager.h',
160
+ 'RCTFPSGraph.h',
161
+ 'RCTFileReaderModule.h',
162
+ 'RCTFileRequestHandler.h',
163
+ 'RCTFont.h',
164
+ 'RCTFrameAnimation.h',
165
+ 'RCTFrameUpdate.h',
166
+ 'RCTGIFImageDecoder.h',
167
+ 'RCTHTTPRequestHandler.h',
168
+ 'RCTI18nManager.h',
169
+ 'RCTI18nUtil.h',
170
+ 'RCTImageBlurUtils.h',
171
+ 'RCTImageCache.h',
172
+ 'RCTImageDataDecoder.h',
173
+ 'RCTImageEditingManager.h',
174
+ 'RCTImageLoader.h',
175
+ 'RCTImageLoaderLoggable.h',
176
+ 'RCTImageLoaderProtocol.h',
177
+ 'RCTImageLoaderWithAttributionProtocol.h',
178
+ 'RCTImagePlugins.h',
179
+ 'RCTImageShadowView.h',
180
+ 'RCTImageSource.h',
181
+ 'RCTImageStoreManager.h',
182
+ 'RCTImageURLLoader.h',
183
+ 'RCTImageURLLoaderWithAttribution.h',
184
+ 'RCTImageUtils.h',
185
+ 'RCTImageView.h',
186
+ 'RCTImageViewManager.h',
187
+ 'RCTInitializing.h',
188
+ 'RCTInputAccessoryShadowView.h',
189
+ 'RCTInputAccessoryView.h',
190
+ 'RCTInputAccessoryViewContent.h',
191
+ 'RCTInputAccessoryViewManager.h',
192
+ 'RCTInspector.h',
193
+ 'RCTInspectorDevServerHelper.h',
194
+ 'RCTInspectorPackagerConnection.h',
195
+ 'RCTInterpolationAnimatedNode.h',
196
+ 'RCTInvalidating.h',
197
+ 'RCTJSStackFrame.h',
198
+ 'RCTJSThread.h',
199
+ 'RCTJavaScriptExecutor.h',
200
+ 'RCTJavaScriptLoader.h',
201
+ 'RCTKeyCommands.h',
202
+ 'RCTKeyboardObserver.h',
203
+ 'RCTLayout.h',
204
+ 'RCTLayoutAnimation.h',
205
+ 'RCTLayoutAnimationGroup.h',
206
+ 'RCTLinkingManager.h',
207
+ 'RCTLinkingPlugins.h',
208
+ 'RCTLocalAssetImageLoader.h',
209
+ 'RCTLocalizedString.h',
210
+ 'RCTLog.h',
211
+ 'RCTLogBox.h',
212
+ 'RCTLogBoxView.h',
213
+ 'RCTMacros.h',
214
+ 'RCTManagedPointer.h',
215
+ 'RCTMockDef.h',
216
+ 'RCTModalHostView.h',
217
+ 'RCTModalHostViewController.h',
218
+ 'RCTModalHostViewManager.h',
219
+ 'RCTModalManager.h',
220
+ 'RCTModuleData.h',
221
+ 'RCTModuleMethod.h',
222
+ 'RCTModuloAnimatedNode.h',
223
+ 'RCTMultilineTextInputView.h',
224
+ 'RCTMultilineTextInputViewManager.h',
225
+ 'RCTMultipartDataTask.h',
226
+ 'RCTMultipartStreamReader.h',
227
+ 'RCTMultiplicationAnimatedNode.h',
228
+ 'RCTNativeAnimatedModule.h',
229
+ 'RCTNativeAnimatedNodesManager.h',
230
+ 'RCTNativeAnimatedTurboModule.h',
231
+ 'RCTNetworkPlugins.h',
232
+ 'RCTNetworkTask.h',
233
+ 'RCTNetworking.h',
234
+ 'RCTNullability.h',
235
+ 'RCTObjectAnimatedNode.h',
236
+ 'RCTPLTag.h',
237
+ 'RCTPackagerClient.h',
238
+ 'RCTPackagerConnection.h',
239
+ 'RCTParserUtils.h',
240
+ 'RCTPerformanceLogger.h',
241
+ 'RCTPerformanceLoggerLabels.h',
242
+ 'RCTPlatform.h',
243
+ 'RCTPointerEvents.h',
244
+ 'RCTProfile.h',
245
+ 'RCTPropsAnimatedNode.h',
246
+ 'RCTRawTextShadowView.h',
247
+ 'RCTRawTextViewManager.h',
248
+ 'RCTReconnectingWebSocket.h',
249
+ 'RCTRedBox.h',
250
+ 'RCTRedBoxExtraDataViewController.h',
251
+ 'RCTRedBoxSetEnabled.h',
252
+ 'RCTRefreshControl.h',
253
+ 'RCTRefreshControlManager.h',
254
+ 'RCTRefreshableProtocol.h',
255
+ 'RCTReloadCommand.h',
256
+ 'RCTResizeMode.h',
257
+ 'RCTRootContentView.h',
258
+ 'RCTRootShadowView.h',
259
+ 'RCTRootView.h',
260
+ 'RCTRootViewDelegate.h',
261
+ 'RCTRootViewInternal.h',
262
+ 'RCTRuntimeExecutorModule.h',
263
+ 'RCTSafeAreaShadowView.h',
264
+ 'RCTSafeAreaView.h',
265
+ 'RCTSafeAreaViewLocalData.h',
266
+ 'RCTSafeAreaViewManager.h',
267
+ 'RCTScrollContentShadowView.h',
268
+ 'RCTScrollContentView.h',
269
+ 'RCTScrollContentViewManager.h',
270
+ 'RCTScrollEvent.h',
271
+ 'RCTScrollView.h',
272
+ 'RCTScrollViewManager.h',
273
+ 'RCTScrollableProtocol.h',
274
+ 'RCTSegmentedControl.h',
275
+ 'RCTSegmentedControlManager.h',
276
+ 'RCTSettingsManager.h',
277
+ 'RCTSettingsPlugins.h',
278
+ 'RCTShadowView+Internal.h',
279
+ 'RCTShadowView+Layout.h',
280
+ 'RCTShadowView.h',
281
+ 'RCTSinglelineTextInputView.h',
282
+ 'RCTSinglelineTextInputViewManager.h',
283
+ 'RCTSourceCode.h',
284
+ 'RCTSpringAnimation.h',
285
+ 'RCTStatusBarManager.h',
286
+ 'RCTStyleAnimatedNode.h',
287
+ 'RCTSubtractionAnimatedNode.h',
288
+ 'RCTSurface.h',
289
+ 'RCTSurfaceDelegate.h',
290
+ 'RCTSurfaceHostingProxyRootView.h',
291
+ 'RCTSurfaceHostingView.h',
292
+ 'RCTSurfacePresenterStub.h',
293
+ 'RCTSurfaceProtocol.h',
294
+ 'RCTSurfaceRootShadowView.h',
295
+ 'RCTSurfaceRootShadowViewDelegate.h',
296
+ 'RCTSurfaceRootView.h',
297
+ 'RCTSurfaceSizeMeasureMode.h',
298
+ 'RCTSurfaceStage.h',
299
+ 'RCTSurfaceView+Internal.h',
300
+ 'RCTSurfaceView.h',
301
+ 'RCTSwitch.h',
302
+ 'RCTSwitchManager.h',
303
+ 'RCTTextAttributes.h',
304
+ 'RCTTextDecorationLineType.h',
305
+ 'RCTTextSelection.h',
306
+ 'RCTTextShadowView.h',
307
+ 'RCTTextTransform.h',
308
+ 'RCTTextView.h',
309
+ 'RCTTextViewManager.h',
310
+ 'RCTTiming.h',
311
+ 'RCTTouchEvent.h',
312
+ 'RCTTouchHandler.h',
313
+ 'RCTTrackingAnimatedNode.h',
314
+ 'RCTTransformAnimatedNode.h',
315
+ 'RCTTurboModuleRegistry.h',
316
+ 'RCTUIImageViewAnimated.h',
317
+ 'RCTUIManager.h',
318
+ 'RCTUIManagerObserverCoordinator.h',
319
+ 'RCTUIManagerUtils.h',
320
+ 'RCTUITextField.h',
321
+ 'RCTUITextView.h',
322
+ 'RCTUIUtils.h',
323
+ 'RCTURLRequestDelegate.h',
324
+ 'RCTURLRequestHandler.h',
325
+ 'RCTUtils.h',
326
+ 'RCTUtilsUIOverride.h',
327
+ 'RCTValueAnimatedNode.h',
328
+ 'RCTVersion.h',
329
+ 'RCTVibration.h',
330
+ 'RCTVibrationPlugins.h',
331
+ 'RCTView.h',
332
+ 'RCTViewManager.h',
333
+ 'RCTViewUtils.h',
334
+ 'RCTVirtualTextShadowView.h',
335
+ 'RCTVirtualTextView.h',
336
+ 'RCTVirtualTextViewManager.h',
337
+ 'RCTWebSocketExecutor.h',
338
+ 'RCTWebSocketModule.h',
339
+ 'RCTWrapperViewController.h',
340
+ 'React-Core-umbrella.h',
341
+ 'React-Core.modulemap',
342
+ 'UIView+Private.h',
343
+ 'UIView+React.h',
344
+ ]);
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DEFAULT_SOURCE_SKIPS = exports.DEFAULT_IGNORE_PATHS = void 0;
18
+ __exportStar(require("./Fingerprint"), exports);
19
+ __exportStar(require("./Fingerprint.types"), exports);
20
+ __exportStar(require("./sourcer/SourceSkips"), exports);
21
+ var Options_1 = require("./Options");
22
+ Object.defineProperty(exports, "DEFAULT_IGNORE_PATHS", { enumerable: true, get: function () { return Options_1.DEFAULT_IGNORE_PATHS; } });
23
+ Object.defineProperty(exports, "DEFAULT_SOURCE_SKIPS", { enumerable: true, get: function () { return Options_1.DEFAULT_SOURCE_SKIPS; } });
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.normalizeAutolinkingConfig = normalizeAutolinkingConfig;
7
+ exports.isPathLike = isPathLike;
8
+ const path_1 = __importDefault(require("path"));
9
+ const Path_1 = require("../utils/Path");
10
+ const NAMED_ARRAY_KEYS = new Set(['modules', 'projects', 'plugins', 'pods', 'extraDependencies']);
11
+ const STRING_ARRAY_KEYS = new Set(['coreFeatures', 'configurations', 'buildTypes']);
12
+ const FILE_URL_REGEX = /^file:/i;
13
+ const NETWORK_URL_REGEX = /^[a-z][a-z0-9+.-]*:\/\//i;
14
+ const RELATIVE_OR_NODE_MODULES_PATH_REGEX = /^(?:\.\.?\/|node_modules\/)/;
15
+ /**
16
+ * Normalizes resolved autolinking config before it is hashed.
17
+ * Converts react-native-config dependency maps to a sorted array of objects and sorts known
18
+ * arrays by their identifying field. `scriptPhases` is left in order.
19
+ *
20
+ * When `stripPaths` is true, filesystem path fields are omitted, including `scriptPhases[].path`
21
+ * and `sourceDir` / `podspecPath` overrides from the project's **react-native.config.js**.
22
+ * Linked names and `scriptPhases` names remain.
23
+ */
24
+ function normalizeAutolinkingConfig(config, options) {
25
+ const roots = (options.roots ?? []).map((root) => (0, Path_1.toPosixPath)(root));
26
+ return normalizeNode(structuredClone(config), options.stripPaths, roots);
27
+ }
28
+ function normalizeNode(value, stripPaths, roots, parentKey) {
29
+ if (Array.isArray(value)) {
30
+ const mapped = value
31
+ .map((item) => normalizeNode(item, stripPaths, roots, parentKey))
32
+ .filter((item) => item !== undefined);
33
+ return sortKnownArray(parentKey, mapped);
34
+ }
35
+ if (value && typeof value === 'object') {
36
+ if (isNamedDependencyMap(value)) {
37
+ return normalizeNode(namedMapToSortedArray(value), stripPaths, roots, 'modules');
38
+ }
39
+ const result = {};
40
+ for (const [key, child] of Object.entries(value)) {
41
+ if (stripPaths && typeof child === 'string' && isPathLike(child, roots)) {
42
+ continue;
43
+ }
44
+ result[key] = normalizeNode(child, stripPaths, roots, key);
45
+ }
46
+ return result;
47
+ }
48
+ if (stripPaths && typeof value === 'string' && isPathLike(value, roots)) {
49
+ return undefined;
50
+ }
51
+ return value;
52
+ }
53
+ /**
54
+ * True when `value` is a `{ [packageName]: { root | platforms } }` map from react-native-config.
55
+ * Those maps are converted to arrays because object key order is not stable across autolinking.
56
+ */
57
+ function isNamedDependencyMap(value) {
58
+ const entries = Object.entries(value);
59
+ if (entries.length === 0) {
60
+ return false;
61
+ }
62
+ return entries.every(([, child]) => child != null &&
63
+ typeof child === 'object' &&
64
+ !Array.isArray(child) &&
65
+ ('platforms' in child || 'root' in child));
66
+ }
67
+ function namedMapToSortedArray(map) {
68
+ return Object.entries(map)
69
+ .sort(([left], [right]) => compareStrings(left, right))
70
+ .map(([name, child]) => ({ ...child, name }));
71
+ }
72
+ function sortKnownArray(parentKey, items) {
73
+ if (parentKey && STRING_ARRAY_KEYS.has(parentKey)) {
74
+ return [...items].sort((left, right) => compareStrings(String(left), String(right)));
75
+ }
76
+ if (parentKey && NAMED_ARRAY_KEYS.has(parentKey)) {
77
+ return [...items].sort((left, right) => compareStrings(namedKey(left), namedKey(right)));
78
+ }
79
+ return items;
80
+ }
81
+ function namedKey(value) {
82
+ if (value == null || typeof value !== 'object') {
83
+ return String(value);
84
+ }
85
+ const record = value;
86
+ for (const key of ['packageName', 'name', 'podName', 'id', 'url']) {
87
+ if (typeof record[key] === 'string') {
88
+ return record[key];
89
+ }
90
+ }
91
+ return '';
92
+ }
93
+ function compareStrings(left, right) {
94
+ if (left < right) {
95
+ return -1;
96
+ }
97
+ if (left > right) {
98
+ return 1;
99
+ }
100
+ return 0;
101
+ }
102
+ /**
103
+ * True when `value` is a filesystem path, including values already rewritten relative to
104
+ * `projectRoot` or a dependency root.
105
+ * URLs are kept so extra Maven repos and similar project settings still hash.
106
+ */
107
+ function isPathLike(value, roots) {
108
+ if (!value) {
109
+ return false;
110
+ }
111
+ if (FILE_URL_REGEX.test(value)) {
112
+ return true;
113
+ }
114
+ if (NETWORK_URL_REGEX.test(value)) {
115
+ return false;
116
+ }
117
+ const posixValue = (0, Path_1.toPosixPath)(value);
118
+ if (path_1.default.posix.isAbsolute(posixValue) || path_1.default.win32.isAbsolute(value)) {
119
+ return true;
120
+ }
121
+ for (const root of roots) {
122
+ if (!root) {
123
+ continue;
124
+ }
125
+ if (posixValue === root || posixValue.startsWith(`${root}/`)) {
126
+ return true;
127
+ }
128
+ }
129
+ return RELATIVE_OR_NODE_MODULES_PATH_REGEX.test(posixValue);
130
+ }