@absolutejs/absolute 0.20.0-beta.5 → 0.20.0-beta.50

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 (142) hide show
  1. package/README.md +205 -0
  2. package/dist/angular/browser.js +392 -361
  3. package/dist/angular/browser.js.map +3 -3
  4. package/dist/angular/components/core/streamingSlotRegistrar.js +7 -7
  5. package/dist/angular/components/core/streamingSlotRegistry.js +4 -4
  6. package/dist/angular/index.js +355 -302
  7. package/dist/angular/index.js.map +5 -5
  8. package/dist/angular/server.js +109 -58
  9. package/dist/angular/server.js.map +5 -5
  10. package/dist/build.js +2261 -1335
  11. package/dist/build.js.map +16 -12
  12. package/dist/cli/config/client.js +12 -12
  13. package/dist/cli/config/server.js +1136 -1090
  14. package/dist/cli/index.js +8247 -1898
  15. package/dist/client/index.js +29 -25
  16. package/dist/client/index.js.map +2 -2
  17. package/dist/core/streamingSlotRegistrar.js +15 -13
  18. package/dist/core/streamingSlotRegistrar.js.map +2 -2
  19. package/dist/core/streamingSlotRegistry.js +11 -9
  20. package/dist/core/streamingSlotRegistry.js.map +2 -2
  21. package/dist/dev/client/hmrClient.ts +35 -3
  22. package/dist/dev/client/hmrTiming.ts +6 -0
  23. package/dist/dev/client/syncDevtools.ts +237 -0
  24. package/dist/dev/serverBootstrap.js +28 -0
  25. package/dist/image-client/imageClient.js +7 -7
  26. package/dist/index.js +3400 -2126
  27. package/dist/index.js.map +30 -23
  28. package/dist/islands/browser.js +11 -9
  29. package/dist/islands/browser.js.map +2 -2
  30. package/dist/islands/index.js +39 -35
  31. package/dist/islands/index.js.map +2 -2
  32. package/dist/mobile/browser.js +167 -20
  33. package/dist/mobile/browser.js.map +7 -5
  34. package/dist/mobile/index.js +7840 -2983
  35. package/dist/mobile/index.js.map +37 -18
  36. package/dist/mobile/remoteMacAgentEntry.js +1184 -14
  37. package/dist/mobile/shellAuth.js +36 -0
  38. package/dist/mobile/shellBootstrap.js +836 -0
  39. package/dist/mobile/shellExpoAuth.js +163 -0
  40. package/dist/mobile/shellExpoDevices.js +77 -0
  41. package/dist/mobile/shellExpoSync.js +104 -0
  42. package/dist/mobile/shellSync.js +173 -0
  43. package/dist/react/browser.js +17 -15
  44. package/dist/react/browser.js.map +2 -2
  45. package/dist/react/components/browser/index.js +107 -107
  46. package/dist/react/components/index.js +118 -116
  47. package/dist/react/components/index.js.map +2 -2
  48. package/dist/react/hooks/index.js +11 -9
  49. package/dist/react/hooks/index.js.map +2 -2
  50. package/dist/react/index.js +92 -49
  51. package/dist/react/index.js.map +4 -4
  52. package/dist/react/jsxDevRuntimeCompat.js +11 -9
  53. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  54. package/dist/react/jsxRuntimeCompat.js +11 -9
  55. package/dist/react/jsxRuntimeCompat.js.map +2 -2
  56. package/dist/react/router/browser.js +9 -7
  57. package/dist/react/router/browser.js.map +2 -2
  58. package/dist/react/router/index.js +9 -7
  59. package/dist/react/router/index.js.map +2 -2
  60. package/dist/react/server.js +51 -10
  61. package/dist/react/server.js.map +4 -4
  62. package/dist/src/build/pwa.d.ts +16 -0
  63. package/dist/src/cli/config/server.d.ts +1 -1
  64. package/dist/src/cli/instanceStatus.d.ts +1 -0
  65. package/dist/src/cli/scripts/dev.d.ts +2 -0
  66. package/dist/src/core/devBuild.d.ts +1 -0
  67. package/dist/src/core/prepare.d.ts +376 -0
  68. package/dist/src/dev/clientManager.d.ts +1 -0
  69. package/dist/src/dev/devCert.d.ts +6 -4
  70. package/dist/src/dev/serverEntryCopies.d.ts +3 -0
  71. package/dist/src/mobile/androidEmulatorController.d.ts +8 -1
  72. package/dist/src/mobile/androidRelease.d.ts +9 -2
  73. package/dist/src/mobile/androidTestReport.d.ts +14 -0
  74. package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
  75. package/dist/src/mobile/androidWebView.d.ts +1 -0
  76. package/dist/src/mobile/browser.d.ts +1 -0
  77. package/dist/src/mobile/capacitorBundle.d.ts +11 -0
  78. package/dist/src/mobile/ciWorkflow.d.ts +26 -0
  79. package/dist/src/mobile/config.d.ts +4 -1
  80. package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
  81. package/dist/src/mobile/deviceCapabilities.d.ts +48 -0
  82. package/dist/src/mobile/expoBridge.d.ts +91 -0
  83. package/dist/src/mobile/expoDevController.d.ts +56 -0
  84. package/dist/src/mobile/expoProject.d.ts +16 -0
  85. package/dist/src/mobile/index.d.ts +14 -0
  86. package/dist/src/mobile/iosDeviceAcceptance.d.ts +32 -0
  87. package/dist/src/mobile/iosPhysicalDeviceTransport.d.ts +16 -0
  88. package/dist/src/mobile/iosRelease.d.ts +16 -3
  89. package/dist/src/mobile/iosSimulatorController.d.ts +20 -2
  90. package/dist/src/mobile/iosTestReport.d.ts +24 -0
  91. package/dist/src/mobile/mobileBundleInspection.d.ts +55 -0
  92. package/dist/src/mobile/mobileInspect.d.ts +136 -0
  93. package/dist/src/mobile/mobilePreview.d.ts +174 -0
  94. package/dist/src/mobile/mobilePreviewClient.d.ts +1 -0
  95. package/dist/src/mobile/nativeAuth.d.ts +6 -0
  96. package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
  97. package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
  98. package/dist/src/mobile/nativeRoute.d.ts +13 -0
  99. package/dist/src/mobile/nativeTestReport.d.ts +91 -0
  100. package/dist/src/mobile/pageProtocol.d.ts +2 -0
  101. package/dist/src/mobile/releaseDoctor.d.ts +23 -1
  102. package/dist/src/mobile/remoteMacProtocol.d.ts +38 -0
  103. package/dist/src/mobile/remoteMacWire.d.ts +1 -1
  104. package/dist/src/mobile/shellAuth.d.ts +8 -1
  105. package/dist/src/mobile/shellBootstrap.d.ts +14 -2
  106. package/dist/src/mobile/shellExpoAuth.d.ts +12 -0
  107. package/dist/src/mobile/shellExpoDevices.d.ts +3 -0
  108. package/dist/src/mobile/shellExpoSync.d.ts +18 -0
  109. package/dist/src/mobile/shellHttp.d.ts +2 -0
  110. package/dist/src/mobile/shellPush.d.ts +11 -0
  111. package/dist/src/mobile/shellSync.d.ts +46 -1
  112. package/dist/src/mobile/syncRemediation.d.ts +10 -0
  113. package/dist/src/mobile/syncSchema.d.ts +9 -0
  114. package/dist/src/mobile/transport.d.ts +7 -0
  115. package/dist/src/plugins/hmr.d.ts +3 -0
  116. package/dist/src/plugins/imageOptimizer.d.ts +1 -1
  117. package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
  118. package/dist/src/utils/imageProcessing.d.ts +3 -0
  119. package/dist/src/utils/loadConfig.d.ts +1 -0
  120. package/dist/src/utils/logger.d.ts +1 -0
  121. package/dist/src/utils/startupBanner.d.ts +1 -0
  122. package/dist/src/utils/userAgentFunctions.d.ts +1 -1
  123. package/dist/svelte/browser.js +12 -10
  124. package/dist/svelte/browser.js.map +2 -2
  125. package/dist/svelte/index.js +86 -43
  126. package/dist/svelte/index.js.map +4 -4
  127. package/dist/svelte/server.js +68 -27
  128. package/dist/svelte/server.js.map +4 -4
  129. package/dist/types/build.d.ts +53 -3
  130. package/dist/types/cli.d.ts +1 -0
  131. package/dist/types/messages.d.ts +1 -1
  132. package/dist/vue/browser.js +14 -12
  133. package/dist/vue/browser.js.map +2 -2
  134. package/dist/vue/components/Image.js +9 -7
  135. package/dist/vue/components/Image.js.map +2 -2
  136. package/dist/vue/components/index.js +11 -9
  137. package/dist/vue/components/index.js.map +2 -2
  138. package/dist/vue/index.js +91 -48
  139. package/dist/vue/index.js.map +4 -4
  140. package/dist/vue/server.js +53 -12
  141. package/dist/vue/server.js.map +4 -4
  142. package/package.json +35 -15
