powersync 0.10.0 → 0.10.2

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
@@ -99,7 +99,7 @@ powersync link cloud --create --project-id=<project-id> # add --org-id if toke
99
99
  powersync deploy
100
100
  ```
101
101
 
102
- Use `--directory` for a different config folder. The **powersync init cloud** command has a `--vscode` flag to configure your workspace for YAML custom tag support.
102
+ Use `--directory` for a different config folder. Add `--dry-run` to a deploy command to print the target instance, run the validations and see what would change, without deploying. The **powersync init cloud** command has a `--vscode` flag to configure your workspace for YAML custom tag support.
103
103
 
104
104
  ## Cloud secrets format (`service.yaml`)
105
105
 
@@ -238,7 +238,7 @@ $ npm install -g powersync
238
238
  $ powersync COMMAND
239
239
  running command...
240
240
  $ powersync (--version)
241
- powersync/0.10.0 linux-x64 node-v24.16.0
241
+ powersync/0.10.2 linux-x64 node-v24.21.0
242
242
  $ powersync --help [COMMAND]
243
243
  USAGE
244
244
  $ powersync COMMAND
@@ -261,7 +261,7 @@ Example (Cloud):
261
261
  PS_ADMIN_TOKEN=your-token INSTANCE_ID=123 powersync status
262
262
  ```
263
263
 
264
- See [docs/usage.md](../docs/usage.md) for full usage and resolution order (flags, env, cli.yaml).
264
+ See [docs/usage.md](../docs/usage.md) for full usage and resolution order (flags, cli.yaml, env).
265
265
 
266
266
  # Commands
267
267
 
@@ -401,7 +401,7 @@ EXAMPLES
401
401
  $ powersync compact --timeout=0
402
402
  ```
403
403
 
404
- _See code: [src/commands/compact.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/compact.ts)_
404
+ _See code: [src/commands/compact.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/compact.ts)_
405
405
 
406
406
  ## `powersync configure ide`
407
407
 
@@ -421,7 +421,7 @@ EXAMPLES
421
421
  $ powersync configure ide
422
422
  ```
423
423
 
424
- _See code: [src/commands/configure/ide.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/configure/ide.ts)_
424
+ _See code: [src/commands/configure/ide.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/configure/ide.ts)_
425
425
 
426
426
  ## `powersync deploy`
427
427
 
