native-update 2.0.0 → 3.1.1

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 (304) hide show
  1. package/Readme.md +28 -14
  2. package/android/manifest-additions.xml +28 -0
  3. package/android/src/main/AndroidManifest.xml +3 -7
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/BackgroundNotificationManager.kt +21 -13
  5. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +196 -29
  6. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +21 -36
  7. package/cli/AGENTS.md +24 -1
  8. package/cli/CLAUDE.md +24 -1
  9. package/cli/commands/backend-create.js +56 -15
  10. package/cli/commands/bundle-create.js +39 -7
  11. package/cli/commands/monitor.js +72 -51
  12. package/cli/index.js +10 -24
  13. package/cli/package.json +11 -3
  14. package/dist/esm/app-review/app-review-manager.js +0 -1
  15. package/dist/esm/app-review/index.js +0 -1
  16. package/dist/esm/app-review/platform-review-handler.js +0 -1
  17. package/dist/esm/app-review/review-conditions-checker.js +0 -1
  18. package/dist/esm/app-review/review-rate-limiter.js +0 -1
  19. package/dist/esm/app-review/types.js +0 -1
  20. package/dist/esm/app-update/app-update-checker.d.ts +19 -0
  21. package/dist/esm/app-update/app-update-checker.js +19 -1
  22. package/dist/esm/app-update/app-update-installer.d.ts +1 -0
  23. package/dist/esm/app-update/app-update-installer.js +19 -8
  24. package/dist/esm/app-update/app-update-manager.js +0 -1
  25. package/dist/esm/app-update/app-update-notifier.js +0 -1
  26. package/dist/esm/app-update/index.js +0 -1
  27. package/dist/esm/app-update/platform-app-update.js +12 -3
  28. package/dist/esm/app-update/types.js +0 -1
  29. package/dist/esm/background-update/background-scheduler.d.ts +21 -0
  30. package/dist/esm/background-update/background-scheduler.js +47 -25
  31. package/dist/esm/background-update/index.js +0 -1
  32. package/dist/esm/background-update/notification-manager.js +0 -1
  33. package/dist/esm/config/support.js +0 -1
  34. package/dist/esm/core/analytics.d.ts +13 -0
  35. package/dist/esm/core/analytics.js +15 -1
  36. package/dist/esm/core/cache-manager.js +0 -1
  37. package/dist/esm/core/config.d.ts +0 -15
  38. package/dist/esm/core/config.js +0 -4
  39. package/dist/esm/core/errors.d.ts +1 -0
  40. package/dist/esm/core/errors.js +1 -1
  41. package/dist/esm/core/event-emitter.d.ts +0 -3
  42. package/dist/esm/core/event-emitter.js +8 -3
  43. package/dist/esm/core/logger.js +0 -1
  44. package/dist/esm/core/performance.js +0 -1
  45. package/dist/esm/core/plugin-manager.js +3 -1
  46. package/dist/esm/core/security.d.ts +11 -0
  47. package/dist/esm/core/security.js +27 -1
  48. package/dist/esm/core/update-check.d.ts +89 -0
  49. package/dist/esm/core/update-check.js +86 -0
  50. package/dist/esm/definitions.d.ts +11 -12
  51. package/dist/esm/definitions.js +0 -1
  52. package/dist/esm/index.d.ts +3 -2
  53. package/dist/esm/index.js +3 -1
  54. package/dist/esm/live-update/bundle-manager.d.ts +8 -0
  55. package/dist/esm/live-update/bundle-manager.js +20 -1
  56. package/dist/esm/live-update/certificate-pinning.js +0 -1
  57. package/dist/esm/live-update/delta-processor.d.ts +1 -1
  58. package/dist/esm/live-update/delta-processor.js +3 -1
  59. package/dist/esm/live-update/download-manager.js +9 -2
  60. package/dist/esm/live-update/rollout-checker.d.ts +1 -1
  61. package/dist/esm/live-update/rollout-checker.js +5 -6
  62. package/dist/esm/live-update/update-manager.js +0 -1
  63. package/dist/esm/live-update/version-manager.d.ts +0 -12
  64. package/dist/esm/live-update/version-manager.js +43 -95
  65. package/dist/esm/plugin.js +71 -51
  66. package/dist/esm/security/crypto.js +11 -7
  67. package/dist/esm/security/validator.js +0 -1
  68. package/dist/esm/types/rollout.d.ts +91 -0
  69. package/dist/esm/types/rollout.js +25 -0
  70. package/dist/esm/web.d.ts +8 -0
  71. package/dist/esm/web.js +148 -54
  72. package/dist/plugin.cjs.js +1 -2
  73. package/dist/plugin.esm.js +1 -2
  74. package/dist/plugin.js +2 -3
  75. package/docs/AGENTS.md +9 -0
  76. package/docs/CHANGELOG.md +140 -0
  77. package/docs/CLAUDE.md +10 -1
  78. package/docs/DEPLOY_NOTES.md +117 -0
  79. package/docs/MANUAL-TASKS.md +30 -0
  80. package/docs/MARKETING_WEBSITE_TRACKER.md +18 -2
  81. package/docs/MIGRATION.md +83 -0
  82. package/docs/PACKAGES.md +167 -0
  83. package/docs/PERFORMANCE.md +110 -0
  84. package/docs/PROJECT_COMPLETION_TRACKER.md +4 -35
  85. package/docs/README.md +0 -1
  86. package/docs/REMAINING_FEATURES.md +123 -76
  87. package/docs/ROADMAP.md +200 -120
  88. package/docs/SECURITY-IF-REPO-PUBLIC.md +232 -0
  89. package/docs/TESTING_REQUIREMENTS.md +1 -112
  90. package/docs/ai-knowledge-base/00-project-profile.md +38 -0
  91. package/docs/ai-knowledge-base/01-features.md +46 -0
  92. package/docs/ai-knowledge-base/02-routes.md +72 -0
  93. package/docs/ai-knowledge-base/03-tech-stack.md +57 -0
  94. package/docs/ai-knowledge-base/README.md +23 -0
  95. package/docs/analytics-tracking.md +37 -0
  96. package/docs/api/background-update-api.md +14 -1
  97. package/docs/capacitor-official-plugins.md +46 -0
  98. package/docs/capawesome-plugins.md +29 -0
  99. package/docs/deployment/HOSTINGER_DEPLOY.md +75 -34
  100. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +184 -0
  101. package/docs/docs-site/plan.md +201 -0
  102. package/docs/docs-site/scope.md +127 -0
  103. package/docs/docs-site/tracker.json +235 -0
  104. package/docs/error-handling-tracking.md +37 -0
  105. package/docs/features/e2e-full-verification/00-overview.md +99 -0
  106. package/docs/features/e2e-full-verification/00-tracker.json +284 -0
  107. package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +183 -0
  108. package/docs/features/e2e-full-verification/phase02-test-auth.md +176 -0
  109. package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +63 -0
  110. package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +73 -0
  111. package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +69 -0
  112. package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +51 -0
  113. package/docs/features/e2e-full-verification/results/phase01-drift-report.md +50 -0
  114. package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +215 -0
  115. package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +139 -0
  116. package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +99 -0
  117. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
  118. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
  119. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
  120. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
  121. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
  122. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
  123. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
  124. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
  125. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
  126. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
  127. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
  128. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
  129. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
  130. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
  131. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
  132. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
  133. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
  134. package/docs/features/e2e-full-verification/results/route-list.json +1 -0
  135. package/docs/features/queues-and-emails/00-overview.md +41 -0
  136. package/docs/features/queues-and-emails/00-tracker.json +99 -0
  137. package/docs/features/queues-and-emails/phase01-foundation.md +15 -0
  138. package/docs/features/queues-and-emails/phase02-queued-jobs.md +19 -0
  139. package/docs/features/queues-and-emails/phase03-transactional-emails.md +16 -0
  140. package/docs/features/queues-and-emails/phase04-quota-ops.md +17 -0
  141. package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +16 -0
  142. package/docs/features/queues-and-emails/phase06-verify-deploy.md +17 -0
  143. package/docs/guides/testing-guide.md +15 -41
  144. package/docs/package-audit.md +41 -0
  145. package/docs/play-store/ASO-METADATA.md +5 -0
  146. package/docs/play-store/DATA-SAFETY.md +5 -0
  147. package/docs/play-store/DECLARATIONS.md +5 -0
  148. package/docs/play-store/README.md +27 -0
  149. package/docs/play-store/RELEASE-NOTES.md +99 -0
  150. package/docs/play-store/RELEASE-STEPS.md +6 -0
  151. package/docs/play-store/STORE-LISTING.md +7 -0
  152. package/docs/play-store/SUBMISSION-CHECKLIST.md +5 -0
  153. package/docs/production-readiness.md +1 -1
  154. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +123 -0
  155. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +227 -0
  156. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +144 -0
  157. package/docs/project-audit/2026-05-16/sessions/batch-01.md +42 -0
  158. package/docs/project-audit/2026-05-16/sessions/batch-02.md +74 -0
  159. package/docs/project-audit/2026-05-16/sessions/batch-03.md +71 -0
  160. package/docs/project-audit/2026-05-16/sessions/batch-04.md +88 -0
  161. package/docs/project-audit/2026-05-16/sessions/batch-05.md +63 -0
  162. package/docs/project-audit/2026-05-16/sessions/batch-06.md +103 -0
  163. package/docs/project-audit/2026-05-16/sessions/batch-07.md +61 -0
  164. package/docs/project-audit/2026-05-16/sessions/batch-08.md +101 -0
  165. package/docs/project-audit/2026-05-16/sessions/batch-09.md +105 -0
  166. package/docs/project-audit/2026-05-16/sessions/batch-10.md +102 -0
  167. package/docs/project-audit/AUDIT-HISTORY.md +74 -0
  168. package/docs/project-audit/BATCH-PLAN.md +168 -0
  169. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +73 -0
  170. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +275 -0
  171. package/docs/project-finalization/00-tracker.json +60 -0
  172. package/docs/project-knowledge-base/01-system-overview.md +39 -30
  173. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +87 -81
  174. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +140 -108
  175. package/docs/project-knowledge-base/04-data-models-integrations.md +191 -254
  176. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +83 -20
  177. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +67 -29
  178. package/docs/project-knowledge-base/README.md +27 -14
  179. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +81 -0
  180. package/docs/rules-tracker.md +102 -0
  181. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +116 -0
  182. package/docs/server-requirements.md +41 -11
  183. package/docs/social-media-marketing/README.md +81 -0
  184. package/docs/social-media-marketing/posts-batch-01.md +613 -0
  185. package/docs/social-media-marketing/posts-batch-02.md +528 -0
  186. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +458 -0
  187. package/docs/social-media-marketing/whatsapp-status-batch-01.md +355 -0
  188. package/docs/tracking/finalization-2026-05-16-tracker.json +346 -0
  189. package/docs/tracking/full-audit-tracker.json +121 -0
  190. package/docs/tracking/production-readiness-audit-tracker.json +429 -0
  191. package/ios/Plugin/BackgroundUpdate/BackgroundUpdatePlugin.swift +16 -3
  192. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +71 -47
  193. package/ios/Plugin/NativeUpdatePlugin.swift +14 -9
  194. package/package.json +29 -29
  195. package/cli/node_modules/.yarn-integrity +0 -16
  196. package/cli/node_modules/commander/LICENSE +0 -22
  197. package/cli/node_modules/commander/Readme.md +0 -1148
  198. package/cli/node_modules/commander/esm.mjs +0 -16
  199. package/cli/node_modules/commander/index.js +0 -26
  200. package/cli/node_modules/commander/lib/argument.js +0 -145
  201. package/cli/node_modules/commander/lib/command.js +0 -2179
  202. package/cli/node_modules/commander/lib/error.js +0 -43
  203. package/cli/node_modules/commander/lib/help.js +0 -462
  204. package/cli/node_modules/commander/lib/option.js +0 -329
  205. package/cli/node_modules/commander/lib/suggestSimilar.js +0 -100
  206. package/cli/node_modules/commander/package-support.json +0 -16
  207. package/cli/node_modules/commander/package.json +0 -80
  208. package/cli/node_modules/commander/typings/esm.d.mts +0 -3
  209. package/cli/node_modules/commander/typings/index.d.ts +0 -884
  210. package/cli/yarn.lock +0 -8
  211. package/dist/esm/__tests__/bundle-manager.test.d.ts +0 -1
  212. package/dist/esm/__tests__/bundle-manager.test.js +0 -151
  213. package/dist/esm/__tests__/bundle-manager.test.js.map +0 -1
  214. package/dist/esm/__tests__/config.test.d.ts +0 -1
  215. package/dist/esm/__tests__/config.test.js +0 -70
  216. package/dist/esm/__tests__/config.test.js.map +0 -1
  217. package/dist/esm/__tests__/delta-processor.test.d.ts +0 -1
  218. package/dist/esm/__tests__/delta-processor.test.js +0 -77
  219. package/dist/esm/__tests__/delta-processor.test.js.map +0 -1
  220. package/dist/esm/__tests__/firestore-schema.test.d.ts +0 -1
  221. package/dist/esm/__tests__/firestore-schema.test.js +0 -74
  222. package/dist/esm/__tests__/firestore-schema.test.js.map +0 -1
  223. package/dist/esm/__tests__/integration.test.d.ts +0 -1
  224. package/dist/esm/__tests__/integration.test.js +0 -78
  225. package/dist/esm/__tests__/integration.test.js.map +0 -1
  226. package/dist/esm/__tests__/manifest-reader.test.d.ts +0 -1
  227. package/dist/esm/__tests__/manifest-reader.test.js +0 -271
  228. package/dist/esm/__tests__/manifest-reader.test.js.map +0 -1
  229. package/dist/esm/__tests__/rollout-checker.test.d.ts +0 -1
  230. package/dist/esm/__tests__/rollout-checker.test.js +0 -210
  231. package/dist/esm/__tests__/rollout-checker.test.js.map +0 -1
  232. package/dist/esm/__tests__/security-enforcement.test.d.ts +0 -1
  233. package/dist/esm/__tests__/security-enforcement.test.js +0 -95
  234. package/dist/esm/__tests__/security-enforcement.test.js.map +0 -1
  235. package/dist/esm/__tests__/security.test.d.ts +0 -1
  236. package/dist/esm/__tests__/security.test.js +0 -54
  237. package/dist/esm/__tests__/security.test.js.map +0 -1
  238. package/dist/esm/__tests__/version-manager.test.d.ts +0 -1
  239. package/dist/esm/__tests__/version-manager.test.js +0 -45
  240. package/dist/esm/__tests__/version-manager.test.js.map +0 -1
  241. package/dist/esm/app-review/app-review-manager.js.map +0 -1
  242. package/dist/esm/app-review/index.js.map +0 -1
  243. package/dist/esm/app-review/platform-review-handler.js.map +0 -1
  244. package/dist/esm/app-review/review-conditions-checker.js.map +0 -1
  245. package/dist/esm/app-review/review-rate-limiter.js.map +0 -1
  246. package/dist/esm/app-review/types.js.map +0 -1
  247. package/dist/esm/app-update/app-update-checker.js.map +0 -1
  248. package/dist/esm/app-update/app-update-installer.js.map +0 -1
  249. package/dist/esm/app-update/app-update-manager.js.map +0 -1
  250. package/dist/esm/app-update/app-update-notifier.js.map +0 -1
  251. package/dist/esm/app-update/index.js.map +0 -1
  252. package/dist/esm/app-update/platform-app-update.js.map +0 -1
  253. package/dist/esm/app-update/types.js.map +0 -1
  254. package/dist/esm/background-update/background-scheduler.js.map +0 -1
  255. package/dist/esm/background-update/index.js.map +0 -1
  256. package/dist/esm/background-update/notification-manager.js.map +0 -1
  257. package/dist/esm/config/support.js.map +0 -1
  258. package/dist/esm/core/analytics.js.map +0 -1
  259. package/dist/esm/core/cache-manager.js.map +0 -1
  260. package/dist/esm/core/config.js.map +0 -1
  261. package/dist/esm/core/errors.js.map +0 -1
  262. package/dist/esm/core/event-emitter.js.map +0 -1
  263. package/dist/esm/core/logger.js.map +0 -1
  264. package/dist/esm/core/performance.js.map +0 -1
  265. package/dist/esm/core/plugin-manager.js.map +0 -1
  266. package/dist/esm/core/security.js.map +0 -1
  267. package/dist/esm/definitions.js.map +0 -1
  268. package/dist/esm/firestore/firestore-client.d.ts +0 -109
  269. package/dist/esm/firestore/firestore-client.js +0 -264
  270. package/dist/esm/firestore/firestore-client.js.map +0 -1
  271. package/dist/esm/firestore/index.d.ts +0 -11
  272. package/dist/esm/firestore/index.js +0 -11
  273. package/dist/esm/firestore/index.js.map +0 -1
  274. package/dist/esm/firestore/manifest-reader.d.ts +0 -87
  275. package/dist/esm/firestore/manifest-reader.js +0 -294
  276. package/dist/esm/firestore/manifest-reader.js.map +0 -1
  277. package/dist/esm/firestore/schema.d.ts +0 -507
  278. package/dist/esm/firestore/schema.js +0 -73
  279. package/dist/esm/firestore/schema.js.map +0 -1
  280. package/dist/esm/index.js.map +0 -1
  281. package/dist/esm/live-update/bundle-manager.js.map +0 -1
  282. package/dist/esm/live-update/certificate-pinning.js.map +0 -1
  283. package/dist/esm/live-update/delta-processor.js.map +0 -1
  284. package/dist/esm/live-update/download-manager.js.map +0 -1
  285. package/dist/esm/live-update/rollout-checker.js.map +0 -1
  286. package/dist/esm/live-update/update-manager.js.map +0 -1
  287. package/dist/esm/live-update/version-manager.js.map +0 -1
  288. package/dist/esm/plugin.js.map +0 -1
  289. package/dist/esm/security/crypto.js.map +0 -1
  290. package/dist/esm/security/validator.js.map +0 -1
  291. package/dist/esm/web.js.map +0 -1
  292. package/dist/plugin.cjs.js.map +0 -1
  293. package/dist/plugin.esm.js.map +0 -1
  294. package/dist/plugin.js.map +0 -1
  295. package/docs/FIREBASE_INTEGRATION_TRACKER.md +0 -321
  296. package/docs/FIREBASE_QUERIES_AND_INDEXES_AUDIT.md +0 -221
  297. package/docs/examples/firebase-backend-example.md +0 -27
  298. package/docs/features/laravel-nova-backend/credentials.ignore.md +0 -34
  299. package/docs/guides/no-cost-backend-implementation-plan.md +0 -77
  300. package/docs/guides/no-cost-firestore-google-drive-backend.md +0 -60
  301. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-16.md +0 -454
  302. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-24.md +0 -66
  303. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md +0 -67
  304. /package/docs/{MARKETING_WEBSITE_PLAN.md → archive/MARKETING_WEBSITE_PLAN.md} +0 -0
