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.
- package/LICENSE +21 -0
- package/dist/cli/basalt.d.ts +3 -0
- package/dist/cli/basalt.d.ts.map +1 -0
- package/dist/cli/basalt.js +47 -0
- package/dist/cli/basalt.js.map +1 -0
- package/dist/cli/bundle-cli.d.ts +12 -0
- package/dist/cli/bundle-cli.d.ts.map +1 -0
- package/dist/cli/bundle-cli.js +124 -0
- package/dist/cli/bundle-cli.js.map +1 -0
- package/dist/cli/bundleWithAssets.d.ts +79 -0
- package/dist/cli/bundleWithAssets.d.ts.map +1 -0
- package/dist/cli/bundleWithAssets.js +198 -0
- package/dist/cli/bundleWithAssets.js.map +1 -0
- package/dist/cli/desktop.d.ts +339 -0
- package/dist/cli/desktop.d.ts.map +1 -0
- package/dist/cli/desktop.js +1029 -0
- package/dist/cli/desktop.js.map +1 -0
- package/dist/cli/doctor.d.ts +31 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +283 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/init.d.ts +77 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +442 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/metro.d.ts +49 -0
- package/dist/cli/metro.d.ts.map +1 -0
- package/dist/cli/metro.js +148 -0
- package/dist/cli/metro.js.map +1 -0
- package/dist/cli/packageApp.d.ts +102 -0
- package/dist/cli/packageApp.d.ts.map +1 -0
- package/dist/cli/packageApp.js +319 -0
- package/dist/cli/packageApp.js.map +1 -0
- package/dist/cli/steps.d.ts +34 -0
- package/dist/cli/steps.d.ts.map +1 -0
- package/dist/cli/steps.js +53 -0
- package/dist/cli/steps.js.map +1 -0
- package/dist/metro-config.d.ts +168 -0
- package/dist/metro-config.d.ts.map +1 -0
- package/dist/metro-config.js +671 -0
- package/dist/metro-config.js.map +1 -0
- package/dist/react-native.config.d.ts +7 -0
- package/dist/react-native.config.d.ts.map +1 -0
- package/dist/react-native.config.js +80 -0
- package/dist/react-native.config.js.map +1 -0
- package/dist/src/DragSource.d.ts +52 -0
- package/dist/src/DragSource.d.ts.map +1 -0
- package/dist/src/DragSource.js +97 -0
- package/dist/src/DragSource.js.map +1 -0
- package/dist/src/DropTarget.d.ts +58 -0
- package/dist/src/DropTarget.d.ts.map +1 -0
- package/dist/src/DropTarget.js +131 -0
- package/dist/src/DropTarget.js.map +1 -0
- package/dist/src/KeyHandler.d.ts +57 -0
- package/dist/src/KeyHandler.d.ts.map +1 -0
- package/dist/src/KeyHandler.js +48 -0
- package/dist/src/KeyHandler.js.map +1 -0
- package/dist/src/Menu.d.ts +72 -0
- package/dist/src/Menu.d.ts.map +1 -0
- package/dist/src/Menu.js +179 -0
- package/dist/src/Menu.js.map +1 -0
- package/dist/src/TitleBar.d.ts +75 -0
- package/dist/src/TitleBar.d.ts.map +1 -0
- package/dist/src/TitleBar.js +236 -0
- package/dist/src/TitleBar.js.map +1 -0
- package/dist/src/Window.d.ts +87 -0
- package/dist/src/Window.d.ts.map +1 -0
- package/dist/src/Window.js +248 -0
- package/dist/src/Window.js.map +1 -0
- package/dist/src/closeRequest.d.ts +55 -0
- package/dist/src/closeRequest.d.ts.map +1 -0
- package/dist/src/closeRequest.js +134 -0
- package/dist/src/closeRequest.js.map +1 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +92 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/overrides/Alert.d.ts +69 -0
- package/dist/src/overrides/Alert.d.ts.map +1 -0
- package/dist/src/overrides/Alert.js +112 -0
- package/dist/src/overrides/Alert.js.map +1 -0
- package/dist/src/overrides/BaseViewConfig.d.ts +28 -0
- package/dist/src/overrides/BaseViewConfig.d.ts.map +1 -0
- package/dist/src/overrides/BaseViewConfig.js +72 -0
- package/dist/src/overrides/BaseViewConfig.js.map +1 -0
- package/dist/src/overrides/Platform.linux.d.ts +10 -0
- package/dist/src/overrides/Platform.linux.d.ts.map +1 -0
- package/dist/src/overrides/Platform.linux.js +15 -0
- package/dist/src/overrides/Platform.linux.js.map +1 -0
- package/dist/src/overrides/Platform.macos.d.ts +10 -0
- package/dist/src/overrides/Platform.macos.d.ts.map +1 -0
- package/dist/src/overrides/Platform.macos.js +15 -0
- package/dist/src/overrides/Platform.macos.js.map +1 -0
- package/dist/src/overrides/Platform.windows.d.ts +10 -0
- package/dist/src/overrides/Platform.windows.d.ts.map +1 -0
- package/dist/src/overrides/Platform.windows.js +15 -0
- package/dist/src/overrides/Platform.windows.js.map +1 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts +24 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.d.ts.map +1 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.js +30 -0
- package/dist/src/overrides/ReactDevToolsSettingsManager.js.map +1 -0
- package/dist/src/overrides/RefreshControl.d.ts +52 -0
- package/dist/src/overrides/RefreshControl.d.ts.map +1 -0
- package/dist/src/overrides/RefreshControl.js +92 -0
- package/dist/src/overrides/RefreshControl.js.map +1 -0
- package/dist/src/overrides/ScrollView.d.ts +39 -0
- package/dist/src/overrides/ScrollView.d.ts.map +1 -0
- package/dist/src/overrides/ScrollView.js +59 -0
- package/dist/src/overrides/ScrollView.js.map +1 -0
- package/dist/src/overrides/Share.d.ts +96 -0
- package/dist/src/overrides/Share.d.ts.map +1 -0
- package/dist/src/overrides/Share.js +97 -0
- package/dist/src/overrides/Share.js.map +1 -0
- package/dist/src/overrides/TextInput.d.ts +81 -0
- package/dist/src/overrides/TextInput.d.ts.map +1 -0
- package/dist/src/overrides/TextInput.js +213 -0
- package/dist/src/overrides/TextInput.js.map +1 -0
- package/dist/src/overrides/View.d.ts +36 -0
- package/dist/src/overrides/View.d.ts.map +1 -0
- package/dist/src/overrides/View.js +99 -0
- package/dist/src/overrides/View.js.map +1 -0
- package/dist/src/overrides/createPlatform.d.ts +32 -0
- package/dist/src/overrides/createPlatform.d.ts.map +1 -0
- package/dist/src/overrides/createPlatform.js +84 -0
- package/dist/src/overrides/createPlatform.js.map +1 -0
- package/dist/src/overrides/setUpDeveloperTools.d.ts +28 -0
- package/dist/src/overrides/setUpDeveloperTools.d.ts.map +1 -0
- package/dist/src/overrides/setUpDeveloperTools.js +84 -0
- package/dist/src/overrides/setUpDeveloperTools.js.map +1 -0
- package/dist/src/overrides/setUpXHR.d.ts +46 -0
- package/dist/src/overrides/setUpXHR.d.ts.map +1 -0
- package/dist/src/overrides/setUpXHR.js +236 -0
- package/dist/src/overrides/setUpXHR.js.map +1 -0
- package/dist/src/quitRequest.d.ts +55 -0
- package/dist/src/quitRequest.d.ts.map +1 -0
- package/dist/src/quitRequest.js +121 -0
- package/dist/src/quitRequest.js.map +1 -0
- package/dist/src/resourcePath.d.ts +18 -0
- package/dist/src/resourcePath.d.ts.map +1 -0
- package/dist/src/resourcePath.js +31 -0
- package/dist/src/resourcePath.js.map +1 -0
- package/dist/src/responseBody.d.ts +76 -0
- package/dist/src/responseBody.d.ts.map +1 -0
- package/dist/src/responseBody.js +94 -0
- package/dist/src/responseBody.js.map +1 -0
- package/dist/src/responseHeaders.d.ts +40 -0
- package/dist/src/responseHeaders.d.ts.map +1 -0
- package/dist/src/responseHeaders.js +75 -0
- package/dist/src/responseHeaders.js.map +1 -0
- package/dist/src/titleBarState.d.ts +43 -0
- package/dist/src/titleBarState.d.ts.map +1 -0
- package/dist/src/titleBarState.js +77 -0
- package/dist/src/titleBarState.js.map +1 -0
- package/dist/src/useContextMenu.d.ts +113 -0
- package/dist/src/useContextMenu.d.ts.map +1 -0
- package/dist/src/useContextMenu.js +109 -0
- package/dist/src/useContextMenu.js.map +1 -0
- package/dist/src/useDialog.d.ts +98 -0
- package/dist/src/useDialog.d.ts.map +1 -0
- package/dist/src/useDialog.js +112 -0
- package/dist/src/useDialog.js.map +1 -0
- package/dist/src/useDisplays.d.ts +70 -0
- package/dist/src/useDisplays.d.ts.map +1 -0
- package/dist/src/useDisplays.js +118 -0
- package/dist/src/useDisplays.js.map +1 -0
- package/dist/src/useHandledKeys.d.ts +38 -0
- package/dist/src/useHandledKeys.d.ts.map +1 -0
- package/dist/src/useHandledKeys.js +70 -0
- package/dist/src/useHandledKeys.js.map +1 -0
- package/dist/src/useWindow.d.ts +140 -0
- package/dist/src/useWindow.d.ts.map +1 -0
- package/dist/src/useWindow.js +233 -0
- package/dist/src/useWindow.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/native/CMakeLists.txt +355 -0
- package/native/bootstrap.sh +613 -0
- package/native/cmake/CompilerFlags.cmake +49 -0
- package/native/cmake/Expo.cmake +125 -0
- package/native/cmake/ReactNativeCore.cmake +612 -0
- package/native/cmake/Reanimated.cmake +108 -0
- package/native/cmake/Skia.cmake +379 -0
- package/native/cmake/ThirdParty.cmake +290 -0
- package/native/cmake/Worklets.cmake +67 -0
- package/native/cmake/codegen/CMakeLists.txt +32 -0
- package/native/core/AppIdentity.cpp +85 -0
- package/native/core/AppIdentity.h +59 -0
- package/native/core/AppPaths.cpp +96 -0
- package/native/core/AppPaths.h +53 -0
- package/native/core/AppearanceModule.cpp +60 -0
- package/native/core/AppearanceModule.h +40 -0
- package/native/core/Backface.h +59 -0
- package/native/core/BlobModule.cpp +283 -0
- package/native/core/BlobModule.h +76 -0
- package/native/core/BlobRegistry.cpp +75 -0
- package/native/core/BlobRegistry.h +44 -0
- package/native/core/ColorScheme.cpp +105 -0
- package/native/core/ColorScheme.h +59 -0
- package/native/core/ComponentRegistry.h +30 -0
- package/native/core/ControlMetrics.h +37 -0
- package/native/core/CoreModules.cpp +592 -0
- package/native/core/CoreModules.h +308 -0
- package/native/core/DebuggingOverlay.cpp +106 -0
- package/native/core/DebuggingOverlay.h +65 -0
- package/native/core/DesktopControls.cpp +232 -0
- package/native/core/DesktopControls.h +170 -0
- package/native/core/DevBundle.cpp +108 -0
- package/native/core/DevBundle.h +69 -0
- package/native/core/DevMenu.cpp +99 -0
- package/native/core/DevMenu.h +75 -0
- package/native/core/DialogModule.cpp +150 -0
- package/native/core/DialogModule.h +51 -0
- package/native/core/DragAndDrop.cpp +45 -0
- package/native/core/DragAndDrop.h +225 -0
- package/native/core/ExpoImageComponent.cpp +79 -0
- package/native/core/ExpoImageComponent.h +80 -0
- package/native/core/ExpoModules.cpp +415 -0
- package/native/core/ExpoModules.h +115 -0
- package/native/core/ExpoRuntime.cpp +366 -0
- package/native/core/ExpoRuntime.h +42 -0
- package/native/core/FocusRing.h +36 -0
- package/native/core/FontRegistry.h +51 -0
- package/native/core/GestureHandlerModule.cpp +136 -0
- package/native/core/GestureHandlerModule.h +71 -0
- package/native/core/Gestures.cpp +533 -0
- package/native/core/Gestures.h +145 -0
- package/native/core/HoverTracker.cpp +69 -0
- package/native/core/HoverTracker.h +109 -0
- package/native/core/HttpClient.cpp +282 -0
- package/native/core/ImageBytes.cpp +205 -0
- package/native/core/ImageBytes.h +29 -0
- package/native/core/ImageCache.cpp +51 -0
- package/native/core/ImageCache.h +89 -0
- package/native/core/JsRuntimeAccess.cpp +70 -0
- package/native/core/JsRuntimeAccess.h +60 -0
- package/native/core/JsiPromise.h +51 -0
- package/native/core/KeyEvents.cpp +116 -0
- package/native/core/KeyEvents.h +144 -0
- package/native/core/LogBoxSurface.cpp +46 -0
- package/native/core/LogBoxSurface.h +68 -0
- package/native/core/MenuModel.h +117 -0
- package/native/core/MenuModule.cpp +209 -0
- package/native/core/MenuModule.h +66 -0
- package/native/core/MountingWalk.h +524 -0
- package/native/core/PackageModules.cpp.in +25 -0
- package/native/core/PackageModules.h +50 -0
- package/native/core/PlatformConstantsModule.cpp +63 -0
- package/native/core/PlatformConstantsModule.h +64 -0
- package/native/core/PlatformServices.h +213 -0
- package/native/core/PointerButtons.h +63 -0
- package/native/core/PullToRefresh.cpp +57 -0
- package/native/core/PullToRefresh.h +73 -0
- package/native/core/ReanimatedCompat.h +47 -0
- package/native/core/ReanimatedModule.cpp +203 -0
- package/native/core/ReanimatedModule.h +55 -0
- package/native/core/ScrollAnimation.cpp +59 -0
- package/native/core/ScrollAnimation.h +70 -0
- package/native/core/ScrollBounds.cpp +26 -0
- package/native/core/ScrollBounds.h +68 -0
- package/native/core/ScrollIndicator.cpp +50 -0
- package/native/core/ScrollIndicator.h +69 -0
- package/native/core/ScrollMomentum.cpp +71 -0
- package/native/core/ScrollMomentum.h +73 -0
- package/native/core/ScrollSnap.cpp +123 -0
- package/native/core/ScrollSnap.h +80 -0
- package/native/core/ShareFallback.cpp +101 -0
- package/native/core/ShareFallback.h +45 -0
- package/native/core/SkiaPictureViewComponent.cpp +11 -0
- package/native/core/SkiaPictureViewComponent.h +47 -0
- package/native/core/SourceCodeModule.cpp +55 -0
- package/native/core/SourceCodeModule.h +53 -0
- package/native/core/StatusBarModule.cpp +23 -0
- package/native/core/StatusBarModule.h +42 -0
- package/native/core/TestDialog.cpp +148 -0
- package/native/core/TestDialog.h +96 -0
- package/native/core/TestKeys.cpp +78 -0
- package/native/core/TestKeys.h +50 -0
- package/native/core/TestQuitFile.cpp +33 -0
- package/native/core/TestQuitFile.h +60 -0
- package/native/core/TestSettle.h +192 -0
- package/native/core/TitleBarRegions.h +31 -0
- package/native/core/TurboModuleProxy.cpp +51 -0
- package/native/core/TurboModuleProxy.h +46 -0
- package/native/core/UIManagerAccess.cpp +43 -0
- package/native/core/UIManagerAccess.h +43 -0
- package/native/core/WindowBoundsCache.cpp +319 -0
- package/native/core/WindowControl.h +235 -0
- package/native/core/WindowHost.h +158 -0
- package/native/core/WindowMethods.cpp +167 -0
- package/native/core/WindowMethods.h +84 -0
- package/native/core/WindowsModule.cpp +448 -0
- package/native/core/WindowsModule.h +133 -0
- package/native/core/WorkletsModule.cpp +199 -0
- package/native/core/WorkletsModule.h +57 -0
- package/native/core/portability_probe.cpp +210 -0
- package/native/tests/EventRecorder.h +124 -0
- package/native/tests/TestHarness.cpp +109 -0
- package/native/tests/TestHarness.h +89 -0
- package/native/tests/TreeDump.h +49 -0
- package/native/tests/test_app_identity.cpp +114 -0
- package/native/tests/test_app_paths.cpp +48 -0
- package/native/tests/test_appearance.cpp +107 -0
- package/native/tests/test_backface.cpp +79 -0
- package/native/tests/test_blobs.cpp +157 -0
- package/native/tests/test_controls.cpp +185 -0
- package/native/tests/test_devbundle.cpp +103 -0
- package/native/tests/test_drag_and_drop.cpp +143 -0
- package/native/tests/test_gestures.cpp +331 -0
- package/native/tests/test_hover.cpp +92 -0
- package/native/tests/test_image_cache.cpp +109 -0
- package/native/tests/test_js_runtime_access.cpp +137 -0
- package/native/tests/test_key_events.cpp +235 -0
- package/native/tests/test_momentum.cpp +138 -0
- package/native/tests/test_quit_file.cpp +104 -0
- package/native/tests/test_scroll_animation.cpp +120 -0
- package/native/tests/test_scroll_bounds.cpp +66 -0
- package/native/tests/test_scroll_indicator.cpp +149 -0
- package/native/tests/test_scroll_snap.cpp +112 -0
- package/native/tests/test_settle.cpp +115 -0
- package/native/tests/test_share.cpp +75 -0
- package/native/tests/test_sourcecode.cpp +62 -0
- package/native/tests/test_window_close.cpp +119 -0
- package/native/tests/test_window_limits.cpp +123 -0
- package/package.json +43 -0
- package/react-native.config.js +86 -0
- 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,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAKlD;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,gFAAgF;AAChF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;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