@@ -429,12 +429,14 @@ _See code: [src/commands/configure/ide.ts](https://github.com/powersync-ja/power
429
429
 
430
430
  ```
431
431
  USAGE
432
- $ powersync deploy [--deploy-timeout <value>] [--directory <value>] [--instance-id <value>]
432
+ $ powersync deploy [--deploy-timeout <value>] [--dry-run] [--directory <value>] [--instance-id <value>]
433
433
  [--sync-config-file-path <value>] [--skip-validations <value> | --validate-only <value>]
434
434
 
435
435
  FLAGS
436
436
  --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
437
437
  status (default 300 seconds).
438
+ --dry-run Show the target instance, run the validations and print what would change, then exit
439
+ without deploying.
438
440
  --skip-validations=<value> Comma-separated list of validation tests to skip. Options: configuration, connections,
439
441
  sync-config. Example: --skip-validations="configuration"
440
442
  --validate-only=<value> Comma-separated list of validation tests to run, skipping all others. Options:
@@ -457,14 +459,17 @@ DESCRIPTION
457
459
  Validates connections and sync config before deploying.
458
460
  See also powersync deploy sync-config to deploy only sync config changes.
459
461
  See also powersync deploy service-config to deploy only service config changes.
462
+ Use --dry-run to show the target instance, the validation results and what would change, without deploying.
460
463
 
461
464
  EXAMPLES
462
465
  $ powersync deploy
463
466
 
467
+ $ powersync deploy --dry-run
468
+
464
469
  $ powersync deploy --instance-id=<id>
465
470
  ```
466
471
 
467
- _See code: [src/commands/deploy/index.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/deploy/index.ts)_
472
+ _See code: [src/commands/deploy/index.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/deploy/index.ts)_
468
473
 
469
474
  ## `powersync deploy service-config`
470
475
 
@@ -472,12 +477,14 @@ _See code: [src/commands/deploy/index.ts](https://github.com/powersync-ja/powers
472
477
 
473
478
  ```
474
479
  USAGE
475
- $ powersync deploy service-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value>]
480
+ $ powersync deploy service-config [--deploy-timeout <value>] [--dry-run] [--directory <value>] [--instance-id <value>]
476
481
  [--skip-validations <value> | --validate-only <value>]
477
482
 
478
483
  FLAGS
479
484
  --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
480
485
  status (default 300 seconds).
486
+ --dry-run Show the target instance, run the validations and print what would change, then exit
487
+ without deploying.
481
488
  --skip-validations=<value> Comma-separated list of validation tests to skip. Options: configuration, connections.
482
489
  Example: --skip-validations="configuration"
483
490
  --validate-only=<value> Comma-separated list of validation tests to run, skipping all others. Options:
@@ -494,15 +501,18 @@ CLOUD_PROJECT FLAGS
494
501
  DESCRIPTION
495
502
  [Cloud only] Deploy only local service config to the linked Cloud instance.
496
503
 
497
- Deploy only service config changes (without sync config updates).
504
+ Deploy only service config changes (without sync config updates). Use --dry-run to show the target instance, the
505
+ validation results and what would change, without deploying.
498
506
 
499
507
  EXAMPLES
500
508
  $ powersync deploy service-config
501
509
 
510
+ $ powersync deploy service-config --dry-run
511
+
502
512
  $ powersync deploy service-config --instance-id=<id>
503
513
  ```
504
514
 
505
- _See code: [src/commands/deploy/service-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/deploy/service-config.ts)_
515
+ _See code: [src/commands/deploy/service-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/deploy/service-config.ts)_
506
516
 
507
517
  ## `powersync deploy sync-config`
508
518
 
@@ -510,12 +520,14 @@ _See code: [src/commands/deploy/service-config.ts](https://github.com/powersync-
510
520
 
511
521
  ```
512
522
  USAGE
513
- $ powersync deploy sync-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value>]
523
+ $ powersync deploy sync-config [--deploy-timeout <value>] [--dry-run] [--directory <value>] [--instance-id <value>]
514
524
  [--sync-config-file-path <value>] [--skip-validations <value> | ]
515
525
 
516
526
  FLAGS
517
527
  --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
518
528
  status (default 300 seconds).
529
+ --dry-run Show the target instance, run the validations and print what would change, then exit
530
+ without deploying.
519
531
  --skip-validations=<value> Comma-separated list of validation tests to skip. Options: sync-config. Example:
520
532
  --skip-validations="sync-config"
521
533
 
@@ -532,15 +544,18 @@ CLOUD_PROJECT FLAGS
532
544
  DESCRIPTION
533
545
  [Cloud only] Deploy only local sync config to the linked Cloud instance.
534
546
 
535
- Deploy only sync config changes.
547
+ Deploy only sync config changes. Use --dry-run to show the target instance, the validation results and what would
548
+ change, without deploying.
536
549
 
537
550
  EXAMPLES
538
551
  $ powersync deploy sync-config
539
552
 
553
+ $ powersync deploy sync-config --dry-run
554
+
540
555
  $ powersync deploy sync-config --instance-id=<id>
541
556
  ```
542
557
 
543
- _See code: [src/commands/deploy/sync-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/deploy/sync-config.ts)_
558
+ _See code: [src/commands/deploy/sync-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/deploy/sync-config.ts)_
544
559
 
545
560
  ## `powersync destroy`
546
561
 
@@ -573,7 +588,7 @@ EXAMPLES
573
588
  $ powersync destroy --confirm=yes
574
589
  ```
575
590
 
576
- _See code: [src/commands/destroy.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/destroy.ts)_
591
+ _See code: [src/commands/destroy.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/destroy.ts)_
577
592
 
578
593
  ## `powersync docker configure`
579
594
 
@@ -611,7 +626,7 @@ EXAMPLES
611
626
  $ powersync docker configure --database=postgres --storage=postgres
612
627
  ```
613
628
 
614
- _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/docker/configure.ts)_
629
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/docker/configure.ts)_
615
630
 
616
631
  ## `powersync docker reset`
617
632
 
@@ -640,7 +655,7 @@ EXAMPLES
640
655
  $ powersync docker reset
641
656
  ```
642
657
 
643
- _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/docker/reset.ts)_
658
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/docker/reset.ts)_
644
659
 
645
660
  ## `powersync docker start`
646
661
 
@@ -668,7 +683,7 @@ EXAMPLES
668
683
  $ powersync docker start
669
684
  ```
670
685
 
671
- _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/docker/start.ts)_
686
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/docker/start.ts)_
672
687
 
