@sanity/workflow-cli 0.28.0 → 0.29.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/CHANGELOG.md +28 -0
- package/README.md +26 -24
- package/dist/command-ids.d.ts +8 -0
- package/dist/command-ids.js +8 -0
- package/dist/help.js +3 -4
- package/dist/hooks/finally/telemetry.d.ts +2 -1
- package/dist/hooks/prerun/telemetry.d.ts +2 -1
- package/dist/hooks/prerun/telemetry.js +7 -0
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @sanity/workflow-cli
|
|
2
2
|
|
|
3
|
+
## 0.29.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8bb6a85: The workflow CLI README lists commands with operator-facing descriptions instead of implementation status.
|
|
8
|
+
|
|
9
|
+
**No upgrade action required.** Command behavior is unchanged.
|
|
10
|
+
|
|
11
|
+
**Docs impact:** `packages/workflow-cli` README — the former Command status table is now Command list.
|
|
12
|
+
|
|
13
|
+
- 772876b: When this package is mounted inside the official `sanity` CLI, its telemetry prerun hook no longer installs a store for host commands outside the `workflows` topic (the finally hook already no-ops when telemetry was never installed). Previously every `sanity` command in a directory with a `sanity.workflow.ts` could load workflow config, show the workflow-cli disclosure, and emit an `Editorial Workflows CLI Command Executed` event for unrelated commands such as `sanity dataset list`. Standalone `sanity-workflows` behaviour is unchanged.
|
|
14
|
+
|
|
15
|
+
**No upgrade action required** for standalone users. Hosts that already mount this package as an oclif plugin pick up the safer hook scope on upgrade — no config change.
|
|
16
|
+
|
|
17
|
+
**Docs impact:** None — host-mount telemetry scoping only; documented invoke paths are unchanged.
|
|
18
|
+
|
|
19
|
+
- 772876b: The `workflows` topic help description no longer uses an em dash. It now reads "Deploy, inspect, and administer Editorial Workflows definitions and instances", matching the plain phrasing of other product CLI topics.
|
|
20
|
+
|
|
21
|
+
**No upgrade action required.**
|
|
22
|
+
|
|
23
|
+
**Docs impact:** None — help copy only; documented invoke paths are unchanged.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [f44fc33]
|
|
26
|
+
- Updated dependencies [26f25e0]
|
|
27
|
+
- Updated dependencies [25bd1fb]
|
|
28
|
+
- Updated dependencies [3fd04f1]
|
|
29
|
+
- @sanity/workflow-engine@0.29.0
|
|
30
|
+
|
|
3
31
|
## 0.28.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -153,30 +153,32 @@ stale compiled output.
|
|
|
153
153
|
> `--dry-run` and `--only` don't collide with pnpm flags and work
|
|
154
154
|
> through the normal `pnpm --filter … dev …` invocation.
|
|
155
155
|
|
|
156
|
-
## Command
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
| `deploy
|
|
163
|
-
| `deploy --
|
|
164
|
-
| `deploy --
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `definition
|
|
177
|
-
| `definition
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
156
|
+
## Command list
|
|
157
|
+
|
|
158
|
+
Invoke as `sanity-workflows <command>` (or `sanity workflows <command>` once the host CLI mount lands).
|
|
159
|
+
|
|
160
|
+
| Command | Description |
|
|
161
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
162
|
+
| `deploy` | Validate and deploy the definitions in the selected deployment. |
|
|
163
|
+
| `deploy --all-tags` | Deploy every deployment in the config. A failure in one does not stop the rest. |
|
|
164
|
+
| `deploy --check` | Validate local definitions without contacting the dataset. |
|
|
165
|
+
| `deploy --dry-run` | Show a diff against what is already deployed, without writing. |
|
|
166
|
+
| `deploy --only <name>` | Limit deploy, check, or dry-run to one definition. |
|
|
167
|
+
| `start <name>` | Start an instance from a deployed definition. Pass `--field` for input values. |
|
|
168
|
+
| `list` | List instances (in-flight by default). Filter with `--definition`. |
|
|
169
|
+
| `show <instance-id>` | Show an instance's state, activities, and effects. |
|
|
170
|
+
| `diagnose <instance-id>` | Explain why an instance is or isn't progressing, and what would unstick it. |
|
|
171
|
+
| `tail <instance-id>` | Stream new history entries as they land. |
|
|
172
|
+
| `abort <instance-id>` | Stop an in-flight instance. Pending effects cancel; the instance stays where it is. |
|
|
173
|
+
| `set-stage <instance-id> --to <stage>` | Move an instance to a stage, skipping declared transitions. The target stage's enter lifecycle still runs. |
|
|
174
|
+
| `reset-activity <instance-id> <activity>` | Re-run a failed activity, or `--skip` it so a gated transition can fire. |
|
|
175
|
+
| `fire-action <instance-id>` | Fire an action on a waiting activity. Omit `--action` to list what can be fired. |
|
|
176
|
+
| `definition list` | List deployed definitions. |
|
|
177
|
+
| `definition show <name>` | Show a deployed definition (latest version, or `--version`). |
|
|
178
|
+
| `definition diff <name>` | Diff the in-code definition against what is deployed. |
|
|
179
|
+
| `definition delete <name>` | Delete a deployed definition. Refuses while live instances exist unless `--cascade`. |
|
|
180
|
+
| `nuke --deployment <name>` / `nuke --tag <tag>` | Dev reset: delete every engine-owned document for that tag (instances, definitions, guards). Prints a plan, then asks for confirmation. Content documents are never touched. |
|
|
181
|
+
| `nuke --instance <id>` | Dev reset: delete one finished instance and its guards. Refuses in-flight instances (abort first). |
|
|
180
182
|
|
|
181
183
|
## Telemetry
|
|
182
184
|
|
package/dist/command-ids.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export declare const WORKFLOWS_TOPIC = "workflows";
|
|
2
|
+
export declare const WORKFLOWS_TOPIC_PREFIX = "workflows:";
|
|
2
3
|
export declare const WORKFLOWS_DEPLOY_COMMAND_ID = "workflows:deploy";
|
|
4
|
+
/** Standalone binary name from package.json `oclif.bin` / `bin`. */
|
|
5
|
+
export declare const STANDALONE_BIN = "sanity-workflows";
|
|
6
|
+
/** True on `sanity-workflows`, or on a host only for `workflows` / `workflows:*`. */
|
|
7
|
+
export declare function shouldRunWorkflowCliTelemetry(args: {
|
|
8
|
+
bin: string;
|
|
9
|
+
commandId: string | undefined;
|
|
10
|
+
}): boolean;
|
package/dist/command-ids.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export const WORKFLOWS_TOPIC = 'workflows';
|
|
2
|
+
export const WORKFLOWS_TOPIC_PREFIX = `${WORKFLOWS_TOPIC}:`;
|
|
2
3
|
export const WORKFLOWS_DEPLOY_COMMAND_ID = `${WORKFLOWS_TOPIC}:deploy`;
|
|
4
|
+
export const STANDALONE_BIN = 'sanity-workflows';
|
|
5
|
+
export function shouldRunWorkflowCliTelemetry(args) {
|
|
6
|
+
const { bin, commandId } = args;
|
|
7
|
+
return (bin === STANDALONE_BIN ||
|
|
8
|
+
commandId === WORKFLOWS_TOPIC ||
|
|
9
|
+
commandId?.startsWith(WORKFLOWS_TOPIC_PREFIX) === true);
|
|
10
|
+
}
|
package/dist/help.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Help } from '@oclif/core';
|
|
2
|
-
import { WORKFLOWS_TOPIC } from "./command-ids.js";
|
|
3
|
-
const TOPIC_PREFIX = `${WORKFLOWS_TOPIC}:`;
|
|
2
|
+
import { WORKFLOWS_TOPIC, WORKFLOWS_TOPIC_PREFIX } from "./command-ids.js";
|
|
4
3
|
const CANONICAL_EXAMPLE_PREFIX = `<%= config.bin %> ${WORKFLOWS_TOPIC} `;
|
|
5
4
|
const STANDALONE_EXAMPLE_PREFIX = '<%= config.bin %> ';
|
|
6
5
|
const HELP_COMMAND_ID = 'help';
|
|
7
6
|
export const standaloneSurfaceId = (id) => {
|
|
8
|
-
if (!id.startsWith(
|
|
7
|
+
if (!id.startsWith(WORKFLOWS_TOPIC_PREFIX))
|
|
9
8
|
return undefined;
|
|
10
|
-
return id.slice(
|
|
9
|
+
return id.slice(WORKFLOWS_TOPIC_PREFIX.length);
|
|
11
10
|
};
|
|
12
11
|
export const keepCommandAtRoot = (id) => id === HELP_COMMAND_ID || standaloneSurfaceId(id) !== undefined;
|
|
13
12
|
export const standaloneExample = (example) => {
|
|
@@ -2,7 +2,8 @@ import type { Hook } from '@oclif/core';
|
|
|
2
2
|
/**
|
|
3
3
|
* Completes the command trace — command id, declared-flag names, success —
|
|
4
4
|
* and flushes the final batch. Runs on success and on error alike (oclif's
|
|
5
|
-
* `finally`); an invocation the prerun hook left with telemetry off no-ops
|
|
5
|
+
* `finally`); an invocation the prerun hook left with telemetry off no-ops,
|
|
6
|
+
* which is what keeps host commands outside the `workflows` topic silent.
|
|
6
7
|
*/
|
|
7
8
|
declare const hook: Hook<'finally'>;
|
|
8
9
|
export default hook;
|
|
@@ -4,6 +4,7 @@ import type { Hook } from '@oclif/core';
|
|
|
4
4
|
* A deploy that may share definitions—flagless by default or explicitly
|
|
5
5
|
* enabled—forces the store to send despite CI / `DO_NOT_TRACK`. This is
|
|
6
6
|
* resolved from raw argv because the store is built before oclif parses
|
|
7
|
-
* flags.
|
|
7
|
+
* flags. Skips non-workflows commands when this package is mounted as a
|
|
8
|
+
* host plugin so `sanity dataset list` does not inherit the shell. */
|
|
8
9
|
declare const hook: Hook<'prerun'>;
|
|
9
10
|
export default hook;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { shouldRunWorkflowCliTelemetry } from "../../command-ids.js";
|
|
1
2
|
import { shouldForceShareTelemetry } from "../../lib/share-definitions.js";
|
|
2
3
|
import { setupCliTelemetry } from "../../lib/telemetry-setup.js";
|
|
3
4
|
const hook = async function ({ config, Command, argv }) {
|
|
5
|
+
if (!shouldRunWorkflowCliTelemetry({
|
|
6
|
+
bin: config.bin,
|
|
7
|
+
commandId: Command?.id,
|
|
8
|
+
})) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
4
11
|
await setupCliTelemetry({
|
|
5
12
|
cliVersion: config.version,
|
|
6
13
|
forceSend: shouldForceShareTelemetry({ commandId: Command?.id, argv }),
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workflow-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"@types/node": "^24.12.4",
|
|
63
63
|
"oclif": "^4.23.16",
|
|
64
64
|
"vitest": "^4.1.8",
|
|
65
|
-
"@sanity/workflow-engine": "0.
|
|
66
|
-
"@sanity/workflow-engine-test": "0.
|
|
67
|
-
"@sanity/workflow-examples": "0.10.
|
|
65
|
+
"@sanity/workflow-engine": "0.29.0",
|
|
66
|
+
"@sanity/workflow-engine-test": "0.29.0",
|
|
67
|
+
"@sanity/workflow-examples": "0.10.8"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@sanity/workflow-engine": "0.
|
|
70
|
+
"@sanity/workflow-engine": "0.29.0"
|
|
71
71
|
},
|
|
72
72
|
"oclif": {
|
|
73
73
|
"bin": "sanity-workflows",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"topicSeparator": " ",
|
|
85
85
|
"topics": {
|
|
86
86
|
"workflows": {
|
|
87
|
-
"description": "
|
|
87
|
+
"description": "Deploy, inspect, and administer Editorial Workflows definitions and instances",
|
|
88
88
|
"subtopics": {
|
|
89
89
|
"definition": {
|
|
90
90
|
"description": "Read and manage workflow definitions"
|