basalt-core 0.0.0-rc5

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 (325) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cli/basalt.d.ts +3 -0
  3. package/dist/cli/basalt.d.ts.map +1 -0
  4. package/dist/cli/basalt.js +47 -0
  5. package/dist/cli/basalt.js.map +1 -0
  6. package/dist/cli/bundle-cli.d.ts +12 -0
  7. package/dist/cli/bundle-cli.d.ts.map +1 -0
  8. package/dist/cli/bundle-cli.js +124 -0
  9. package/dist/cli/bundle-cli.js.map +1 -0
  10. package/dist/cli/bundleWithAssets.d.ts +79 -0
  11. package/dist/cli/bundleWithAssets.d.ts.map +1 -0
  12. package/dist/cli/bundleWithAssets.js +198 -0
  13. package/dist/cli/bundleWithAssets.js.map +1 -0
  14. package/dist/cli/desktop.d.ts +339 -0
  15. package/dist/cli/desktop.d.ts.map +1 -0
  16. package/dist/cli/desktop.js +1029 -0
  17. package/dist/cli/desktop.js.map +1 -0
  18. package/dist/cli/doctor.d.ts +31 -0
  19. package/dist/cli/doctor.d.ts.map +1 -0
  20. package/dist/cli/doctor.js +283 -0
  21. package/dist/cli/doctor.js.map +1 -0
  22. package/dist/cli/init.d.ts +77 -0
  23. package/dist/cli/init.d.ts.map +1 -0
  24. package/dist/cli/init.js +442 -0
  25. package/dist/cli/init.js.map +1 -0
  26. package/dist/cli/metro.d.ts +49 -0
  27. package/dist/cli/metro.d.ts.map +1 -0
  28. package/dist/cli/metro.js +148 -0
  29. package/dist/cli/metro.js.map +1 -0
  30. package/dist/cli/packageApp.d.ts +102 -0
  31. package/dist/cli/packageApp.d.ts.map +1 -0
  32. package/dist/cli/packageApp.js +319 -0
  33. package/dist/cli/packageApp.js.map +1 -0
  34. package/dist/cli/steps.d.ts +34 -0
  35. package/dist/cli/steps.d.ts.map +1 -0
  36. package/dist/cli/steps.js +53 -0
  37. package/dist/cli/steps.js.map +1 -0
  38. package/dist/metro-config.d.ts +168 -0
  39. package/dist/metro-config.d.ts.map +1 -0
  40. package/dist/metro-config.js +671 -0
  41. package/dist/metro-config.js.map +1 -0
  42. package/dist/react-native.config.d.ts +7 -0
  43. package/dist/react-native.config.d.ts.map +1 -0
  44. package/dist/react-native.config.js +80 -0
  45. package/dist/react-native.config.js.map +1 -0
  46. package/dist/src/DragSource.d.ts +52 -0
  47. package/dist/src/DragSource.d.ts.map +1 -0
  48. package/dist/src/DragSource.js +97 -0
  49. package/dist/src/DragSource.js.map +1 -0
  50. package/dist/src/DropTarget.d.ts +58 -0
  51. package/dist/src/DropTarget.d.ts.map +1 -0
  52. package/dist/src/DropTarget.js +131 -0
  53. package/dist/src/DropTarget.js.map +1 -0
  54. package/dist/src/KeyHandler.d.ts +57 -0
  55. package/dist/src/KeyHandler.d.ts.map +1 -0
  56. package/dist/src/KeyHandler.js +48 -0
  57. package/dist/src/KeyHandler.js.map +1 -0
  58. package/dist/src/Menu.d.ts +72 -0
  59. package/dist/src/Menu.d.ts.map +1 -0
  60. package/dist/src/Menu.js +179 -0
  61. package/dist/src/Menu.js.map +1 -0
  62. package/dist/src/TitleBar.d.ts +75 -0
  63. package/dist/src/TitleBar.d.ts.map +1 -0
  64. package/dist/src/TitleBar.js +236 -0
  65. package/dist/src/TitleBar.js.map +1 -0
  66. package/dist/src/Window.d.ts +87 -0
  67. package/dist/src/Window.d.ts.map +1 -0
  68. package/dist/src/Window.js +248 -0
  69. package/dist/src/Window.js.map +1 -0
  70. package/dist/src/closeRequest.d.ts +55 -0
  71. package/dist/src/closeRequest.d.ts.map +1 -0
  72. package/dist/src/closeRequest.js +134 -0
  73. package/dist/src/closeRequest.js.map +1 -0
  74. package/dist/src/index.d.ts +45 -0
  75. package/dist/src/index.d.ts.map +1 -0
  76. package/dist/src/index.js +92 -0
  77. package/dist/src/index.js.map +1 -0
  78. package/dist/src/overrides/Alert.d.ts +69 -0
  79. package/dist/src/overrides/Alert.d.ts.map +1 -0
  80. package/dist/src/overrides/Alert.js +112 -0
  81. package/dist/src/overrides/Alert.js.map +1 -0
  82. package/dist/src/overrides/BaseViewConfig.d.ts +28 -0
  83. package/dist/src/overrides/BaseViewConfig.d.ts.map +1 -0
  84. package/dist/src/overrides/BaseViewConfig.js +72 -0
  85. package/dist/src/overrides/BaseViewConfig.js.map +1 -0
  86. package/dist/src/overrides/Platform.linux.d.ts +10 -0
  87. package/dist/src/overrides/Platform.linux.d.ts.map +1 -0
  88. package/dist/src/overrides/Platform.linux.js +15 -0
  89. package/dist/src/overrides/Platform.linux.js.map +1 -0
  90. package/dist/src/overrides/Platform.macos.d.ts +10 -0
  91. package/dist/src/overrides/Platform.macos.d.ts.map +1 -0
  92. package/dist/src/overrides/Platform.macos.js +15 -0
  93. package/dist/src/overrides/Platform.macos.js.map +1 -0
  94. package/dist/src/overrides/Platform.windows.d.ts +10 -0
  95. package/dist/src/overrides/Platform.windows.d.ts.map +1 -0
  96. package/dist/src/overrides/Platform.windows.js +15 -0
  97. package/dist/src/overrides/Platform.windows.js.map +1 -0
  98. package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts +24 -0
  99. package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts.map +1 -0
  100. package/dist/src/overrides/ReactDevToolsSettingsManager.js +30 -0
  101. package/dist/src/overrides/ReactDevToolsSettingsManager.js.map +1 -0
  102. package/dist/src/overrides/RefreshControl.d.ts +52 -0
  103. package/dist/src/overrides/RefreshControl.d.ts.map +1 -0
  104. package/dist/src/overrides/RefreshControl.js +92 -0
  105. package/dist/src/overrides/RefreshControl.js.map +1 -0
  106. package/dist/src/overrides/ScrollView.d.ts +39 -0
  107. package/dist/src/overrides/ScrollView.d.ts.map +1 -0
  108. package/dist/src/overrides/ScrollView.js +59 -0
  109. package/dist/src/overrides/ScrollView.js.map +1 -0
  110. package/dist/src/overrides/Share.d.ts +96 -0
  111. package/dist/src/overrides/Share.d.ts.map +1 -0
  112. package/dist/src/overrides/Share.js +97 -0
  113. package/dist/src/overrides/Share.js.map +1 -0
  114. package/dist/src/overrides/TextInput.d.ts +81 -0
  115. package/dist/src/overrides/TextInput.d.ts.map +1 -0
  116. package/dist/src/overrides/TextInput.js +213 -0
  117. package/dist/src/overrides/TextInput.js.map +1 -0
  118. package/dist/src/overrides/View.d.ts +36 -0
  119. package/dist/src/overrides/View.d.ts.map +1 -0
  120. package/dist/src/overrides/View.js +99 -0
  121. package/dist/src/overrides/View.js.map +1 -0
  122. package/dist/src/overrides/createPlatform.d.ts +32 -0
  123. package/dist/src/overrides/createPlatform.d.ts.map +1 -0
  124. package/dist/src/overrides/createPlatform.js +84 -0
  125. package/dist/src/overrides/createPlatform.js.map +1 -0
  126. package/dist/src/overrides/setUpDeveloperTools.d.ts +28 -0
  127. package/dist/src/overrides/setUpDeveloperTools.d.ts.map +1 -0
  128. package/dist/src/overrides/setUpDeveloperTools.js +84 -0
  129. package/dist/src/overrides/setUpDeveloperTools.js.map +1 -0
  130. package/dist/src/overrides/setUpXHR.d.ts +46 -0
  131. package/dist/src/overrides/setUpXHR.d.ts.map +1 -0
  132. package/dist/src/overrides/setUpXHR.js +236 -0
  133. package/dist/src/overrides/setUpXHR.js.map +1 -0
  134. package/dist/src/quitRequest.d.ts +55 -0
  135. package/dist/src/quitRequest.d.ts.map +1 -0
  136. package/dist/src/quitRequest.js +121 -0
  137. package/dist/src/quitRequest.js.map +1 -0
  138. package/dist/src/resourcePath.d.ts +18 -0
  139. package/dist/src/resourcePath.d.ts.map +1 -0
  140. package/dist/src/resourcePath.js +31 -0
  141. package/dist/src/resourcePath.js.map +1 -0
  142. package/dist/src/responseBody.d.ts +76 -0
  143. package/dist/src/responseBody.d.ts.map +1 -0
  144. package/dist/src/responseBody.js +94 -0
  145. package/dist/src/responseBody.js.map +1 -0
  146. package/dist/src/responseHeaders.d.ts +40 -0
  147. package/dist/src/responseHeaders.d.ts.map +1 -0
  148. package/dist/src/responseHeaders.js +75 -0
  149. package/dist/src/responseHeaders.js.map +1 -0
  150. package/dist/src/titleBarState.d.ts +43 -0
  151. package/dist/src/titleBarState.d.ts.map +1 -0
  152. package/dist/src/titleBarState.js +77 -0
  153. package/dist/src/titleBarState.js.map +1 -0
  154. package/dist/src/useContextMenu.d.ts +113 -0
  155. package/dist/src/useContextMenu.d.ts.map +1 -0
  156. package/dist/src/useContextMenu.js +109 -0
  157. package/dist/src/useContextMenu.js.map +1 -0
  158. package/dist/src/useDialog.d.ts +98 -0
  159. package/dist/src/useDialog.d.ts.map +1 -0
  160. package/dist/src/useDialog.js +112 -0
  161. package/dist/src/useDialog.js.map +1 -0
  162. package/dist/src/useDisplays.d.ts +70 -0
  163. package/dist/src/useDisplays.d.ts.map +1 -0
  164. package/dist/src/useDisplays.js +118 -0
  165. package/dist/src/useDisplays.js.map +1 -0
  166. package/dist/src/useHandledKeys.d.ts +38 -0
  167. package/dist/src/useHandledKeys.d.ts.map +1 -0
  168. package/dist/src/useHandledKeys.js +70 -0
  169. package/dist/src/useHandledKeys.js.map +1 -0
  170. package/dist/src/useWindow.d.ts +140 -0
  171. package/dist/src/useWindow.d.ts.map +1 -0
  172. package/dist/src/useWindow.js +233 -0
  173. package/dist/src/useWindow.js.map +1 -0
  174. package/dist/tsconfig.tsbuildinfo +1 -0
  175. package/native/CMakeLists.txt +355 -0
  176. package/native/bootstrap.sh +613 -0
  177. package/native/cmake/CompilerFlags.cmake +49 -0
  178. package/native/cmake/Expo.cmake +125 -0
  179. package/native/cmake/ReactNativeCore.cmake +612 -0
  180. package/native/cmake/Reanimated.cmake +108 -0
  181. package/native/cmake/Skia.cmake +379 -0
  182. package/native/cmake/ThirdParty.cmake +290 -0
  183. package/native/cmake/Worklets.cmake +67 -0
  184. package/native/cmake/codegen/CMakeLists.txt +32 -0
  185. package/native/core/AppIdentity.cpp +85 -0
  186. package/native/core/AppIdentity.h +59 -0
  187. package/native/core/AppPaths.cpp +96 -0
  188. package/native/core/AppPaths.h +53 -0
  189. package/native/core/AppearanceModule.cpp +60 -0
  190. package/native/core/AppearanceModule.h +40 -0
  191. package/native/core/Backface.h +59 -0
  192. package/native/core/BlobModule.cpp +283 -0
  193. package/native/core/BlobModule.h +76 -0
  194. package/native/core/BlobRegistry.cpp +75 -0
  195. package/native/core/BlobRegistry.h +44 -0
  196. package/native/core/ColorScheme.cpp +105 -0
  197. package/native/core/ColorScheme.h +59 -0
  198. package/native/core/ComponentRegistry.h +30 -0
  199. package/native/core/ControlMetrics.h +37 -0
  200. package/native/core/CoreModules.cpp +592 -0
  201. package/native/core/CoreModules.h +308 -0
  202. package/native/core/DebuggingOverlay.cpp +106 -0
  203. package/native/core/DebuggingOverlay.h +65 -0
  204. package/native/core/DesktopControls.cpp +232 -0
  205. package/native/core/DesktopControls.h +170 -0
  206. package/native/core/DevBundle.cpp +108 -0
  207. package/native/core/DevBundle.h +69 -0
  208. package/native/core/DevMenu.cpp +99 -0
  209. package/native/core/DevMenu.h +75 -0
  210. package/native/core/DialogModule.cpp +150 -0
  211. package/native/core/DialogModule.h +51 -0
  212. package/native/core/DragAndDrop.cpp +45 -0
  213. package/native/core/DragAndDrop.h +225 -0
  214. package/native/core/ExpoImageComponent.cpp +79 -0
  215. package/native/core/ExpoImageComponent.h +80 -0
  216. package/native/core/ExpoModules.cpp +415 -0
  217. package/native/core/ExpoModules.h +115 -0
  218. package/native/core/ExpoRuntime.cpp +366 -0
  219. package/native/core/ExpoRuntime.h +42 -0
  220. package/native/core/FocusRing.h +36 -0
  221. package/native/core/FontRegistry.h +51 -0
  222. package/native/core/GestureHandlerModule.cpp +136 -0
  223. package/native/core/GestureHandlerModule.h +71 -0
  224. package/native/core/Gestures.cpp +533 -0
  225. package/native/core/Gestures.h +145 -0
  226. package/native/core/HoverTracker.cpp +69 -0
  227. package/native/core/HoverTracker.h +109 -0
  228. package/native/core/HttpClient.cpp +282 -0
  229. package/native/core/ImageBytes.cpp +205 -0
  230. package/native/core/ImageBytes.h +29 -0
  231. package/native/core/ImageCache.cpp +51 -0
  232. package/native/core/ImageCache.h +89 -0
  233. package/native/core/JsRuntimeAccess.cpp +70 -0
  234. package/native/core/JsRuntimeAccess.h +60 -0
  235. package/native/core/JsiPromise.h +51 -0
  236. package/native/core/KeyEvents.cpp +116 -0
  237. package/native/core/KeyEvents.h +144 -0
  238. package/native/core/LogBoxSurface.cpp +46 -0
  239. package/native/core/LogBoxSurface.h +68 -0
  240. package/native/core/MenuModel.h +117 -0
  241. package/native/core/MenuModule.cpp +209 -0
  242. package/native/core/MenuModule.h +66 -0
  243. package/native/core/MountingWalk.h +524 -0
  244. package/native/core/PackageModules.cpp.in +25 -0
  245. package/native/core/PackageModules.h +50 -0
  246. package/native/core/PlatformConstantsModule.cpp +63 -0
  247. package/native/core/PlatformConstantsModule.h +64 -0
  248. package/native/core/PlatformServices.h +213 -0
  249. package/native/core/PointerButtons.h +63 -0
  250. package/native/core/PullToRefresh.cpp +57 -0
  251. package/native/core/PullToRefresh.h +73 -0
  252. package/native/core/ReanimatedCompat.h +47 -0
  253. package/native/core/ReanimatedModule.cpp +203 -0
  254. package/native/core/ReanimatedModule.h +55 -0
  255. package/native/core/ScrollAnimation.cpp +59 -0
  256. package/native/core/ScrollAnimation.h +70 -0
  257. package/native/core/ScrollBounds.cpp +26 -0
  258. package/native/core/ScrollBounds.h +68 -0
  259. package/native/core/ScrollIndicator.cpp +50 -0
  260. package/native/core/ScrollIndicator.h +69 -0
  261. package/native/core/ScrollMomentum.cpp +71 -0
  262. package/native/core/ScrollMomentum.h +73 -0
  263. package/native/core/ScrollSnap.cpp +123 -0
  264. package/native/core/ScrollSnap.h +80 -0
  265. package/native/core/ShareFallback.cpp +101 -0
  266. package/native/core/ShareFallback.h +45 -0
  267. package/native/core/SkiaPictureViewComponent.cpp +11 -0
  268. package/native/core/SkiaPictureViewComponent.h +47 -0
  269. package/native/core/SourceCodeModule.cpp +55 -0
  270. package/native/core/SourceCodeModule.h +53 -0
  271. package/native/core/StatusBarModule.cpp +23 -0
  272. package/native/core/StatusBarModule.h +42 -0
  273. package/native/core/TestDialog.cpp +148 -0
  274. package/native/core/TestDialog.h +96 -0
  275. package/native/core/TestKeys.cpp +78 -0
  276. package/native/core/TestKeys.h +50 -0
  277. package/native/core/TestQuitFile.cpp +33 -0
  278. package/native/core/TestQuitFile.h +60 -0
  279. package/native/core/TestSettle.h +192 -0
  280. package/native/core/TitleBarRegions.h +31 -0
  281. package/native/core/TurboModuleProxy.cpp +51 -0
  282. package/native/core/TurboModuleProxy.h +46 -0
  283. package/native/core/UIManagerAccess.cpp +43 -0
  284. package/native/core/UIManagerAccess.h +43 -0
  285. package/native/core/WindowBoundsCache.cpp +319 -0
  286. package/native/core/WindowControl.h +235 -0
  287. package/native/core/WindowHost.h +158 -0
  288. package/native/core/WindowMethods.cpp +167 -0
  289. package/native/core/WindowMethods.h +84 -0
  290. package/native/core/WindowsModule.cpp +448 -0
  291. package/native/core/WindowsModule.h +133 -0
  292. package/native/core/WorkletsModule.cpp +199 -0
  293. package/native/core/WorkletsModule.h +57 -0
  294. package/native/core/portability_probe.cpp +210 -0
  295. package/native/tests/EventRecorder.h +124 -0
  296. package/native/tests/TestHarness.cpp +109 -0
  297. package/native/tests/TestHarness.h +89 -0
  298. package/native/tests/TreeDump.h +49 -0
  299. package/native/tests/test_app_identity.cpp +114 -0
  300. package/native/tests/test_app_paths.cpp +48 -0
  301. package/native/tests/test_appearance.cpp +107 -0
  302. package/native/tests/test_backface.cpp +79 -0
  303. package/native/tests/test_blobs.cpp +157 -0
  304. package/native/tests/test_controls.cpp +185 -0
  305. package/native/tests/test_devbundle.cpp +103 -0
  306. package/native/tests/test_drag_and_drop.cpp +143 -0
  307. package/native/tests/test_gestures.cpp +331 -0
  308. package/native/tests/test_hover.cpp +92 -0
  309. package/native/tests/test_image_cache.cpp +109 -0
  310. package/native/tests/test_js_runtime_access.cpp +137 -0
  311. package/native/tests/test_key_events.cpp +235 -0
  312. package/native/tests/test_momentum.cpp +138 -0
  313. package/native/tests/test_quit_file.cpp +104 -0
  314. package/native/tests/test_scroll_animation.cpp +120 -0
  315. package/native/tests/test_scroll_bounds.cpp +66 -0
  316. package/native/tests/test_scroll_indicator.cpp +149 -0
  317. package/native/tests/test_scroll_snap.cpp +112 -0
  318. package/native/tests/test_settle.cpp +115 -0
  319. package/native/tests/test_share.cpp +75 -0
  320. package/native/tests/test_sourcecode.cpp +62 -0
  321. package/native/tests/test_window_close.cpp +119 -0
  322. package/native/tests/test_window_limits.cpp +123 -0
  323. package/package.json +43 -0
  324. package/react-native.config.js +86 -0
  325. package/supported-versions.json +66 -0