673
688
  ## `powersync docker stop`
674
689
 
@@ -710,7 +725,7 @@ EXAMPLES
710
725
  $ powersync docker stop --project-name=powersync_myapp --remove
711
726
  ```
712
727
 
713
- _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/docker/stop.ts)_
728
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/docker/stop.ts)_
714
729
 
715
730
  ## `powersync edit config`
716
731
 
@@ -749,7 +764,7 @@ EXAMPLES
749
764
  $ powersync edit config --directory ./powersync
750
765
  ```
751
766
 
752
- _See code: [@powersync/cli-plugin-config-edit](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/edit/config.ts)_
767
+ _See code: [@powersync/cli-plugin-config-edit](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/edit/config.ts)_
753
768
 
754
769
  ## `powersync fetch config`
755
770
 
@@ -782,7 +797,7 @@ EXAMPLES
782
797
  $ powersync fetch config --output=json
783
798
  ```
784
799
 
785
- _See code: [src/commands/fetch/config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/fetch/config.ts)_
800
+ _See code: [src/commands/fetch/config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/fetch/config.ts)_
786
801
 
787
802
  ## `powersync fetch instances`
788
803
 
@@ -810,7 +825,7 @@ EXAMPLES
810
825
  $ powersync fetch instances --project-id=<id> --output=json
811
826
  ```
812
827
 
813
- _See code: [src/commands/fetch/instances.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/fetch/instances.ts)_
828
+ _See code: [src/commands/fetch/instances.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/fetch/instances.ts)_
814
829
 
815
830
  ## `powersync fetch status`
816
831
 
@@ -842,7 +857,7 @@ DESCRIPTION
842
857
  Show instance diagnostics (connections, sync config, replication).
843
858
 
844
859
  Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as
845
- human-readable, JSON, or YAML. Cloud and self-hosted.
860
+ human-readable, JSON, or YAML. Human output starts with the target instance. Cloud and self-hosted.
846
861
 
847
862
  EXAMPLES
848
863
  $ powersync fetch status
@@ -852,7 +867,7 @@ EXAMPLES
852
867
  $ powersync fetch status --instance-id=<id>
853
868
  ```
854
869
 
855
- _See code: [src/commands/fetch/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/fetch/status.ts)_
870
+ _See code: [src/commands/fetch/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/fetch/status.ts)_
856
871
 
857
872
  ## `powersync generate schema`
858
873
 
@@ -860,13 +875,13 @@ Generate client schema file from instance schema and sync config.
860
875
 
861
876
  ```
862
877
  USAGE
863
- $ powersync generate schema --output dart|dotNet|dotNetClass|js|jsLegacy|kotlin|swift|ts --output-path <value>
878
+ $ powersync generate schema --output dart|dotNet|dotNetClass|js|jsLegacy|kotlin|rust|swift|ts --output-path <value>
864
879
  [--api-url <value> | --instance-id <value> | | ] [--directory <value>] [--sync-config-file-path <value>]
