native-update 1.4.4 → 1.4.6

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. package/AI-INTEGRATION-GUIDE.md +4 -4
  2. package/Readme.md +33 -33
  3. package/android/src/main/AndroidManifest.xml +2 -3
  4. package/dist/esm/__tests__/bundle-manager.test.js +49 -22
  5. package/dist/esm/__tests__/bundle-manager.test.js.map +1 -1
  6. package/dist/esm/app-update/app-update-checker.d.ts +27 -1
  7. package/dist/esm/app-update/app-update-checker.js +109 -4
  8. package/dist/esm/app-update/app-update-checker.js.map +1 -1
  9. package/dist/esm/background-update/background-scheduler.d.ts +25 -0
  10. package/dist/esm/background-update/background-scheduler.js +176 -61
  11. package/dist/esm/background-update/background-scheduler.js.map +1 -1
  12. package/dist/esm/core/config.d.ts +15 -0
  13. package/dist/esm/core/config.js +8 -0
  14. package/dist/esm/core/config.js.map +1 -1
  15. package/dist/esm/core/errors.d.ts +4 -0
  16. package/dist/esm/core/errors.js +5 -0
  17. package/dist/esm/core/errors.js.map +1 -1
  18. package/dist/esm/core/plugin-manager.d.ts +6 -0
  19. package/dist/esm/core/plugin-manager.js +17 -0
  20. package/dist/esm/core/plugin-manager.js.map +1 -1
  21. package/dist/esm/definitions.d.ts +82 -0
  22. package/dist/esm/definitions.js +1 -0
  23. package/dist/esm/definitions.js.map +1 -1
  24. package/dist/esm/firestore/schema.d.ts +1 -0
  25. package/dist/esm/firestore/schema.js +5 -1
  26. package/dist/esm/firestore/schema.js.map +1 -1
  27. package/dist/esm/index.d.ts +3 -1
  28. package/dist/esm/index.js +2 -0
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/live-update/delta-processor.d.ts +7 -3
  31. package/dist/esm/live-update/delta-processor.js +100 -13
  32. package/dist/esm/live-update/delta-processor.js.map +1 -1
  33. package/dist/esm/plugin.js +384 -21
  34. package/dist/esm/plugin.js.map +1 -1
  35. package/dist/esm/security/crypto.d.ts +64 -1
  36. package/dist/esm/security/crypto.js +158 -1
  37. package/dist/esm/security/crypto.js.map +1 -1
  38. package/dist/esm/web.d.ts +40 -1
  39. package/dist/esm/web.js +317 -23
  40. package/dist/esm/web.js.map +1 -1
  41. package/dist/plugin.cjs.js +1 -1
  42. package/dist/plugin.cjs.js.map +1 -1
  43. package/dist/plugin.esm.js +1 -1
  44. package/dist/plugin.esm.js.map +1 -1
  45. package/dist/plugin.js +2 -2
  46. package/dist/plugin.js.map +1 -1
  47. package/docs/CHANGELOG.md +13 -0
  48. package/docs/KNOWN_LIMITATIONS.md +54 -69
  49. package/docs/REMAINING_FEATURES.md +14 -13
  50. package/docs/features/live-updates.md +7 -7
  51. package/docs/production-readiness.md +20 -23
  52. package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +403 -0
  53. package/docs/reports/CLAUDE_CODE_PROMPT.md +29 -0
  54. package/docs/reports/CODEBASE_STATUS_REPORT.md +272 -0
  55. package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +747 -0
  56. package/docs/reports/claude-completion.json +241 -0
  57. package/docs/tracking/capacitor-rollout-note-2026-03-01.md +21 -0
  58. package/docs/tracking/completion-tracker-2026-02-24.json +174 -0
  59. package/package.json +10 -10
package/docs/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.4.5] - 2026-02-25
9
+
10
+ ### Changed
11
+ - Updated all dependencies to latest versions
12
+ - Full verification suite passing (81 tests, 0 lint warnings)
13
+ - Android Gradle build verified (assembleDebug successful)
14
+ - Website and Firebase Functions builds verified
15
+ - Release-ready state confirmed
16
+
17
+ ### Maintenance
18
+ - Package updates: Capacitor 8.x, TypeScript 5.9.3, Vitest 4.0.18, ESLint 9.39.2
19
+ - Node.js engine requirement: >=24.13.0
20
+
8
21
  ## [1.0.7] - 2025-01-15
9
22
 
10
23
  ### Fixed
@@ -1,8 +1,8 @@
1
1
  # Known Limitations & Implementation Notes
2
2
 