@@ -0,0 +1,339 @@
1
+ /**
2
+ * `react-native run-linux`, `run-macos` and `run-windows`, which are one
3
+ * command with three names.
4
+ *
5
+ * Everything a desktop run does is the same on all three: find or build a host
6
+ * binary, work out the module name, make sure a packager is running, write a
7
+ * bundle, launch the host in the foreground and hand back its exit status. What
8
+ * differs is four strings -- the platform, the command name, the binary, and
9
+ * where its native sources are -- so that is what a platform package passes in.
10
+ *
11
+ * The same division as the C++ half, for the same reason. Three copies of this
12
+ * file would be three places for `--mode release` to mean something slightly
13
+ * different, and the first anyone would hear of it is an app that bundles
14
+ * without assets on one desktop.
15
+ *
16
+ * @format
17
+ */
18
+ import type { PackagePlatform } from './packageApp';
19
+ /**
20
+ * A target is the whole of what a platform package contributes.
21
+ *
22
+ * platform what Metro bundles for, and what Platform.OS will say
23
+ * command the CLI command name
24
+ * binary the host executable, with the extension the platform uses
25
+ * nativeDir that package's native/ directory, for --build
26
+ * coreDir basalt-core/native, where bootstrap.sh lives
27
+ * toolchain one sentence naming what --build needs installed
28
+ * generator optional CMake generator, when the default is wrong
29
+ */
30
+ /**
31
+ * What a platform package contributes. The fields are documented above; this
32
+ * is the same list, so that a package leaving one out is a compile error
33
+ * rather than an undefined read a long way from here.
34
+ */
35
+ export type Target = {
36
+ platform: PackagePlatform;
37
+ command: string;
38
+ binary: string;
39
+ nativeDir: string;
40
+ coreDir: string;
41
+ toolchain: string;
42
+ label?: string;
43
+ generator?: string;
44
+ /** Extra CMake arguments this platform always needs. */
45
+ configureArgs?: string[];
46
+ };
47
+ /** What React Native's CLI hands a command. Only the fields this file reads. */
48
+ /**
49
+ * Where React Native's C++ is, and how to ask bootstrap for it. A checkout and
50
+ * an installed package are different layouts, and the difference is what
51
+ * bootstrap has to be told.
52
+ */
53
+ export type ReactNativeSources = {
54
+ layout: 'checkout' | 'installed';
55
+ bootstrapArg: string;
56
+ rnDir: string;
57
+ };
58
+ /**
59
+ * CMake arguments, and the one-line notes the run prints to say why each is
60
+ * there -- "capability package, from ...". The notes exist so that a build
61
+ * picking something up from the app's dependencies says so rather than doing
62
+ * it silently.
63
+ */
64
+ export type ContributedArgs = {
65
+ args: string[];
66
+ notes: string[];
67
+ };
68
+ export type CliContext = {
69
+ root: string;
70
+ reactNativePath: string;
71
+ };
72
+ /** The flags a run command accepts. */
73
+ export type RunOptions = {
74
+ mode?: string;
75
+ build?: boolean;
76
+ packager?: boolean;
77
+ port?: number;
78
+ entryFile?: string;
79
+ /** `--module`: the name the app registered with AppRegistry. */
80
+ module?: string;
81
+ /** `--host-binary`: a host to run instead of the one that would be found. */
82
+ hostBinary?: string;
83
+ /** `--bundle`: where the bundle is, or should be written. */
84
+ bundle?: string;
85
+ /** `--jobs`: parallelism for the build. */
86
+ jobs?: number | string;
87
+ generator?: string;
88
+ };
89
+ export declare class MissingHost extends Error {
90
+ }
91
+ /**
92
+ * Executable, on a platform that has an opinion about it.
93
+ *
94
+ * `X_OK` is meaningless on Windows -- every readable file answers yes -- so the
95
+ * question there is only whether it is a file. Asking the same question of a
96
+ * Unix binary would call a non-executable one runnable, which is worse than
97
+ * either mistake this avoids.
98
+ */
99
+ export declare function isExecutable(file: string): boolean;
100
+ /**
101
+ * Where to look for the host, in order of how explicit the answer is.
102
+ *
103
+ * The last entry is the development checkout: when the platform package is
104
+ * being used from inside its own repository, the build tree is four
105
+ * directories up. That is what makes the demo app in examples/ work without
106
+ * configuration.
107
+ */
108
+ export declare function candidates(projectRoot: string, options: RunOptions, target: Target): string[];
109
+ export declare function resolveHost(projectRoot: string, options: RunOptions, target: Target): string;
110
+ /**
111
+ * The React Native to build against, in either of the two shapes bootstrap
112
+ * accepts.
113
+ *
114
+ * A checkout, where bootstrap is handed the monorepo root and CMake the
115
+ * packages/react-native beneath it; or an installed package, where both are
116
+ * handed the package itself. The second is what every app has. React Native's
117
+ * npm package ships everything the host compiles against except
118
+ * ReactCxxPlatform, and bootstrap fetches that at the app's exact version --
119
+ * see docs/PORTING.md.
120
+ *
121
+ * This used to refuse an installed package outright, saying the npm package
122
+ * lacked the C++, long after bootstrap and CMake had learned to build from one.
123
+ * The command was the only part that had not.
124
+ */
125
+ export declare function reactNativeSources(reactNativePath: string): ReactNativeSources;
126
+ /**
127
+ * The optional native halves an app brings with it, as CMake definitions.
128
+ *
129
+ * Expo's runtime, worklets and Reanimated each compile from the app's own copy
130
+ * of the package (cmake/Expo.cmake and its siblings), and each is off unless
131
+ * named. `--build` never named them, so the host it built for an Expo app had
132
+ * no Expo runtime and the app failed at its first Expo import. Now whatever the
133
+ * app has installed is what gets built.
134
+ *
135
+ * expo-modules-core is looked for beside `expo` as well, since it is `expo`'s
136
+ * dependency rather than the app's, and a package manager that does not hoist
137
+ * leaves it there. Reanimated without worklets is skipped with a note rather
138
+ * than failing the configure: Reanimated 4 is built on worklets and
139
+ * Reanimated.cmake requires both.
140
+ */
141
+ /**
142
+ * Capability packages: anything installed that declares native code of its own.
143
+ *
144
+ * A package says so in its own manifest -- `"basalt": {"native": "..."}` -- and
145
+ * the build reads that rather than this file knowing its name. Which is the
146
+ * difference between this and the three special cases below: Expo, worklets and
147
+ * Reanimated are third-party packages that will never carry the key, so they
148
+ * stay hardcoded; anything shipped for this platform does not have to be.
149
+ *
150
+ * Scanned from the app's own dependencies rather than the whole of
151
+ * node_modules: a transitive dependency contributing C++ to the host binary
152
+ * without the app asking is not a thing to make easy.
153
+ */
154
+ export declare function capabilityPackages(projectRoot: string): string[];
155
+ /**
156
+ * The app's own native modules: `<projectRoot>/modules/*` with a
157
+ * `native/CMakeLists.txt` in it.
158
+ *
159
+ * Expo's autolinking looks in exactly this directory for an app's local modules
160
+ * -- `expo-module.config.json` there is how `requireNativeModule('KinoProcess')`
161
+ * finds native code that was never published -- and an app that has written an
162
+ * iOS half and an Android half of one has nowhere to put the desktop half. A
163
+ * package would be the alternative, and publishing a package to yourself, so
164
+ * that one binary can compile a file already sitting in the repo, is not a
165
+ * reasonable thing to ask.
166
+ *
167
+ * **Presence is the declaration**, unlike a capability package, which says so in
168
+ * its manifest. A local module has no manifest to say it in: `create-expo-module
169
+ * --local` writes a config, an index and a platform directory, and no
170
+ * package.json. So the desktop half is declared the way the Apple half is --
171
+ * by being there -- and `native/CMakeLists.txt` is the name, because that is
172
+ * already what a host's package loop looks for.
173
+ *
174
+ * The rule capabilityPackages exists to keep is kept here for free: this is the
175
+ * app's own source tree, so nothing gets compiled into the binary that the app
176
+ * did not write.
177
+ */
178
+ export declare function localNativeModules(projectRoot: string): string[];
179
+ export declare function optionalNativeModules(projectRoot: string, platform: PackagePlatform): ContributedArgs;
180
+ /**
181
+ * What the configure step has to name rather than leave to CMake's defaults.
182
+ *
183
+ * **The compiler.** React Native's C++ is built -Wall -Werror -Wpedantic and is
184
+ * warning-clean only under clang, which is why bootstrap's own configure line,
185
+ * CI and the README all name it. Left alone, CMake picks the system default --
186
+ * g++ on Ubuntu, cl on Windows -- and `--build` left it alone: a fresh Expo
187
+ * app's first build on Ubuntu 24.04 compiled Hermes (bootstrap names clang)
188
+ * and then stopped in ReactCommon on GCC's class-memaccess and pedantic
189
+ * __int128 errors. CC and CXX still win, as they would for a plain cmake.
190
+ *
191
+ * **On Windows, two more.** CMAKE_BUILD_TYPE, because unset MSVC picks the debug
192
+ * runtime and vcpkg follows it, while Hermes was built Release, and lld-link's
193
+ * complaint about _ITERATOR_DEBUG_LEVEL names neither. And vcpkg's toolchain
194
+ * file, found the way bootstrap.sh finds vcpkg: by a header it cannot do
195
+ * without, not by VCPKG_ROOT, which vcvars64.bat points at an empty copy.
196
+ */
197
+ export declare function compilerArgs(platform: string, env?: NodeJS.ProcessEnv): string[];
198
+ /**
199
+ * Git Bash, found rather than assumed.
200
+ *
201
+ * bootstrap.sh runs under Git Bash on Windows, and `bash` by name is not it on
202
+ * any machine with WSL: System32\bash.exe and WindowsApps\bash.exe both come
203
+ * first on PATH, and both launch Linux. Run there, bootstrap sees a Linux host
204
+ * and a Windows checkout and fails in ways that name neither.
205
+ *
206
+ * So: BASALT_BASH if set; else the bash.exe beside whichever git.exe is on PATH
207
+ * (Git for Windows puts git.exe in <Git>\cmd and bash.exe in <Git>\bin); else
208
+ * the standard install locations. Anything under System32 or WindowsApps is
209
+ * refused wherever it came from.
210
+ */
211
+ export declare function findGitBash(env?: NodeJS.ProcessEnv): string | null;
212
+ /**
213
+ * The environment `set` prints, as an object. Only lines of the form NAME=value;
214
+ * cmd prints nothing else there, but a banner from a profile script might.
215
+ */
216
+ export declare function parseSetOutput(output: string): Record<string, string>;
217
+ /**
218
+ * The MSVC environment, loaded the way a Developer Command Prompt loads it.
219
+ *
220
+ * clang-cl needs the Windows SDK's headers and libraries, and only
221
+ * vcvars64.bat puts them on INCLUDE and LIB; the Visual Studio CMake component
222
+ * it also puts on PATH brings cmake and ninja. Without this, `--build` worked
223
+ * only from a shell somebody had already prepared, and preparing one from
224
+ * PowerShell meant a wrapper script -- which is how an example app came to
225
+ * forward its arguments into npm's npx.ps1 with @args, and lose every one of
226
+ * them.
227
+ *
228
+ * Skipped when the shell already has it (VCToolsInstallDir is vcvars' own
229
+ * marker). VCPKG_ROOT is left as it was: vcvars points it at the copy bundled
230
+ * with Visual Studio, which has nothing installed in it.
231
+ */
232
+ export declare function msvcEnvironment(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
233
+ /**
234
+ * The React Native monorepo root, when `reactNativePath` is inside a checkout.
235
+ *
236
+ * `reactNativePath` is the package directory, two levels below the root in a
237
+ * checkout. An installed react-native has no monorepo above it, and this
238
+ * returns null for one; reactNativeSources above decides what to do then.
239
+ */
240
+ export declare function monorepoRoot(reactNativePath: string): string | null;
241
+ /**
242
+ * Building the host from an app.
243
+ *
244
+ * This is what `run-android` gets from Gradle and `run-ios` from Xcode. There
245
+ * is no equivalent to hand it to, so the work is here: vendor React Native's
246
+ * C++ dependencies, configure CMake against the app's own React Native, and
247
+ * build.
248
+ *
249
+ * Two things about where output goes. It goes under the app, in `.basalt`, not
250
+ * into `node_modules`, because npm rewrites node_modules on install and a
251
+ * Hermes build is not something to lose that way. And `third_party` is shared
252
+ * between builds of the same app rather than per configuration, because it
253
+ * depends on the React Native version and nothing else; the version stamp
254
+ * inside it is what keeps that honest.
255
+ *
256
+ * The first build is slow in a way `run-android` is not. It compiles Hermes and
257
+ * React Native's C++ core. Saying so before it starts is better than a silent
258
+ * half hour.
259
+ */
260
+ /**
261
+ * A build failure, with what was in the build.
262
+ *
263
+ * A capability package -- or one of the app's own modules -- compiles into the
264
+ * same binary as the platform, so its compiler errors arrive looking exactly
265
+ * like the platform's own: a path, in a node_modules directory nobody was
266
+ * thinking about. Naming what contributed is the part that cannot be read off
267
+ * the error.
268
+ *
269
+ * Which package broke it is deliberately not claimed. The build output is
270
+ * streamed rather than captured, because a person watching a twenty-minute
271
+ * compile should see it happen, and buffering it to grep for a directory would
272
+ * trade that for a guess. Naming the contributors is what can be said honestly
273
+ * without giving that up.
274
+ */
275
+ export declare function explainContributedFailure(projectRoot: string, error: Error): Error;
276
+ /**
277
+ * Clears a build directory from before it was split by target.
278
+ *
279
+ * `.basalt/build` used to be the build directory itself; it is now a directory
280
+ * of them, one per target. The old one cannot become the new one: a CMake build
281
+ * directory records its own path, and moving it produces "The current
282
+ * CMakeCache.txt directory ... is different than the directory ..." -- which was
283
+ * this function's first shape, and it did not work.
284
+ *
285
+ * So it is moved aside rather than salvaged, and the target is built once more.
286
+ * That costs less than it sounds: the expensive vendoring -- Hermes, folly,
287
+ * ReactCxxPlatform -- lives in `.basalt/third_party`, which is untouched, and
288
+ * ccache carries most of the rest.
289
+ *
290
+ * Kept rather than deleted, because it is hundreds of megabytes of someone
291
+ * else's disk and the CLI is not the right thing to decide that. The line it
292
+ * prints says where it went.
293
+ */
294
+ export declare function migrateBuildDirectory(workDir: string, log: (line: string) => void): void;
295
+ export declare function buildHost(context: CliContext, options: RunOptions, target: Target): string;
296
+ /**
297
+ * The name the app registered with AppRegistry.
298
+ *
299
+ * app.json's `name`, which is what `registerRootComponent` and every template
300
+ * use, and what run-android reads for the same purpose. Expo apps register
301
+ * "main" regardless, so an explicit --module has to win.
302
+ */
303
+ export declare function resolveModuleName(projectRoot: string, options: RunOptions): string;
304
+ /**
305
+ * Whether React Native's `start` command can load its Metro configuration in
306
+ * this app. Null when it can; otherwise the message to show.
307
+ *
308
+ * Development runs start Metro through that command, and its loader requires
309
+ * @react-native/metro-config from the app whatever the app's own
310
+ * metro.config.js says. A React Native template lists it. An Expo app does
311
+ * not -- Expo's CLI brings its own configuration -- so every Expo app's first
312
+ * development run died inside Metro with "Cannot resolve
313
+ * `@react-native/metro-config`", and only after the port timeout. Asked up
314
+ * front, the answer can name the version to install: the app's react-native
315
+ * version, which is what @react-native/community-cli-plugin pins it to.
316
+ */
317
+ export declare function missingMetroConfig(projectRoot: string): string | null;
318
+ /**
319
+ * The CLI command object React Native's CLI expects, for one target.
320
+ */
321
+ export declare function makeRunCommand(target: Target): {
322
+ name: string;
323
+ description: string;
324
+ func: (argv: string[], context: CliContext, options: RunOptions) => Promise<void>;
325
+ options: ({
326
+ name: string;
327
+ description: string;
328
+ default: number;
329
+ } | {
330
+ name: string;
331
+ description: string;
332
+ default: string;
333
+ } | {
334
+ name: string;
335
+ description: string;
336
+ default?: undefined;
337
+ })[];
338
+ };
339
+ //# sourceMappingURL=desktop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop.d.ts","sourceRoot":"","sources":["../../cli/desktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,KA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