865
880
 
866
881
  FLAGS
867
- --output=<option> (required) [default: type] Output type: dart, dotNet, dotNetClass, js, jsLegacy, kotlin, swift,
868
- ts
869
- <options: dart|dotNet|dotNetClass|js|jsLegacy|kotlin|swift|ts>
882
+ --output=<option> (required) [default: type] Output type: dart, dotNet, dotNetClass, js, jsLegacy, kotlin, rust,
883
+ swift, ts
884
+ <options: dart|dotNet|dotNetClass|js|jsLegacy|kotlin|rust|swift|ts>
870
885
  --output-path=<value> (required) Path to output the schema file.
871
886
 
872
887
  SELF_HOSTED_PROJECT FLAGS
@@ -896,7 +911,7 @@ EXAMPLES
896
911
  $ powersync generate schema --output=dart --output-path=lib/schema.dart --instance-id=<id>
897
912
  ```
898
913
 
899
- _See code: [src/commands/generate/schema.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/generate/schema.ts)_
914
+ _See code: [src/commands/generate/schema.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/generate/schema.ts)_
900
915
 
901
916
  ## `powersync generate token`
902
917
 
@@ -939,7 +954,7 @@ EXAMPLES
939
954
  $ powersync generate token --subject=user-123 --expires-in-seconds=3600
940
955
  ```
941
956
 
942
- _See code: [src/commands/generate/token.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/generate/token.ts)_
957
+ _See code: [src/commands/generate/token.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/generate/token.ts)_
943
958
 
944
959
  ## `powersync help [COMMAND]`
945
960
 
@@ -985,7 +1000,7 @@ EXAMPLES
985
1000
  $ powersync init cloud --directory=powersync
986
1001
  ```
987
1002
 
988
- _See code: [src/commands/init/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/init/cloud.ts)_
1003
+ _See code: [src/commands/init/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/init/cloud.ts)_
989
1004
 
990
1005
  ## `powersync init self-hosted`
991
1006
 
@@ -1012,7 +1027,7 @@ EXAMPLES
1012
1027
  $ powersync init self-hosted --directory=powersync
1013
1028
  ```
1014
1029
 
1015
- _See code: [src/commands/init/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/init/self-hosted.ts)_
1030
+ _See code: [src/commands/init/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/init/self-hosted.ts)_
1016
1031
 
1017
1032
  ## `powersync link cloud`
1018
1033
 
@@ -1049,7 +1064,7 @@ EXAMPLES
1049
1064
  $ powersync link cloud --create --project-id=<project-id> --org-id=<org-id>
1050
1065
  ```
1051
1066
 
1052
- _See code: [src/commands/link/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/link/cloud.ts)_
1067
+ _See code: [src/commands/link/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/link/cloud.ts)_
1053
1068
 
1054
1069
  ## `powersync link self-hosted`
1055
1070
 
@@ -1077,7 +1092,7 @@ EXAMPLES
1077
1092
  $ powersync link self-hosted --api-url=https://powersync.example.com
1078
1093
  ```
1079
1094
 
1080
- _See code: [src/commands/link/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/link/self-hosted.ts)_
1095
+ _See code: [src/commands/link/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/link/self-hosted.ts)_
1081
1096
 
1082
1097
  ## `powersync login`
1083
1098
 
@@ -1098,7 +1113,7 @@ EXAMPLES
1098
1113
  $ powersync login
1099
1114
  ```
1100
1115
 
1101
- _See code: [src/commands/login.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/login.ts)_
1116
+ _See code: [src/commands/login.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/login.ts)_
1102
1117
 
1103
1118
  ## `powersync logout`
1104
1119
 
@@ -1118,7 +1133,7 @@ EXAMPLES
1118
1133
  $ powersync logout
1119
1134
  ```