@@ -0,0 +1,117 @@
1
+ # DEPLOY_NOTES.md — Live deploy queue (server agent reads this first)
2
+
3
+ **Purpose:** a small, living hand-off between the local agent (writes fixes + pushes to `main`) and
4
+ the **Claude Code agent running on the server** (pulls `main` and deploys). It answers one question:
5
+ *"besides pulling the latest code, is there anything I must DO on this deploy?"*
6
+
7
+ This is **not** a deployment guide. The full runbooks live in
8
+ `docs/deployment/` (`PRODUCTION-DEPLOY-CHECKLIST.md`, `HOSTINGER_DEPLOY.md`) and the
9
+ "Backend Deployment Zip Standard" in `backend/CLAUDE.md`. This file only carries the *deltas*.
10
+
11
+ ---
12
+
13
+ ## Rules (server agent MUST follow)
14
+
15
+ 1. **Read this file at the START of every deployment**, before pulling/building. Do every item in
16
+ **§ Pending deploy actions** that applies to what you're deploying.
17
+ 2. **Remove each pending item the moment it is done AND verified on the server.** This file is a
18
+ queue, not a changelog — `git log` is the history. Do not let completed items pile up here.
19
+ When the queue is empty, leave the literal line `_No pending deploy actions._` under the heading.
20
+ 3. **Keep it up to date.** If a deploy step is missing or wrong, fix it here in the same session
21
+ (and bump `Last updated`). Move anything that is *permanently* true into **§ Standing deploy
22
+ notes** (those are NOT removed).
23
+ 4. **The local agent ADDS pending items here** whenever a fix needs a server-side action beyond a
24
+ plain `git pull` (a migration, an env var, a cache/OPcache clear, an FPM restart, a one-off
25
+ artisan command, a manual verification). The server agent CLEARS them once applied.
26
+ 5. **One commit per deploy session** that touches this file (per the project commit rule). The
27
+ removal of a completed item is itself a valid, expected change to commit.
28
+
29
+ ---
30
+
31
+ ## Pending deploy actions
32
+
33
+ > Do these on the next deploy, then delete each line once completed + verified. Newest at top.
34
+
35
+ - [ ] **2026-07-13 — Queues + transactional emails batch (feature: `docs/features/queues-and-emails/`).**
36
+ The backend now queues work for real: notifications (welcome, subscription lifecycle, suspension,
37
+ MAU quota, admin alerts), `ProcessPayPalWebhookJob` (webhook ACKs 200 fast, handling+retries on
38
+ the queue), `DeleteFilesHubObjectsJob` (retrying FilesHub cleanup), and an env-gated async build
39
+ pipeline (default OFF). **The queue worker is scheduler-driven** —
40
+ `queue:work --stop-when-empty --max-time=50` runs every minute from `routes/console.php` — so the
41
+ **`queue:work` hPanel cron is NO LONGER NEEDED; only `schedule:run` must fire** (see the 2026-07-10
42
+ item below, now narrowed to one cron). Deploy steps beyond `git pull` + the standing cache rebuild:
43
+ 1. **Run migrations** (`php artisan migrate --force`) — one new file:
44
+ `2026_07_13_000001_add_quota_notified_columns_to_users` (2 nullable timestamps; verified on
45
+ local MySQL 8.x strict). Verify: `SHOW COLUMNS FROM users LIKE 'mau_%'` → 2 rows, `Null=YES`.
46
+ 2. **Set the MAIL_* block in the server `.env`** — email sends through the **FilesHub email API**
47
+ (global rule: FilesHub for email sending + file storage; custom transport
48
+ `app/Mail/Transport/FilesHubTransport.php` reuses the existing `FILESHUB_*` keys):
49
+ `MAIL_MAILER=fileshub`, `MAIL_FROM_ADDRESS=no-reply@fileshub.zaions.com` (display-only —
50
+ FilesHub sends from its own rotated account), `MAIL_FROM_NAME="Native Update"`. No SMTP
51
+ host/port/credentials exist anymore. **Prerequisite (owner):** the prod `FILESHUB_API_KEY`
52
+ must carry the `email` permission (see `docs/MANUAL-TASKS.md` row 10). **Until then, leave
53
+ `MAIL_MAILER=log`** — everything works, mail just lands in the log file.
54
+ 3. Rebuild caches (`php artisan config:cache && php artisan route:cache`) + restart PHP-FPM/OPcache
55
+ (standing note) — the new schedule entries and MAIL config are config-cached.
56
+ 4. **Verify the worker chain:** `php artisan schedule:list` shows 6 custom entries (worker every
57
+ minute, prune-failed weekly, sanctum-prune + quota:check-mau + queue:alert-failed daily,
58
+ analytics:cleanup monthly). Then `php artisan tinker --execute="App\Models\User::first()->notify(new App\Notifications\WelcomeNotification);"`
59
+ → `SELECT COUNT(*) FROM jobs;` shows 1 → within ~1 min the scheduler drains it to 0 (with
60
+ `MAIL_MAILER=log`, the rendered mail appears in `storage/logs/laravel-<date>.log`). Check
61
+ `failed_jobs` stays 0.
62
+ 5. With `MAIL_MAILER=fileshub` set: `php artisan tinker --execute="Mail::raw('FilesHub mail OK', fn (\$m) => \$m->to('aoneahsan@gmail.com')->subject('native-update FilesHub mail check'));"`
63
+ → expect no exception (a 4xx from FilesHub throws with the response body — a 403 means the
64
+ API key lacks the `email` permission). Confirm receipt in the inbox.
65
+ **Local verification state (2026-07-13):** the owner-provided key (in committed `backend/.env`
66
+ + `~/.secrets/native-update/fileshub-api-key`) passed auth + `email` permission, but FilesHub
67
+ PROD currently 503s (`Unknown column 'email_attachments.updated_at'`) — run the pending
68
+ migration on the **FilesHub** prod app first (files-hub repo migration
69
+ `2026_07_03_100000_…`, commit `af19905`: `git pull && php artisan migrate --force` there),
70
+ then this check should pass. Keep `MAIL_MAILER=log` here until it does.
71
+
72
+ - [ ] **2026-07-10 — Retention cron not yet firing (operational; Hostinger hPanel — OWNER-ONLY).**
73
+ `device_hash` widening (part 1) is **DONE + verified on the server 2026-07-10**: the tables
74
+ already existed at `varchar(64)` from the initial deploy, so — since `migrate:fresh` is banned on
75
+ this production DB and a plain `migrate` won't alter an already-run migration — the columns were
76
+ widened in place with `ALTER TABLE {device_activities,analytics_events} MODIFY device_hash
77
+ VARCHAR(191) NOT NULL`. Confirmed `varchar(191)` on both, and a 71-char `sha256:…` write was
78
+ smoke-tested (stored exact, no truncation, rolled back → 0 junk rows).
79
+ **REMAINING (owner action — hPanel UI ONLY, NOT shell):** the `schedule:run` + `queue:work` crons
80
+ are still erroring every minute (confirmed 2026-07-10 20:02 in `laravel-2026-07-10.log`) — Hostinger
81
+ isn't shell-interpreting `>/dev/null 2>&1`, so it lands as a literal arg
82
+ (`No arguments expected for "schedule:run", got ">/dev/null"` and `Too many arguments to "queue:work"`).
83
+ Until fixed, `analytics:cleanup` never runs. **The server deploy agent CANNOT fix these from the
84
+ shell:** this CloudLinux CageFS jail has no real `crontab` binary (`/usr/bin/crontab` absent; the
85
+ shell `crontab` is a read-only alias) and `/var/spool/cron/<user>` is not user-writable — so these
86
+ MUST be edited in **hPanel → Advanced → Cron Jobs**. **UPDATE 2026-07-13: only ONE cron is needed
87
+ now — `schedule:run`. DELETE the `queue:work` cron entirely** (the scheduler drives the queue
88
+ worker from `routes/console.php` as of the queues+emails batch; a second cron would double-run it).
89
+ Replace with the single `/bin/sh -c` form
90
+ (app dir = `/home/u156712920/domains/aoneahsan.com/public_html/nativeupdatebe-aoneahsan-com`):
91
+ ```
92
+ * * * * * /bin/sh -c "cd /home/u156712920/domains/aoneahsan.com/public_html/nativeupdatebe-aoneahsan-com && php artisan schedule:run >/dev/null 2>&1"
93
+ ```
94
+ **Verify:** the arg-parse errors stop appearing in `storage/logs/laravel-*.log`;
95
+ `php artisan schedule:list` already shows `0 3 1 * * php artisan analytics:cleanup` (plus the
96
+ queue worker + quota/alert entries from the 2026-07-13 batch).
97
+ **Data smoke (later):** once a real device hits `/v1/updates/check`, confirm a row lands in
98
+ `device_activities` + `analytics_events` (empty today — no live device traffic yet).
99
+
100
+ ---
101
+
102
+ ## Standing deploy notes (permanent — do NOT remove)
103
+
104
+ - **Always clear + rebuild caches on the server after a code pull:**
105
+ `php artisan optimize:clear` → `php artisan config:cache && php artisan route:cache && php artisan view:cache`.
106
+ A stale `bootstrap/cache/config.php` can bake the wrong `.env` values into the running app.
107
+ - **PHP class changes need OPcache invalidation** if OPcache is enabled with `revalidate_freq > 0`
108
+ or `validate_timestamps=0`: `php artisan optimize:clear` clears Laravel's caches but NOT OPcache —
109
+ restart PHP-FPM (or call `opcache_reset()`) to be certain the new bytecode is live.
110
+ - **Never cache config locally before zipping/pushing** — caching happens ON the server (see the
111
+ Backend Deployment Zip Standard). Ship no locally-cached config/routes/views.
112
+ - **Migrations** run on the server with `php artisan migrate --force` only when a pending item here
113
+ says so (or the checklist flags new migrations). Never `migrate:fresh` in production.
114
+
115
+ ---
116
+
117
+ **Last updated:** 2026-07-10
@@ -0,0 +1,30 @@
1
+ # Manual / User-Only Tasks — Native Update
2
+ > The ONE place for everything only you (the human) can do. Fixed path: docs/MANUAL-TASKS.md.
3
+ > Global spec: ~/.claude/rules/manual-tasks.md. Last updated: 2026-07-13 (queues+emails batch: row 8 narrowed to ONE cron — queue:work cron now DELETED, scheduler drives the worker; row 10 — grant the FilesHub API key the `email` permission — email sends via FilesHub, NOT SMTP)
4
+ >
5
+ > ✅ Server agent 2026-07-10: rows 1, 2, 3 CONFIRMED superseded and moved to Completed — prod is live
6
+ > (`/api/health` → 200 JSON), PHP 8.3.30 (≥8.3), both new migrations applied on prod MySQL. Row 8's
7
+ > `device_hash` half is verified DONE; row 8 now tracks ONLY the still-broken hPanel retention cron
8
+ > (owner/hPanel-UI action — the shell has no `crontab` access; see `docs/DEPLOY_NOTES.md`).
9
+
10
+ ## ⏳ Pending manual tasks
11
+
12
+ | # | Task | Why only you | Detail | Status |
13
+ |---|------|--------------|--------|--------|
14
+ | 4 | Deploy the Docusaurus docs site (`native-update-docs/`) | Needs Firebase Hosting auth | `cd native-update-docs && yarn build` → `yarn firebase:deploy`. Runbook: `native-update-docs/DEPLOY.md`. (This repo's marketing site + dashboard were deployed by the agent — see Completed.) | ☐ Not started |
15
+ | 5 | On-device OTA verification (Android + iOS) | Device-only; agent cannot run emulators/`cap run` | Per `docs/CLAUDE.md` Bundle/OTA Release Safety: test bundles on both platforms, verify checksum validation + rollback + background-update behavior before any live release. | ☐ Not started |
16
+ | 6 | Add the **Nova admin Google redirect URI** to the OAuth client | Needs Google Cloud Console access | Google Cloud Console → APIs & Services → Credentials → the OAuth 2.0 Client (`686131007016-…`) → **Authorized redirect URIs** → add BOTH `http://localhost:5946/admin/login/google/callback` (dev) and `https://nativeupdatebe.aoneahsan.com/admin/login/google/callback` (prod). Without it, admin sign-in returns Google's `redirect_uri_mismatch`. (The Nova admin panel is now **Google-only** — password login/reset removed; only admins can enter. `GOOGLE_ADMIN_REDIRECT_URI` already set in `.env`/`.env.example`.) | ☐ Not started |
17
+ | 8 | 🟠 **Fix the `schedule:run` hPanel cron + DELETE the `queue:work` cron** so the scheduler (and with it analytics cleanup + the queue worker) actually runs | hPanel UI only — no `crontab` binary in this CageFS shell | `device_hash` `VARCHAR(191)` half is **DONE + verified**. Still open: the crons error every minute (Hostinger passes `>/dev/null` as a literal arg). **Since 2026-07-13 only ONE cron is needed** — the scheduler now drives the queue worker itself (`routes/console.php`), so in **hPanel → Advanced → Cron Jobs**: fix `schedule:run` with the `/bin/sh -c "…"` form (exact line in the 2026-07-10 item of `docs/DEPLOY_NOTES.md`) and **delete the `queue:work` cron entirely**. Verify: arg-parse errors stop in `storage/logs/laravel-*.log`. | ☐ Not started (hPanel) |
18
+ | 10 | 🟡 **Run the pending FilesHub PROD migration** so `/emails/send` stops 503ing, then flip this app's prod `MAIL_MAILER=fileshub` | FilesHub prod server access (Hostinger) — owner/server-agent only | **Key DONE (agent, 2026-07-13):** the owner-provided `fh_live_…` key is in `~/.secrets/native-update/fileshub-api-key` + committed `backend/.env`; verified live — auth + `email` permission PASS (request reaches FilesHub's send pipeline). **Blocked on FilesHub's side:** prod `/api/v1/emails/send` throws `Unknown column 'email_attachments.updated_at'` → 503. The fix is ALREADY COMMITTED in the files-hub repo (migration `2026_07_03_100000_add_updated_at_to_email_attachments_table`, commit `af19905`) — it just needs `git pull` + `php artisan migrate --force` on the **FilesHub** prod app. Then: set this app's prod `FILESHUB_API_KEY` to the same key, `MAIL_MAILER=fileshub`, `php artisan config:cache`, and re-run the test-mail check (DEPLOY_NOTES 2026-07-13 item step 5). **Until then, prod stays on `MAIL_MAILER=log` — safe.** | ☐ FilesHub migrate pending |
19
+ | 7 | 🟡 Set **`GOOGLE_CLIENT_SECRET`** in the **prod** Hostinger `.env` (dev `.env` ✅ done by agent 2026-07-10) | Secret must be set on the server — needs Hostinger SSH/hPanel | **Dev done:** the rotated secret (`GOCSPX-RKrsCCFZP…`, the only working one after the old one was deleted in Google Cloud Console 2026-07-10) is now in committed `backend/.env` (private repo) and stored in `~/.secrets/native-update/google-oauth-client-secret` + `~/.secrets/INDEX.md`. **Still for you:** during the #1 Hostinger deploy, set the SAME `GOOGLE_CLIENT_SECRET=GOCSPX-RKrsCCFZP…` in the production `.env`, then `php artisan config:clear` (or re-cache). Without it, Google sign-in (admin + dashboard) fails token exchange with `client_secret is missing`. | ☐ Not started (prod only) |
20
+ | 9 | ✅ **Server deploy of the E2E-verification batch — DONE + verified 2026-07-10** (commits `d11cb50..682a211`) | — | Server agent pulled `main`, overlaid `backend/`, `composer install --no-dev`, applied both migrations (`apps.bundle_id` → `varchar(191) UNI`, `builds.status` enum gained `paused`), added the 3 `TEST_AUTH_*` vars to prod `.env`, rebuilt config/route/view cache. Verified live: `POST /api/auth/test-e2e/<slug>/login` with a wrong password → **401**, bogus slug → **404**. **Handed to the LOCAL agent:** run the full prod smoke (phase06.3 — create app → API key → update-check → analytics rows → cleanup) and close the feature. Residual server item: the hPanel crons → row 8. | ✅ Done (server) — local smoke pending |
21
+
22
+ ## ✅ Completed manual tasks
23
+
24
+ | Task | Done | Date |
25
+ |------|------|------|
26
+ | (#1) Production backend restored + live — `curl https://nativeupdatebe.aoneahsan.com/api/health` → 200 JSON (`{"status":"ok",…,"env":"production"}`) | verified by server agent | 2026-07-10 |
27
+ | (#2) Laravel 11→13 + spatie-permission 6→8 upgrade against prod MySQL — all migrations applied clean on prod DB; app serving | verified by server agent | 2026-07-10 |
28
+ | (#3) Production PHP ≥ 8.3 — `php -v` → **PHP 8.3.30** (Node not needed at runtime; Vite assets ship pre-built) | verified by server agent | 2026-07-10 |
29
+ | Publish `native-update@3.1.0` to npm (`npm view native-update version` → 3.1.0, tag `latest`) | by agent at user request | 2026-07-02 |
30
+ | Deploy marketing site + dashboard (`website/`) to Firebase Hosting (project `native-update`; live bundle `index-BgWyydoP.js`, immutable asset caching) | by agent at user request | 2026-07-02 |
@@ -1,8 +1,24 @@
1
1
  # Marketing Website - Progress Tracker
2
2
 
3
3
  **Created:** 2025-12-27
4
- **Last Updated:** 2025-12-27
5
- **Status:** 🔴 Not Started
4
+ **Last Updated:** 2025-12-27 (stale — see note below)
5
+ **Status:** 📦 SUPERSEDED
6
+
7
+ ---
8
+
9
+ ## ⚠️ Stale tracker — superseded as of 2026-05-11
10
+
11
+ This file is a **pre-launch planning artifact** from December 2025. It was never updated as features actually shipped. The 236 unchecked `[ ]` items below do NOT reflect the current state of the live website — most of them correspond to features that are already in production at https://nativeupdate.aoneahsan.com and in the `website/` directory of this repo.
12
+
13
+ **Where to look instead:**
14
+
15
+ - For genuine rendered-on-live-pages gaps as of 2026-05-11, see [docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md](./project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md). That file is the production-readiness audit Batch 9 deliverable.
16
+ - For the per-route SEO + indexing tracker, see [website/docs/tracking/seo-url-coverage.json](../website/docs/tracking/seo-url-coverage.json).
17
+ - For the website's run-history of SEO/AEO/AIO passes (3-day + commit-delta gated), see the `SEO / AEO / AIO Run History` table in [website/CLAUDE.md](../website/CLAUDE.md).
18
+
19
+ **Why this file is kept (not deleted):**
20
+
21
+ History reference only. Reading the items below is a useful "what did we plan vs what shipped" archaeology, especially when onboarding a contributor who wants to understand the project's early scope decisions. If you are chasing what is broken or missing TODAY, do not start here.
6
22
 
7
23
  ---
8
24
 
package/docs/MIGRATION.md CHANGED
@@ -1,5 +1,88 @@
1
1
  # Migration Guide
2
2
 
3
+ ## Upgrading v2 → v3.0.0
4
+
5
+ v3 narrows the plugin to a single, well-supported backend contract: the
6
+ hosted Native Update SaaS at `https://nativeupdate.aoneahsan.com`
7
+ (reference implementation: Laravel 11 + Nova 5 in `backend/`). The
8
+ direct-Firestore branch — `backendType: 'firestore'` plus the
9
+ `firestore: { … }` config — is removed, along with the
10
+ `src/firestore/` schema/client/manifest-reader/rules/indexes and the
11
+ `example-apps/firebase-backend/` example.
12
+
13
+ ### Why
14
+
15
+ The Firestore branch existed so apps could run without any server. In
16
+ practice it pushed a lot of operational work (security rules, indexes,
17
+ billing, Drive token storage) onto every consumer. The SaaS handles all
18
+ of it server-side, so the SDK only needs to know how to call one
19
+ backend.
20
+
21
+ ### Required action
22
+
23
+ #### 1. Drop `backendType` and `firestore` from your config
24
+
25
+ ```diff
26
+ await NativeUpdate.initialize({
27
+ - backendType: 'firestore',
28
+ - firestore: { projectId: '…', appId: 'com.your.app', channel: 'production' },
29
+ + serverUrl: 'https://api.nativeupdate.aoneahsan.com',
30
+ + apiKey: import.meta.env.VITE_NATIVE_UPDATE_API_KEY,
31
+ + publicKey: import.meta.env.VITE_NATIVE_UPDATE_PUBLIC_KEY,
32
+ appId: 'com.your.app',
33
+ channel: 'production',
34
+ });
35
+ ```
36
+
37
+ If you were running your own Firestore project for manifests, register
38
+ your app in the Native Update dashboard, generate an API key, and
39
+ switch to the HTTP config above. The dashboard mirrors every field
40
+ that previously lived in your Firestore manifest.
41
+
42
+ #### 2. Delete any direct Firestore reads from your app code
43
+
44
+ ```diff
45
+ - import { FirestoreConfig } from 'native-update';
46
+ ```
47
+
48
+ The plugin no longer exposes `FirestoreConfig`, `firestore-client`, or
49
+ `manifest-reader`. Update checks happen via
50
+ `NativeUpdate.checkForUpdate()` / `NativeUpdate.sync()`, which now
51
+ always speak HTTP to your configured `serverUrl`.
52
+
53
+ #### 3. Replace `firestore/schema` type imports
54
+
55
+ If you were importing rollout / device / update-check types, switch to
56
+ the new backend-neutral exports:
57
+
58
+ ```diff
59
+ - import type {
60
+ - RolloutConfig,
61
+ - RolloutTargetSegments,
62
+ - DeviceInfo,
63
+ - UpdateCheckResponse,
64
+ - } from 'native-update/firestore';
65
+ + import type {
66
+ + RolloutConfig,
67
+ + RolloutTargetSegments,
68
+ + DeviceInfo,
69
+ + UpdateCheckResponse,
70
+ + } from 'native-update';
71
+ ```
72
+
73
+ `FirestoreTimestamp` is replaced by `RolloutTimestamp` (`number |
74
+ string | Date`); a `toEpochMs()` helper handles all three forms.
75
+
76
+ ### Not affected
77
+
78
+ - Bundle download, verification, install, rollback, boot-time
79
+ re-verify, and crash-loop auto-rollback are unchanged.
80
+ - Native Android / iOS plugin code is unchanged.
81
+ - App store update checks (`AppUpdate`) and in-app review prompts
82
+ (`AppReview`) are unchanged.
83
+
84
+ ---
85
+
3
86
  ## Upgrading v1 → v2.0.0
4
87
 
5
88
  v2 is a security-focused hardening release with a handful of breaking
@@ -0,0 +1,167 @@
1
+ # Packages — Native Update
2
+
3
+ > Inventory of every package this project depends on and where it's used.
4
+ > Fixed path (all projects): docs/PACKAGES.md. Update on EVERY add/remove/upgrade.
5
+ > Last updated: 2026-06-19 | Fleet pass: 2026-06-19 (absolute-latest + Node ≥24.16.0; cooldown OFF)
6
+
7
+ ## package.json / composer.json units (in scope)
8
+
9
+ - `package.json` (root) — Published Capacitor plugin (`native-update`) + bundled CLI. Build: `tsc` → Rollup.
10
+ - `website/package.json` — React 19 + Vite 8 + Tailwind v4 + Radix marketing site + dashboard.
11
+ - `cli/package.json` (`native-update-cli`) — CLI shipped via the root `bin`; deps also resolve from root when published.
12
+ - `backend/package.json` — Laravel Vite asset build (JS tooling). `backend/composer.json` — Laravel 13 + Nova 5 (PHP).
13
+
14
+ **Out of scope:** `example-apps/**` (demo apps — fleet rule: skip), `backend/vendor/**` (Composer vendor).
15
+
16
+ **Engines:** every unit pins `node >=24.16.0` (user directive 2026-06-19). The published plugin therefore requires Node ≥24.16 in consumer toolchains. PHP floor raised to `^8.3` (Laravel 13).
17
+
18
+ ---
19
+
20
+ ## Root plugin (`native-update`)
21
+
22
+ ### Production deps — the bundled CLI's runtime deps (root `bin: cli/index.js`)
23
+ | Package | Version | Used where | Notes |
24
+ |---|---|---|---|
25
+ | archiver | ^8.0.0 | `cli/commands/bundle-create.js` | ZIP bundle creation |
26
+ | chalk | ^5.6.2 | `cli/index.js`, all `cli/commands/*.js` | Colored output |
27
+ | commander | ^15.0.0 | `cli/index.js` | CLI arg parsing (14→15; needs Node ≥22.12, OK under ≥24.16) |
28
+ | express | ^5.2.1 | `cli/commands/server-start.js` | Local test/manifest server |
29
+ | ora | ^9.4.0 | `cli/commands/{backend-create,monitor}.js` | Spinners |
30
+ | prompts | ^2.4.2 | `cli/commands/init.js` | Interactive init |
31
+
32
+ > Plugin TS (`src/**`) imports only `@capacitor/core`, `@capacitor/filesystem`, `@capacitor/preferences` — all Rollup `external`; core is the lone peer. Not bundled.
33
+
34
+ ### Dev deps
35
+ | Package | Version | Notes |
36
+ |---|---|---|
37
+ | @capacitor/app | ^8.1.0 | Capacitor 8 lockstep (referenced in src/build context) |
38
+ | @capacitor/core | ^8.4.1 | `src/**` peer + type-check |
39
+ | @capacitor/device | ^8.0.2 | Capacitor 8 lockstep |
40
+ | @capacitor/filesystem | ^8.1.2 | `src/**` (external) |
41
+ | @capacitor/preferences | ^8.0.1 | `src/**` (external) |
42
+ | @rollup/plugin-node-resolve | ^16.0.3 | `rollup.config.js` |
43
+ | @rollup/plugin-terser | ^1.0.0 | `rollup.config.js` |
44
+ | @types/node | ^26.0.0 | tsconfig node typings |
45
+ | @typescript-eslint/eslint-plugin · parser | ^8.61.1 | `eslint.config.js` |
46
+ | eslint | ^10.5.0 | `yarn lint` |
47
+ | prettier | ^3.8.4 | `yarn prettier` |
48
+ | rimraf | ^6.1.3 | `build`/`clean` scripts |
49
+ | rollup | ^4.62.0 | `build` |
50
+ | typescript | ^6.0.3 | `build`/`tsc` |
51
+
52
+ ### Peer deps
53
+ | Package | Version | Notes |
54
+ |---|---|---|
55
+ | @capacitor/core | ^8.0.1 | Provided by the consumer app |
56
+
57
+ ---
58
+
59
+ ## website/ (React 19 + Vite 8 + Tailwind v4)
60
+
61
+ ### Production deps
62
+ | Package | Version | Used where |
63
+ |---|---|---|
64
+ | @amplitude/analytics-browser | ^2.44.1 | `src/lib/analytics.ts` |
65
+ | @capacitor/android · cli · core · ios | ^8.4.1 | native build / `cap:sync` |
66
+ | @capacitor/motion | ^8.0.0 | `src/services/capacitor/motion.service.ts` |
67
+ | @capacitor/preferences | ^8.0.1 | token/theme storage |
68
+ | @capacitor/privacy-screen | ^2.0.1 | `src/services/capacitor/privacy-screen.service.ts` |
69
+ | @capacitor/share | ^8.0.1 | `src/services/capacitor/share.service.ts` |
70
+ | @capawesome/capacitor-app-shortcuts | ^8.0.1 | `src/services/capacitor/app-shortcuts.service.ts` |
71
+ | @hookform/resolvers | ^5.4.0 | RHF + Zod (UploadPage) |
72
+ | @microsoft/clarity | ^1.0.2 | `src/lib/errorTracking.ts` |
73
+ | @radix-ui/react-{dialog,icons,select,slider,slot,switch} | various | UI components |
74
+ | @sentry/react | ^10.58.0 | `src/lib/errorTracking.ts` |
75
+ | @tanstack/react-query | ^5.101.0 | `src/App.tsx` + hooks |
76
+ | @types/d3 | ^7.4.3 | type-only for `d3` (kept; see ambiguous) |
77
+ | axios | ^1.18.0 | `src/lib/api.ts` |
78
+ | class-variance-authority / clsx / tailwind-merge | — | UI utils |
79
+ | d3 | ^7.9.0 | `src/pages/ExamplesPage.tsx` |
80
+ | framer-motion | 12.40.0 | **PINNED exact** (see pins) |
81
+ | jszip | ^3.10.1 | `src/services/manifest-generator.ts` |
82
+ | lucide-react | ^1.21.0 | icons |
83
+ | react / react-dom | ^19.2.7 | app-wide |
84
+ | react-hook-form | ^7.79.0 | UploadPage |
85
+ | react-markdown / remark-gfm | — | DocsMarkdownPage |
86
+ | react-router-dom | ^7.18.0 | `src/router.tsx` |
87
+ | zod | ^4.4.3 | validation |
88
+ | zustand | ^5.0.14 | `src/stores/themeStore.ts` |
89
+
90
+ ### Dev deps
91
+ | Package | Version | Notes |
92
+ |---|---|---|
93
+ | @tailwindcss/vite | ^4.3.1 | `vite.config.ts` — the ONLY Tailwind path now |
94
+ | @trapezedev/configure | ^7.1.4 | `sync:apps-config` |
95
+ | @types/node | ^26.0.0 | `tsconfig.node.json` |
96
+ | @types/react · @types/react-dom | ^19.2.x | typings |
97
+ | @vitejs/plugin-react | ^6.0.2 | `vite.config.ts` |
98
+ | eslint + eslint-plugin-react-hooks + eslint-plugin-react-refresh + typescript-eslint + globals | — | lint |
99
+ | tailwindcss | ^4.3.1 | resolves `@import "tailwindcss"` |
100
+ | tsx | ^4.22.4 | runs `postbuild-seo.ts` (added so build doesn't `npx`-fetch) |
101
+ | typescript | ~6.0.3 | `tsc -b` (typecheck gate) |
102
+ | vite | ^8.0.16 | build/dev |
103
+
104
+ ---
105
+
106
+ ## cli/ (`native-update-cli`)
107
+ Now self-contained (previously declared only `commander`, but imports more):
108
+ | Package | Version | Used where |
109
+ |---|---|---|
110
+ | archiver ^8.0.0 · chalk ^5.6.2 · commander ^15.0.0 · express ^5.2.1 · ora ^9.4.0 · prompts ^2.4.2 | — | `cli/index.js` + `cli/commands/*.js` |
111
+
112
+ ---
113
+
114
+ ## backend/ — Composer (PHP, Laravel 13 + Nova 5)
115
+ | Package | Version | Notes |
116
+ |---|---|---|
117
+ | php | ^8.3 | raised from ^8.2 for Laravel 13 |
118
+ | laravel/framework | ^13.0 (13.16.1) | 11→13; fixes 3 security advisories (CRLF email / signed-URL) |
119
+ | laravel/nova | ^5.8 | supports Laravel 13 |
120
+ | laravel/sanctum | ^4.3 | dashboard bearer tokens |
121
+ | laravel/socialite | ^5.27 | Google OAuth |
122
+ | laravel/tinker | ^3.0 | 2→3 (needed for L13) |
123
+ | spatie/laravel-permission | ^8.0 | 6→8 — **RBAC: re-run migrations + Pest before deploy** |
124
+ | srmklive/paypal | ^3.1 | unlocked by L13 (was stuck at 3.0.40) |
125
+ | google/apiclient | ^2.15 | Drive API |
126
+ | phpunit/phpunit (dev) | ^12.0 | 11→12 |
127
+
128
+ ## backend/ — npm (Vite asset build)
129
+ | Package | Version | Notes |
130
+ |---|---|---|
131
+ | @tailwindcss/postcss + postcss | ^4.3.1 / ^8.5.15 | backend uses the postcss Tailwind path (no @tailwindcss/vite here) — KEPT |
132
+ | tailwindcss | ^4.3.1 | `tailwind.config.js` |
133
+ | axios | ^1.18.0 | `resources/js/bootstrap.js` |
134
+ | concurrently | ^10.0.3 | composer `dev` script — KEPT |
135
+ | laravel-vite-plugin | ^3.1.0 | `vite.config.js` |
136
+ | vite | ^8.0.16 | build/dev |
137
+
138
+ ---
139
+
140
+ ## Intentional pins / floors
141
+ | Item | Value | Reason |
142
+ |---|---|---|
143
+ | framer-motion | 12.40.0 exact (website) | Pre-existing exact pin; held to avoid animation-runtime regressions. |
144
+ | @capacitor/* | ^8.x (all units) | Capacitor major lockstep. |
145
+ | node engine | >=24.16.0 (all units) | User directive 2026-06-19 — unblocks commander@15 + latest majors. |
146
+ | php | ^8.3 (backend) | Laravel 13 minimum. |
147
+
148
+ ## Removed in cleanup
149
+ | Date | Package | unit | Why |
150
+ |---|---|---|---|
151
+ | 2026-06-19 | @capacitor/android, @capacitor/ios | root dev | A plugin's TS never imports native runtime packages (only core/filesystem/preferences); confirmed unused. |
152
+ | 2026-06-19 | @tailwindcss/postcss, postcss (+ `postcss.config.js`) | website dev | Redundant — Tailwind already runs via `@tailwindcss/vite`; the postcss path double-processed it. |
153
+ | 2026-06-18 | @rollup/plugin-json | root dev | Not used by `rollup.config.js`. |
154
+ | 2026-06-18 | 8× unused `@radix-ui/react-*` | website prod | No imports in `src/` (accordion, dropdown-menu, label, navigation-menu, scroll-area, separator, tabs, tooltip). |
155
+ | 2026-06-18 | autoprefixer | backend dev | Tailwind v4 handles prefixing. |
156
+
157
+ ## Ambiguous / kept
158
+ | Package | Why |
159
+ |---|---|
160
+ | @types/d3 (website) | Type-only; consumed implicitly for `d3`. Kept (lives in deps; left as-is). |
161
+
162
+ ## Build (re-measured 2026-06-19 — all <60s; outputs preserved)
163
+ The website's `tsc -b` was moved **out of `build`** into the `typecheck` gate (was the ~80s bottleneck), so the three checks are now independent and each green:
164
+ - **Root**: `yarn build` (rimraf + tsc + rollup) **~4s** · lint 0. Outputs: `dist/esm/**` + `plugin.{js,cjs.js,esm.js}` + `.d.ts` + sourcemaps.
165
+ - **website**: `yarn build` (sitemap + `vite build` + `tsx postbuild-seo`) **~4s** · `yarn typecheck` (`tsc -b`) **~10s** · lint 0. Outputs: 122 dist files, 17 HTML, 9 discovery files, sitemap/feed — preserved. (Removing the double-Tailwind processing also trimmed the vite step.)
166
+ - **cli**: no build step; verified `node cli/index.js --help` runs under commander@15.
167
+ - **backend**: `npx vite build` **~2s**; PHP boot verified (`route:list` 161 routes, `config:cache`/`view:cache` OK, Nova assets publish, `composer audit` clean).
@@ -0,0 +1,110 @@
1
+ # Performance
2
+
3
+ This document captures the SDK's performance characteristics — what's measured,
4
+ what the targets are, and where the hot paths live. It is the entry point for
5
+ anyone investigating a perf regression or considering an optimisation patch.
6
+
7
+ Real-device perf testing is out of scope here — that needs a separate
8
+ Maestro / XCTest harness and is on the roadmap.
9
+
10
+ Maintained by Ahsan Mahmood. Last review: 2026-05-11.
11
+
12
+ ## What dominates real-world OTA performance
13
+
14
+ For most apps, the user-visible latency between "release pushed" and "device
15
+ running the new code" is dominated by three things, in order:
16
+
17
+ 1. **Bundle download time** — completely network-bound. A 5 MB bundle on a
18
+ typical mobile connection takes ~10-30 seconds. The SDK's job here is to
19
+ not make it worse with extra round-trips or stalled retries.
20
+ 2. **The wait for the user's next app launch** — depending on the update
21
+ strategy, this is hours or days for `on-app-start`, minutes for
22
+ `on-app-resume`, and immediate for `immediate`. See [Update strategies
23
+ compared](https://docs.nativeupdate.aoneahsan.com/concepts/update-strategies-compared).
24
+ 3. **Server-side check latency** — typically ~50-200 ms when the backend is
25
+ warm. Cold-start backends (Firebase Functions, Cloud Run) can push this to
26
+ 2-5 seconds on the first request.
27
+
28
+ The SDK's compute work — checksum, signature verify, ZIP extraction, atomic
29
+ swap — is comparatively cheap. SHA-256 over 5 MB takes ~12 ms; RSA-SHA256
30
+ verify takes ~2 ms with RSA-2048; ZIP extraction is dominated by I/O. None
31
+ of these is the bottleneck unless something has gone wrong.
32
+
33
+ That priority ordering also dictates where optimisation effort pays off:
34
+ network-aware retry backoff > update-strategy selection > server warm-up >
35
+ compute path optimisation.
36
+
37
+ ## Microbenchmark targets
38
+
39
+ The compute-bound paths have the following calibration targets (MacBook M2,
40
+ Node 20.10, single-threaded):
41
+
42
+ | Operation | p50 target | p95 target | Notes |
43
+ |---|---|---|---|
44
+ | SHA-256 over 1 MB | ~2.5 ms | ~4 ms | Linear in bundle size. |
45
+ | SHA-256 over 5 MB | ~12 ms | ~18 ms | The common case for Capacitor bundles. |
46
+ | SHA-256 over 20 MB | ~50 ms | ~70 ms | Large bundles; consider asset CDN offload. |
47
+ | RSA-SHA256 verify (2048-bit, 5 MB) | ~2 ms | ~4 ms | Dominated by the SHA, not the asymmetric op. |
48
+ | RSA-SHA256 verify (4096-bit, 5 MB) | ~6 ms | ~10 ms | ~3x slower than 2048-bit verify. |
49
+
50
+ Real Android / iOS devices are typically 2-5x slower than the dev machine.
51
+ Tail devices (iOS 14-era, Android API 22-26) can be 8-10x slower. Plan
52
+ backend timeouts and SDK retry policies accordingly.
53
+
54
+ ## Regression workflow
55
+
56
+ If the compute paths show numbers >2x the calibration target on equivalent
57
+ hardware:
58
+
59
+ 1. **Re-measure on a quiet machine** to confirm the regression is real and not
60
+ noise from a busy machine.
61
+ 2. **Profile with `clinic.js`** against a small harness exercising the hot path.
62
+ The flame graph usually points at the regression directly.
63
+ 3. **Common culprits**:
64
+ - Streaming hash with too-small chunk sizes (each `update()` has overhead)
65
+ - PEM parsing in the verify hot loop instead of pre-parsing the key
66
+ - Allocations inside the loop (`Buffer.alloc()` per iteration)
67
+ - Crypto algorithm fallback to a slow polyfill
68
+ 4. **Fix** with the smallest possible patch. Re-run bench to confirm. PR
69
+ should include before/after numbers.
70
+
71
+ ## Hot paths in the SDK
72
+
73
+ For anyone optimising the plugin internals, here's the runtime map of where
74
+ CPU goes during a typical OTA update:
75
+
76
+ ```
77
+ sync() ← orchestration, no hot work
78
+ ├── checkForUpdate() ← one HTTP call, ~100 ms wall
79
+ ├── downloadUpdate()
80
+ │ ├── fetch(downloadUrl) ← network I/O, ~10-30 s
81
+ │ ├── SecurityValidator.verifyChecksum() ← ~12 ms for 5 MB
82
+ │ ├── SecurityValidator.verifySignature() ← ~2 ms for RSA-2048
83
+ │ └── ZIP extraction ← I/O dominated, ~100-500 ms
84
+ └── notifyAppReady() (later, next launch) ← O(1)
85
+ ```
86
+
87
+ The two checksum/signature steps run sequentially after the bundle hits
88
+ disk. They are the only places where compute time is measurable. ZIP
89
+ extraction is platform-native (java.util.zip on Android, NSFileManager
90
+ on iOS) and not exposed to optimisation from the TypeScript side.
91
+
92
+ ## What's NOT covered here
93
+
94
+ Real-device benchmarks (Android API ladder, iOS device matrix). The
95
+ microbenches measure Node performance, which differs from on-device
96
+ JavaScript engines (Hermes on Android, JavaScriptCore on iOS). Real-device
97
+ perf testing is a separate roadmap item.
98
+
99
+ Web-platform performance. The plugin's web target uses `SubtleCrypto` for
100
+ hashing and verification, which has its own perf profile. No web benches
101
+ exist today.
102
+
103
+ Memory profiling. The benches measure CPU time only. Memory pressure is
104
+ typically not an issue for the SDK (the largest allocation is the bundle
105
+ buffer during streaming), but a memory bench would be welcome — file an
106
+ issue if you want to contribute one.
107
+
108
+ ## Authored by
109
+
110
+ [Ahsan Mahmood](https://aoneahsan.com) — author and maintainer of `native-update`.
@@ -21,10 +21,8 @@ This document provides a comprehensive tracking of all project components, their
21
21
  | Example Applications | ✅ Complete | 100% |
22
22
  | Documentation | ✅ Complete | 100% |
23
23
  | Firebase Integration | ✅ Complete | 100% |
24
- | Unit Tests | ✅ Complete | 100% |
25
24
  | iOS Native Tests (XCTest) | ✅ Complete | 100% |
26
25
  | Android Native Tests (JUnit) | ✅ Complete | 100% |
27
- | E2E Tests (Detox) | ✅ Complete | 100% |
28
26
 
29
27
  **Overall:** Production ready with comprehensive test coverage.
30
28
 
@@ -273,21 +271,7 @@ This document provides a comprehensive tracking of all project components, their
273
271
 
274
272
  ## 10. Testing ✅ COMPLETE
275
273
 
276
- ### 10.1 TypeScript Unit Tests (`/src/__tests__/`)
277
-
278
- | Test File | Status |
279
- |-----------|--------|
280
- | `bundle-manager.test.ts` | ✅ Complete |
281
- | `config.test.ts` | ✅ Complete |
282
- | `delta-processor.test.ts` | ✅ Complete |
283
- | `firestore-schema.test.ts` | ✅ Complete |
284
- | `manifest-reader.test.ts` | ✅ Complete |
285
- | `rollout-checker.test.ts` | ✅ Complete |
286
- | `security.test.ts` | ✅ Complete |
287
- | `version-manager.test.ts` | ✅ Complete |
288
- | `integration.test.ts` | ✅ Complete |
289
-
290
- ### 10.2 iOS Native Tests (XCTest) ✅ IMPLEMENTED
274
+ ### 10.1 iOS Native Tests (XCTest) ✅ IMPLEMENTED
291
275
 
292
276
  | Test File | Tests | Status |
293
277
  |-----------|-------|--------|
@@ -300,7 +284,7 @@ This document provides a comprehensive tracking of all project components, their
300
284
 
301
285
  **Location:** `/ios/Tests/NativeUpdateTests/`
302
286
 
303
- ### 10.3 Android Native Tests (JUnit/Kotlin) ✅ IMPLEMENTED
287
+ ### 10.2 Android Native Tests (JUnit/Kotlin) ✅ IMPLEMENTED
304
288
 
305
289
  | Test File | Tests | Status |
306
290
  |-----------|-------|--------|
@@ -314,27 +298,13 @@ This document provides a comprehensive tracking of all project components, their
314
298
 
315
299
  **Location:** `/android/src/test/java/com/aoneahsan/nativeupdate/`
316
300
 
317
- ### 10.4 E2E Tests (Detox) ✅ IMPLEMENTED
318
-
319
- | Spec File | Tests | Status |
320
- |-----------|-------|--------|
321
- | `ota-update.e2e.spec.js` | 5 | ✅ Complete |
322
- | `download-progress.e2e.spec.js` | 5 | ✅ Complete |
323
- | `channel-switching.e2e.spec.js` | 5 | ✅ Complete |
324
- | `error-handling.e2e.spec.js` | 4 | ✅ Complete |
325
- | **Total** | **19 tests** | ✅ |
326
-
327
- **Location:** `/e2e/specs/`
328
-
329
- ### 10.5 Test Summary
301
+ ### 10.3 Test Summary
330
302
 
331
303
  | Category | Files | Tests | Status |
332
304
  |----------|-------|-------|--------|
333
- | TypeScript Unit Tests | 9 | ~30 | ✅ Complete |
334
305
  | iOS Native Tests | 5 | 32 | ✅ Complete |
335
306
  | Android Native Tests | 6 | 40 | ✅ Complete |
336
- | E2E Tests | 4 | 19 | ✅ Complete |
337
- | **Total** | **24** | **~121** | ✅ |
307
+ | **Total** | **11** | **72** | ✅ |
338
308
 
339
309
  ---
340
310
 
@@ -355,7 +325,6 @@ The delta processor (`/src/live-update/delta-processor.ts`) has a WASM placehold
355
325
  Native platform tests are fully implemented:
356
326
  - **iOS XCTest:** 5 test files with 32 tests in `/ios/Tests/NativeUpdateTests/`
357
327
  - **Android JUnit/Kotlin:** 6 test files with 40 tests in `/android/src/test/`
358
- - **E2E Detox:** 4 spec files with 19 tests in `/e2e/specs/`
359
328
 
360
329
  See `/docs/TESTING_REQUIREMENTS.md` for detailed test documentation.
361
330
 
package/docs/README.md CHANGED
@@ -6,7 +6,6 @@ Welcome to the comprehensive documentation for **Capacitor Native Update**, a co
6
6
 
7
7
  - Last reviewed: `2026-03-25`
8
8
  - Current package version: `1.4.9`
9
- - Test status: `yarn test:run` passed with 81 tests
10
9
  - Build status: `yarn build` passed
11
10
  - Root package manager: `yarn@4.10.3`
12
11
  - Root package workflow is Yarn-only and no longer shells out to npm or pnpm