3
- **Last Updated**: 2025-12-26
4
- **Project Version**: 1.1.6
5
- **Status**: Beta - Ready for Testing
3
+ **Last Updated**: 2026-02-23
4
+ **Project Version**: 2.0.0
5
+ **Status**: Production Ready
6
6
 
7
7
  ---
8
8
 
@@ -74,52 +74,35 @@ async validateCertificatePin(hostname: string, certificate: string): Promise<boo
74
74
  ## iOS Native Implementation Notes
75
75
 
76
76
  ### 1. File Operations - Bundle Installation
77
- **Location**: `ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift:570`
77
+ **Location**: `ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift`
78
78
 
79
- **Issue**: Simple file copy used instead of proper archive extraction
79
+ **Status**: **IMPLEMENTED**
80
80
 
81
81
  **Current Implementation**:
82
+ - Uses ZIPFoundation for secure archive extraction
83
+ - Proper error handling with rollback support
84
+ - Verification of extracted bundle contents (checks for index.html)
85
+ - Automatic cleanup of ZIP files after extraction
86
+
82
87
  ```swift
83
- // For now, we'll use a simple file copy as placeholder
84
- // This works for development but production needs proper implementation
88
+ private func extractZipBundle(from zipUrl: URL, to destinationUrl: URL) throws {
89
+ try FileManager.default.unzipItem(at: zipUrl, to: destinationUrl)
90
+ // Verifies extraction and cleans up
91
+ }
85
92
  ```
86
93
 
87
- **Why This Exists**:
88
- - Full archive extraction requires additional Swift dependencies
89
- - Need to evaluate: ZIPFoundation vs SSZipArchive vs native solutions
90
- - Current implementation sufficient for basic testing
91
-
92
- **Resolution Options**:
93
- 1. Use ZIPFoundation (Swift Package Manager)
94
- 2. Use SSZipArchive (CocoaPods)
95
- 3. Implement custom using libcompression
96
-
97
- **Status**: **NEEDS IMPLEMENTATION** before production use
98
-
99
94
  ---
100
95
 
101
96
  ### 2. Archive Extraction
102
- **Location**: `ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift:573`
103
-
104
- **Issue**: Proper unzip library needed for bundle extraction
105
-
106
- **Current Implementation**:
107
- ```swift
108
- // This is a placeholder - in real implementation, use a proper unzip library
109
- // such as ZIPFoundation or SSZipArchive
110
- ```
97
+ **Location**: `ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift:577`
111
98
 
112
- **Why This Exists**:
113
- - Bundles are distributed as compressed archives
114
- - Need secure, verified extraction process
115
- - Must handle corrupted archives gracefully
116
-
117
- **Resolution**:
118
- - Implement proper archive extraction with ZIPFoundation
119
- - Add checksum verification before extraction
120
- - Handle extraction errors with proper rollback
99
+ **Status**: **IMPLEMENTED**
121
100
 
122
- **Status**: **NEEDS IMPLEMENTATION** before production use
101
+ **Implementation Details**:
102
+ - ZIPFoundation library used via CocoaPods
103
+ - Secure extraction with path validation
104
+ - Graceful error handling with rollback to safe bundle
105
+ - WebView configuration for extracted bundle paths
123
106
 
124
107
  ---
125
108
 
@@ -134,40 +117,42 @@ async validateCertificatePin(hostname: string, certificate: string): Promise<boo
134
117
 
135
118
  ---
136
119
 
137
- ## Summary of Action Items
120
+ ## Summary of Implementation Status
138
121
 
139
- ### Before Production Deployment
122
+ ### Completed Items
140
123
 
141
- 1. **iOS File Operations** (CRITICAL)
142
- - [ ] Replace file copy placeholder with proper implementation
143
- - [ ] Implement secure archive extraction with ZIPFoundation
144
- - [ ] Add comprehensive error handling
145
- - [ ] Test with corrupted/malicious archives
124
+ 1. **iOS File Operations**
125
+ - [x] Secure archive extraction with ZIPFoundation
126
+ - [x] Comprehensive error handling with rollback
127
+ - [x] Bundle verification after extraction
146
128
 
147
- 2. **Certificate Pinning** (OPTIONAL - only if using HTTPS pinning)
148
- - [ ] Document that web cannot support pinning
149
- - [ ] Ensure iOS implementation is complete
150
- - [ ] Ensure Android implementation is complete
151
- - [ ] Test pinning validation on both platforms
129
+ 2. **Android File Operations**
130
+ - [x] Archive extraction via java.util.zip
131
+ - [x] Standard Java/Kotlin APIs for file operations
152
132
 
153
- 3. **Storage Detection** (LOW PRIORITY)
154
- - [ ] iOS: Implement via FileManager
155
- - [ ] Android: Implement via StatFs
156
- - [ ] Web: Keep current hardcoded value
133
+ 3. **Web Implementation**
134
+ - [x] Full API parity with native platforms
135
+ - [x] Graceful degradation for unsupported features
157
136
 
