@sanity/workflow-cli 0.9.0 → 0.10.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 +485 -0
- package/README.md +62 -18
- package/bin/run.js +0 -4
- package/dist/commands/abort.d.ts +4 -6
- package/dist/commands/abort.js +13 -24
- package/dist/commands/definition/delete.d.ts +2 -2
- package/dist/commands/definition/delete.js +14 -27
- package/dist/commands/definition/diff.d.ts +2 -2
- package/dist/commands/definition/diff.js +3 -12
- package/dist/commands/definition/list.d.ts +3 -4
- package/dist/commands/definition/list.js +40 -46
- package/dist/commands/definition/show.d.ts +22 -3
- package/dist/commands/definition/show.js +23 -21
- package/dist/commands/deploy.d.ts +11 -5
- package/dist/commands/deploy.js +54 -57
- package/dist/commands/diagnose.d.ts +22 -4
- package/dist/commands/diagnose.js +39 -45
- package/dist/commands/fire-action.d.ts +2 -4
- package/dist/commands/fire-action.js +27 -61
- package/dist/commands/list.d.ts +7 -8
- package/dist/commands/list.js +43 -56
- package/dist/commands/reset-activity.js +0 -1
- package/dist/commands/set-stage.d.ts +2 -2
- package/dist/commands/set-stage.js +14 -30
- package/dist/commands/show.d.ts +2 -2
- package/dist/commands/show.js +12 -24
- package/dist/commands/start.d.ts +4 -7
- package/dist/commands/start.js +18 -54
- package/dist/commands/tail.d.ts +2 -2
- package/dist/commands/tail.js +20 -25
- package/dist/hooks/finally/telemetry.d.ts +8 -0
- package/dist/hooks/finally/telemetry.js +13 -0
- package/dist/hooks/prerun/telemetry.d.ts +5 -0
- package/dist/hooks/prerun/telemetry.js +5 -0
- package/dist/index.js +0 -3
- package/dist/lib/base-command.d.ts +14 -0
- package/dist/lib/base-command.js +10 -0
- package/dist/lib/client.js +13 -30
- package/dist/lib/context.d.ts +49 -13
- package/dist/lib/context.js +49 -48
- package/dist/lib/definitions.js +5 -24
- package/dist/lib/diff.d.ts +5 -2
- package/dist/lib/diff.js +61 -27
- package/dist/lib/env.d.ts +4 -0
- package/dist/lib/env.js +4 -3
- package/dist/lib/fail.d.ts +12 -6
- package/dist/lib/fail.js +24 -25
- package/dist/lib/flags.d.ts +0 -7
- package/dist/lib/flags.js +0 -17
- package/dist/lib/load-config.d.ts +11 -7
- package/dist/lib/load-config.js +40 -20
- package/dist/lib/operation-args.d.ts +14 -23
- package/dist/lib/operation-args.js +6 -38
- package/dist/lib/ops-report.d.ts +18 -10
- package/dist/lib/ops-report.js +20 -16
- package/dist/lib/params.js +0 -8
- package/dist/lib/read-fanout.d.ts +22 -0
- package/dist/lib/read-fanout.js +28 -0
- package/dist/lib/select-deployment.js +0 -21
- package/dist/lib/share-definitions.d.ts +86 -0
- package/dist/lib/share-definitions.js +106 -0
- package/dist/lib/stub.js +0 -7
- package/dist/lib/telemetry-setup.d.ts +66 -0
- package/dist/lib/telemetry-setup.js +92 -0
- package/dist/lib/telemetry.d.ts +100 -0
- package/dist/lib/telemetry.js +89 -0
- package/dist/lib/ui.d.ts +33 -1
- package/dist/lib/ui.js +32 -21
- package/oclif.manifest.json +8 -47
- package/package.json +14 -8
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createBatchedStore, createSessionId, defineEvent, defineTrace, } from '@sanity/telemetry';
|
|
2
|
+
import { createTelemetryIntake, isTelemetryEnvDenied, noopTelemetry, } from '@sanity/workflow-engine';
|
|
3
|
+
export const WorkflowCliCommandExecuted = defineTrace({
|
|
4
|
+
name: 'Editorial Workflows CLI Command Executed',
|
|
5
|
+
version: 1,
|
|
6
|
+
description: 'A workflow CLI command was executed — payload is the command id, the names of declared flags used (never their values), and a success flag',
|
|
7
|
+
});
|
|
8
|
+
export const WorkflowDefinitionShared = defineEvent({
|
|
9
|
+
name: 'Editorial Workflows Definition Shared',
|
|
10
|
+
version: 1,
|
|
11
|
+
description: 'A newly created workflow definition version was donated through the explicit definition-sharing opt-in. Content-free marker: the content hash plus the same structural counts Editorial Workflows Definition Deployed carries — the document itself goes to the first-party definition-feedback endpoint, never through telemetry.',
|
|
12
|
+
});
|
|
13
|
+
const OFF = { kind: 'off', logger: noopTelemetry };
|
|
14
|
+
let current = OFF;
|
|
15
|
+
let activeTrace;
|
|
16
|
+
export function cliTelemetry() {
|
|
17
|
+
return current;
|
|
18
|
+
}
|
|
19
|
+
export function setCliTelemetry(telemetry) {
|
|
20
|
+
current = telemetry;
|
|
21
|
+
if (telemetry.kind === 'builtin') {
|
|
22
|
+
activeTrace = telemetry.store.logger.trace(WorkflowCliCommandExecuted);
|
|
23
|
+
activeTrace.start();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function clearCliTelemetry() {
|
|
27
|
+
current = OFF;
|
|
28
|
+
activeTrace = undefined;
|
|
29
|
+
}
|
|
30
|
+
export function createBuiltinTelemetry(args) {
|
|
31
|
+
const { client, projectId, env } = args;
|
|
32
|
+
const envDenied = isTelemetryEnvDenied(env);
|
|
33
|
+
const store = createBatchedStore(createSessionId(), createTelemetryIntake({ client, projectId, denied: envDenied }));
|
|
34
|
+
return { kind: 'builtin', logger: store.logger, store, envDenied };
|
|
35
|
+
}
|
|
36
|
+
function traceAsLogEvent(trace) {
|
|
37
|
+
const { name, version, description } = trace;
|
|
38
|
+
return { type: 'log', name, version, description };
|
|
39
|
+
}
|
|
40
|
+
const FLUSH_DEADLINE_MS = 3_000;
|
|
41
|
+
export async function raceWithDeadline(work, deadlineMs) {
|
|
42
|
+
let deadline;
|
|
43
|
+
try {
|
|
44
|
+
return await Promise.race([
|
|
45
|
+
work,
|
|
46
|
+
new Promise((resolve) => {
|
|
47
|
+
deadline = setTimeout(() => resolve(undefined), deadlineMs);
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
clearTimeout(deadline);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export async function finishCliTelemetry(data) {
|
|
56
|
+
if (current.kind === 'provided') {
|
|
57
|
+
current.logger.log(traceAsLogEvent(WorkflowCliCommandExecuted), data);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (current.kind !== 'builtin')
|
|
61
|
+
return;
|
|
62
|
+
if (activeTrace !== undefined) {
|
|
63
|
+
activeTrace.log(data);
|
|
64
|
+
activeTrace.complete();
|
|
65
|
+
activeTrace = undefined;
|
|
66
|
+
}
|
|
67
|
+
const { store } = current;
|
|
68
|
+
try {
|
|
69
|
+
await raceWithDeadline(store.flush(), FLUSH_DEADLINE_MS);
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
store.end();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function usedFlagNames(argv, flagDefs) {
|
|
76
|
+
const terminator = argv.indexOf('--');
|
|
77
|
+
const tokens = argv.slice(0, terminator === -1 ? argv.length : terminator);
|
|
78
|
+
return Object.entries(flagDefs ?? {})
|
|
79
|
+
.filter(([name, def]) => tokens.some((token) => matchesFlag({ token, name, char: def.char })))
|
|
80
|
+
.map(([name]) => name)
|
|
81
|
+
.sort();
|
|
82
|
+
}
|
|
83
|
+
function matchesFlag(args) {
|
|
84
|
+
const { token, name, char } = args;
|
|
85
|
+
if (token === `--${name}` || token.startsWith(`--${name}=`) || token === `--no-${name}`) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return char !== undefined && (token === `-${char}` || token.startsWith(`-${char}=`));
|
|
89
|
+
}
|
package/dist/lib/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActivityStatus } from '@sanity/workflow-engine';
|
|
1
|
+
import type { ActivityStatus, WorkflowResource } from '@sanity/workflow-engine';
|
|
2
2
|
/**
|
|
3
3
|
* A bold `Title:` section heading. Mirrors the Sanity CLI's `sectionHeader`
|
|
4
4
|
* (name + shape) so it folds into the shared helper when this CLI merges in.
|
|
@@ -15,6 +15,38 @@ export declare function formatKeyValue({ key, value, indent, padTo, }: {
|
|
|
15
15
|
indent?: number;
|
|
16
16
|
padTo?: number;
|
|
17
17
|
}): string;
|
|
18
|
+
/**
|
|
19
|
+
* A borderless column table as printable lines: cyan header row, every
|
|
20
|
+
* column padded to its widest cell, columns joined by three spaces.
|
|
21
|
+
* Mirrors the Sanity CLI's list-table shape (see `projects list`) so it
|
|
22
|
+
* folds into the shared helper when this CLI merges in. Widths count
|
|
23
|
+
* visible characters, so a pre-styled (ANSI) cell still pads correctly.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatTable(headers: string[], rows: string[][]): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Clip a probe-fetched result back to `limit`. The list query builders
|
|
28
|
+
* fetch one row past the display limit; when that probe row comes back,
|
|
29
|
+
* `note` carries the dim "showing the first N" hint to print under the table.
|
|
30
|
+
*/
|
|
31
|
+
export declare function clipToLimit<T>(rows: T[], limit: number): {
|
|
32
|
+
rows: T[];
|
|
33
|
+
note?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The `▸ label` banner printed above a group's output when a run spans
|
|
37
|
+
* several groups (deployments for deploy, resources for fanned-out reads),
|
|
38
|
+
* so each block is attributable. `undefined` for a lone group — it keeps its
|
|
39
|
+
* original unprefixed output. A leading blank line separates every group
|
|
40
|
+
* after the first.
|
|
41
|
+
*/
|
|
42
|
+
export declare function groupBanner({ label, index, total, }: {
|
|
43
|
+
label: string;
|
|
44
|
+
index: number;
|
|
45
|
+
total: number;
|
|
46
|
+
}): string | undefined;
|
|
47
|
+
/** A workflow resource as a display label: a dataset's `project.dataset` id
|
|
48
|
+
* reads naturally bare; other resource types keep their type for clarity. */
|
|
49
|
+
export declare function resourceLabel(resource: WorkflowResource): string;
|
|
18
50
|
/** Status glyph per activity state. log-symbols ship pre-colored (green ✔, red ✖),
|
|
19
51
|
* so those need no extra wrap; the rest carry their own state color. */
|
|
20
52
|
export declare const activityIcon: Record<ActivityStatus, string>;
|
package/dist/lib/ui.js
CHANGED
|
@@ -1,26 +1,46 @@
|
|
|
1
|
-
import { styleText } from 'node:util';
|
|
1
|
+
import { stripVTControlCharacters, styleText } from 'node:util';
|
|
2
2
|
import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';
|
|
3
3
|
import { lightFormat } from 'date-fns/lightFormat';
|
|
4
4
|
import { parseISO } from 'date-fns/parseISO';
|
|
5
5
|
import logSymbols from 'log-symbols';
|
|
6
|
-
/**
|
|
7
|
-
* A bold `Title:` section heading. Mirrors the Sanity CLI's `sectionHeader`
|
|
8
|
-
* (name + shape) so it folds into the shared helper when this CLI merges in.
|
|
9
|
-
*/
|
|
10
6
|
export function sectionHeader(title) {
|
|
11
7
|
return styleText('bold', `${title}:`);
|
|
12
8
|
}
|
|
13
|
-
/**
|
|
14
|
-
* A ` key: value` detail row — a dim, padded key then the value. Mirrors
|
|
15
|
-
* the Sanity CLI's `formatKeyValue` so it folds into the shared helper on
|
|
16
|
-
* merge; pass `padTo` (the longest key's length) to align a block of rows.
|
|
17
|
-
*/
|
|
18
9
|
export function formatKeyValue({ key, value, indent = 2, padTo = 0, }) {
|
|
19
10
|
const paddedKey = `${key}:`.padEnd(padTo > 0 ? padTo + 1 : key.length + 1);
|
|
20
11
|
return `${' '.repeat(indent)}${styleText('dim', paddedKey)} ${value}`;
|
|
21
12
|
}
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
export function formatTable(headers, rows) {
|
|
14
|
+
const width = (cell) => stripVTControlCharacters(cell).length;
|
|
15
|
+
const widths = headers.map((header, i) => Math.max(width(header), ...rows.map((row) => width(row[i] ?? ''))));
|
|
16
|
+
const formatRow = (row) => widths
|
|
17
|
+
.map((columnWidth, i) => {
|
|
18
|
+
const cell = row[i] ?? '';
|
|
19
|
+
return cell + ' '.repeat(columnWidth - width(cell));
|
|
20
|
+
})
|
|
21
|
+
.join(' ')
|
|
22
|
+
.trimEnd();
|
|
23
|
+
return [styleText('cyan', formatRow(headers)), ...rows.map(formatRow)];
|
|
24
|
+
}
|
|
25
|
+
export function clipToLimit(rows, limit) {
|
|
26
|
+
if (rows.length <= limit) {
|
|
27
|
+
return { rows };
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
rows: rows.slice(0, limit),
|
|
31
|
+
note: styleText('dim', `showing the first ${limit} — raise --limit to see more`),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function groupBanner({ label, index, total, }) {
|
|
35
|
+
if (total <= 1) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const gap = index > 0 ? '\n' : '';
|
|
39
|
+
return `${gap}${styleText('bold', `▸ ${label}`)}`;
|
|
40
|
+
}
|
|
41
|
+
export function resourceLabel(resource) {
|
|
42
|
+
return resource.type === 'dataset' ? resource.id : `${resource.type}:${resource.id}`;
|
|
43
|
+
}
|
|
24
44
|
export const activityIcon = {
|
|
25
45
|
done: logSymbols.success,
|
|
26
46
|
active: styleText('cyan', '●'),
|
|
@@ -28,25 +48,16 @@ export const activityIcon = {
|
|
|
28
48
|
failed: logSymbols.error,
|
|
29
49
|
skipped: styleText('dim', '⊘'),
|
|
30
50
|
};
|
|
31
|
-
/** Parse an engine ISO-8601 timestamp, or `undefined` when it's missing or
|
|
32
|
-
* unparseable. The engine writes valid ISO, but the lake is the only
|
|
33
|
-
* enforcement boundary — a legacy or raw-client-written doc can carry a bad
|
|
34
|
-
* or absent timestamp, and `parseISO`/`lightFormat` throw on those. Callers
|
|
35
|
-
* fall back to the raw value so one bad field never crashes a whole command. */
|
|
36
51
|
function parseTimestamp(iso) {
|
|
37
52
|
if (!iso)
|
|
38
53
|
return undefined;
|
|
39
54
|
const date = parseISO(iso);
|
|
40
55
|
return Number.isNaN(date.getTime()) ? undefined : date;
|
|
41
56
|
}
|
|
42
|
-
/** An engine ISO-8601 timestamp as an absolute `yyyy-MM-dd HH:mm:ss` — the
|
|
43
|
-
* Sanity CLI's audit-log format (see `backups/list`). For detail views. */
|
|
44
57
|
export function formatTimestamp(iso) {
|
|
45
58
|
const date = parseTimestamp(iso);
|
|
46
59
|
return date ? lightFormat(date, 'yyyy-MM-dd HH:mm:ss') : iso;
|
|
47
60
|
}
|
|
48
|
-
/** An engine ISO-8601 timestamp as a relative `… ago` — the Sanity CLI's
|
|
49
|
-
* job-list format (see `datasets/copy`). For scannable overview tables. */
|
|
50
61
|
export function formatAge(iso) {
|
|
51
62
|
const date = parseTimestamp(iso);
|
|
52
63
|
return date ? `${formatDistanceToNow(date)} ago` : iso;
|
package/oclif.manifest.json
CHANGED
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"pluginName": "@sanity/workflow-cli",
|
|
38
38
|
"pluginType": "core",
|
|
39
39
|
"strict": true,
|
|
40
|
-
"enableJsonFlag": false,
|
|
41
40
|
"isESM": true,
|
|
42
41
|
"relativePath": [
|
|
43
42
|
"dist",
|
|
@@ -91,6 +90,12 @@
|
|
|
91
90
|
"hasDynamicHelp": false,
|
|
92
91
|
"multiple": false,
|
|
93
92
|
"type": "option"
|
|
93
|
+
},
|
|
94
|
+
"share-definitions-with-sanity": {
|
|
95
|
+
"description": "Share the definition documents newly created by this deploy with Sanity — the full document, verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment coordinates (project and dataset, or resource id); never content documents, instances, or your Sanity auth token. Opt-in for this invocation only; the CLI never prompts. Independent of telemetry consent.",
|
|
96
|
+
"name": "share-definitions-with-sanity",
|
|
97
|
+
"allowNo": false,
|
|
98
|
+
"type": "boolean"
|
|
94
99
|
}
|
|
95
100
|
},
|
|
96
101
|
"hasDynamicHelp": false,
|
|
@@ -100,7 +105,6 @@
|
|
|
100
105
|
"pluginName": "@sanity/workflow-cli",
|
|
101
106
|
"pluginType": "core",
|
|
102
107
|
"strict": true,
|
|
103
|
-
"enableJsonFlag": false,
|
|
104
108
|
"isESM": true,
|
|
105
109
|
"relativePath": [
|
|
106
110
|
"dist",
|
|
@@ -145,7 +149,6 @@
|
|
|
145
149
|
"pluginName": "@sanity/workflow-cli",
|
|
146
150
|
"pluginType": "core",
|
|
147
151
|
"strict": true,
|
|
148
|
-
"enableJsonFlag": false,
|
|
149
152
|
"isESM": true,
|
|
150
153
|
"relativePath": [
|
|
151
154
|
"dist",
|
|
@@ -162,11 +165,10 @@
|
|
|
162
165
|
"required": true
|
|
163
166
|
}
|
|
164
167
|
},
|
|
165
|
-
"description": "Fire an action on an instance
|
|
168
|
+
"description": "Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to list what can be fired.",
|
|
166
169
|
"examples": [
|
|
167
170
|
"<%= config.bin %> fire-action wf-instance.abc123",
|
|
168
171
|
"<%= config.bin %> fire-action wf-instance.abc123 --activity approve --action approve",
|
|
169
|
-
"<%= config.bin %> fire-action wf-instance.abc123 --activity approve --action approve --as user.xyz --as-role editor",
|
|
170
172
|
"<%= config.bin %> fire-action wf-instance.abc123 --activity publish --action publish --param note=shipping"
|
|
171
173
|
],
|
|
172
174
|
"flags": {
|
|
@@ -199,21 +201,6 @@
|
|
|
199
201
|
"multiple": true,
|
|
200
202
|
"type": "option"
|
|
201
203
|
},
|
|
202
|
-
"as": {
|
|
203
|
-
"description": "Attribute the write to this Sanity user id (default: a workflow-cli system actor).",
|
|
204
|
-
"name": "as",
|
|
205
|
-
"hasDynamicHelp": false,
|
|
206
|
-
"multiple": false,
|
|
207
|
-
"type": "option"
|
|
208
|
-
},
|
|
209
|
-
"as-role": {
|
|
210
|
-
"description": "Role to attribute to the --as user (repeatable), so role-gated filters pass.",
|
|
211
|
-
"name": "as-role",
|
|
212
|
-
"default": [],
|
|
213
|
-
"hasDynamicHelp": false,
|
|
214
|
-
"multiple": true,
|
|
215
|
-
"type": "option"
|
|
216
|
-
},
|
|
217
204
|
"json": {
|
|
218
205
|
"description": "Emit structured JSON instead of rendered output.",
|
|
219
206
|
"name": "json",
|
|
@@ -228,7 +215,6 @@
|
|
|
228
215
|
"pluginName": "@sanity/workflow-cli",
|
|
229
216
|
"pluginType": "core",
|
|
230
217
|
"strict": true,
|
|
231
|
-
"enableJsonFlag": false,
|
|
232
218
|
"isESM": true,
|
|
233
219
|
"relativePath": [
|
|
234
220
|
"dist",
|
|
@@ -289,7 +275,6 @@
|
|
|
289
275
|
"pluginName": "@sanity/workflow-cli",
|
|
290
276
|
"pluginType": "core",
|
|
291
277
|
"strict": true,
|
|
292
|
-
"enableJsonFlag": false,
|
|
293
278
|
"isESM": true,
|
|
294
279
|
"relativePath": [
|
|
295
280
|
"dist",
|
|
@@ -373,7 +358,6 @@
|
|
|
373
358
|
"pluginName": "@sanity/workflow-cli",
|
|
374
359
|
"pluginType": "core",
|
|
375
360
|
"strict": true,
|
|
376
|
-
"enableJsonFlag": false,
|
|
377
361
|
"isESM": true,
|
|
378
362
|
"relativePath": [
|
|
379
363
|
"dist",
|
|
@@ -422,7 +406,6 @@
|
|
|
422
406
|
"pluginName": "@sanity/workflow-cli",
|
|
423
407
|
"pluginType": "core",
|
|
424
408
|
"strict": true,
|
|
425
|
-
"enableJsonFlag": false,
|
|
426
409
|
"isESM": true,
|
|
427
410
|
"relativePath": [
|
|
428
411
|
"dist",
|
|
@@ -443,7 +426,6 @@
|
|
|
443
426
|
"examples": [
|
|
444
427
|
"<%= config.bin %> start productLaunch",
|
|
445
428
|
"<%= config.bin %> start article-review --field subject='{\"id\":\"dataset:proj:ds:article-1\",\"type\":\"article\"}'",
|
|
446
|
-
"<%= config.bin %> start article-review --as user.xyz --as-role editor",
|
|
447
429
|
"<%= config.bin %> start productLaunch --version 2 --tag prod"
|
|
448
430
|
],
|
|
449
431
|
"flags": {
|
|
@@ -469,21 +451,6 @@
|
|
|
469
451
|
"multiple": true,
|
|
470
452
|
"type": "option"
|
|
471
453
|
},
|
|
472
|
-
"as": {
|
|
473
|
-
"description": "Attribute the write to this Sanity user id (default: a workflow-cli system actor).",
|
|
474
|
-
"name": "as",
|
|
475
|
-
"hasDynamicHelp": false,
|
|
476
|
-
"multiple": false,
|
|
477
|
-
"type": "option"
|
|
478
|
-
},
|
|
479
|
-
"as-role": {
|
|
480
|
-
"description": "Role to attribute to the --as user (repeatable), so role-gated filters pass.",
|
|
481
|
-
"name": "as-role",
|
|
482
|
-
"default": [],
|
|
483
|
-
"hasDynamicHelp": false,
|
|
484
|
-
"multiple": true,
|
|
485
|
-
"type": "option"
|
|
486
|
-
},
|
|
487
454
|
"json": {
|
|
488
455
|
"description": "Emit structured JSON instead of rendered output.",
|
|
489
456
|
"name": "json",
|
|
@@ -498,7 +465,6 @@
|
|
|
498
465
|
"pluginName": "@sanity/workflow-cli",
|
|
499
466
|
"pluginType": "core",
|
|
500
467
|
"strict": true,
|
|
501
|
-
"enableJsonFlag": false,
|
|
502
468
|
"isESM": true,
|
|
503
469
|
"relativePath": [
|
|
504
470
|
"dist",
|
|
@@ -535,7 +501,6 @@
|
|
|
535
501
|
"pluginName": "@sanity/workflow-cli",
|
|
536
502
|
"pluginType": "core",
|
|
537
503
|
"strict": true,
|
|
538
|
-
"enableJsonFlag": false,
|
|
539
504
|
"isESM": true,
|
|
540
505
|
"relativePath": [
|
|
541
506
|
"dist",
|
|
@@ -594,7 +559,6 @@
|
|
|
594
559
|
"pluginName": "@sanity/workflow-cli",
|
|
595
560
|
"pluginType": "core",
|
|
596
561
|
"strict": true,
|
|
597
|
-
"enableJsonFlag": false,
|
|
598
562
|
"isESM": true,
|
|
599
563
|
"relativePath": [
|
|
600
564
|
"dist",
|
|
@@ -640,7 +604,6 @@
|
|
|
640
604
|
"pluginName": "@sanity/workflow-cli",
|
|
641
605
|
"pluginType": "core",
|
|
642
606
|
"strict": true,
|
|
643
|
-
"enableJsonFlag": false,
|
|
644
607
|
"isESM": true,
|
|
645
608
|
"relativePath": [
|
|
646
609
|
"dist",
|
|
@@ -688,7 +651,6 @@
|
|
|
688
651
|
"pluginName": "@sanity/workflow-cli",
|
|
689
652
|
"pluginType": "core",
|
|
690
653
|
"strict": true,
|
|
691
|
-
"enableJsonFlag": false,
|
|
692
654
|
"isESM": true,
|
|
693
655
|
"relativePath": [
|
|
694
656
|
"dist",
|
|
@@ -730,7 +692,6 @@
|
|
|
730
692
|
"pluginName": "@sanity/workflow-cli",
|
|
731
693
|
"pluginType": "core",
|
|
732
694
|
"strict": true,
|
|
733
|
-
"enableJsonFlag": false,
|
|
734
695
|
"isESM": true,
|
|
735
696
|
"relativePath": [
|
|
736
697
|
"dist",
|
|
@@ -740,5 +701,5 @@
|
|
|
740
701
|
]
|
|
741
702
|
}
|
|
742
703
|
},
|
|
743
|
-
"version": "0.
|
|
704
|
+
"version": "0.10.0"
|
|
744
705
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workflow-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist",
|
|
29
29
|
"bin/run.js",
|
|
30
|
-
"oclif.manifest.json"
|
|
30
|
+
"oclif.manifest.json",
|
|
31
|
+
"CHANGELOG.md"
|
|
31
32
|
],
|
|
32
33
|
"type": "module",
|
|
33
34
|
"sideEffects": false,
|
|
@@ -41,34 +42,38 @@
|
|
|
41
42
|
"./package.json": "./package.json"
|
|
42
43
|
},
|
|
43
44
|
"publishConfig": {
|
|
44
|
-
"access": "
|
|
45
|
+
"access": "public"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@oclif/core": "^4.11.4",
|
|
48
49
|
"@oclif/plugin-help": "^6.2.50",
|
|
49
50
|
"@sanity/cli-core": "^2.1.1",
|
|
50
51
|
"@sanity/client": "^7.22.1",
|
|
52
|
+
"@sanity/telemetry": "^1.1.0",
|
|
51
53
|
"boxen": "^8.0.1",
|
|
52
|
-
"console-table-printer": "^2.16.0",
|
|
53
54
|
"date-fns": "^4.4.0",
|
|
54
55
|
"diff": "^9.0.0",
|
|
55
56
|
"jiti": "^2.7.0",
|
|
56
57
|
"log-symbols": "^7.0.1",
|
|
57
58
|
"ora": "^9.4.0",
|
|
58
|
-
"@sanity/workflow-engine": "0.
|
|
59
|
+
"@sanity/workflow-engine": "0.15.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@types/diff": "^8.0.0",
|
|
62
63
|
"@types/node": "^24.12.4",
|
|
63
64
|
"oclif": "^4.23.16",
|
|
64
65
|
"vitest": "^4.1.8",
|
|
65
|
-
"@sanity/workflow-engine-test": "0.
|
|
66
|
-
"@sanity/workflow-examples": "0.
|
|
66
|
+
"@sanity/workflow-engine-test": "0.10.0",
|
|
67
|
+
"@sanity/workflow-examples": "0.5.0"
|
|
67
68
|
},
|
|
68
69
|
"oclif": {
|
|
69
70
|
"bin": "sanity-workflows",
|
|
70
71
|
"commands": "./dist/commands",
|
|
71
72
|
"dirname": "sanity-workflows",
|
|
73
|
+
"hooks": {
|
|
74
|
+
"finally": "./dist/hooks/finally/telemetry",
|
|
75
|
+
"prerun": "./dist/hooks/prerun/telemetry"
|
|
76
|
+
},
|
|
72
77
|
"plugins": [
|
|
73
78
|
"@oclif/plugin-help"
|
|
74
79
|
],
|
|
@@ -86,9 +91,10 @@
|
|
|
86
91
|
"node": ">=20.12"
|
|
87
92
|
},
|
|
88
93
|
"scripts": {
|
|
89
|
-
"build": "tsc -p tsconfig.build.json",
|
|
94
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc -p tsconfig.declarations.json",
|
|
90
95
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
91
96
|
"test": "vitest run",
|
|
97
|
+
"test:packaging": "vitest run --config vitest.packaging.config.ts",
|
|
92
98
|
"test:watch": "vitest",
|
|
93
99
|
"dev": "NODE_OPTIONS='--conditions=development' tsx --env-file-if-exists=../../.env bin/dev.js",
|
|
94
100
|
"cli": "NODE_OPTIONS='--conditions=development' tsx --env-file-if-exists=../../.env bin/dev.js"
|