@solidnative-dev/cli 0.0.0-stage → 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +841 -2
- package/dist/android-apk-signing.d.ts +36 -0
- package/dist/android-apk-signing.d.ts.map +1 -0
- package/dist/android-apk-signing.js +292 -0
- package/dist/android-apk-signing.js.map +1 -0
- package/dist/android-bundle-signing.d.ts +34 -0
- package/dist/android-bundle-signing.d.ts.map +1 -0
- package/dist/android-bundle-signing.js +167 -0
- package/dist/android-bundle-signing.js.map +1 -0
- package/dist/android-causal-debug.d.ts +38 -0
- package/dist/android-causal-debug.d.ts.map +1 -0
- package/dist/android-causal-debug.js +239 -0
- package/dist/android-causal-debug.js.map +1 -0
- package/dist/android-device-proof.d.ts +58 -0
- package/dist/android-device-proof.d.ts.map +1 -0
- package/dist/android-device-proof.js +554 -0
- package/dist/android-device-proof.js.map +1 -0
- package/dist/android-logs.d.ts +50 -0
- package/dist/android-logs.d.ts.map +1 -0
- package/dist/android-logs.js +253 -0
- package/dist/android-logs.js.map +1 -0
- package/dist/android-release-signing.d.ts +12 -0
- package/dist/android-release-signing.d.ts.map +1 -0
- package/dist/android-release-signing.js +165 -0
- package/dist/android-release-signing.js.map +1 -0
- package/dist/android-run-lease.d.ts +15 -0
- package/dist/android-run-lease.d.ts.map +1 -0
- package/dist/android-run-lease.js +333 -0
- package/dist/android-run-lease.js.map +1 -0
- package/dist/android-run-preflight.d.ts +45 -0
- package/dist/android-run-preflight.d.ts.map +1 -0
- package/dist/android-run-preflight.js +183 -0
- package/dist/android-run-preflight.js.map +1 -0
- package/dist/android-signing-shared.d.ts +38 -0
- package/dist/android-signing-shared.d.ts.map +1 -0
- package/dist/android-signing-shared.js +210 -0
- package/dist/android-signing-shared.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +4530 -0
- package/dist/bin.js.map +1 -0
- package/dist/bundle-artifacts.d.ts +48 -0
- package/dist/bundle-artifacts.d.ts.map +1 -0
- package/dist/bundle-artifacts.js +427 -0
- package/dist/bundle-artifacts.js.map +1 -0
- package/dist/causal-debug-compare.d.ts +81 -0
- package/dist/causal-debug-compare.d.ts.map +1 -0
- package/dist/causal-debug-compare.js +238 -0
- package/dist/causal-debug-compare.js.map +1 -0
- package/dist/causal-debug-report.d.ts +33 -0
- package/dist/causal-debug-report.d.ts.map +1 -0
- package/dist/causal-debug-report.js +979 -0
- package/dist/causal-debug-report.js.map +1 -0
- package/dist/causal-debug-watch.d.ts +33 -0
- package/dist/causal-debug-watch.d.ts.map +1 -0
- package/dist/causal-debug-watch.js +92 -0
- package/dist/causal-debug-watch.js.map +1 -0
- package/dist/causal-debug.d.ts +131 -0
- package/dist/causal-debug.d.ts.map +1 -0
- package/dist/causal-debug.js +503 -0
- package/dist/causal-debug.js.map +1 -0
- package/dist/compatibility-catalog.d.ts +88 -0
- package/dist/compatibility-catalog.d.ts.map +1 -0
- package/dist/compatibility-catalog.js +344 -0
- package/dist/compatibility-catalog.js.map +1 -0
- package/dist/deep-link.d.ts +90 -0
- package/dist/deep-link.d.ts.map +1 -0
- package/dist/deep-link.js +346 -0
- package/dist/deep-link.js.map +1 -0
- package/dist/device-proof-signatures.d.ts +307 -0
- package/dist/device-proof-signatures.d.ts.map +1 -0
- package/dist/device-proof-signatures.js +1024 -0
- package/dist/device-proof-signatures.js.map +1 -0
- package/dist/fingerprint.d.ts +35 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +454 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +388 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2996 -0
- package/dist/index.js.map +1 -0
- package/dist/ios-causal-debug.d.ts +39 -0
- package/dist/ios-causal-debug.d.ts.map +1 -0
- package/dist/ios-causal-debug.js +318 -0
- package/dist/ios-causal-debug.js.map +1 -0
- package/dist/ios-logs.d.ts +58 -0
- package/dist/ios-logs.d.ts.map +1 -0
- package/dist/ios-logs.js +269 -0
- package/dist/ios-logs.js.map +1 -0
- package/dist/ios-process.d.ts +69 -0
- package/dist/ios-process.d.ts.map +1 -0
- package/dist/ios-process.js +389 -0
- package/dist/ios-process.js.map +1 -0
- package/dist/ios-run-preflight.d.ts +35 -0
- package/dist/ios-run-preflight.d.ts.map +1 -0
- package/dist/ios-run-preflight.js +172 -0
- package/dist/ios-run-preflight.js.map +1 -0
- package/dist/live-causal-debug-report.d.ts +49 -0
- package/dist/live-causal-debug-report.d.ts.map +1 -0
- package/dist/live-causal-debug-report.js +123 -0
- package/dist/live-causal-debug-report.js.map +1 -0
- package/dist/local-symbolication.d.ts +35 -0
- package/dist/local-symbolication.d.ts.map +1 -0
- package/dist/local-symbolication.js +89 -0
- package/dist/local-symbolication.js.map +1 -0
- package/dist/native-archive.d.ts +15 -0
- package/dist/native-archive.d.ts.map +1 -0
- package/dist/native-archive.js +441 -0
- package/dist/native-archive.js.map +1 -0
- package/dist/native-test.d.ts +43 -0
- package/dist/native-test.d.ts.map +1 -0
- package/dist/native-test.js +209 -0
- package/dist/native-test.js.map +1 -0
- package/dist/package-add.d.ts +56 -0
- package/dist/package-add.d.ts.map +1 -0
- package/dist/package-add.js +764 -0
- package/dist/package-add.js.map +1 -0
- package/dist/react-native-upgrade.d.ts +96 -0
- package/dist/react-native-upgrade.d.ts.map +1 -0
- package/dist/react-native-upgrade.js +882 -0
- package/dist/react-native-upgrade.js.map +1 -0
- package/dist/release-device-correlation.d.ts +40 -0
- package/dist/release-device-correlation.d.ts.map +1 -0
- package/dist/release-device-correlation.js +113 -0
- package/dist/release-device-correlation.js.map +1 -0
- package/dist/release-signatures.d.ts +168 -0
- package/dist/release-signatures.d.ts.map +1 -0
- package/dist/release-signatures.js +677 -0
- package/dist/release-signatures.js.map +1 -0
- package/dist/release.d.ts +88 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +771 -0
- package/dist/release.js.map +1 -0
- package/dist/signature-utilities.d.ts +16 -0
- package/dist/signature-utilities.d.ts.map +1 -0
- package/dist/signature-utilities.js +114 -0
- package/dist/signature-utilities.js.map +1 -0
- package/dist/solid-diagnostics-correlation.d.ts +11 -0
- package/dist/solid-diagnostics-correlation.d.ts.map +1 -0
- package/dist/solid-diagnostics-correlation.js +78 -0
- package/dist/solid-diagnostics-correlation.js.map +1 -0
- package/dist/solid-diagnostics-debug.d.ts +15 -0
- package/dist/solid-diagnostics-debug.d.ts.map +1 -0
- package/dist/solid-diagnostics-debug.js +93 -0
- package/dist/solid-diagnostics-debug.js.map +1 -0
- package/dist/solid-diagnostics-inspection.d.ts +41 -0
- package/dist/solid-diagnostics-inspection.d.ts.map +1 -0
- package/dist/solid-diagnostics-inspection.js +196 -0
- package/dist/solid-diagnostics-inspection.js.map +1 -0
- package/dist/source-map.d.ts +36 -0
- package/dist/source-map.d.ts.map +1 -0
- package/dist/source-map.js +488 -0
- package/dist/source-map.js.map +1 -0
- package/dist/stack-symbolication.d.ts +56 -0
- package/dist/stack-symbolication.d.ts.map +1 -0
- package/dist/stack-symbolication.js +310 -0
- package/dist/stack-symbolication.js.map +1 -0
- package/dist/symbolication.d.ts +27 -0
- package/dist/symbolication.d.ts.map +1 -0
- package/dist/symbolication.js +75 -0
- package/dist/symbolication.js.map +1 -0
- package/dist/tree-debug.d.ts +53 -0
- package/dist/tree-debug.d.ts.map +1 -0
- package/dist/tree-debug.js +283 -0
- package/dist/tree-debug.js.map +1 -0
- package/dist/versions.d.ts +13 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +14 -0
- package/dist/versions.js.map +1 -0
- package/package.json +46 -3
- package/templates/react-native-0.88/README.md +328 -0
- package/templates/react-native-0.88/android/CMakeLists.txt +27 -0
- package/templates/react-native-0.88/android/MainActivity.kt +123 -0
- package/templates/react-native-0.88/android/MainApplication.kt +43 -0
- package/templates/react-native-0.88/android/OnLoad.cpp +60 -0
- package/templates/react-native-0.88/index.js +1 -0
- package/templates/react-native-0.88/ios/AppDelegate.swift +190 -0
- package/templates/react-native-0.88/metro.config.js +16 -0
- package/templates/react-native-0.88/specs/NativeSolidNativeDebug.ts +16 -0
- package/templates/react-native-0.88/specs/NativeSolidNativePlatformAndroid.ts +14 -0
- package/templates/react-native-0.88/src/App.tsx +161 -0
- package/templates/react-native-0.88/src/main.tsx +88 -0
- package/templates/react-native-0.88/test/App.test.tsx +152 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# **PROJECT_NAME**
|
|
2
|
+
|
|
3
|
+
**APP_TITLE** is a Solid Native application backed by the version-pinned React
|
|
4
|
+
Native 0.88.1 Fabric runtime. Solid owns the application component tree; React is
|
|
5
|
+
present only as a native backend dependency.
|
|
6
|
+
|
|
7
|
+
## First run and first edit
|
|
8
|
+
|
|
9
|
+
Validate the generated project before paying for a native build:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm run doctor
|
|
13
|
+
pnpm check
|
|
14
|
+
pnpm test
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Start Metro in one terminal:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm start
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
With an authorized, unlocked phone attached, launch the application from a
|
|
24
|
+
second terminal:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pnpm android
|
|
28
|
+
# or
|
|
29
|
+
pnpm ios
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Install the iOS pods first with the commands below. For a deterministic Android
|
|
33
|
+
launch, pass the exact adb serial after `--`, for example
|
|
34
|
+
`pnpm android -- --device DEVICE_SERIAL`. Solid Native verifies that target
|
|
35
|
+
before Gradle starts. A physical device must be unlocked; the CLI owns a
|
|
36
|
+
reversible USB/AC stay-awake lease for the native command and restores the prior
|
|
37
|
+
setting on success or failure. Concurrent local runs cannot lease the same
|
|
38
|
+
serial, and a later run recovers a valid lease left by an abruptly killed CLI.
|
|
39
|
+
Emulators receive availability checks without power-setting changes. Plain
|
|
40
|
+
`pnpm android` applies this contract when exactly one authorized target is
|
|
41
|
+
attached and passes that validated serial explicitly to React Native; with
|
|
42
|
+
several, select one explicitly or use
|
|
43
|
+
`pnpm android -- --list-devices` for React Native's interactive picker.
|
|
44
|
+
|
|
45
|
+
When more than one iOS destination is available, pass the ordinary React Native
|
|
46
|
+
CLI device option after `--`, for example
|
|
47
|
+
`pnpm ios -- --device CORE_DEVICE_ID`. Explicit physical iOS targets must be
|
|
48
|
+
currently unlocked; the Solid Native CLI checks CoreDevice before starting
|
|
49
|
+
Metro, CocoaPods, or Xcode. Simulator runs are unchanged.
|
|
50
|
+
|
|
51
|
+
Edit `src/App.tsx` to make the first application change. Solid signal reads in
|
|
52
|
+
TSX update only their dependent native output; the application is not rendered
|
|
53
|
+
through React or a WebView. Source changes currently perform a safe
|
|
54
|
+
whole-runtime reload, so mounted Solid owners and native resources cannot
|
|
55
|
+
survive stale code.
|
|
56
|
+
|
|
57
|
+
The starter screen includes a bounded animation authored from typed named
|
|
58
|
+
inputs. `createNativeViewAnimation` waits for its Fabric ref to mount, then
|
|
59
|
+
drives the card on Android `Choreographer` or iOS `CADisplayLink` without a
|
|
60
|
+
JavaScript frame loop. Its Solid owner releases the graph automatically.
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
pnpm run doctor
|
|
66
|
+
pnpm test
|
|
67
|
+
pnpm fingerprint
|
|
68
|
+
pnpm generate
|
|
69
|
+
pnpm start
|
|
70
|
+
pnpm android
|
|
71
|
+
pnpm ios
|
|
72
|
+
pnpm build:android
|
|
73
|
+
pnpm build:ios
|
|
74
|
+
pnpm bundle:android
|
|
75
|
+
pnpm bundle:ios
|
|
76
|
+
pnpm release -- --help
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`pnpm test` runs the generated `test/App.test.tsx` against the deterministic
|
|
80
|
+
Solid Native host. It compiles application TSX with the same Solid universal
|
|
81
|
+
OXC pipeline as Metro and uses Node's built-in test runner with Solid's
|
|
82
|
+
development diagnostics enabled; it does not start React, Jest, Metro, a
|
|
83
|
+
simulator, or a device. The starter test presses the real `App` component's
|
|
84
|
+
counter, observes its fine-grained native text mutation, and drives a delayed
|
|
85
|
+
response and chunk through the app's real Solid-owned native network controller
|
|
86
|
+
before requiring complete owner and surface cleanup. It rejects Solid
|
|
87
|
+
diagnostics, wasted computations, rerun-budget regressions, and excess native
|
|
88
|
+
commits or mutations. Use `pnpm test -- --production` for an explicit optimized-
|
|
89
|
+
runtime pass of the same behavior; Solid does not expose diagnostic channels in
|
|
90
|
+
that mode. Keep
|
|
91
|
+
physical-device tests for Fabric, Yoga, operating-system UI, and performance
|
|
92
|
+
claims.
|
|
93
|
+
Call `screen.debug()` in a test to return a bounded readable native tree;
|
|
94
|
+
`screen.debug({ includeProps: true })` also includes deterministic transport
|
|
95
|
+
props when a component boundary needs deeper inspection.
|
|
96
|
+
Use `await screen.findByText("Loaded")` (or another `findBy*` query) for delayed
|
|
97
|
+
native service or stream output; use `screen.waitFor` for a custom synchronous
|
|
98
|
+
assertion. Polling is bounded and abortable, and timeout errors include both the
|
|
99
|
+
last failed assertion and the committed native tree.
|
|
100
|
+
Capture `screen.commitCheckpoint()` before an action when transaction shape is
|
|
101
|
+
part of the contract, then use `getCommit` or `getMutation` with
|
|
102
|
+
`afterSequence`. These typed structural queries keep text, prop values, and
|
|
103
|
+
command arguments out of their bounded failure diagnostics.
|
|
104
|
+
Use `pnpm test -- --watch` for dependency-aware reruns and add
|
|
105
|
+
`--test-name-pattern "counter"` to focus matching test names.
|
|
106
|
+
For retained screens or repeated labels, scope the full query set with
|
|
107
|
+
`screen.within(screen.getByTestId("screen-id"))`; stale and cross-render roots
|
|
108
|
+
fail instead of matching a sibling native subtree.
|
|
109
|
+
|
|
110
|
+
The development entrypoint enables a bounded causal timeline on Android and iOS
|
|
111
|
+
debug builds. It also resolves `DevelopmentRoot` to a Solid-owned native error
|
|
112
|
+
overlay that catches render failures and guarded non-fatal Hermes exceptions.
|
|
113
|
+
Release bundles resolve the same import to a pass-through root and do not load
|
|
114
|
+
the controller, overlay, or global error bridge. Capture one live snapshot from
|
|
115
|
+
an attached device without starting a resident relay:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
pnpm exec solid-native debug capture-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL \
|
|
119
|
+
| pnpm exec solid-native debug inspect -
|
|
120
|
+
pnpm exec solid-native debug capture-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL \
|
|
121
|
+
| pnpm exec solid-native debug trace - > causal-trace.json
|
|
122
|
+
pnpm exec solid-native debug capture-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL \
|
|
123
|
+
| pnpm exec solid-native debug report - --output causal-report.html
|
|
124
|
+
pnpm exec solid-native debug capture-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID \
|
|
125
|
+
| pnpm exec solid-native debug inspect -
|
|
126
|
+
pnpm exec solid-native debug capture-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID \
|
|
127
|
+
| pnpm exec solid-native debug trace - > causal-trace.json
|
|
128
|
+
pnpm exec solid-native debug capture-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID \
|
|
129
|
+
| pnpm exec solid-native debug report - --output causal-report.html
|
|
130
|
+
pnpm exec solid-native debug watch-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL
|
|
131
|
+
pnpm exec solid-native debug watch-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID
|
|
132
|
+
pnpm exec solid-native debug diagnostics-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL \
|
|
133
|
+
--duration 1000 > solid-diagnostics.json
|
|
134
|
+
pnpm exec solid-native debug diagnostics-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID \
|
|
135
|
+
--duration 1000 > solid-diagnostics.json
|
|
136
|
+
pnpm exec solid-native debug report-android __ANDROID_PACKAGE__ --serial DEVICE_SERIAL \
|
|
137
|
+
--duration 1000 --output causal-report.html
|
|
138
|
+
pnpm exec solid-native debug report-ios __IOS_BUNDLE_ID__ --device CORE_DEVICE_ID \
|
|
139
|
+
--duration 1000 --output causal-report.html
|
|
140
|
+
pnpm exec solid-native debug diagnostics-inspect solid-diagnostics.json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The Android and iOS diagnostics commands open one exclusive timed window in
|
|
144
|
+
the development Solid runtime and return only bounded diagnostic codes, static
|
|
145
|
+
computation names, dependency changes, rerun causes, and aggregate costs. They
|
|
146
|
+
never export reactive values, messages, stacks, owner IDs, component props,
|
|
147
|
+
text, or rendered content. The production resolver substitutes an inert shim,
|
|
148
|
+
so optimized bundles do not retain the capture controller.
|
|
149
|
+
Use `debug diagnostics-inspect solid-diagnostics.json` for a path-free summary
|
|
150
|
+
of diagnostic codes, rerun outcomes, retained causes, and ranked cost totals.
|
|
151
|
+
|
|
152
|
+
The starter's **Check native network** button uses the direct Solid Native
|
|
153
|
+
transport with a bounded response and owner-safe cancellation. Development
|
|
154
|
+
builds show those requests in the local native network badge; the same source
|
|
155
|
+
resolves to the uninstrumented `NetworkService` in production. The inspector
|
|
156
|
+
does not retain request headers, bodies, response text, or error messages.
|
|
157
|
+
|
|
158
|
+
Development builds also expose a native **Trace** badge backed by the same
|
|
159
|
+
bounded causal timeline used by capture commands. Opening it takes a manual
|
|
160
|
+
snapshot of retained operations; selecting one shows its transitive causes and
|
|
161
|
+
effects, and `Refresh` deliberately takes the next snapshot. The viewer does
|
|
162
|
+
not subscribe to its own Fabric telemetry, which prevents the inspector's
|
|
163
|
+
render commits from creating a self-observation loop. Release builds ignore the
|
|
164
|
+
development-root timeline prop and skip timeline allocation.
|
|
165
|
+
|
|
166
|
+
The generated development entry shares one Solid diagnostics controller with
|
|
167
|
+
the device transport and this inspector. Open **Trace**, choose **Capture
|
|
168
|
+
Solid**, exercise the application, and press **Stop Solid**. The reopened panel
|
|
169
|
+
shows bounded named rerun totals alongside same-window native frame-chain
|
|
170
|
+
counts. It does not render values or cause names and labels the association as
|
|
171
|
+
non-exact until Solid exposes a per-rerun correlation identity. Release builds
|
|
172
|
+
resolve both the root and diagnostics controller to inert shims.
|
|
173
|
+
|
|
174
|
+
If the native host, JSI binding, or initial Fabric surface cannot start, the
|
|
175
|
+
platform shell replaces the blank container with a dependency-free accessible
|
|
176
|
+
failure view. Debug builds include one bounded local diagnostic; production
|
|
177
|
+
builds expose only a generic message. After startup, fatal Hermes errors and
|
|
178
|
+
terminal Fabric commit failures cross the same bounded native handoff: the
|
|
179
|
+
shell stops Fabric-owned work and replaces the surface instead of leaving a
|
|
180
|
+
live blank tree. Only the error name and message cross; stacks and arbitrary
|
|
181
|
+
thrown values remain in JavaScript. `startNativeApplication` owns the global
|
|
182
|
+
fatal handler and restores its predecessor after failed startup or explicit
|
|
183
|
+
application disposal. Non-fatal development errors still belong to the
|
|
184
|
+
recoverable Solid overlay.
|
|
185
|
+
|
|
186
|
+
The iOS shell uses UIKit's scene lifecycle, including on iOS 27. One scene owns
|
|
187
|
+
one native application: scene connection creates its window, activation starts
|
|
188
|
+
Solid, backgrounding retains it, and disconnection stops the native runtime.
|
|
189
|
+
Custom-scheme and universal-link URLs enter through the scene delegate for both
|
|
190
|
+
cold starts and warm delivery. Multiple simultaneous scenes are disabled; this
|
|
191
|
+
starter does not yet provide independent per-window runtimes.
|
|
192
|
+
|
|
193
|
+
The trace artifact opens directly in Perfetto. The report is a self-contained
|
|
194
|
+
offline debugger with search and causal navigation. Release/store builds leave
|
|
195
|
+
the native request transport inactive and skip timeline allocation.
|
|
196
|
+
|
|
197
|
+
The `build:*` scripts create non-launching Release builds by default. Pass
|
|
198
|
+
native React Native CLI options after `--` to select a scheme, Gradle task, or
|
|
199
|
+
another configuration explicitly.
|
|
200
|
+
|
|
201
|
+
Android `doctor`, `run`, and `build` commands preserve an explicit `JAVA_HOME`.
|
|
202
|
+
If it is unset, they discover Android Studio's bundled JBR and use that same JDK
|
|
203
|
+
for both diagnostics and Gradle. This lets a current Android Studio toolchain
|
|
204
|
+
work even when the login shell still resolves an older Java. Use
|
|
205
|
+
`pnpm build:android -- --dry-run` to inspect the resolved `JAVA_HOME` without
|
|
206
|
+
starting a build.
|
|
207
|
+
|
|
208
|
+
`pnpm fingerprint` emits deterministic per-platform compatibility identities
|
|
209
|
+
for the runtime, dependency locks, compiler/bootstrap, and native project. The
|
|
210
|
+
local result is intentionally unsigned; sign it in the delivery pipeline before
|
|
211
|
+
attaching it to trusted runtime or update metadata.
|
|
212
|
+
|
|
213
|
+
`pnpm generate` runs the pinned React Native Codegen into the ignored,
|
|
214
|
+
isolated `build/solid-native-codegen` tree. Keeping this separate from Gradle's
|
|
215
|
+
application Codegen directory prevents dependency implementations discovered
|
|
216
|
+
by the upstream app generator from being linked twice beside their autolinked
|
|
217
|
+
libraries. Generation is staged transactionally: failures retain the previous
|
|
218
|
+
native and Solid outputs, while successful runs replace the complete native
|
|
219
|
+
tree so removed schemas cannot leave stale sources behind.
|
|
220
|
+
|
|
221
|
+
`pnpm start` verifies the installed Solid runtime, OXC/Metro compiler, and
|
|
222
|
+
application bootstrap before starting Metro. Stopping the command also stops
|
|
223
|
+
its worker process group so the development server does not linger.
|
|
224
|
+
Application source edits deliberately trigger a complete runtime reload:
|
|
225
|
+
React Refresh cannot safely replace mounted Solid owners. Owner-preserving
|
|
226
|
+
Solid HMR is not claimed by this template yet.
|
|
227
|
+
|
|
228
|
+
The `bundle:*` scripts write minified production JavaScript, copied assets,
|
|
229
|
+
portable composed source maps, and a deterministic unsigned SHA-256 manifest
|
|
230
|
+
beneath the selected platform's ignored native build directory unless
|
|
231
|
+
`--output` selects an explicit artifact directory.
|
|
232
|
+
Verify the complete unsigned artifact set before handing it to a signing or
|
|
233
|
+
symbolication pipeline:
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
pnpm exec solid-native bundle verify ios/build/solid-native-bundle/solid-native-bundle.json
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
For an Android release envelope that proves which reviewed source produced the
|
|
240
|
+
Hermes bytecode inside its APK or AAB, generate the packaging-shaped source and
|
|
241
|
+
enable archive inspection during release creation:
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
pnpm bundle:android -- --hermes-source
|
|
245
|
+
pnpm release -- create \
|
|
246
|
+
--bundle android/app/build/solid-native-bundle/solid-native-bundle.json \
|
|
247
|
+
--artifact android/app/build/outputs/bundle/release/app-release.aab \
|
|
248
|
+
--release 1.0.0+1 --channel production --revision "$GIT_REVISION" \
|
|
249
|
+
--inspect-embedded-bundle \
|
|
250
|
+
--android-upload-certificate-sha256 "$ANDROID_UPLOAD_CERTIFICATE_SHA256"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The ordinary `pnpm build:android` command delegates to React Native 0.88's
|
|
254
|
+
Release `bundle` task and writes that AAB path. Pass an explicit Gradle task
|
|
255
|
+
such as `--tasks assembleRelease` only when an APK is intentionally required,
|
|
256
|
+
then select the corresponding artifact path yourself. For that APK path, replace
|
|
257
|
+
the AAB upload-certificate option above with one or more
|
|
258
|
+
`--android-signing-certificate-sha256` options naming its complete expected
|
|
259
|
+
signer set.
|
|
260
|
+
|
|
261
|
+
The generated Android project initially reuses the debug keystore for its
|
|
262
|
+
Release build so a local AAB can be produced without private credentials. That
|
|
263
|
+
artifact is development-signed and must not be uploaded to Play. Before a store
|
|
264
|
+
release, define an application-owned non-debug `signingConfigs` entry, inject
|
|
265
|
+
its keystore path and credentials from protected local or CI configuration,
|
|
266
|
+
assign it to `buildTypes.release`, and use Play App Signing. Never commit the
|
|
267
|
+
keystore or its credentials. `pnpm run doctor --platform android` warns while
|
|
268
|
+
the debug signing fallback remains and recognizes an explicit non-debug config;
|
|
269
|
+
the delivery pipeline must still prove that the key is available and accepted.
|
|
270
|
+
Use `pnpm run doctor --platform android --strict` as a release-CI gate so any
|
|
271
|
+
remaining warning or required-check failure exits nonzero.
|
|
272
|
+
|
|
273
|
+
After configuring release signing, inspect the produced bytes independently at
|
|
274
|
+
any time with:
|
|
275
|
+
|
|
276
|
+
```sh
|
|
277
|
+
pnpm exec solid-native release verify-android-signing \
|
|
278
|
+
android/app/build/outputs/bundle/release/app-release.aab \
|
|
279
|
+
--expected-certificate-sha256 "$ANDROID_UPLOAD_CERTIFICATE_SHA256"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
This reads no keystore or credentials. It rejects unsigned, partially or
|
|
283
|
+
multiply signed, and Android-Debug-signed AABs. The production `release create`
|
|
284
|
+
example above passes the same public fingerprint as a mandatory gate, records
|
|
285
|
+
it beside the exact AAB digest, and makes `release verify` repeat the proof. It
|
|
286
|
+
does not claim that Play accepted or re-signed the bundle.
|
|
287
|
+
|
|
288
|
+
The command also accepts an APK and then uses the newest stable Android SDK
|
|
289
|
+
`apksigner`. It verifies every Android version declared as supported by the
|
|
290
|
+
APK's manifest, rejects warnings and debug signers, and preserves a bounded
|
|
291
|
+
version-targeted key-rotation set. Repeat `--expected-certificate-sha256` for
|
|
292
|
+
every expected certificate. A release envelope records that exact set when its
|
|
293
|
+
creation command receives the matching repeated
|
|
294
|
+
`--android-signing-certificate-sha256` values.
|
|
295
|
+
|
|
296
|
+
Supply `GIT_REVISION` from a clean trusted build checkout. The resulting
|
|
297
|
+
envelope remains unsigned until the delivery pipeline attests it.
|
|
298
|
+
After signing, `solid-native release symbolication` can verify the signature,
|
|
299
|
+
policy, bundle, and final native artifact together and emit the exact local
|
|
300
|
+
bundle/source-map pair under the same `authorizedRelease` identity used by
|
|
301
|
+
runtime telemetry. Feed its `--json` result to the chosen backend adapter; the
|
|
302
|
+
CLI itself does not upload or read vendor credentials.
|
|
303
|
+
|
|
304
|
+
Install iOS pods before the first iOS build:
|
|
305
|
+
|
|
306
|
+
```sh
|
|
307
|
+
cd ios
|
|
308
|
+
bundle install
|
|
309
|
+
bundle exec pod install
|
|
310
|
+
cd ..
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
The generated `ios` and `android` directories are application-owned and may be
|
|
314
|
+
edited directly. `solid-native doctor` validates that their Hermes, Fabric,
|
|
315
|
+
JSI, CMake, CocoaPods, and package integration still matches the verified
|
|
316
|
+
backend.
|
|
317
|
+
|
|
318
|
+
The generated Android Activity forwards handled configuration changes to
|
|
319
|
+
React Native's bridgeless `ReactHost`. Preserve that callback when customizing
|
|
320
|
+
the Activity; native appearance and related platform subscriptions depend on
|
|
321
|
+
it even when the manifest prevents Activity recreation.
|
|
322
|
+
|
|
323
|
+
The iOS project sets `UIViewControllerBasedStatusBarAppearance` to `true` and
|
|
324
|
+
uses `SolidNativeRootViewController` as its scene root view controller so Solid
|
|
325
|
+
Native's owner-bound `StatusBar` component works through view-controller-based
|
|
326
|
+
appearance on iOS 15.1 through iOS 27+. Keep both when customizing the iOS
|
|
327
|
+
shell unless the application supplies its own view-controller status-bar
|
|
328
|
+
integration.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
project(appmodules)
|
|
3
|
+
|
|
4
|
+
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
|
5
|
+
|
|
6
|
+
# React Native enables any host ccache binary it finds. Ignore a stale optional
|
|
7
|
+
# installation without disabling a healthy cache.
|
|
8
|
+
if(CCACHE_FOUND)
|
|
9
|
+
execute_process(
|
|
10
|
+
COMMAND "${CCACHE_FOUND}" --version
|
|
11
|
+
RESULT_VARIABLE SOLID_NATIVE_CCACHE_STATUS
|
|
12
|
+
OUTPUT_QUIET
|
|
13
|
+
ERROR_QUIET
|
|
14
|
+
)
|
|
15
|
+
if(NOT SOLID_NATIVE_CCACHE_STATUS EQUAL 0)
|
|
16
|
+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "")
|
|
17
|
+
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "")
|
|
18
|
+
endif()
|
|
19
|
+
endif()
|
|
20
|
+
|
|
21
|
+
if(NOT DEFINED SOLID_NATIVE_FABRIC_HOST_DIR OR SOLID_NATIVE_FABRIC_HOST_DIR STREQUAL "")
|
|
22
|
+
message(FATAL_ERROR "SOLID_NATIVE_FABRIC_HOST_DIR must point to the installed @solidnative-dev/fabric-host package")
|
|
23
|
+
endif()
|
|
24
|
+
get_filename_component(SOLID_NATIVE_FABRIC_HOST_DIR "${SOLID_NATIVE_FABRIC_HOST_DIR}" ABSOLUTE)
|
|
25
|
+
set(SOLID_NATIVE_ANDROID_DIR "${SOLID_NATIVE_FABRIC_HOST_DIR}/native/android")
|
|
26
|
+
include("${SOLID_NATIVE_ANDROID_DIR}/SolidNativeRuntime.cmake")
|
|
27
|
+
solid_native_configure_android_target(${CMAKE_PROJECT_NAME})
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
package __ANDROID_PACKAGE__
|
|
2
|
+
|
|
3
|
+
import android.content.Intent
|
|
4
|
+
import android.content.res.Configuration
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
import android.util.Log
|
|
7
|
+
import androidx.activity.OnBackPressedCallback
|
|
8
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
9
|
+
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
10
|
+
import com.facebook.react.modules.core.PermissionAwareActivity
|
|
11
|
+
import com.facebook.react.modules.core.PermissionListener
|
|
12
|
+
import dev.solidnative.runtime.SolidNativeSurface
|
|
13
|
+
import dev.solidnative.runtime.SolidNativeStartupFailureView
|
|
14
|
+
|
|
15
|
+
class MainActivity :
|
|
16
|
+
AppCompatActivity(),
|
|
17
|
+
DefaultHardwareBackBtnHandler,
|
|
18
|
+
PermissionAwareActivity {
|
|
19
|
+
private lateinit var nativeApplication: MainApplication
|
|
20
|
+
private var solidNativeSurface: SolidNativeSurface? = null
|
|
21
|
+
private var permissionListener: PermissionListener? = null
|
|
22
|
+
private val backPressedCallback =
|
|
23
|
+
object : OnBackPressedCallback(true) {
|
|
24
|
+
override fun handleOnBackPressed() {
|
|
25
|
+
if (!nativeApplication.reactHost.onBackPressed()) {
|
|
26
|
+
invokeDefaultOnBackPressed()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
32
|
+
super.onCreate(savedInstanceState)
|
|
33
|
+
nativeApplication = application as MainApplication
|
|
34
|
+
try {
|
|
35
|
+
solidNativeSurface =
|
|
36
|
+
SolidNativeSurface.start(
|
|
37
|
+
activity = this,
|
|
38
|
+
reactHost = nativeApplication.reactHost,
|
|
39
|
+
bindingsInstaller = nativeApplication.solidNativeBindingsInstaller,
|
|
40
|
+
statusHandler = { status, error ->
|
|
41
|
+
if (
|
|
42
|
+
error != null &&
|
|
43
|
+
(status == "surface-start-failed" ||
|
|
44
|
+
status == "surface-publish-failed")
|
|
45
|
+
) {
|
|
46
|
+
Log.e(TAG, "Solid Native startup failed at $status.", error)
|
|
47
|
+
SolidNativeStartupFailureView.show(this, error)
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
} catch (error: Throwable) {
|
|
52
|
+
Log.e(TAG, "Solid Native startup failed before surface creation.", error)
|
|
53
|
+
SolidNativeStartupFailureView.show(this, error)
|
|
54
|
+
}
|
|
55
|
+
onBackPressedDispatcher.addCallback(this, backPressedCallback)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
override fun onResume() {
|
|
59
|
+
super.onResume()
|
|
60
|
+
nativeApplication.reactHost.onHostResume(this, this)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
override fun onPause() {
|
|
64
|
+
nativeApplication.reactHost.onHostPause(this)
|
|
65
|
+
super.onPause()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
override fun onNewIntent(intent: Intent) {
|
|
69
|
+
super.onNewIntent(intent)
|
|
70
|
+
setIntent(intent)
|
|
71
|
+
nativeApplication.reactHost.onNewIntent(intent)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
override fun onConfigurationChanged(newConfig: Configuration) {
|
|
75
|
+
super.onConfigurationChanged(newConfig)
|
|
76
|
+
if (::nativeApplication.isInitialized) {
|
|
77
|
+
nativeApplication.reactHost.onConfigurationChanged(this)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun requestPermissions(
|
|
82
|
+
permissions: Array<String>,
|
|
83
|
+
requestCode: Int,
|
|
84
|
+
listener: PermissionListener?,
|
|
85
|
+
) {
|
|
86
|
+
permissionListener = listener
|
|
87
|
+
super.requestPermissions(permissions, requestCode)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun onRequestPermissionsResult(
|
|
91
|
+
requestCode: Int,
|
|
92
|
+
permissions: Array<String>,
|
|
93
|
+
grantResults: IntArray,
|
|
94
|
+
) {
|
|
95
|
+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
96
|
+
val listener = permissionListener ?: return
|
|
97
|
+
if (listener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
|
|
98
|
+
permissionListener = null
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
override fun onDestroy() {
|
|
103
|
+
solidNativeSurface?.stop()
|
|
104
|
+
solidNativeSurface = null
|
|
105
|
+
if (::nativeApplication.isInitialized) {
|
|
106
|
+
nativeApplication.reactHost.onHostDestroy(this)
|
|
107
|
+
}
|
|
108
|
+
super.onDestroy()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
override fun invokeDefaultOnBackPressed() {
|
|
112
|
+
backPressedCallback.isEnabled = false
|
|
113
|
+
try {
|
|
114
|
+
onBackPressedDispatcher.onBackPressed()
|
|
115
|
+
} finally {
|
|
116
|
+
backPressedCallback.isEnabled = true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
companion object {
|
|
121
|
+
private const val TAG = "SolidNativeMainActivity"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
package __ANDROID_PACKAGE__
|
|
2
|
+
|
|
3
|
+
import android.app.Application
|
|
4
|
+
import com.facebook.react.PackageList
|
|
5
|
+
import com.facebook.react.ReactApplication
|
|
6
|
+
import com.facebook.react.ReactHost
|
|
7
|
+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
|
|
8
|
+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
9
|
+
import dev.solidnative.runtime.SolidNativeBindingsInstaller
|
|
10
|
+
import dev.solidnative.runtime.SolidNativeMemoryWarning
|
|
11
|
+
import dev.solidnative.runtime.SolidNativePackage
|
|
12
|
+
|
|
13
|
+
class MainApplication : Application(), ReactApplication {
|
|
14
|
+
val solidNativeBindingsInstaller: SolidNativeBindingsInstaller by lazy {
|
|
15
|
+
SolidNativeBindingsInstaller()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override val reactHost: ReactHost by lazy {
|
|
19
|
+
getDefaultReactHost(
|
|
20
|
+
context = applicationContext,
|
|
21
|
+
packageList = PackageList(this).packages + SolidNativePackage(),
|
|
22
|
+
jsMainModulePath = "index",
|
|
23
|
+
jsBundleAssetPath = "index.android.bundle",
|
|
24
|
+
useDevSupport = BuildConfig.DEBUG,
|
|
25
|
+
bindingsInstaller = solidNativeBindingsInstaller,
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override fun onCreate() {
|
|
30
|
+
super.onCreate()
|
|
31
|
+
loadReactNative(this)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun onTrimMemory(level: Int) {
|
|
35
|
+
super.onTrimMemory(level)
|
|
36
|
+
SolidNativeMemoryWarning.handleTrimMemory(level)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
override fun onLowMemory() {
|
|
40
|
+
super.onLowMemory()
|
|
41
|
+
SolidNativeMemoryWarning.handleLowMemory()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#include <DefaultComponentsRegistry.h>
|
|
2
|
+
#include <DefaultTurboModuleManagerDelegate.h>
|
|
3
|
+
#include <FBReactNativeSpec.h>
|
|
4
|
+
#include <autolinking.h>
|
|
5
|
+
#include <fbjni/fbjni.h>
|
|
6
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
7
|
+
|
|
8
|
+
#include "SolidNativeBindingsInstaller.h"
|
|
9
|
+
|
|
10
|
+
#ifdef REACT_NATIVE_APP_CODEGEN_HEADER
|
|
11
|
+
#include REACT_NATIVE_APP_CODEGEN_HEADER
|
|
12
|
+
#endif
|
|
13
|
+
#ifdef REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
|
14
|
+
#include REACT_NATIVE_APP_COMPONENT_DESCRIPTORS_HEADER
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
void registerComponents(
|
|
20
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
21
|
+
#ifdef REACT_NATIVE_APP_COMPONENT_REGISTRATION
|
|
22
|
+
REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
|
|
23
|
+
#endif
|
|
24
|
+
autolinking_registerProviders(registry);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
std::shared_ptr<TurboModule> cxxModuleProvider(
|
|
28
|
+
const std::string &name,
|
|
29
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
30
|
+
return autolinking_cxxModuleProvider(name, jsInvoker);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
std::shared_ptr<TurboModule> javaModuleProvider(
|
|
34
|
+
const std::string &name,
|
|
35
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
36
|
+
#ifdef REACT_NATIVE_APP_MODULE_PROVIDER
|
|
37
|
+
if (auto module = REACT_NATIVE_APP_MODULE_PROVIDER(name, params)) {
|
|
38
|
+
return module;
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
if (auto module = FBReactNativeSpec_ModuleProvider(name, params)) {
|
|
42
|
+
return module;
|
|
43
|
+
}
|
|
44
|
+
return autolinking_ModuleProvider(name, params);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
} // namespace facebook::react
|
|
48
|
+
|
|
49
|
+
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
|
50
|
+
return facebook::jni::initialize(vm, [] {
|
|
51
|
+
solid_native::android::registerSolidNativeBindingsInstaller();
|
|
52
|
+
facebook::react::DefaultTurboModuleManagerDelegate::cxxModuleProvider =
|
|
53
|
+
&facebook::react::cxxModuleProvider;
|
|
54
|
+
facebook::react::DefaultTurboModuleManagerDelegate::javaModuleProvider =
|
|
55
|
+
&facebook::react::javaModuleProvider;
|
|
56
|
+
facebook::react::DefaultComponentsRegistry::
|
|
57
|
+
registerComponentDescriptorsFromEntryPoint =
|
|
58
|
+
&facebook::react::registerComponents;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./src/main";
|