@sanity/workflow-cli 0.13.0 → 0.20.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +40 -27
  3. package/dist/commands/editorial-workflows/abort.d.ts +1 -0
  4. package/dist/commands/editorial-workflows/abort.js +2 -2
  5. package/dist/commands/editorial-workflows/definition/delete.d.ts +1 -0
  6. package/dist/commands/editorial-workflows/definition/delete.js +2 -2
  7. package/dist/commands/editorial-workflows/definition/diff.d.ts +1 -0
  8. package/dist/commands/editorial-workflows/definition/diff.js +2 -2
  9. package/dist/commands/editorial-workflows/deploy.d.ts +2 -1
  10. package/dist/commands/editorial-workflows/deploy.js +15 -9
  11. package/dist/commands/editorial-workflows/diagnose.d.ts +1 -0
  12. package/dist/commands/editorial-workflows/diagnose.js +2 -2
  13. package/dist/commands/editorial-workflows/fire-action.d.ts +1 -0
  14. package/dist/commands/editorial-workflows/fire-action.js +2 -2
  15. package/dist/commands/editorial-workflows/nuke.d.ts +2 -1
  16. package/dist/commands/editorial-workflows/nuke.js +13 -9
  17. package/dist/commands/editorial-workflows/set-stage.d.ts +1 -0
  18. package/dist/commands/editorial-workflows/set-stage.js +2 -2
  19. package/dist/commands/editorial-workflows/start.d.ts +1 -0
  20. package/dist/commands/editorial-workflows/start.js +2 -2
  21. package/dist/lib/context.d.ts +36 -13
  22. package/dist/lib/context.js +27 -6
  23. package/dist/lib/fail.js +1 -1
  24. package/dist/lib/flags.d.ts +27 -5
  25. package/dist/lib/flags.js +17 -1
  26. package/dist/lib/nuke.d.ts +15 -14
  27. package/dist/lib/nuke.js +27 -8
  28. package/dist/lib/prompt.d.ts +14 -0
  29. package/dist/lib/prompt.js +4 -0
  30. package/dist/lib/select-deployment.d.ts +41 -16
  31. package/dist/lib/select-deployment.js +55 -38
  32. package/oclif.manifest.json +131 -19
  33. package/package.json +8 -5
@@ -17,8 +17,21 @@
17
17
  "<%= config.bin %> abort wf-instance.abc123 --reason 'superseded by relaunch'"
18
18
  ],
