ruby_everywhere 0.1.15 → 0.2.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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/bridge/README.md +57 -2
  3. data/bridge/everywhere/bridge.js +803 -9
  4. data/bridge/package.json +1 -1
  5. data/lib/everywhere/builders/ios.rb +364 -0
  6. data/lib/everywhere/cli.rb +2 -0
  7. data/lib/everywhere/commands/build.rb +17 -1
  8. data/lib/everywhere/commands/clean.rb +19 -10
  9. data/lib/everywhere/commands/dev.rb +182 -19
  10. data/lib/everywhere/commands/doctor.rb +45 -3
  11. data/lib/everywhere/commands/icon.rb +14 -0
  12. data/lib/everywhere/commands/install.rb +37 -6
  13. data/lib/everywhere/commands/logs.rb +56 -0
  14. data/lib/everywhere/commands/platform/build.rb +3 -3
  15. data/lib/everywhere/commands/platform/runner.rb +1 -1
  16. data/lib/everywhere/commands/release.rb +1 -1
  17. data/lib/everywhere/commands/shell_dir.rb +11 -4
  18. data/lib/everywhere/config.rb +366 -1
  19. data/lib/everywhere/engine.rb +33 -1
  20. data/lib/everywhere/icon.rb +50 -0
  21. data/lib/everywhere/log_filter.rb +28 -2
  22. data/lib/everywhere/mobile_config_endpoint.rb +75 -0
  23. data/lib/everywhere/mobile_configs_controller.rb +46 -0
  24. data/lib/everywhere/native_helper.rb +156 -0
  25. data/lib/everywhere/paths.rb +41 -0
  26. data/lib/everywhere/raster.rb +17 -0
  27. data/lib/everywhere/shellout.rb +3 -1
  28. data/lib/everywhere/simulator.rb +74 -0
  29. data/lib/everywhere/ui.rb +18 -0
  30. data/lib/everywhere/version.rb +1 -1
  31. data/support/mobile/ios/App/App.xcconfig +6 -0
  32. data/support/mobile/ios/App/AppDelegate.swift +163 -0
  33. data/support/mobile/ios/App/Assets.xcassets/AccentColor.colorset/Contents.json +20 -0
  34. data/support/mobile/ios/App/Assets.xcassets/AppIcon.appiconset/AppIcon.png +0 -0
  35. data/support/mobile/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  36. data/support/mobile/ios/App/Assets.xcassets/Contents.json +6 -0
  37. data/support/mobile/ios/App/Assets.xcassets/LaunchBackground.colorset/Contents.json +38 -0
  38. data/support/mobile/ios/App/Base.lproj/LaunchScreen.storyboard +32 -0
  39. data/support/mobile/ios/App/Bridge/BiometricsComponent.swift +276 -0
  40. data/support/mobile/ios/App/Bridge/HapticsComponent.swift +47 -0
  41. data/support/mobile/ios/App/Bridge/NotificationComponent.swift +56 -0
  42. data/support/mobile/ios/App/Bridge/PermissionsComponent.swift +142 -0
  43. data/support/mobile/ios/App/Bridge/StorageComponent.swift +63 -0
  44. data/support/mobile/ios/App/ErrorViewController.swift +64 -0
  45. data/support/mobile/ios/App/EverywhereConfig.swift +268 -0
  46. data/support/mobile/ios/App/EverywhereHost.swift +34 -0
  47. data/support/mobile/ios/App/Extensions/EverywhereExtensions.swift +32 -0
  48. data/support/mobile/ios/App/Info.plist +28 -0
  49. data/support/mobile/ios/App/Resources/everywhere.json +8 -0
  50. data/support/mobile/ios/App/Resources/path-configuration.json +19 -0
  51. data/support/mobile/ios/App/SceneDelegate.swift +443 -0
  52. data/support/mobile/ios/App.xcodeproj/project.pbxproj +454 -0
  53. data/support/mobile/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  54. data/support/mobile/ios/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +14 -0
  55. data/support/mobile/ios/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme +77 -0
  56. data/support/mobile/ios/NativeExtensions/Package.swift +26 -0
  57. data/support/mobile/ios/NativeExtensions/Sources/NativeExtensions/Exports.swift +5 -0
  58. data/support/mobile/ios/README.md +66 -0
  59. metadata +35 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63effa5f5f00816aa20ada48ca9e1d29fd016dc98b294da2bc0c7d8e1e09d853
4
- data.tar.gz: 9f998859661f637feac481d87de6964de030b45fdf197b0c4f72286a1f80fb63
3
+ metadata.gz: 0bb96376a66f4202388542212bc1d03b2dea1bb6519ccc4a8339cc1b3cda3e43
4
+ data.tar.gz: be5f8b69e0157a93dfc1837445faa8f4e6326678741b88ddd76c9bff0521ddf5
5
5
  SHA512:
6
- metadata.gz: 86c4032c3973f6e85dcfbb4e8e203f30acd41639c261fc1df07e43dd1c9ee31f681eb445c2a4197d656ec3e96c3b7de94ddd22bd9e3e60ac8ad392038229d0bc
7
- data.tar.gz: cc951a4ebdc8ecefffee7d418a871fe4e50fd74b676810a522792d0463aebb638307c7aaed124c2699f9b153f4e74ec8201907731a1049a43d8b8caa68c6c7ac
6
+ metadata.gz: 29c23a79521c57f81a0881e663debc4e2c9a505a424dbe8b615c1a1c5eccba3d93c1dfd7ee0281ea04c8121d2c4ba6ec4c0de8276453ab5ca0d348d6d8afdf00
7
+ data.tar.gz: 7a626876bb0820701922e23990541e149360b35246b2456be3b2d5f7729743f2c5e3772d6e9e2d94d7ea898b85d6e528ff5e9ad85e919653357463073cfbdcea
data/bridge/README.md CHANGED
@@ -35,8 +35,58 @@ Everywhere.visit("/settings") // Turbo.visit with location fallback
35
35
 
36
36
  Everywhere.clipboard.write(text) // Promise<void>
37
37
  Everywhere.clipboard.read() // Promise<string | null>
38
+
39
+ Everywhere.haptics.impact("medium") // real haptics in the mobile shell;
40
+ Everywhere.haptics.notification("success") // Vibration API in browsers, no-op elsewhere
41
+ Everywhere.haptics.selection()
42
+
43
+ Everywhere.badge.set(3) // app icon badge (mobile / installed PWAs)
44
+ Everywhere.badge.clear()
45
+ Everywhere.badge.setTab("/inbox", 3) // native tab bar badge (mobile)
46
+ Everywhere.badge.clearTab("/inbox")
47
+
48
+ Everywhere.permissions.query("camera") // Promise<{name, status}>
49
+ Everywhere.permissions.request("camera") // prompts when possible
50
+ Everywhere.permissions.openSettings() // for the denied dead-end (iOS asks once)
51
+ // status: "granted" | "denied" | "prompt" | "undeclared" | "unsupported"
52
+ // mobile permissions must be declared in everywhere.yml (camera/location
53
+ // declarations carry the usage string iOS shows) — undeclared never prompts
54
+
55
+ Everywhere.storage.get("key") // Promise<any | null> — device-local settings
56
+ Everywhere.storage.set("key", value) // Promise<boolean>; any JSON value round-trips
57
+ Everywhere.storage.remove("key") // Promise<boolean>
58
+ Everywhere.storage.clear() // Promise<boolean> — clears app keys only
59
+ // UserDefaults in the mobile shell (survives web view resets and cache
60
+ // clears, unlike localStorage); localStorage-backed in browsers and the
61
+ // desktop shell. Settings, not secrets — tokens go in biometrics.credential.
62
+ ```
63
+
64
+ ### Multi-instance apps
65
+
66
+ Apps whose users pick a server — one hosted platform, many instances — opt in
67
+ with `remote.instances: true` in `everywhere.yml`. The mobile shell then boots
68
+ into `remote.url` (your hosted picker page) until that page picks an instance:
69
+
70
+ ```js
71
+ Everywhere.instance.supported // true in a shell built with remote.instances
72
+ Everywhere.instance.current // active instance URL, or null (= built-in root)
73
+
74
+ Everywhere.instance.set("https://acme.example.com")
75
+ // validates, persists, and fully resets the app onto the instance — every
76
+ // later launch boots straight there. {to: "/path"} lands somewhere specific.
77
+
78
+ Everywhere.instance.clear() // back to the picker (and resets again)
38
79
  ```
39
80
 
81
+ In a plain browser `set()` simply navigates to the URL — going there is what
82
+ picking an instance means on the web.
83
+
84
+ Declarative forms need no JS: elements with `data-everywhere-haptic`
85
+ (`"light"`, `"impact:heavy"`, `"notification:error"`, `"selection"`) play on
86
+ tap, and `<meta name="everywhere:badge">` / `<meta name="everywhere:tab-badge">`
87
+ tags (the `everywhere_badge` / `everywhere_tab_badge` Rails helpers) are
88
+ applied on every Turbo visit.
89
+
40
90
  ### Auto-updates
41
91
 
42
92
  Inside the desktop shell, apps with an update feed configured can check,
@@ -69,8 +119,13 @@ In a plain browser tab the updates API is inert: `check()` resolves
69
119
  clipboard, shell events, and auto-updates are native.
70
120
  - **browser** — honest web fallbacks: the Notification API, `window.confirm`,
71
121
  `navigator.clipboard`, DOM CustomEvents.
72
- - **mobile** — Hotwire Native detection is live; behavior currently falls back
73
- to the browser adapter until the bridge-component adapter lands.
122
+ - **mobile** — Hotwire Native (iOS shell). `notify()` delivers a native local
123
+ notification via the shell's `everywhere--notification` bridge component
124
+ (web-bridge handshake is installed automatically unless the app already
125
+ loads `@hotwired/hotwire-native-bridge` — first one wins, like the official
126
+ package). `confirm()`/clipboard use the browser fallbacks, which are native
127
+ in a WKWebView anyway. Everything degrades to browser behavior outside the
128
+ shell.
74
129
 
75
130
  ## License
76
131