native-update 1.0.8 → 1.1.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 CHANGED
@@ -41,6 +41,7 @@
41
41
  - **[App Update API](./docs/api/app-update-api.md)** - Native app update methods
42
42
  - **[App Review API](./docs/api/app-review-api.md)** - Review request methods
43
43
  - **[Events API](./docs/api/events-api.md)** - Event listeners and handlers
44
+ - **[CLI Reference](./docs/cli-reference.md)** - Command-line tools documentation
44
45
 
45
46
  ### Examples
46
47
 
@@ -316,28 +317,45 @@ The **[example-app](./example-app)** directory contains a complete, production-r
316
317
 
317
318
  We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
318
319
 
319
- ## 🛠️ New Development Tools
320
+ ## 🛠️ CLI Tools & Utilities
320
321
 
321
- ### Available Tools
322
+ ### Zero-Install CLI Access
322
323
 
323
- **Testing Framework**
324
- - Vitest test setup with example tests
325
- - Run tests: `npm test`
326
- - Coverage: `npm run test:coverage`
324
+ All tools are available via `npx` without cloning the repo:
327
325
 
328
- ✅ **Bundle Creation Tool**
329
- - Create update bundles: `node tools/bundle-creator.js create ./dist`
330
- - Generates ZIP bundle with manifest
326
+ ```bash
327
+ # Quick start
328
+ npx native-update init --example
329
+ npx native-update backend create express --with-admin
330
+ ```
331
+
332
+ ### Available Commands
333
+
334
+ ✅ **Bundle Management**
335
+ - Create bundles: `npx native-update bundle create ./www`
336
+ - Sign bundles: `npx native-update bundle sign bundle.zip --key private.pem`
337
+ - Verify signatures: `npx native-update bundle verify bundle.zip --key public.pem`
338
+
339
+ ✅ **Key Management**
340
+ - Generate keys: `npx native-update keys generate --type rsa --size 4096`
341
+ - Supports RSA (2048/4096) and EC (256/384) keys
342
+ - Creates timestamped key pairs with proper permissions
343
+ - See [Key Management Guide](./docs/guides/key-management.md) for detailed instructions
344
+
345
+ ✅ **Backend Templates**
346
+ - Express.js: `npx native-update backend create express --with-admin`
347
+ - Firebase: `npx native-update backend create firebase --with-monitoring`
348
+ - Vercel: `npx native-update backend create vercel`
349
+
350
+ ✅ **Development Tools**
351
+ - Start dev server: `npx native-update server start --port 3000`
352
+ - Monitor updates: `npx native-update monitor --server https://your-server.com`
353
+ - Validate config: `npx native-update config check`
331
354
 
332
- ✅ **Security Signing Tool**
333
- - Generate keys: `node tools/bundle-signer.js generate-keys`
334
- - Sign bundles: `node tools/bundle-signer.js sign bundle.zip private-key.pem`
335
- - Verify: `node tools/bundle-signer.js verify bundle.zip bundle.zip.sig public-key.pem`
355
+ ✅ **Migration Tools**
356
+ - From CodePush: `npx native-update migrate --from codepush`
336
357
 
337
- **Minimal Backend Server**
338
- - Development server in `backend-template/`
339
- - Start: `cd backend-template && npm install && npm start`
340
- - Provides basic update API endpoints
358
+ See [CLI Reference](./docs/cli-reference.md) for complete documentation.
341
359
 
342
360
  ## 🏗️ Development Status
343
361
 
@@ -15,20 +15,4 @@
15
15
  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
16
16
  <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
17
17
 
18
- <!-- WorkManager service -->
19
- <service
20
- android:name="androidx.work.impl.foreground.SystemForegroundService"
21
- android:foregroundServiceType="dataSync" />
22
-
23
- <!-- Broadcast receiver for notification actions -->
24
- <receiver
25
- android:name="com.aoneahsan.nativeupdate.NotificationActionReceiver"
26
- android:exported="false">
27
- <intent-filter>
28
- <action android:name="com.aoneahsan.nativeupdate.UPDATE_NOW" />
29
- <action android:name="com.aoneahsan.nativeupdate.UPDATE_LATER" />
30
- <action android:name="com.aoneahsan.nativeupdate.DISMISS" />
31
- </intent-filter>
32
- </receiver>
33
-
34
18
  </manifest>
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from 'commander';
4
+ import { readFileSync } from 'fs';
5
+ import { resolve } from 'path';
6
+
7
+ const program = new Command();
8
+ const packageJson = JSON.parse(
9
+ readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')
10
+ );
11
+
12
+ program
13
+ .name('cap-update')
14
+ .description('CLI for Capacitor Native Update')
15
+ .version('1.0.0');
16
+
17
+ program
18
+ .command('init')
19
+ .description('Initialize update configuration')
20
+ .option('-s, --server <url>', 'Update server URL')
21
+ .action((options) => {
22
+ console.log('Initializing Capacitor Native Update...');
23
+ console.log('Server:', options.server || 'Not specified');
24
+ // TODO: Create config file
25
+ });
26
+
27
+ program
28
+ .command('bundle')
29
+ .description('Create update bundle')
30
+ .argument('<path>', 'Path to dist directory')
31
+ .action((path) => {
32
+ console.log(`Creating bundle from: ${path}`);
33
+ // TODO: Call bundle creator
34
+ });
35
+
36
+ program
37
+ .command('sign')
38
+ .description('Sign update bundle')
39
+ .argument('<bundle>', 'Bundle file path')
40
+ .action((bundle) => {
41
+ console.log(`Signing bundle: ${bundle}`);
42
+ // TODO: Call bundle signer
43
+ });
44
+
45
+ program.parse();