19
19
  "flags": {
20
+ "deployment": {
21
+ "description": "Deployment name — read the instance from the resource that deployment targets; the tag partition still comes from the loaded instance.",
22
+ "exclusive": [
23
+ "tag"
24
+ ],
25
+ "name": "deployment",
26
+ "hasDynamicHelp": false,
27
+ "multiple": false,
28
+ "type": "option"
29
+ },
20
30
  "tag": {
21
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
31
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
32
+ "exclusive": [
33
+ "deployment"
34
+ ],
22
35
  "name": "tag",
23
36
  "hasDynamicHelp": false,
24
37
  "multiple": false,
@@ -54,6 +67,7 @@
54
67
  "args": {},
55
68
  "description": "Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.",
56
69
  "examples": [
70
+ "<%= config.bin %> deploy --deployment review-prod",
57
71
  "<%= config.bin %> deploy --tag prod",
58
72
  "<%= config.bin %> deploy --all-tags",
59
73
  "<%= config.bin %> deploy --check",
@@ -61,17 +75,31 @@
61
75
  "<%= config.bin %> deploy --only productLaunch"
62
76
  ],
63
77
  "flags": {
78
+ "deployment": {
79
+ "description": "Deployment name — the unique identity of one deployment in the config.",
80
+ "exclusive": [
81
+ "tag"
82
+ ],
83
+ "name": "deployment",
84
+ "hasDynamicHelp": false,
85
+ "multiple": false,
86
+ "type": "option"
87
+ },
64
88
  "tag": {
65
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
89
+ "description": "Workflow environment tag (e.g. prod, test) — deploys every deployment carrying the tag (a tag is an environment group).",
90
+ "exclusive": [
91
+ "deployment"
92
+ ],
66
93
  "name": "tag",
67
94
  "hasDynamicHelp": false,
68
95
  "multiple": false,
69
96
  "type": "option"
70
97
  },
71
98
  "all-tags": {
72
- "description": "Deploy every deployment in the config, not just one tag.",
99
+ "description": "Deploy every deployment in the config, not just a selection.",
73
100
  "exclusive": [
74
- "tag"
101
+ "tag",
102
+ "deployment"
75
103
  ],
76
104
  "name": "all-tags",
77
105
  "allowNo": false,
@@ -136,8 +164,21 @@
136
164
  "<%= config.bin %> diagnose wf-instance.abc123 --json"
137
165
  ],
138
166
  "flags": {
167
+ "deployment": {
168
+ "description": "Deployment name — read the instance from the resource that deployment targets; the tag partition still comes from the loaded instance.",
169
+ "exclusive": [
170
+ "tag"
171
+ ],
172
+ "name": "deployment",
173
+ "hasDynamicHelp": false,
174
+ "multiple": false,
175
+ "type": "option"
176
+ },
139
177
  "tag": {
140
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
178
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
179
+ "exclusive": [
180
+ "deployment"
181
+ ],
141
182
  "name": "tag",
142
183
  "hasDynamicHelp": false,
143
184
  "multiple": false,
@@ -183,8 +224,21 @@
183
224
  "<%= config.bin %> fire-action wf-instance.abc123 --activity publish --action publish --param note=shipping"
184
225
  ],
185
226
  "flags": {
227
+ "deployment": {
228
+ "description": "Deployment name — read the instance from the resource that deployment targets; the tag partition still comes from the loaded instance.",
229
+ "exclusive": [
230
+ "tag"
231
+ ],
232
+ "name": "deployment",
233
+ "hasDynamicHelp": false,
234
+ "multiple": false,
235
+ "type": "option"
236
+ },
186
237
  "tag": {
187
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
238
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
239
+ "exclusive": [
240
+ "deployment"
241
+ ],
188
242
  "name": "tag",
189
243
  "hasDynamicHelp": false,
190
244
  "multiple": false,
@@ -249,7 +303,7 @@
249
303
  ],
250
304
  "flags": {
251
305
  "tag": {
252
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
306
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
253
307
  "name": "tag",
254
308
  "hasDynamicHelp": false,
255
309
  "multiple": false,
@@ -312,14 +366,20 @@
312
366
  "args": {},
313
367
  "description": "The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the tag's instances, definitions, and guards (across every alias-bound resource). Content documents are never touched. Prints a dry-run plan, then requires you to type back every involved dataset (--force skips the prompt; the plan still prints).",
314
368
  "examples": [
315
- "<%= config.bin %> nuke --tag plugin-dev",
369
+ "<%= config.bin %> nuke --deployment plugin-dev",
316
370
  "<%= config.bin %> nuke --tag plugin-dev --force"
317
371
  ],
318
372
  "flags": {
373
+ "deployment": {
374
+ "description": "The deployment name to reset.",
375
+ "name": "deployment",
376
+ "hasDynamicHelp": false,
377
+ "multiple": false,
378
+ "type": "option"
379
+ },
319
380
  "tag": {
320
- "description": "The deployment tag to reset. Required — a destructive reset never guesses the environment.",
381
+ "description": "The deployment tag to reset (while it names exactly one deployment).",
321
382
  "name": "tag",
322
- "required": true,
323
383
  "hasDynamicHelp": false,
324
384
  "multiple": false,
325
385
  "type": "option"
@@ -398,8 +458,21 @@
398
458
  "<%= config.bin %> set-stage wf-instance.abc123 --to ready --reason 'unblock for demo'"
399
459
  ],
400
460
  "flags": {
461
+ "deployment": {
462
+ "description": "Deployment name — read the instance from the resource that deployment targets; the tag partition still comes from the loaded instance.",
463
+ "exclusive": [
464
+ "tag"
465
+ ],
466
+ "name": "deployment",
467
+ "hasDynamicHelp": false,
468
+ "multiple": false,
469
+ "type": "option"
470
+ },
401
471
  "tag": {
402
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
472
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
473
+ "exclusive": [
474
+ "deployment"
475
+ ],
403
476
  "name": "tag",
404
477
  "hasDynamicHelp": false,
405
478
  "multiple": false,
@@ -454,7 +527,7 @@
454
527
  ],
455
528
  "flags": {
456
529
  "tag": {
457
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
530
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
458
531
  "name": "tag",
459
532
  "hasDynamicHelp": false,
460
533
  "multiple": false,
@@ -506,8 +579,21 @@
506
579
  "<%= config.bin %> start productLaunch --instance-id prod.wf-instance.a1b2c3d4e5f6"
507
580
  ],
508
581
  "flags": {
582
+ "deployment": {
583
+ "description": "Deployment name — the unique identity of one deployment in the config.",
584
+ "exclusive": [
585
+ "tag"
586
+ ],
587
+ "name": "deployment",
588
+ "hasDynamicHelp": false,
589
+ "multiple": false,
590
+ "type": "option"
591
+ },
509
592
  "tag": {
510
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
593
+ "description": "Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag names exactly one; pass --deployment when it spans several.",
594
+ "exclusive": [
595
+ "deployment"
596
+ ],
511
597
  "name": "tag",
512
598
  "hasDynamicHelp": false,
513
599
  "multiple": false,
@@ -574,7 +660,7 @@
574
660
  ],
575
661
  "flags": {
576
662
  "tag": {
577
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
663
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
578
664
  "name": "tag",
579
665
  "hasDynamicHelp": false,
580
666
  "multiple": false,
@@ -614,8 +700,21 @@
614
700
  "<%= config.bin %> definition delete my-workflow --cascade --reason 'workflow retired'"
615
701
  ],
616
702
  "flags": {
703
+ "deployment": {
704
+ "description": "Deployment name — the unique identity of one deployment in the config.",
705
+ "exclusive": [
706
+ "tag"
707
+ ],
708
+ "name": "deployment",
709
+ "hasDynamicHelp": false,
710
+ "multiple": false,
711
+ "type": "option"
712
+ },
617
713
  "tag": {
618
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
714
+ "description": "Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag names exactly one; pass --deployment when it spans several.",
715
+ "exclusive": [
716
+ "deployment"
717
+ ],
619
718
  "name": "tag",
620
719
  "hasDynamicHelp": false,
621
720
  "multiple": false,
@@ -675,8 +774,21 @@
675
774
  "<%= config.bin %> definition diff productLaunch --version 2"
676
775
  ],
677
776
  "flags": {
777
+ "deployment": {
778
+ "description": "Deployment name — the unique identity of one deployment in the config.",
779
+ "exclusive": [
780
+ "tag"
781
+ ],
782
+ "name": "deployment",
783
+ "hasDynamicHelp": false,
784
+ "multiple": false,
785
+ "type": "option"
786
+ },
678
787
  "tag": {
679
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
788
+ "description": "Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag names exactly one; pass --deployment when it spans several.",
789
+ "exclusive": [
790
+ "deployment"
791
+ ],
680
792
  "name": "tag",
681
793
  "hasDynamicHelp": false,
682
794
  "multiple": false,
@@ -718,7 +830,7 @@
718
830
  ],
719
831
  "flags": {
720
832
  "tag": {
721
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
833
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
722
834
  "name": "tag",
723
835
  "hasDynamicHelp": false,
724
836
  "multiple": false,
@@ -770,7 +882,7 @@
770
882
  "description": "Show a deployed workflow definition.",
771
883
  "flags": {
772
884
  "tag": {
773
- "description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
885
+ "description": "Workflow environment tag (e.g. prod, test) — an optional query filter, and the resource disambiguator when the config spans several.",
774
886
  "name": "tag",
775
887
  "hasDynamicHelp": false,
776
888
  "multiple": false,
@@ -801,5 +913,5 @@
801
913
  ]
802
914
  }
803
915
  },
804
- "version": "0.13.0"
916
+ "version": "0.20.0"
805
917
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/workflow-cli",
3
- "version": "0.13.0",
3
+ "version": "0.20.0",
4
4
  "description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
5
5
  "keywords": [
6
6
  "cli",
@@ -55,16 +55,19 @@
55
55
  "diff": "^9.0.0",
56
56
  "jiti": "^2.7.0",
57
57
  "log-symbols": "^7.0.1",
58
- "ora": "^9.4.0",
59
- "@sanity/workflow-engine": "0.18.0"
58
+ "ora": "^9.4.0"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@types/diff": "^8.0.0",
63
62
  "@types/node": "^24.12.4",
64
63
  "oclif": "^4.23.16",
65
64
  "vitest": "^4.1.8",
66
- "@sanity/workflow-engine-test": "0.13.0",
67
- "@sanity/workflow-examples": "0.8.0"
65
+ "@sanity/workflow-engine": "0.20.0",
66
+ "@sanity/workflow-engine-test": "0.20.0",
67
+ "@sanity/workflow-examples": "0.9.0"
68
+ },
69
+ "peerDependencies": {
70
+ "@sanity/workflow-engine": "0.20.0"
68
71
  },
69
72
  "oclif": {
70
73
  "bin": "sanity-workflows",