ruby_everywhere 0.3.0 → 0.4.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 (88) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +255 -0
  3. data/bridge/everywhere/bridge.js +60 -3
  4. data/lib/everywhere/android_resources.rb +217 -0
  5. data/lib/everywhere/android_sdk.rb +330 -0
  6. data/lib/everywhere/asset_catalog.rb +185 -0
  7. data/lib/everywhere/auth_handoff.rb +398 -0
  8. data/lib/everywhere/auth_token.rb +118 -0
  9. data/lib/everywhere/builders/android.rb +844 -0
  10. data/lib/everywhere/builders/ios.rb +40 -3
  11. data/lib/everywhere/commands/build.rb +51 -9
  12. data/lib/everywhere/commands/clean.rb +10 -5
  13. data/lib/everywhere/commands/dev.rb +46 -8
  14. data/lib/everywhere/commands/doctor.rb +89 -3
  15. data/lib/everywhere/commands/install.rb +1 -1
  16. data/lib/everywhere/commands/logs.rb +117 -8
  17. data/lib/everywhere/config.rb +409 -13
  18. data/lib/everywhere/emulator.rb +405 -0
  19. data/lib/everywhere/engine.rb +12 -0
  20. data/lib/everywhere/icon.rb +196 -0
  21. data/lib/everywhere/log_filter.rb +74 -0
  22. data/lib/everywhere/native_helper.rb +2 -5
  23. data/lib/everywhere/omniauth.rb +88 -0
  24. data/lib/everywhere/paths.rb +47 -0
  25. data/lib/everywhere/version.rb +1 -1
  26. data/support/mobile/android/README.md +217 -0
  27. data/support/mobile/android/app/build.gradle.kts +156 -0
  28. data/support/mobile/android/app/everywhere.properties +8 -0
  29. data/support/mobile/android/app/native-packages.gradle.kts +16 -0
  30. data/support/mobile/android/app/proguard-rules.pro +21 -0
  31. data/support/mobile/android/app/src/debug/res/xml/network_security_config.xml +30 -0
  32. data/support/mobile/android/app/src/main/AndroidManifest.xml +42 -0
  33. data/support/mobile/android/app/src/main/assets/everywhere.json +9 -0
  34. data/support/mobile/android/app/src/main/assets/fonts/MaterialIcons-Regular.codepoints +2235 -0
  35. data/support/mobile/android/app/src/main/assets/fonts/MaterialIcons-Regular.ttf +0 -0
  36. data/support/mobile/android/app/src/main/assets/json/path-configuration.json +19 -0
  37. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/AuthFlow.kt +268 -0
  38. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/EverywhereApplication.kt +178 -0
  39. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/EverywhereConfig.kt +409 -0
  40. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/EverywhereEvents.kt +68 -0
  41. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/EverywhereHost.kt +101 -0
  42. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/IconFont.kt +211 -0
  43. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/MainActivity.kt +975 -0
  44. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/MainTabs.kt +201 -0
  45. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/WebBottomSheetFragment.kt +13 -0
  46. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/WebFragment.kt +36 -0
  47. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/BiometricsComponent.kt +535 -0
  48. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/HapticsComponent.kt +141 -0
  49. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/MenuComponent.kt +361 -0
  50. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/NotificationComponent.kt +151 -0
  51. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/PermissionsComponent.kt +271 -0
  52. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/StorageComponent.kt +101 -0
  53. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/bridge/WebControlChannel.kt +204 -0
  54. data/support/mobile/android/app/src/main/java/com/rubyeverywhere/shell/extensions/EverywhereExtensions.kt +51 -0
  55. data/support/mobile/android/app/src/main/res/color/bottom_navigation_active_indicator.xml +4 -0
  56. data/support/mobile/android/app/src/main/res/color/bottom_navigation_item.xml +11 -0
  57. data/support/mobile/android/app/src/main/res/drawable/ic_launcher_foreground.xml +26 -0
  58. data/support/mobile/android/app/src/main/res/drawable/ic_tab_placeholder.xml +28 -0
  59. data/support/mobile/android/app/src/main/res/layout/activity_main.xml +116 -0
  60. data/support/mobile/android/app/src/main/res/layout/bridge_menu_sheet.xml +83 -0
  61. data/support/mobile/android/app/src/main/res/layout/bridge_menu_sheet_item.xml +35 -0
  62. data/support/mobile/android/app/src/main/res/layout/tab_more_sheet.xml +48 -0
  63. data/support/mobile/android/app/src/main/res/layout/tab_more_sheet_item.xml +35 -0
  64. data/support/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +12 -0
  65. data/support/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
  66. data/support/mobile/android/app/src/main/res/values/colors.xml +21 -0
  67. data/support/mobile/android/app/src/main/res/values/ic_launcher_background.xml +5 -0
  68. data/support/mobile/android/app/src/main/res/values/strings.xml +18 -0
  69. data/support/mobile/android/app/src/main/res/values/styles.xml +32 -0
  70. data/support/mobile/android/app/src/main/res/values/themes.xml +53 -0
  71. data/support/mobile/android/app/src/main/res/values-night/colors.xml +11 -0
  72. data/support/mobile/android/app/src/main/res/values-night/themes.xml +33 -0
  73. data/support/mobile/android/app/src/main/res/xml/network_security_config.xml +12 -0
  74. data/support/mobile/android/app/src/stamped/AndroidManifest.xml +34 -0
  75. data/support/mobile/android/build.gradle.kts +8 -0
  76. data/support/mobile/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  77. data/support/mobile/android/gradle/wrapper/gradle-wrapper.properties +10 -0
  78. data/support/mobile/android/gradle.properties +14 -0
  79. data/support/mobile/android/gradlew +251 -0
  80. data/support/mobile/android/gradlew.bat +94 -0
  81. data/support/mobile/android/settings.gradle.kts +28 -0
  82. data/support/mobile/ios/App/AppDelegate.swift +5 -0
  83. data/support/mobile/ios/App/AuthFlow.swift +101 -0
  84. data/support/mobile/ios/App/EverywhereConfig.swift +84 -0
  85. data/support/mobile/ios/App/SceneDelegate.swift +103 -0
  86. data/support/mobile/ios/App.xcodeproj/project.pbxproj +4 -0
  87. data/support/mobile/ios/README.md +4 -1
  88. metadata +67 -1