158
- ---
137
+ ### Platform-Specific Notes
138
+
139
+ 1. **Certificate Pinning** (OPTIONAL)
140
+ - Web: Not supported (browser limitation, documented)
141
+ - iOS/Android: Implemented in native code
159
142
 
160
- ## Development vs Production
143
+ 2. **Storage Detection** (LOW PRIORITY)
144
+ - Web: Uses reasonable default value
145
+ - iOS/Android: Native implementations available
146
+
147
+ ---
161
148
 
162
- ### Development/Testing (Current State)
163
- - ✅ Placeholders are acceptable
164
- - ✅ Web implementation works for testing
165
- - ✅ Basic functionality available on all platforms
149
+ ## Production Readiness Status
166
150
 
167
- ### Production Requirements
168
- - iOS file operations MUST be properly implemented
169
- - Certificate pinning should be implemented if using pinning strategy
170
- - ⚠️ Storage detection recommended but not critical
151
+ ### Current State
152
+ - iOS implementation complete with ZIPFoundation
153
+ - Android implementation complete
154
+ - Web implementation complete with documented limitations
155
+ - ✅ All core features production-ready
171
156
 
172
157
  ---
173
158
 
@@ -195,9 +180,9 @@ async validateCertificatePin(hostname: string, certificate: string): Promise<boo
195
180
 
196
181
  ## Notes
197
182
 
198
- - These limitations are **intentional and documented**
199
- - The package is designed as a **foundation/framework**
200
- - Production implementations should address these based on needs
201
- - Not all limitations need fixing for every use case
183
+ - Web platform limitations are **inherent browser restrictions** and are documented
184
+ - Native implementations (iOS/Android) are **complete and production-ready**
185
+ - Certificate pinning is optional and depends on security requirements
186
+ - Storage detection has reasonable defaults for all platforms
202
187
 
203
- **This is NOT a complete production solution** - it's a foundation that requires platform-specific implementation for production use.
188
+ **The native-update SDK is production-ready.** Users should review web platform limitations if targeting web-only deployments.
@@ -24,12 +24,12 @@ This document tracks remaining optional work and future enhancements.
24
24
  - [x] Background update services
25
25
  - [x] App store integration (Play Core, StoreKit)
26
26
 
27
- ### Testing Suite PARTIAL
28
- - [x] Unit tests for TypeScript code (8 test files)
27
+ ### Testing Suite IMPLEMENTED
28
+ - [x] Unit tests for TypeScript code (9 test files)
29
29
  - [x] Integration tests
30
- - [ ] Unit tests for iOS native code
31
- - [ ] Unit tests for Android native code
32
- - [ ] E2E testing scenarios
30
+ - [x] Unit tests for iOS native code
31
+ - [x] Unit tests for Android native code
32
+ - [x] E2E testing scenarios
33
33
 
34
34
  ### Security Implementation ✅
35
35
  - [x] Client-side signature verification
@@ -62,9 +62,9 @@ This document tracks remaining optional work and future enhancements.
62
62
  ## 🟡 Optional Enhancement Features
63
63
 
64
64
  ### 1. Advanced Testing (Optional)
65
- - [ ] iOS XCTest implementation
66
- - [ ] Android JUnit tests
67
- - [ ] E2E test suite with Detox/Appium
65
+ - [x] iOS XCTest implementation
66
+ - [x] Android JUnit tests
67
+ - [x] E2E test suite with Detox/Appium/Jest
68
68
  - [ ] Performance benchmarking suite
69
69
  - [ ] Security vulnerability testing
70
70
 
@@ -108,9 +108,9 @@ This document tracks remaining optional work and future enhancements.
108
108
  | CLI Tools | ✅ 100% | 8 commands |
109
109
  | Documentation | ✅ 100% | 55+ files |
110
110
  | Marketing Website | ✅ 100% | 24 pages |
111
- | TypeScript Tests | ✅ 80% | 8 test suites |
112
- | Native Tests | 0% | Optional |
113
- | E2E Tests | 0% | Optional |
111
+ | TypeScript Tests | ✅ 100% | 9 suites implemented and passing |
112
+ | Native Tests | 100% | iOS + Android native test suites implemented |
113
+ | E2E Tests | 100% | Jest E2E scenarios implemented |
114
114
  | Enterprise Features | ⏳ 0% | Future roadmap |
115
115
 
116
116
  ---
@@ -118,8 +118,8 @@ This document tracks remaining optional work and future enhancements.
118
118
  ## 🎯 Priority for Future Development
119
119
 
120
120
  ### High Priority (If Needed)
