@craft-native/ios 0.0.91 → 0.0.94
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/README.md +26 -12
- package/dist/cli.js +751 -0
- package/dist/index.d.ts +246 -0
- package/dist/index.js +674 -0
- package/package.json +1 -1
- package/templates/CraftApp.swift +681 -57
- package/LICENSE.md +0 -21
package/README.md
CHANGED
|
@@ -159,14 +159,17 @@ window.addEventListener('craftReady', (e) => {
|
|
|
159
159
|
console.log('Capabilities:', e.detail.capabilities);
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
// Haptic feedback
|
|
163
|
-
|
|
164
|
-
window.craft.haptic('
|
|
165
|
-
window.craft.haptic('
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
// Haptic feedback. Resolves true, and rejects with CAPABILITY_DISABLED when
|
|
163
|
+
// enableHaptics is off.
|
|
164
|
+
await window.craft.haptic('light'); // light, medium, heavy
|
|
165
|
+
await window.craft.haptic('success'); // success, warning, error
|
|
166
|
+
await window.craft.haptic('selection');
|
|
167
|
+
|
|
168
|
+
// Speech recognition. startListening resolves true once the request is
|
|
169
|
+
// taken; whether listening actually began arrives as the events below
|
|
170
|
+
// (craftSpeechError for a declined prompt or no recognizer).
|
|
171
|
+
await window.craft.startListening();
|
|
172
|
+
await window.craft.stopListening();
|
|
170
173
|
|
|
171
174
|
// Listen for speech events
|
|
172
175
|
window.addEventListener('craftSpeechStart', () => { /* recording started */ });
|
|
@@ -620,10 +623,21 @@ On macOS with Xcode and XcodeGen installed, run `bun run test:templates` from
|
|
|
620
623
|
`packages/ios`. It generates a minimal app, a capability-heavy iOS app, and the
|
|
621
624
|
same capability-heavy app with a Watch companion. It builds iOS, Live Activity,
|
|
622
625
|
Watch extension, and Watch app targets against device SDKs with code signing
|
|
623
|
-
disabled.
|
|
624
|
-
|
|
625
|
-
is built
|
|
626
|
-
|
|
626
|
+
disabled.
|
|
627
|
+
|
|
628
|
+
The Watch-enabled app is also built the way Xcode builds it for a person, with
|
|
629
|
+
the Watch app embedded. The script checks that the bundle carries
|
|
630
|
+
`Watch/<App>Watch.app` with `WKWatchKitApp` and its WatchKit extension, then
|
|
631
|
+
installs the app on an iOS simulator. That needs a watchOS simulator runtime
|
|
632
|
+
matching the selected Xcode (`xcodebuild -downloadPlatform watchOS`), and the
|
|
633
|
+
script fails without one rather than skipping.
|
|
634
|
+
|
|
635
|
+
Finally, a push-enabled app is built for the simulator in Debug and Release with
|
|
636
|
+
ad-hoc signing. The script reads the `aps-environment` Xcode actually signed
|
|
637
|
+
into each: `development` for Debug, `production` for Release.
|
|
638
|
+
|
|
639
|
+
This checks the actual generated Swift and Xcode projects; `bun test` checks the
|
|
640
|
+
builder's behavior separately.
|
|
627
641
|
Temporary projects are removed after the run. Pass `--keep` to retain them for
|
|
628
642
|
debugging.
|
|
629
643
|
|