@@ -0,0 +1,21 @@
1
+ # Bridge components are instantiated reflectively through
2
+ # BridgeComponentFactory and named by string from the page, so R8 has no call
3
+ # graph reaching them. Without this the release build strips every component
4
+ # and the page's `everywhere--*` messages silently go nowhere.
5
+ -keep class com.rubyeverywhere.shell.bridge.** { *; }
6
+
7
+ # App-provided native code (native/android/*.kt), same reasoning: it is
8
+ # referenced by identifier from the path configuration, not from Kotlin.
9
+ -keep class com.rubyeverywhere.shell.extensions.** { *; }
10
+
11
+ # Fragment destinations are resolved from the navigation graph by class name.
12
+ -keep class * extends androidx.fragment.app.Fragment { *; }
13
+
14
+ # kotlinx.serialization generates a companion `serializer()` per @Serializable
15
+ # class; the plugin's own rules cover its runtime, these cover our models.
16
+ -keepclassmembers class com.rubyeverywhere.shell.** {
17
+ *** Companion;
18
+ }
19
+ -keepclasseswithmembers class com.rubyeverywhere.shell.** {
20
+ kotlinx.serialization.KSerializer serializer(...);
21
+ }
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Debug only. The analogue of iOS's NSAllowsLocalNetworking: enough cleartext
4
+ to reach a Rails server on the developer's machine, and not one host more.
5
+ Never `cleartextTrafficPermitted="true"` on the base config — that would
6
+ quietly downgrade every request the app makes while debugging, including the
7
+ ones going to the real, deployed app.
8
+
9
+ * 127.0.0.1 / localhost — correct on emulators AND physical devices once
10
+ `adb reverse tcp:<port> tcp:<port>` is set up. The preferred rung.
11
+ * 10.0.2.2 — the Android emulator's alias for the host's loopback, used when
12
+ `adb reverse` is unavailable.
13
+ * .local — a Bonjour hostname, which is how most LAN setups are reachable.
14
+
15
+ network-security-config takes hostnames and IP literals only; there is no
16
+ CIDR syntax, so the private ranges cannot be expressed here. An explicit
17
+ `dev_url` of http://192.168.1.20:3000 therefore needs its host added, and
18
+ appending a domain entry to this file for that case is the one edit the
19
+ builder is allowed to make here.
20
+ -->
21
+ <network-security-config>
22
+ <base-config cleartextTrafficPermitted="false" />
23
+
24
+ <domain-config cleartextTrafficPermitted="true">
25
+ <domain includeSubdomains="false">127.0.0.1</domain>
26
+ <domain includeSubdomains="false">localhost</domain>
27
+ <domain includeSubdomains="false">10.0.2.2</domain>
28
+ <domain includeSubdomains="true">local</domain>
29
+ </domain-config>
30
+ </network-security-config>
@@ -0,0 +1,42 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ FROZEN. Nothing per-app belongs in this file. The app label arrives as a
4
+ manifest placeholder from everywhere.properties; deep-link intent filters,
5
+ the auth callback scheme and runtime permissions are merged in from
6
+ src/stamped/AndroidManifest.xml.
7
+ -->
8
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
9
+ xmlns:tools="http://schemas.android.com/tools">
10
+
11
+ <uses-permission android:name="android.permission.INTERNET" />
12
+
13
+ <application
14
+ android:name=".EverywhereApplication"
15
+ android:allowBackup="false"
16
+ android:enableOnBackInvokedCallback="true"
17
+ android:icon="@mipmap/ic_launcher"
18
+ android:label="${everywhereLabel}"
19
+ android:roundIcon="@mipmap/ic_launcher_round"
20
+ android:supportsRtl="true"
21
+ android:theme="@style/Theme.Everywhere"
22
+ android:networkSecurityConfig="@xml/network_security_config"
23
+ tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
24
+
25
+ <activity
26
+ android:name=".MainActivity"
27
+ android:exported="true"
28
+ android:configChanges="orientation|screenSize"
29
+ android:theme="@style/Theme.Everywhere.Splash"
30
+ android:windowSoftInputMode="adjustResize"
31
+ android:launchMode="singleTask">
32
+
33
+ <intent-filter>
34
+ <action android:name="android.intent.action.MAIN" />
35
+ <category android:name="android.intent.category.LAUNCHER" />
36
+ </intent-filter>
37
+
38
+ </activity>
39
+
40
+ </application>
41
+
42
+ </manifest>
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "RubyEverywhere",
3
+ "bundle_id": "com.rubyeverywhere.app",
4
+ "version": "0.1.0",
5
+ "mode": "remote",
6
+ "remote_url": "https://rubyeverywhere.com",
7
+ "entry_path": "/",
8
+ "lazy_load_tabs": true
9
+ }