Feature request: official @perryts/widgets package for WidgetKit / Glance widgets
Perry already supports a --target ios-widget compile target (mentioned in the README) but doesn't ship a package that wraps the build glue needed to:
- Compile a sibling SwiftUI WidgetKit extension target with the right SDK + entitlements,
- Embed the produced
.appex into the host app bundle,
- Wire the host app's
application-groups entitlement through to the widget,
- Mirror the same setup on Android via Glance for app-widgets.
Today every project that ships widgets ends up with a hand-rolled crate-widgets/build.rs that invokes swiftc with target-specific args, plus copy logic to land the binary in the right place inside the .app.
What we'd want
perry widget init <name> # scaffold a SwiftUI/Glance source tree alongside perry.toml
perry compile --target ios # picks up [[widget]] entries in perry.toml and builds the .appex
perry.toml:
[[widget]]
name = "TopSitesWidget"
swift_source = "ios-widgets/TopSitesWidget"
display_name = "Top sites"
description = "Best-performing sites this week"
intents = ["TopSitesIntent"] # AppIntent configuration
[[widget]]
name = "DailyChangeWidget"
swift_source = "ios-widgets/DailyChangeWidget"
glance_source = "android-widgets/DailyChangeGlance" # optional — Android Glance equivalent
Build glue Perry would handle:
- iOS:
swiftc with -sdk $(xcrun --sdk iphoneos --show-sdk-path), framework search paths (WidgetKit, AppIntents, SwiftUI), correct target triple, embed in Frameworks/<Name>.appex.
- watchOS: same but
--sdk watchos, plus the .appex lives under the watch app's bundle.
- Android: Compose-Glance source compiled by Gradle wrapper or a perry-controlled invocation; produces a regular AppWidgetProvider.
Per-widget data sharing piggybacks on @perryts/app-group (sister request).
Why this matters
Widgets are increasingly a "must-ship" category on iOS — App Store editorial features prioritize them, and they drive engagement. The current state (hand-rolled build.rs per project) is the single biggest piece of unique infrastructure in our app. Centralising it would unblock a lot of downstream apps.
Feature request: official
@perryts/widgetspackage for WidgetKit / Glance widgetsPerry already supports a
--target ios-widgetcompile target (mentioned in the README) but doesn't ship a package that wraps the build glue needed to:.appexinto the host app bundle,application-groupsentitlement through to the widget,Today every project that ships widgets ends up with a hand-rolled
crate-widgets/build.rsthat invokesswiftcwith target-specific args, plus copy logic to land the binary in the right place inside the.app.What we'd want
perry.toml:Build glue Perry would handle:
swiftcwith-sdk $(xcrun --sdk iphoneos --show-sdk-path), framework search paths (WidgetKit, AppIntents, SwiftUI), correct target triple, embed inFrameworks/<Name>.appex.--sdk watchos, plus the.appexlives under the watch app's bundle.Per-widget data sharing piggybacks on
@perryts/app-group(sister request).Why this matters
Widgets are increasingly a "must-ship" category on iOS — App Store editorial features prioritize them, and they drive engagement. The current state (hand-rolled build.rs per project) is the single biggest piece of unique infrastructure in our app. Centralising it would unblock a lot of downstream apps.