package/README.md CHANGED
@@ -105,6 +105,211 @@ export const server = new Elysia()
105
105
  2. Route handlers (`handleReactPageRequest`, `handleSveltePageRequest`, …) stream HTML and inject scripts/assets based on that manifest.
106
106
  3. The static plugin serves all compiled files from `/build`.
107
107
 
108
+ ### Installable PWA and offline Sync
109
+
110
+ Enable the web-app shell once in `absolutejs.config.ts`. AbsoluteJS generates a
111
+ single shared browser bootstrap, service worker, and optional manifest, then
112
+ wires them into React, Vue, Svelte, Angular, HTML, HTMX, and island client
113
+ entries. Route and page code does not change.
114
+
115
+ ```ts
116
+ import { defineConfig } from '@absolutejs/absolute';
117
+
118
+ export default defineConfig({
119
+ // Existing framework directories and build settings...
120
+ pwa: {
121
+ manifest: {
122
+ name: 'Acme',
123
+ shortName: 'Acme',
124
+ themeColor: '#111827',
125
+ icons: [
126
+ {
127
+ src: '/icons/app-512.png',
128
+ sizes: '512x512',
129
+ type: 'image/png'
130
+ }
131
+ ]
132
+ },
133
+ serviceWorker: {
134
+ offline: {
135
+ fallback: '/offline.html',
136
+ assetPrefix: '/assets/'
137
+ }
138
+ },
139
+ // With @absolutejs/auth + syncSocket(), this provisions the existing
140
+ // HTTP-only web session and durable IndexedDB transport automatically.
141
+ sync: true,
142
+ // Optional: importing pushNotifications enables this automatically.
143
+ // The public key defaults to VAPID_PUBLIC_KEY at build time.
144
+ push: true
145
+ }
146
+ });
147
+ ```
148
+
149
+ The default outputs are `/sw.js`, `/manifest.webmanifest`, and the internal
150
+ shared bootstrap at `/__absolute/pwa/bootstrap.js`. Put referenced icons and the
151
+ offline fallback in `publicDirectory`. The worker uses Background Sync when the
152
+ browser offers it, while online/focus/visibility resume remains the correctness
153
+ path. Native Capacitor clients continue to use their Bearer and SQLite
154
+ transport; no web cookie or token is copied into the worker.
155
+
156
+ Portable push uses the same `pushNotifications` API in the browser and a
157
+ Capacitor shell. AbsoluteJS generates Web Push registration and subscription
158
+ rotation against the same-origin `/auth/push` route. Configure the trusted
159
+ server once with `auth({ push: { registrar, tenant, topics } })`; Auth derives
160
+ identity, tenant, and authorized topics, while page code never receives APNs,
161
+ FCM, or Web Push credentials. Only the public VAPID key enters browser output;
162
+ keep `VAPID_PRIVATE_KEY` in the server-side Dispatch sender.
163
+
164
+ `@absolutejs/pwa/client` also exposes `onPwaSyncResult()` and
165
+ `getLastPwaSyncResult()` (plus the `absolute:pwa-sync-result` DOM event) for
166
+ application-owned diagnostics. Results contain only success, duration, trigger,
167
+ and aggregate counts—never credentials, namespaces, endpoints, arguments, or
168
+ rows. Account changes are re-resolved before focus/online/visible Sync and the
169
+ old worker run is aborted and cleared before the new namespace can run.
170
+
171
+ AbsoluteJS also generates one local-storage migration bundle for web and native
172
+ from the app plus installed Sync packs. Routes stay unchanged. A package that
173
+ owns persisted data declares its JSON-safe evolution in `package.json`:
174
+
175
+ ```json
176
+ {
177
+ "absolutejs": {
178
+ "sync": {
179
+ "localSchema": {
180
+ "version": 2,
181
+ "migrations": [
182
+ {
183
+ "toVersion": 2,
184
+ "operations": [
185
+ {
186
+ "type": "set-default",
187
+ "collection": "tasks",
188
+ "field": "completed",
189
+ "value": false
190
+ }
191
+ ]
192
+ }
193
+ ]
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ Absolute derives stable component IDs from package names, keeps independent
201
+ version ledgers, validates migration gaps during build/doctor, and applies the
202
+ same transaction atomically in IndexedDB or Capacitor SQLite before Sync starts.
203
+ The same `localSchema` object can declare `localData` rules for sensitivity,
204
+ encryption, memory-only fallback, whole-cache retention, eviction priority, and
205
+ per-principal quota. Absolute mobile stores record payloads as AES-256-GCM
206
+ ciphertext using a random key held by Keychain/Keystore; native background Sync
207
+ uses the identical authenticated format. Browsers without an audited key
208
+ provider either keep a declared fallback in memory only or fail closed. Pending
209
+ mutations are never evicted to satisfy quota.
210
+
211
+ App updates are consent-driven: `onUpdateAvailable()` latches a waiting worker
212
+ for late UI subscribers, `checkForUpdate()` performs a passive check, and
213
+ `applyUpdate()` activates and reloads only after the user accepts. AbsoluteJS
214
+ does not silently replace a running application session.
215
+
216
+ ### Native device capabilities
217
+
218
+ Application code uses one provider-neutral API in web pages and Capacitor apps:
219
+
220
+ ```ts
221
+ import {
222
+ camera,
223
+ clipboard,
224
+ haptics,
225
+ keyboard,
226
+ photos,
227
+ share,
228
+ systemBars
229
+ } from '@absolutejs/devices';
230
+
231
+ await clipboard.writeText('Copied everywhere');
232
+ await share.share({ text: 'Shared everywhere', url: 'https://absolutejs.com' });
233
+ await haptics.impact('light');
234
+ const removeKeyboard = await keyboard.onChange(({ visible, heightPx }) => {
235
+ document.documentElement.style.setProperty(
236
+ '--keyboard-height',
237
+ visible ? `${heightPx}px` : '0px'
238
+ );
239
+ });
240
+ await systemBars.setAppearance('light', 'status');
241
+ const permission = await camera.requestPermission();
242
+ if (permission.state === 'granted') {
243
+ const capture = await camera.takePhoto();
244
+ image.src = capture.webPath;
245
+ }
246
+ const chosen = await photos.pick({ limit: 1 });
247
+ ```
248
+
249
+ `absolute mobile init` and `absolute mobile sync` discover these named value
250
+ imports, read the tested mappings published by `@absolutejs/devices-capacitor`,
251
+ and offer to install only the exact Capacitor plugins in use. The generated
252
+ shell wires them into the shared device facade; users do not import Capacitor,
253
+ edit Swift/Kotlin, or maintain native bootstrap code. Type-only imports and test
254
+ sources do not provision plugins. `absolute mobile doctor release` rejects a
255
+ missing or mismatched plugin before release.
256
+
257
+ Run `absolute mobile inspect` from an application root for a read-only summary
258
+ of the effective mobile config, runtime package versions, discovered
259
+ capabilities/plugins, native-project state, embedded routes/frameworks, bundle
260
+ validation, and release projection. Add `--json` for a redacted CI or support
261
+ artifact; it omits credentials, device/account identifiers, absolute paths, and
262
+ detailed doctor messages. See [mobile project inspection](docs/MOBILE_INSPECT.md).
263
+
264
+ Before signing, run `absolute mobile doctor release`. It validates pinned and
265
+ aligned Capacitor packages, dependency locking, HTTPS and signed-link identity,
266
+ packaged app identity, SHA-256 page/style integrity, runtime compatibility, CSP,
267
+ native deep-link projections, privacy/permission projections, debug residue,
268
+ and Sync/device policy. Its `--json` output is a redacted format-versioned CI
269
+ artifact containing public app facts, check IDs/statuses, totals, and explicit
270
+ manual-review categories—never local paths or detailed failure text. See the
271
+ [Capacitor mobile threat model](docs/MOBILE_SECURITY_THREAT_MODEL.md).
272
+
273
+ Generate protected GitHub Actions for cryptographic pull-request validation,
274
+ signed AAB/IPA builds, and optional Google Play/TestFlight publication:
275
+
276
+ ```sh
277
+ bunx absolute mobile ci github server.ts --publish
278
+ ```
279
+
280
+ The generated workflow keeps signing and provider credentials behind the
281
+ `absolute-mobile-release` GitHub environment. See
282
+ [mobile CI and store releases](docs/MOBILE_CI.md).
283
+
284
+ An experimental Expo Router hybrid is also available behind
285
+ `mobile.engine: 'expo'`. Explicit React Native routes use native UI while every
286
+ unclaimed AbsoluteJS route remains an embedded, signed web route regardless of
287
+ framework. Capacitor is still the default; Expo Android now supports audited,
288
+ signed production AABs, generated CI, and Google Play publishing while Expo iOS
289
+ release automation remains experimental. See the
290
+ [Expo hybrid experiment](docs/MOBILE_EXPO_EXPERIMENT.md).
291
+ For Expo development, `bun dev` now owns the Bun server, Metro development
292
+ client, configured emulator/simulator builds, categorized logs, and both native
293
+ Fast Refresh and framework-aware AbsoluteJS HMR from the application root.
294
+
295
+ `keyboard` provides portable visibility, CSS-pixel height, dismissal, and
296
+ cleanup-safe change events. `systemBars` controls modern edge-to-edge status and
297
+ navigation bar foreground appearance/visibility through Capacitor 8 core. Its
298
+ `light` and `dark` values name the icon/text foreground. Web appearance uses
299
+ best-effort `color-scheme`; browser chrome visibility reports unsupported.
300
+
301
+ Camera capture requires an explicit `camera.requestPermission()` call from an
302
+ intentional user action. `photos.pick()` uses the item-scoped system picker
303
+ without requesting broad library access. AbsoluteJS generates the required iOS
304
+ usage descriptions from the same audited capability metadata; this first slice
305
+ does not expose EXIF metadata or save captures into the gallery, and Android does
306
+ not receive unnecessary camera/storage permissions.
307
+
308
+ Clipboard and Share use browser standards on the web and fail with normalized
309
+ errors when unavailable. Haptics uses vibration where supported and otherwise
310
+ safely becomes a no-op, because tactile feedback must never be required to
311
+ complete an action.
312
+
108
313
  ### Immutable production images
109
314
 
110
315
  Build production assets and the server bundle while constructing the image,