@_nazmiforreal/flutter-ota 0.1.21 → 0.1.22

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 (41) hide show
  1. package/bin/flutter-ota-linux-x64 +0 -0
  2. package/dart-src/packages/cli-tools/.dart_tool/package_config.json +460 -0
  3. package/dart-src/packages/cli-tools/.dart_tool/package_graph.json +707 -0
  4. package/dart-src/packages/cli-tools/lib/flutter_ota_kit_cli.dart +7 -4
  5. package/dart-src/packages/cli-tools/lib/src/commands/bundle.dart +95 -32
  6. package/dart-src/packages/cli-tools/lib/src/commands/channel.dart +28 -12
  7. package/dart-src/packages/cli-tools/lib/src/commands/config_command.dart +9 -4
  8. package/dart-src/packages/cli-tools/lib/src/commands/deploy.dart +29 -6
  9. package/dart-src/packages/cli-tools/lib/src/commands/doctor.dart +20 -32
  10. package/dart-src/packages/cli-tools/lib/src/commands/init.dart +40 -19
  11. package/dart-src/packages/cli-tools/lib/src/commands/keys.dart +7 -5
  12. package/dart-src/packages/cli-tools/lib/src/commands/migrate.dart +33 -22
  13. package/dart-src/packages/cli-tools/lib/src/commands/pocketbase.dart +256 -68
  14. package/dart-src/packages/cli-tools/lib/src/commands/rollback.dart +17 -11
  15. package/dart-src/packages/cli-tools/lib/src/commands/storage.dart +28 -12
  16. package/dart-src/packages/cli-tools/lib/src/config.dart +5 -6
  17. package/dart-src/packages/cli-tools/lib/src/operations.dart +1 -3
  18. package/dart-src/packages/cli-tools/lib/src/pocketbase/process_manager.dart +17 -16
  19. package/dart-src/packages/cli-tools/lib/src/runner.dart +3 -1
  20. package/dart-src/packages/cli-tools/lib/src/ui/ui.dart +8 -14
  21. package/dart-src/packages/cli-tools/pubspec.lock +590 -0
  22. package/dart-src/packages/cli-tools/test/mocks/mock_pocketbase_client.dart +7 -3
  23. package/dart-src/packages/cli-tools/test/pocketbase_schema_test.dart +13 -16
  24. package/dart-src/packages/core/CHANGELOG.md +15 -0
  25. package/dart-src/packages/core/lib/src/bundle.dart +3 -6
  26. package/dart-src/packages/core/pubspec.yaml +1 -1
  27. package/dart-src/plugins/aws/CHANGELOG.md +18 -0
  28. package/dart-src/plugins/aws/lib/src/aws_cloudfront_client.dart +1 -2
  29. package/dart-src/plugins/aws/pubspec.yaml +3 -3
  30. package/dart-src/plugins/cloudflare/CHANGELOG.md +18 -0
  31. package/dart-src/plugins/cloudflare/pubspec.yaml +3 -3
  32. package/dart-src/plugins/plugin-core/CHANGELOG.md +15 -0
  33. package/dart-src/plugins/plugin-core/pubspec.yaml +2 -2
  34. package/dart-src/plugins/pocketbase/CHANGELOG.md +18 -0
  35. package/dart-src/plugins/pocketbase/pubspec.yaml +3 -3
  36. package/dart-src/plugins/postgres/CHANGELOG.md +18 -0
  37. package/dart-src/plugins/postgres/pubspec.yaml +3 -3
  38. package/dart-src/plugins/supabase/CHANGELOG.md +18 -0
  39. package/dart-src/plugins/supabase/pubspec.yaml +3 -3
  40. package/package.json +2 -2
  41. package/scripts/postinstall.js +5 -1