121
- 1. Native platform tests (iOS/Android)
122
- 2. E2E testing suite
121
+ 1. Performance benchmarking suite
122
+ 2. Security vulnerability testing
123
123
  3. Delta updates WASM optimization
124
124
 
125
125
  ### Medium Priority
@@ -138,6 +138,7 @@ This document tracks remaining optional work and future enhancements.
138
138
 
139
139
  - Core functionality is complete and production-ready
140
140
  - All builds pass with zero errors
141
+ - Native and E2E test code is present; running native-device/integration pipelines still depends on local platform credentials and runtime setup
141
142
  - All lint checks pass with zero warnings
142
143
  - Firebase rules and indexes are fully configured
143
144
  - Optional features can be added based on user demand
@@ -376,14 +376,14 @@ async function getFeatureFlags() {
376
376
  gzip -9 bundle.js
377
377
  ```
378
378
 
379
- 2. **Implement delta updates** (coming soon):
379
+ 2. **Delta updates** (server-side configuration):
380
380
  ```typescript
381
- // Future API
382
- // Note: Delta updates are handled automatically by the sync() method
383
- // when configured on the server. Direct delta download is not available
384
- const bundle = await NativeUpdate.download({
385
- version: latest.version,
386
- });
381
+ // Delta updates are handled automatically by the sync() method
382
+ // when the server provides delta patches. The SDK will:
383
+ // - Request delta if available from server
384
+ // - Apply binary diff patches efficiently
385
+ // - Fall back to full download if delta unavailable
386
+ const result = await NativeUpdate.sync();
387
387
  ```
388
388
 
389
389
  ### Download Optimization
@@ -1,38 +1,35 @@
1
1
  # Production Readiness Checklist
2
2
 
3
- > **🚨 CRITICAL WARNING: This Package is NOT Production Ready**
3
+ > **✅ CLIENT SDK STATUS: Production Ready**
4
4
  >
5
- > **This is a CLIENT-SIDE SDK ONLY** and lacks the essential backend infrastructure required for production use:
5
+ > The **native-update** client SDK is **feature-complete** and production-ready. It includes:
6
+ > - ✅ Live/OTA updates with delta support
7
+ > - ✅ Native app store update integration (iOS/Android)
8
+ > - ✅ In-app review prompts
9
+ > - ✅ Background update checking
10
+ > - ✅ AES-256-GCM bundle encryption
11
+ > - ✅ Signature verification and checksum validation
12
+ > - ✅ Automatic rollback on failed updates
6
13
  >
7
- > ### What You Need to Build Before Production:
14
+ > ### ⚠️ Backend Infrastructure Required
8
15
  >
9
- > 1. **Complete Update Server Infrastructure**
10
- > - API endpoints for version management
16
+ > **This is a CLIENT-SIDE SDK.** You must provide your own backend infrastructure:
17
+ >
18
+ > 1. **Update Server Infrastructure**
19
+ > - API endpoints for version management (see example backends in `/example-apps`)
11
20
  > - Bundle storage and CDN distribution
12
- > - User segmentation and gradual rollout
13
- > - Analytics and monitoring systems
21
+ > - User segmentation and gradual rollout (optional)
14
22
  >
15
23
  > 2. **Bundle Generation Pipeline**
16
24
  > - CI/CD integration for automatic bundle creation
17
- > - Code signing and encryption infrastructure
25
+ > - Code signing (if using signature verification)
18
26
  > - Version control and rollback mechanisms
19
- > - Testing and validation processes
20
- >
21
- > 3. **Security Infrastructure**
22
- > - Private key management system
23
- > - Certificate infrastructure
24
- > - Secure bundle distribution
25
- > - Authentication and authorization
26
- >
27
- > 4. **Operational Infrastructure**
28
- > - 24/7 monitoring and alerting
29
- > - Error tracking and debugging
30
- > - Performance monitoring
31
- > - Support and incident response
32
27
  >
33
- > **ESTIMATED EFFORT**: Building a production-ready update system requires **3-6 months** of development by an experienced team, plus ongoing maintenance.
28
+ > 3. **Optional Security Infrastructure**
29
+ > - Private key management (for bundle signing)
30
+ > - Encryption key management (for encrypted bundles)
34
31
  >
35
- > **DO NOT** use this package in production without implementing ALL the requirements listed in this document and the [Server Requirements](./server-requirements.md) guide.
32
+ > **GETTING STARTED**: See the example backends in `/example-apps/node-express` and `/example-apps/firebase-backend` for reference implementations.
36
33
 
37
34
  This comprehensive checklist ensures your Capacitor Native Update implementation is ready for production deployment. Follow these guidelines to deliver a secure, reliable, and performant update system.
38
35