1120
1135
 
1121
- _See code: [src/commands/logout.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/logout.ts)_
1136
+ _See code: [src/commands/logout.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/logout.ts)_
1122
1137
 
1123
1138
  ## `powersync migrate sync-rules`
1124
1139
 
@@ -1152,7 +1167,7 @@ DESCRIPTION
1152
1167
  Migrates Sync Rules to Sync Streams
1153
1168
  ```
1154
1169
 
1155
- _See code: [src/commands/migrate/sync-rules.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/migrate/sync-rules.ts)_
1170
+ _See code: [src/commands/migrate/sync-rules.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/migrate/sync-rules.ts)_
1156
1171
 
1157
1172
  ## `powersync plugins`
1158
1173
 
@@ -1477,7 +1492,7 @@ EXAMPLES
1477
1492
  $ powersync pull instance --instance-id=<id>
1478
1493
  ```
1479
1494
 
1480
- _See code: [src/commands/pull/instance.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/pull/instance.ts)_
1495
+ _See code: [src/commands/pull/instance.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/pull/instance.ts)_
1481
1496
 
1482
1497
  ## `powersync status`
1483
1498
 
@@ -1509,7 +1524,7 @@ DESCRIPTION
1509
1524
  Show instance diagnostics (connections, sync config, replication).
1510
1525
 
1511
1526
  Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as
1512
- human-readable, JSON, or YAML. Cloud and self-hosted.
1527
+ human-readable, JSON, or YAML. Human output starts with the target instance. Cloud and self-hosted.
1513
1528
 
1514
1529
  EXAMPLES
1515
1530
  $ powersync status
@@ -1519,7 +1534,7 @@ EXAMPLES
1519
1534
  $ powersync status --instance-id=<id>
1520
1535
  ```
1521
1536
 
1522
- _See code: [src/commands/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/status.ts)_
1537
+ _See code: [src/commands/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/status.ts)_
1523
1538
 
1524
1539
  ## `powersync stop`
1525
1540
 
@@ -1552,7 +1567,7 @@ EXAMPLES
1552
1567
  $ powersync stop --confirm=yes
1553
1568
  ```
1554
1569
 
1555
- _See code: [src/commands/stop.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/stop.ts)_
1570
+ _See code: [src/commands/stop.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/stop.ts)_
1556
1571
 
1557
1572
  ## `powersync validate`
1558
1573
 
@@ -1600,6 +1615,6 @@ EXAMPLES
1600
1615
  $ powersync validate --api-url=https://powersync.example.com