@@ -12,9 +12,13 @@ import '../ui/ui.dart';
12
12
  class MigrateCommand extends FlutterPatcherCommand {
13
13
  MigrateCommand({this.config, this.backendOverride}) {
14
14
  final detected = config?.provider ?? loadConfig()?.provider;
15
- argParser.addOption('backend', abbr: 'b', help: detected != null
16
- ? 'Backend provider [detected: $detected].'
17
- : 'Backend provider.');
15
+ argParser.addOption(
16
+ 'backend',
17
+ abbr: 'b',
18
+ help: detected != null
19
+ ? 'Backend provider [detected: $detected].'
20
+ : 'Backend provider.',
21
+ );
18
22
  argParser.addOption(
19
23
  'database-url',
20
24
  help: 'Postgres connection string (or DATABASE_URL env).',
@@ -114,12 +118,17 @@ class MigrateCommand extends FlutterPatcherCommand {
114
118
  @override
115
119
  Future<int> run() => runGuarded(() async {
116
120
  final cfg = effectiveConfig(config ?? loadConfig(), argResults!);
117
- final provider = argResults!['backend'] as String? ?? cfg?.provider ?? 'supabase';
121
+ final provider =
122
+ argResults!['backend'] as String? ?? cfg?.provider ?? 'supabase';
118
123
 
119
124
  if (provider == 'aws') {
120
125
  banner('migrate · aws');
121
- step('AWS stores bundle metadata as JSON in S3 — no SQL migrations needed.');
122
- step('The S3 bucket and object prefix are created automatically on first deploy.');
126
+ step(
127
+ 'AWS stores bundle metadata as JSON in S3 no SQL migrations needed.',
128
+ );
129
+ step(
130
+ 'The S3 bucket and object prefix are created automatically on first deploy.',
131
+ );
123
132
  step('No action required. Run `flutter-ota deploy` to get started.');
124
133
  return;
125
134
  }
@@ -176,7 +185,8 @@ class MigrateCommand extends FlutterPatcherCommand {
176
185
  }
177
186
 
178
187
  if (provider == 'cloudflare') {
179
- final cfCfg = cfg ??
188
+ final cfCfg =
189
+ cfg ??
180
190
  FlutterPatcherConfig(
181
191
  provider: 'cloudflare',
182
192
  supabase: const SupabaseConfigJson(),
@@ -218,7 +228,8 @@ class MigrateCommand extends FlutterPatcherCommand {
218
228
  }
219
229
 
220
230
  if (provider == 'supabase') {
221
- final sbCfg = cfg ??
231
+ final sbCfg =
232
+ cfg ??
222
233
  FlutterPatcherConfig(
223
234
  provider: 'supabase',
224
235
  supabase: const SupabaseConfigJson(),
@@ -289,9 +300,7 @@ class MigrateCommand extends FlutterPatcherCommand {
289
300
  );
290
301
  sw.stop();
291
302
  if (res.statusCode >= 400) {
292
- steps.fail(
293
- '${p.basename(file.path)} (${res.statusCode}): ${res.body}',
294
- );
303
+ steps.fail('${p.basename(file.path)} (${res.statusCode}): ${res.body}');
295
304
  } else {
296
305
  final ms = sw.elapsedMilliseconds;
297
306
  final time = ms >= 1000
@@ -341,9 +350,7 @@ class MigrateCommand extends FlutterPatcherCommand {
341
350
  }
342
351
  }
343
352
  final ms = sw.elapsedMilliseconds;
344
- final time = ms >= 1000
345
- ? '${(ms / 1000).toStringAsFixed(1)}s'
346
- : '${ms}ms';
353
+ final time = ms >= 1000 ? '${(ms / 1000).toStringAsFixed(1)}s' : '${ms}ms';
347
354
  steps.success('Ensured storage bucket "${storage.bucketName}" in $time');
348
355
  }
349
356
 
@@ -483,8 +490,9 @@ class MigrateCommand extends FlutterPatcherCommand {
483
490
  return;
484
491
  }
485
492
  final ms = sw.elapsedMilliseconds;
486
- final time =
487
- ms >= 1000 ? '${(ms / 1000).toStringAsFixed(1)}s' : '${ms}ms';
493
+ final time = ms >= 1000
494
+ ? '${(ms / 1000).toStringAsFixed(1)}s'
495
+ : '${ms}ms';
488
496
  steps.success('Created D1 database ($dbId) in $time');
489
497
  } else {
490
498
  steps.success('Using existing D1 database ($dbId)');
@@ -507,8 +515,9 @@ class MigrateCommand extends FlutterPatcherCommand {
507
515
  steps.fail('${p.basename(file.path)} ($res.statusCode): $msg');
508
516
  } else {
509
517
  final ms = sw.elapsedMilliseconds;
510
- final time =
511
- ms >= 1000 ? '${(ms / 1000).toStringAsFixed(1)}s' : '${ms}ms';
518
+ final time = ms >= 1000
519
+ ? '${(ms / 1000).toStringAsFixed(1)}s'
520
+ : '${ms}ms';
512
521
  steps.success('Applied ${p.basename(file.path)} in $time');
513
522
  }
514
523
  }
@@ -530,14 +539,16 @@ class MigrateCommand extends FlutterPatcherCommand {
530
539
  steps.fail('Could not create R2 bucket "$r2Bucket": $msg');
531
540
  } else {
532
541
  final ms = sw.elapsedMilliseconds;
533
- final time =
534
- ms >= 1000 ? '${(ms / 1000).toStringAsFixed(1)}s' : '${ms}ms';
542
+ final time = ms >= 1000
543
+ ? '${(ms / 1000).toStringAsFixed(1)}s'
544
+ : '${ms}ms';
535
545
  steps.success('Ensured R2 bucket "$r2Bucket" in $time');
536
546
  }
537
547
  } else {
538
548
  final ms = sw.elapsedMilliseconds;
539
- final time =
540
- ms >= 1000 ? '${(ms / 1000).toStringAsFixed(1)}s' : '${ms}ms';
549
+ final time = ms >= 1000
550
+ ? '${(ms / 1000).toStringAsFixed(1)}s'
551
+ : '${ms}ms';
541
552
  steps.success('Created R2 bucket "$r2Bucket" in $time');
542
553
  }
543
554