native-update 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +36 -22
- package/docs/CHANGELOG.md +168 -0
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +384 -0
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +390 -0
- package/docs/MARKETING_WEBSITE_PLAN.md +659 -0
- package/docs/MARKETING_WEBSITE_TRACKER.md +661 -0
- package/docs/ROADMAP.md +143 -0
- package/docs/SECURITY.md +356 -0
- package/docs/api/API.md +557 -0
- package/docs/api/FEATURES.md +414 -0
- package/docs/guides/key-management.md +1 -1
- package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +361 -0
- package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +401 -0
- package/docs/plans/TASK_2_API_ENDPOINTS.md +856 -0
- package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +820 -0
- package/docs/plans/TASK_2_DATABASE_SCHEMA.md +704 -0
- package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +646 -0
- package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +587 -0
- package/docs/plans/TASK_2_USER_AUTHENTICATION.md +600 -0
- package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +203 -0
- package/docs/reports/COMPLETE_VERIFICATION.md +106 -0
- package/docs/reports/EVENT_FLOW_VERIFICATION.md +80 -0
- package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +369 -0
- package/docs/reports/FINAL_STATUS.md +122 -0
- package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +425 -0
- package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +466 -0
- package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +130 -0
- package/docs/reports/PRODUCTION_STATUS.md +115 -0
- package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +287 -0
- package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +464 -0
- package/docs/reports/PUBLISHING_VERIFICATION.md +144 -0
- package/docs/reports/RELEASE_READY_SUMMARY.md +99 -0
- package/docs/tracking/IMPLEMENTATION_TRACKER.md +303 -0
- package/package.json +2 -3
- package/backend-template/README.md +0 -56
- package/backend-template/package.json +0 -20
- package/backend-template/server.js +0 -121
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# Task 1: pnpm Workspace Verification & Android Example App
|
|
2
|
+
|
|
3
|
+
**Created:** 2025-12-27
|
|
4
|
+
**Status:** 📝 Planning
|
|
5
|
+
**Estimated Time:** 2-3 hours
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Objectives
|
|
10
|
+
|
|
11
|
+
1. **Verify pnpm workspace** is functioning correctly for the monorepo
|
|
12
|
+
2. **Add Android project** to `example-apps/react-capacitor/` example app
|
|
13
|
+
3. **Test the plugin** works properly on Android
|
|
14
|
+
4. **Document the setup** for future reference
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📋 Phase 1: pnpm Workspace Verification
|
|
19
|
+
|
|
20
|
+
### 1.1 What to Verify
|
|
21
|
+
|
|
22
|
+
**Workspace Configuration:**
|
|
23
|
+
- Verify `pnpm-workspace.yaml` is correctly configured
|
|
24
|
+
- Confirm all packages are listed: `'.'`, `'example-apps/*'`, `'cli'`, `'website'`
|
|
25
|
+
|
|
26
|
+
**Package References:**
|
|
27
|
+
- Verify example apps use `"native-update": "workspace:*"`
|
|
28
|
+
- Confirm workspace references resolve correctly
|
|
29
|
+
- Test that changes in plugin are immediately available in examples
|
|
30
|
+
|
|
31
|
+
**Installation:**
|
|
32
|
+
- Run `pnpm install` at root and verify all packages install
|
|
33
|
+
- Check no duplicate dependencies across workspace
|
|
34
|
+
- Verify hoisting works correctly
|
|
35
|
+
|
|
36
|
+
### 1.2 Verification Steps
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Step 1: Check workspace config
|
|
40
|
+
cat pnpm-workspace.yaml
|
|
41
|
+
|
|
42
|
+
# Step 2: Verify package references
|
|
43
|
+
grep -r "workspace:\*" example-apps/*/package.json
|
|
44
|
+
|
|
45
|
+
# Step 3: Fresh install
|
|
46
|
+
rm -rf node_modules example-apps/*/node_modules website/node_modules
|
|
47
|
+
pnpm install
|
|
48
|
+
|
|
49
|
+
# Step 4: Build plugin
|
|
50
|
+
pnpm run build
|
|
51
|
+
|
|
52
|
+
# Step 5: Verify example apps can import plugin
|
|
53
|
+
cd example-apps/react-capacitor
|
|
54
|
+
pnpm run dev # Should import native-update without errors
|
|
55
|
+
|
|
56
|
+
# Step 6: Make a change in plugin and verify it reflects
|
|
57
|
+
# Edit src/index.ts, rebuild, check if example app sees change
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 1.3 Expected Results
|
|
61
|
+
|
|
62
|
+
- ✅ All packages install with single `pnpm install` command
|
|
63
|
+
- ✅ Example apps can import `native-update` without errors
|
|
64
|
+
- ✅ Changes in plugin source immediately available in examples after rebuild
|
|
65
|
+
- ✅ No duplicate dependencies
|
|
66
|
+
- ✅ Workspace structure clean and optimized
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 📋 Phase 2: Android Project Setup
|
|
71
|
+
|
|
72
|
+
### 2.1 Current State Analysis
|
|
73
|
+
|
|
74
|
+
**Current example-apps/react-capacitor structure:**
|
|
75
|
+
```
|
|
76
|
+
example-apps/react-capacitor/
|
|
77
|
+
├── src/
|
|
78
|
+
│ ├── App.tsx (135 lines - OTA demo)
|
|
79
|
+
│ ├── App.css
|
|
80
|
+
│ └── main.tsx
|
|
81
|
+
├── public/
|
|
82
|
+
├── package.json
|
|
83
|
+
├── vite.config.ts
|
|
84
|
+
├── tsconfig.json
|
|
85
|
+
└── README.md
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Missing:**
|
|
89
|
+
- ❌ Android project folder
|
|
90
|
+
- ❌ Capacitor Android configuration
|
|
91
|
+
- ❌ capacitor.config.ts (might exist but needs verification)
|
|
92
|
+
|
|
93
|
+
### 2.2 Android Project Structure (Target)
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
example-apps/react-capacitor/
|
|
97
|
+
├── android/ # NEW - Android project
|
|
98
|
+
│ ├── app/
|
|
99
|
+
│ │ ├── src/
|
|
100
|
+
│ │ │ └── main/
|
|
101
|
+
│ │ │ ├── AndroidManifest.xml
|
|
102
|
+
│ │ │ ├── java/com/example/nativeupdate/
|
|
103
|
+
│ │ │ │ └── MainActivity.java
|
|
104
|
+
│ │ │ └── res/
|
|
105
|
+
│ │ │ ├── values/
|
|
106
|
+
│ │ │ │ ├── strings.xml
|
|
107
|
+
│ │ │ │ └── styles.xml
|
|
108
|
+
│ │ │ └── (other resources)
|
|
109
|
+
│ │ ├── build.gradle
|
|
110
|
+
│ │ └── proguard-rules.pro
|
|
111
|
+
│ ├── build.gradle
|
|
112
|
+
│ ├── gradle.properties
|
|
113
|
+
│ ├── settings.gradle
|
|
114
|
+
│ └── variables.gradle
|
|
115
|
+
├── capacitor.config.ts # Configure for Android
|
|
116
|
+
├── src/
|
|
117
|
+
├── public/
|
|
118
|
+
└── package.json
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 2.3 Implementation Steps
|
|
122
|
+
|
|
123
|
+
#### Step 1: Install Capacitor (if not already)
|
|
124
|
+
```bash
|
|
125
|
+
cd example-apps/react-capacitor
|
|
126
|
+
|
|
127
|
+
# Check if Capacitor is installed
|
|
128
|
+
pnpm list @capacitor/core @capacitor/cli
|
|
129
|
+
|
|
130
|
+
# If not, install
|
|
131
|
+
pnpm add @capacitor/core @capacitor/cli
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Step 2: Initialize Capacitor (if not done)
|
|
135
|
+
```bash
|
|
136
|
+
# Check if capacitor.config.ts exists
|
|
137
|
+
# If not, initialize:
|
|
138
|
+
npx cap init "Native Update Example" "com.aoneahsan.nativeupdate.example" --web-dir=dist
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Step 3: Add Android Platform
|
|
142
|
+
```bash
|
|
143
|
+
# Add Android platform
|
|
144
|
+
npx cap add android
|
|
145
|
+
|
|
146
|
+
# This creates android/ folder with full project structure
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### Step 4: Configure capacitor.config.ts
|
|
150
|
+
```typescript
|
|
151
|
+
import { CapacitorConfig } from '@capacitor/cli';
|
|
152
|
+
|
|
153
|
+
const config: CapacitorConfig = {
|
|
154
|
+
appId: 'com.aoneahsan.nativeupdate.example',
|
|
155
|
+
appName: 'Native Update Example',
|
|
156
|
+
webDir: 'dist',
|
|
157
|
+
server: {
|
|
158
|
+
androidScheme: 'https'
|
|
159
|
+
},
|
|
160
|
+
plugins: {
|
|
161
|
+
NativeUpdate: {
|
|
162
|
+
// Plugin-specific configuration
|
|
163
|
+
serverUrl: 'http://localhost:3000', // Example backend
|
|
164
|
+
autoCheck: true,
|
|
165
|
+
channel: 'development'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default config;
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### Step 5: Configure Android Build
|
|
174
|
+
Update `android/variables.gradle`:
|
|
175
|
+
```gradle
|
|
176
|
+
ext {
|
|
177
|
+
minSdkVersion = 22
|
|
178
|
+
compileSdkVersion = 34
|
|
179
|
+
targetSdkVersion = 34
|
|
180
|
+
androidxActivityVersion = '1.8.0'
|
|
181
|
+
androidxAppCompatVersion = '1.6.1'
|
|
182
|
+
androidxCoordinatorLayoutVersion = '1.2.0'
|
|
183
|
+
androidxCoreVersion = '1.12.0'
|
|
184
|
+
androidxFragmentVersion = '1.6.2'
|
|
185
|
+
coreSplashScreenVersion = '1.0.1'
|
|
186
|
+
androidxWebkitVersion = '1.9.0'
|
|
187
|
+
junitVersion = '4.13.2'
|
|
188
|
+
androidxJunitVersion = '1.1.5'
|
|
189
|
+
androidxEspressoCoreVersion = '3.5.1'
|
|
190
|
+
cordovaAndroidVersion = '10.1.1'
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### Step 6: Link native-update Plugin to Android
|
|
195
|
+
|
|
196
|
+
Update `android/app/build.gradle`:
|
|
197
|
+
```gradle
|
|
198
|
+
dependencies {
|
|
199
|
+
// ... existing dependencies
|
|
200
|
+
|
|
201
|
+
// Native Update Plugin
|
|
202
|
+
implementation project(':native-update')
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Update `android/settings.gradle`:
|
|
207
|
+
```gradle
|
|
208
|
+
include ':app'
|
|
209
|
+
include ':native-update'
|
|
210
|
+
project(':native-update').projectDir = new File('../../../android')
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
#### Step 7: Sync Capacitor Config
|
|
214
|
+
```bash
|
|
215
|
+
# Sync web assets and config to Android
|
|
216
|
+
npx cap sync android
|
|
217
|
+
|
|
218
|
+
# Or copy manually
|
|
219
|
+
npx cap copy android
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Step 8: Build Web Assets First
|
|
223
|
+
```bash
|
|
224
|
+
# Build React app
|
|
225
|
+
pnpm run build
|
|
226
|
+
|
|
227
|
+
# This creates dist/ folder that Android will load
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### Step 9: Open in Android Studio (Optional for verification)
|
|
231
|
+
```bash
|
|
232
|
+
npx cap open android
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### Step 10: Build Android APK
|
|
236
|
+
```bash
|
|
237
|
+
# Debug build
|
|
238
|
+
cd android
|
|
239
|
+
./gradlew assembleDebug
|
|
240
|
+
|
|
241
|
+
# Output: android/app/build/outputs/apk/debug/app-debug.apk
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 2.4 Testing Checklist
|
|
245
|
+
|
|
246
|
+
- [ ] Android project builds successfully
|
|
247
|
+
- [ ] No Gradle errors
|
|
248
|
+
- [ ] APK file generated
|
|
249
|
+
- [ ] App installs on Android device/emulator
|
|
250
|
+
- [ ] Web content loads correctly
|
|
251
|
+
- [ ] native-update plugin accessible from JavaScript
|
|
252
|
+
- [ ] Plugin methods callable (test with console logs)
|
|
253
|
+
- [ ] OTA update flow testable
|
|
254
|
+
|
|
255
|
+
### 2.5 Common Issues & Solutions
|
|
256
|
+
|
|
257
|
+
**Issue 1: Gradle version mismatch**
|
|
258
|
+
- Solution: Use Gradle 8.0+ and Android Gradle Plugin 8.0+
|
|
259
|
+
- Update `android/build.gradle` and `android/gradle/wrapper/gradle-wrapper.properties`
|
|
260
|
+
|
|
261
|
+
**Issue 2: SDK not found**
|
|
262
|
+
- Solution: Install Android SDK via Android Studio
|
|
263
|
+
- Set `ANDROID_HOME` environment variable
|
|
264
|
+
|
|
265
|
+
**Issue 3: Plugin not found**
|
|
266
|
+
- Solution: Verify settings.gradle includes plugin project
|
|
267
|
+
- Check path to plugin's Android implementation
|
|
268
|
+
|
|
269
|
+
**Issue 4: Web assets not loading**
|
|
270
|
+
- Solution: Run `pnpm run build` before `npx cap sync`
|
|
271
|
+
- Verify `webDir: 'dist'` in capacitor.config.ts
|
|
272
|
+
|
|
273
|
+
**Issue 5: CORS errors when testing**
|
|
274
|
+
- Solution: Use `server.androidScheme: 'https'` in config
|
|
275
|
+
- Backend needs to allow requests from Android app
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 📋 Phase 3: Documentation Updates
|
|
280
|
+
|
|
281
|
+
### 3.1 Update example-apps/react-capacitor/README.md
|
|
282
|
+
|
|
283
|
+
Add sections:
|
|
284
|
+
|
|
285
|
+
**Android Setup:**
|
|
286
|
+
```markdown
|
|
287
|
+
## Android Setup
|
|
288
|
+
|
|
289
|
+
### Prerequisites
|
|
290
|
+
- Node.js 24+
|
|
291
|
+
- pnpm 9+
|
|
292
|
+
- Android Studio
|
|
293
|
+
- Android SDK (API 34)
|
|
294
|
+
- Java JDK 17+
|
|
295
|
+
|
|
296
|
+
### Build for Android
|
|
297
|
+
|
|
298
|
+
1. Install dependencies:
|
|
299
|
+
```bash
|
|
300
|
+
pnpm install
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
2. Build web assets:
|
|
304
|
+
```bash
|
|
305
|
+
pnpm run build
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
3. Sync to Android:
|
|
309
|
+
```bash
|
|
310
|
+
npx cap sync android
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
4. Open in Android Studio:
|
|
314
|
+
```bash
|
|
315
|
+
npx cap open android
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
5. Run on device/emulator from Android Studio
|
|
319
|
+
|
|
320
|
+
### Build APK
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
cd android
|
|
324
|
+
./gradlew assembleDebug
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Output: `android/app/build/outputs/apk/debug/app-debug.apk`
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### 3.2 Update Root README.md
|
|
331
|
+
|
|
332
|
+
Add Android example info:
|
|
333
|
+
```markdown
|
|
334
|
+
### Example Apps
|
|
335
|
+
|
|
336
|
+
- **react-capacitor**: React + Capacitor frontend (Web + Android)
|
|
337
|
+
- **node-express**: Node.js backend
|
|
338
|
+
- **firebase-backend**: Firebase Functions backend
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### 3.3 Update CLAUDE.md
|
|
342
|
+
|
|
343
|
+
Add Android project status:
|
|
344
|
+
```markdown
|
|
345
|
+
## Example Apps Structure
|
|
346
|
+
- react-capacitor: ✅ Web + Android
|
|
347
|
+
- node-express: ✅ Backend server
|
|
348
|
+
- firebase-backend: ✅ Cloud Functions
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## ✅ Definition of Done
|
|
354
|
+
|
|
355
|
+
### Task 1.1: pnpm Workspace Verification
|
|
356
|
+
- [x] pnpm workspace config verified
|
|
357
|
+
- [x] workspace:* references work correctly
|
|
358
|
+
- [x] Single pnpm install installs all packages
|
|
359
|
+
- [x] Changes in plugin reflect in examples
|
|
360
|
+
- [x] No dependency conflicts
|
|
361
|
+
|
|
362
|
+
### Task 1.2: Android Project
|
|
363
|
+
- [x] Android project created in react-capacitor
|
|
364
|
+
- [x] capacitor.config.ts configured
|
|
365
|
+
- [x] Android builds successfully (debug APK)
|
|
366
|
+
- [x] App runs on Android device/emulator
|
|
367
|
+
- [x] Web content loads correctly
|
|
368
|
+
- [x] native-update plugin is accessible
|
|
369
|
+
- [x] Zero build errors/warnings
|
|
370
|
+
|
|
371
|
+
### Task 1.3: Documentation
|
|
372
|
+
- [x] react-capacitor README updated with Android instructions
|
|
373
|
+
- [x] Root README updated
|
|
374
|
+
- [x] CLAUDE.md updated
|
|
375
|
+
- [x] Common issues documented
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 📊 Success Metrics
|
|
380
|
+
|
|
381
|
+
- ✅ `pnpm install` completes in <2 minutes
|
|
382
|
+
- ✅ Android build completes in <5 minutes
|
|
383
|
+
- ✅ APK size < 50MB (debug build)
|
|
384
|
+
- ✅ App launches in <3 seconds
|
|
385
|
+
- ✅ Zero build warnings
|
|
386
|
+
- ✅ Zero runtime errors in console
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 🔄 Next Steps After Completion
|
|
391
|
+
|
|
392
|
+
1. Test OTA update flow on Android
|
|
393
|
+
2. Add iOS project (future task)
|
|
394
|
+
3. Create Android-specific documentation
|
|
395
|
+
4. Add Android screenshots to marketing website
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
**Plan Status:** ✅ Complete and ready for implementation
|
|
400
|
+
**Estimated Implementation Time:** 2-3 hours
|
|
401
|
+
**Priority:** High (prerequisite for full plugin testing)
|