1601
1616
  ```
1602
1617
 
1603
- _See code: [src/commands/validate.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.0/src/commands/validate.ts)_
1618
+ _See code: [src/commands/validate.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.10.2/src/commands/validate.ts)_
1604
1619
 
1605
1620
  <!-- commandsstop -->
@@ -8,6 +8,7 @@ export default abstract class BaseDeployCommand extends CloudInstanceCommand {
8
8
  'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  'deploy-timeout': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
13
  protected deployAll(params: {
13
14
  cloudConfigState: routes.InstanceConfigResponse;
@@ -18,7 +19,20 @@ export default abstract class BaseDeployCommand extends CloudInstanceCommand {
18
19
  cloudConfigState: routes.InstanceConfigResponse;
19
20
  updateSyncConfig: boolean;
20
21
  }): Promise<routes.DeployInstanceResponse>;
22
+ protected describeServiceConfigChanges(cloudConfigState: routes.InstanceConfigResponse): string;
21
23
  protected loadCloudConfigState(): Promise<routes.InstanceConfigResponse>;
24
+ /**
25
+ * Ends a --dry-run once the target and validation results are shown: reports what a real run would deploy.
26
+ * Set provisionFirst when the instance is deprovisioned, since a real run would provision it before deploying.
27
+ */
28
+ protected logDryRun(params: {
29
+ cloudConfigState: routes.InstanceConfigResponse;
30
+ provisionFirst?: boolean;
31
+ /** Whether the command sends service.yaml. */
32
+ serviceConfig: boolean;
33
+ /** Whether the command sends the local sync config. */
34
+ syncConfig: boolean;
35
+ }): void;
22
36
  parseLocalConfig(projectDirectory: string, useRawConfig?: boolean): ServiceCloudConfigDecoded;
23
37
  protected provision(params: {
24
38
  cloudConfigState: routes.InstanceConfigResponse;
@@ -35,5 +49,10 @@ export default abstract class BaseDeployCommand extends CloudInstanceCommand {
35
49
  logScheduledMessage?: boolean;
36
50
  timeoutMs: number;
37
51
  }): Promise<void>;
52
+ /**
53
+ * Deploying sends the local service.yaml `name` as the instance name, so a deploy renames the
54
+ * instance if the two differ. Warn so users targeting several instances from one config notice.
55
+ */
56
+ protected warnIfDeployRenamesInstance(cloudConfigState: routes.InstanceConfigResponse): void;
38
57
  protected withDeploy(timeoutMs: number, fn: () => Promise<routes.DeployInstanceResponse>): Promise<void>;
39
58
  }
@@ -3,6 +3,7 @@ import { CloudInstanceCommand, SERVICE_FILENAME } from '@powersync/cli-core';
3
3
  import { AdditionalCloudConfigFields } from '@powersync/cli-schemas';
4
4
  import ora from 'ora';
5
5
  import { DEFAULT_DEPLOY_TIMEOUT_MS, waitForOperationStatusChange } from './cloud/wait-for-operation.js';
6
+ import { changedServiceConfigSections, formatSyncConfigDiff } from './dry-run.js';
6
7
  import { parseLocalCloudServiceConfig } from './parse-local-cloud-service-config.js';
7
8
  export default class BaseDeployCommand extends CloudInstanceCommand {
8
9
  static baseFlags = {
@@ -17,6 +18,10 @@ export default class BaseDeployCommand extends CloudInstanceCommand {
17
18
  return value;
18
19
  }
19
20
  }),
21
+ 'dry-run': Flags.boolean({
22
+ default: false,
23
+ description: 'Show the target instance, run the validations and print what would change, then exit without deploying.'
24
+ }),
20
25
  ...CloudInstanceCommand.baseFlags
21
26
  };
22
27
  async deployAll(params) {
@@ -49,6 +54,19 @@ export default class BaseDeployCommand extends CloudInstanceCommand {
49
54
  sync_rules: updateSyncConfig ? syncRulesContent : cloudConfigState.sync_rules
50
55
  });
51
56
  }
57
+ describeServiceConfigChanges(cloudConfigState) {
58
+ const summary = `would deploy ${SERVICE_FILENAME}.`;
59
+ if (!cloudConfigState.config) {
60
+ return `${summary} No config is deployed yet.`;
61
+ }
62
+ const sections = changedServiceConfigSections(this.serviceConfig, cloudConfigState);
63
+ if (!sections) {
64
+ return `${summary} Could not compare with the deployed config.`;
65
+ }
66
+ return sections.length > 0
67
+ ? `${summary} Changes in: ${sections.join(', ')}.`
68
+ : `${summary} No changes compared to the deployed config.`;
69
+ }
52
70
  async loadCloudConfigState() {
53
71
  const { client, project } = this;
54
72
  const { linked } = project;
@@ -65,6 +83,32 @@ export default class BaseDeployCommand extends CloudInstanceCommand {
65
83
  });
66
84
  });
67
85
  }
86
+ /**
87
+ * Ends a --dry-run once the target and validation results are shown: reports what a real run would deploy.
88
+ * Set provisionFirst when the instance is deprovisioned, since a real run would provision it before deploying.
89
+ */
90
+ logDryRun(params) {
91
+ const { cloudConfigState, provisionFirst = false, serviceConfig, syncConfig } = params;
92
+ const { syncRulesContent } = this.project;
93
+ this.log('');
94
+ if (provisionFirst) {
95
+ this.log(`The instance is ${ux.colorize('yellow', 'not currently provisioned')}. Deploying would first provision it, then validate and deploy the sync config.`);
96
+ }
97
+ this.log(ux.colorize('yellow', 'Dry run: nothing was deployed.'));
98
+ this.log(`\tService config: ${serviceConfig ? this.describeServiceConfigChanges(cloudConfigState) : 'not changed by this command.'}`);
99
+ if (!syncConfig) {
100
+ this.log('\tSync config: not changed by this command.');
101
+ }
102
+ else if (syncRulesContent === cloudConfigState.sync_rules) {
103
+ this.log('\tSync config: matches the deployed sync config, nothing to update.');
104
+ }
105
+ else {
106
+ this.log('\tSync config: would deploy the local sync config. Diff against the deployed sync config:');
107
+ for (const line of formatSyncConfigDiff(cloudConfigState.sync_rules ?? '', syncRulesContent ?? '')) {
108
+ this.log(`\t\t${line}`);
109
+ }
110
+ }
111
+ }
68
112
  parseLocalConfig(projectDirectory, useRawConfig) {
69
113
  const config = parseLocalCloudServiceConfig(projectDirectory, useRawConfig ?? false);
70
114
  if (!config) {
@@ -203,6 +247,17 @@ export default class BaseDeployCommand extends CloudInstanceCommand {
203
247
  });
204
248
  }
205
249
  }
250
+ /**
251
+ * Deploying sends the local service.yaml `name` as the instance name, so a deploy renames the
252
+ * instance if the two differ. Warn so users targeting several instances from one config notice.
253
+ */
254
+ warnIfDeployRenamesInstance(cloudConfigState) {
255
+ const localName = this.serviceConfig?.name;
256
+ if (!localName || localName === cloudConfigState.name) {
257
+ return;
258
+ }
259
+ this.warn(`Deploying will rename the instance from "${cloudConfigState.name}" to "${localName}" because ${SERVICE_FILENAME} has name: ${localName}.`);
260
+ }
206
261
  async withDeploy(timeoutMs, fn) {
207
262
  const { project } = this;
208
263
  const spinner = ora({
@@ -1 +1 @@
1
- {"version":3,"file":"BaseDeployCommand.js","sourceRoot":"","sources":["../../src/api/BaseDeployCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,2BAA2B,EAG5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACxG,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF,MAAM,CAAC,OAAO,OAAgB,iBAAkB,SAAQ,oBAAoB;IAC1E,MAAM,CAAC,SAAS,GAAG;QACjB,gBAAgB,EAAE,KAAK,CAAC,OAAO,C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,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC;gBACf,KAAK;gBACL,OAAO,EAAE,wCAAwC,OAAO,CAAC,MAAM,CAAC,WAAW,eAAe,OAAO,CAAC,MAAM,CAAC,UAAU,WAAW,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;gBACrJ,WAAW,EAAE,CAAC,8CAA8C,EAAE,2CAA2C,CAAC;aAC3G,CAAC,CAAC;QACL,CAAC;IACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ServiceCloudConfigDecoded } from '@powersync/cli-schemas';
2
+ import { routes } from '@powersync/management-types';
3
+ /**
4
+ * Names the top-level service config sections whose local value differs from the deployed one.
5
+ * Returns undefined when the deployed config cannot be decoded for comparison.
6
+ */
7
+ export declare function changedServiceConfigSections(localConfig: ServiceCloudConfigDecoded, cloudConfigState: routes.InstanceConfigResponse): string[] | undefined;
8
+ /** Unified diff of the deployed sync config against the local one, one colorized entry per line. Empty when identical. */
9
+ export declare function formatSyncConfigDiff(deployed: string, local: string): string[];
@@ -0,0 +1,40 @@
1
+ import { ux } from '@oclif/core';
2
+ import { AdditionalCloudConfigFields } from '@powersync/cli-schemas';
3
+ import { structuredPatch } from 'diff';
4
+ import isEqual from 'lodash/isEqual.js';
5
+ import { decodeFetchedCloudConfig } from './cloud/fetch-cloud-config.js';
6
+ const CLI_ONLY_FIELDS = new Set(Object.keys(AdditionalCloudConfigFields.props.shape));
7
+ function colorizeDiffLine(line) {
8
+ if (line.startsWith('+'))
9
+ return ux.colorize('green', line);
10
+ if (line.startsWith('-'))
11
+ return ux.colorize('red', line);
12
+ return line;
13
+ }
14
+ /**
15
+ * Names the top-level service config sections whose local value differs from the deployed one.
16
+ * Returns undefined when the deployed config cannot be decoded for comparison.
17
+ */
18
+ export function changedServiceConfigSections(localConfig, cloudConfigState) {
19
+ let deployed;
20
+ try {
21
+ deployed = decodeFetchedCloudConfig(cloudConfigState).config;
22
+ }
23
+ catch {
24
+ return undefined;
25
+ }
26
+ const local = localConfig;
27
+ const sections = new Set([...Object.keys(deployed), ...Object.keys(local)]);
28
+ return [...sections]
29
+ .filter((section) => !CLI_ONLY_FIELDS.has(section) && !isEqual(local[section], deployed[section]))
30
+ .sort();
31
+ }
32
+ /** Unified diff of the deployed sync config against the local one, one colorized entry per line. Empty when identical. */
33
+ export function formatSyncConfigDiff(deployed, local) {
34
+ const { hunks } = structuredPatch('deployed', 'local', deployed, local);
35
+ return hunks.flatMap((hunk) => [
36
+ ux.colorize('cyan', `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`),
37
+ ...hunk.lines.map((line) => colorizeDiffLine(line))
38
+ ]);
39
+ }
40
+ //# sourceMappingURL=dry-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dry-run.js","sourceRoot":"","sources":["../../src/api/dry-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAA6B,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAEtF,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,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act extends CloudInstanceCommand {
21
21
  async run() {
22
22
  const { flags } = await this.parse(Compact);
23
23
  const { linked } = await this.loadProject(flags);
24
+ const instanceLabel = await this.logTargetInstance();
24
25
  const { client } = this;
25
26
  const timeoutMs = flags.timeout === 0 ? Number.POSITIVE_INFINITY : flags.timeout * 60 * 1000;
26
27
  const spinner = ora({
27
28
  discardStdin: false,
28
- prefixText: `\n${ux.colorize('yellow', 'Compacting')} instance ${ux.colorize('blue', linked.instance_id)} in project ${ux.colorize('blue', linked.project_id)} in org ${ux.colorize('blue', linked.org_id)}\n`,
29
+ prefixText: `\n${ux.colorize('yellow', 'Compacting')} instance ${ux.colorize('blue', instanceLabel)} in project ${ux.colorize('blue', linked.project_id)} in org ${ux.colorize('blue', linked.org_id)}\n`,
29
30
  spinner: 'moon',
30
31
  suffixText: '\nThis may take a few minutes.\n'
31
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"compact.js","sourceRoot":"","sources":["../../src/commands/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,oBAAoB;IACvD,MAAM,CAAC,WAAW,GAAG,2FAA2F,CAAC;IACjH,MAAM,CAAC,QAAQ,GAAG;QAChB,qCAAqC;QACrC,mDAAmD;QACnD,iDAAiD;KAClD,CAAC;IACF,MAAM,CAAC,KAAK,GAAG;QACb,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,+BAA+B;YACxC,WAAW,EAAE,0FAA0F;YACvG,GAAG,EAAE,CAAC;SACP,CAAC;KACH,CAAC;IACF,MAAM,CAAC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