@sanity/runtime-cli 11.2.1 → 12.0.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/README.md +36 -38
- package/dist/actions/blueprints/blueprint.d.ts +3 -0
- package/dist/actions/blueprints/blueprint.js +26 -14
- package/dist/actions/blueprints/config.d.ts +34 -3
- package/dist/actions/blueprints/config.js +67 -14
- package/dist/actions/blueprints/stacks.d.ts +1 -2
- package/dist/actions/blueprints/stacks.js +2 -3
- package/dist/commands/blueprints/config.d.ts +0 -1
- package/dist/commands/blueprints/config.js +4 -12
- package/dist/commands/blueprints/deploy.js +1 -1
- package/dist/commands/blueprints/destroy.js +3 -3
- package/dist/commands/blueprints/info.js +2 -2
- package/dist/commands/blueprints/init.d.ts +1 -0
- package/dist/commands/blueprints/init.js +4 -0
- package/dist/commands/blueprints/logs.js +2 -2
- package/dist/commands/blueprints/plan.js +1 -0
- package/dist/config.d.ts +2 -1
- package/dist/config.js +8 -1
- package/dist/cores/blueprints/config.d.ts +1 -1
- package/dist/cores/blueprints/config.js +92 -78
- package/dist/cores/blueprints/deploy.js +8 -8
- package/dist/cores/blueprints/destroy.d.ts +1 -0
- package/dist/cores/blueprints/destroy.js +22 -26
- package/dist/cores/blueprints/doctor.js +24 -72
- package/dist/cores/blueprints/info.d.ts +1 -0
- package/dist/cores/blueprints/info.js +5 -4
- package/dist/cores/blueprints/init.d.ts +1 -1
- package/dist/cores/blueprints/init.js +50 -78
- package/dist/cores/blueprints/logs.d.ts +1 -0
- package/dist/cores/blueprints/logs.js +7 -7
- package/dist/cores/blueprints/plan.d.ts +3 -0
- package/dist/cores/blueprints/plan.js +5 -4
- package/dist/cores/blueprints/stacks.d.ts +1 -0
- package/dist/cores/blueprints/stacks.js +1 -2
- package/dist/cores/functions/add.js +58 -70
- package/dist/cores/functions/logs.js +2 -4
- package/dist/cores/index.js +3 -3
- package/dist/utils/display/blueprints-formatting.js +8 -3
- package/dist/utils/display/errors.js +2 -2
- package/dist/utils/display/presenters.d.ts +2 -0
- package/dist/utils/display/presenters.js +7 -0
- package/dist/utils/display/prompt.d.ts +14 -2
- package/dist/utils/display/prompt.js +60 -41
- package/dist/utils/types.d.ts +0 -1
- package/oclif.manifest.json +19 -26
- package/package.json +4 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { cwd } from 'node:process';
|
|
4
|
+
import { checkbox, confirm, input, select } from '@inquirer/prompts';
|
|
4
5
|
import { highlight } from 'cardinal';
|
|
5
6
|
import chalk from 'chalk';
|
|
6
|
-
import inquirer from 'inquirer';
|
|
7
7
|
import { createFunctionResource } from '../../actions/blueprints/resources.js';
|
|
8
8
|
import { verifyExampleExists, writeExample } from '../../actions/sanity/examples.js';
|
|
9
9
|
import { check, indent, warn } from '../../utils/display/presenters.js';
|
|
@@ -198,86 +198,74 @@ export async function functionAddCore(options) {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
async function promptForFunctionName() {
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
name
|
|
205
|
-
|
|
206
|
-
validate: (input) => validateFunctionName(input) ||
|
|
207
|
-
'Invalid function name. Must be 6+ characters, no special characters, no spaces',
|
|
208
|
-
},
|
|
209
|
-
]);
|
|
201
|
+
const functionName = await input({
|
|
202
|
+
message: 'Enter function name:',
|
|
203
|
+
validate: (input) => validateFunctionName(input) ||
|
|
204
|
+
'Invalid function name. Must be 6+ characters, no special characters, no spaces',
|
|
205
|
+
});
|
|
210
206
|
return functionName;
|
|
211
207
|
}
|
|
212
208
|
async function promptForFunctionType() {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
},
|
|
209
|
+
function hasAtLeastOne(arr) {
|
|
210
|
+
// TypeScript believes me when I make a funciton to "guard" the type
|
|
211
|
+
return arr.length > 0;
|
|
212
|
+
}
|
|
213
|
+
const functionTypes = await checkbox({
|
|
214
|
+
message: 'Choose events to trigger your function:',
|
|
215
|
+
choices: [
|
|
216
|
+
{ name: 'Document Create', value: 'document-create', checked: true },
|
|
217
|
+
{ name: 'Document Update', value: 'document-update', checked: true },
|
|
218
|
+
{ name: 'Document Delete', value: 'document-delete' },
|
|
219
|
+
{ name: 'Media Library Asset Create', value: 'media-library-asset-create' },
|
|
220
|
+
{ name: 'Media Library Asset Update', value: 'media-library-asset-update' },
|
|
221
|
+
{ name: 'Media Library Asset Delete', value: 'media-library-asset-delete' },
|
|
222
|
+
],
|
|
223
|
+
validate(choices) {
|
|
224
|
+
if (choices.length === 0) {
|
|
225
|
+
return 'You must choose at least one function type / document change event';
|
|
226
|
+
}
|
|
227
|
+
if (choices.some((c) => String(c.value).startsWith('media-library')) &&
|
|
228
|
+
choices.some((c) => String(c.value).startsWith('document'))) {
|
|
229
|
+
return 'You cannot mix both Document and Media Library Asset events together in one Function';
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
237
232
|
},
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
});
|
|
234
|
+
// checking functionTypes.length > 0 doesn't narrow the type
|
|
235
|
+
// validate should prevent this from happening, but just in case
|
|
236
|
+
if (!hasAtLeastOne(functionTypes)) {
|
|
237
|
+
throw new Error('You must choose at least one function type / document change event');
|
|
238
|
+
}
|
|
239
|
+
return functionTypes;
|
|
240
240
|
}
|
|
241
241
|
async function promptForFunctionLang() {
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
name: '
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
],
|
|
251
|
-
default: 'ts',
|
|
252
|
-
},
|
|
253
|
-
]);
|
|
242
|
+
const functionLang = await select({
|
|
243
|
+
message: 'Choose function language:',
|
|
244
|
+
choices: [
|
|
245
|
+
{ name: 'TypeScript', value: 'ts' },
|
|
246
|
+
{ name: 'JavaScript', value: 'js' },
|
|
247
|
+
],
|
|
248
|
+
default: 'ts',
|
|
249
|
+
});
|
|
254
250
|
return functionLang;
|
|
255
251
|
}
|
|
256
252
|
async function promptForAddHelpers() {
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
message: 'Add @sanity/functions helpers to the new Function?',
|
|
262
|
-
default: true,
|
|
263
|
-
},
|
|
264
|
-
]);
|
|
253
|
+
const addHelpers = await confirm({
|
|
254
|
+
message: 'Add @sanity/functions helpers to the new Function?',
|
|
255
|
+
default: true,
|
|
256
|
+
});
|
|
265
257
|
return addHelpers;
|
|
266
258
|
}
|
|
267
259
|
async function promptForInstallCommand() {
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
name: '
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
],
|
|
279
|
-
default: 'npm',
|
|
280
|
-
},
|
|
281
|
-
]);
|
|
260
|
+
const command = await select({
|
|
261
|
+
message: 'How to install the @sanity/functions helpers:',
|
|
262
|
+
choices: [
|
|
263
|
+
{ name: 'npm', value: 'npm' },
|
|
264
|
+
{ name: 'pnpm', value: 'pnpm' },
|
|
265
|
+
{ name: 'yarn', value: 'yarn' },
|
|
266
|
+
{ name: 'Skip install', value: null },
|
|
267
|
+
],
|
|
268
|
+
default: 'npm',
|
|
269
|
+
});
|
|
282
270
|
return command;
|
|
283
271
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import { deleteLogs as deleteLogsAction, logs as getLogsAction, streamLogs as streamLogsAction, } from '../../actions/functions/logs.js';
|
|
5
5
|
import { formatTitle } from '../../utils/display/blueprints-formatting.js';
|
|
@@ -18,9 +18,7 @@ export async function functionLogsCore(options) {
|
|
|
18
18
|
}
|
|
19
19
|
async function deleteLogs({ name, externalId, auth, force, }) {
|
|
20
20
|
if (!force) {
|
|
21
|
-
const
|
|
22
|
-
type: 'confirm',
|
|
23
|
-
name: 'certain',
|
|
21
|
+
const certain = await confirm({
|
|
24
22
|
message: `Are you sure you want to delete ${chalk.bold('all')} logs for function ${chalk.yellow(name)}?`,
|
|
25
23
|
default: false,
|
|
26
24
|
});
|
package/dist/cores/index.js
CHANGED
|
@@ -46,14 +46,14 @@ export async function initDeployedBlueprintConfig(config) {
|
|
|
46
46
|
if (!scopeType || !scopeId)
|
|
47
47
|
return { ok: false, error: 'Missing scope configuration for Blueprint' };
|
|
48
48
|
if (!stackId)
|
|
49
|
-
return { ok: false, error: 'Missing deployment configuration for Blueprint' };
|
|
49
|
+
return { ok: false, error: 'Missing Stack deployment configuration for Blueprint' };
|
|
50
50
|
}
|
|
51
51
|
const auth = { token: config.token, scopeType, scopeId };
|
|
52
52
|
const stackResponse = await getStack({ stackId, auth });
|
|
53
53
|
if (!stackResponse.ok) {
|
|
54
|
-
config.log(`Could not retrieve deployment info for ${niceId(stackId)}.`);
|
|
54
|
+
config.log(`Could not retrieve Stack deployment info for ${niceId(stackId)}.`);
|
|
55
55
|
config.log(`Run \`${config.bin} blueprints doctor\` for diagnostics.`);
|
|
56
|
-
return { ok: false, error: 'Missing deployment' };
|
|
56
|
+
return { ok: false, error: 'Missing Stack deployment' };
|
|
57
57
|
}
|
|
58
58
|
return {
|
|
59
59
|
ok: true,
|
|
@@ -84,11 +84,16 @@ export function formatResourceTree(resources) {
|
|
|
84
84
|
return `${treeify(output)}\n`;
|
|
85
85
|
}
|
|
86
86
|
export function formatStackInfo(stack, isCurrentStack = false) {
|
|
87
|
-
const isStack = 'id' in stack;
|
|
87
|
+
const isStack = 'id' in stack; // type narrowing
|
|
88
|
+
const isProjectBasedStack = isStack && stack.id === `ST-${stack.scopeId}`;
|
|
88
89
|
const output = [];
|
|
89
90
|
if (isStack) {
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
let stackName = chalk.bold(`"${stack.name}"`);
|
|
92
|
+
if (isCurrentStack)
|
|
93
|
+
stackName = `${chalk.blue(stackName)} (current)`;
|
|
94
|
+
if (isProjectBasedStack)
|
|
95
|
+
stackName += ' (project-based)';
|
|
96
|
+
output.push(`${stackName} ${niceId(stack.id)}`);
|
|
92
97
|
}
|
|
93
98
|
else {
|
|
94
99
|
output.push('Local Blueprint');
|
|
@@ -8,7 +8,7 @@ export function presentBlueprintIssues(issues) {
|
|
|
8
8
|
report.push(presentBlueprintParserErrors(issue.errors));
|
|
9
9
|
break;
|
|
10
10
|
case 'NO_STACK_ID':
|
|
11
|
-
report.push('Existing deployment not found.');
|
|
11
|
+
report.push('Existing Stack deployment not found.');
|
|
12
12
|
break;
|
|
13
13
|
case 'NO_SCOPE_TYPE':
|
|
14
14
|
report.push('Scope type not found.');
|
|
@@ -17,7 +17,7 @@ export function presentBlueprintIssues(issues) {
|
|
|
17
17
|
report.push('Scope ID not found.');
|
|
18
18
|
break;
|
|
19
19
|
case 'NO_STACK':
|
|
20
|
-
report.push('Existing deployment not found.');
|
|
20
|
+
report.push('Existing Stack deployment not found.');
|
|
21
21
|
break;
|
|
22
22
|
default:
|
|
23
23
|
report.push(issue.message);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare function check(str: string): string;
|
|
2
2
|
export declare function info(str: string): string;
|
|
3
3
|
export declare function warn(str: string): string;
|
|
4
|
+
export declare function unsure(str: string): string;
|
|
4
5
|
export declare function severe(str: string): string;
|
|
5
6
|
export declare function niceId(id: string | undefined): string;
|
|
6
7
|
export declare function indent(str: string, spaces?: number): string;
|
|
7
8
|
export declare function capitalize(str: string): string;
|
|
9
|
+
export declare function filePathRelativeToCwd(filePath: string): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cwd } from 'node:process';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
3
|
export function check(str) {
|
|
3
4
|
return `${chalk.bold(chalk.green('✔︎'))} ${str}`;
|
|
@@ -8,6 +9,9 @@ export function info(str) {
|
|
|
8
9
|
export function warn(str) {
|
|
9
10
|
return `${chalk.bold.yellow('▶︎')} ${str}`;
|
|
10
11
|
}
|
|
12
|
+
export function unsure(str) {
|
|
13
|
+
return `${chalk.bold.cyan('?')} ${str}`;
|
|
14
|
+
}
|
|
11
15
|
export function severe(str) {
|
|
12
16
|
return `${chalk.bold.red('✘')} ${str}`;
|
|
13
17
|
}
|
|
@@ -26,3 +30,6 @@ export function indent(str, spaces = 2) {
|
|
|
26
30
|
export function capitalize(str) {
|
|
27
31
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
28
32
|
}
|
|
33
|
+
export function filePathRelativeToCwd(filePath) {
|
|
34
|
+
return filePath.replace(cwd(), '.');
|
|
35
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function promptForBlueprintType(): Promise<string>;
|
|
1
2
|
/**
|
|
2
3
|
* Prompt the user for a Project after selecting an Organization.
|
|
3
4
|
* @param token - The Sanity API token
|
|
@@ -12,7 +13,18 @@ export declare function promptForProject({ token, knownOrganizationId, knownProj
|
|
|
12
13
|
projectId: string;
|
|
13
14
|
displayName: string;
|
|
14
15
|
}>;
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Prompt the user for a Stack ID after selecting a Project.
|
|
18
|
+
* Can be used to create a new Stack or select an existing one.
|
|
19
|
+
* @param projectId - The ID of the Project
|
|
20
|
+
* @param token - The Sanity API token
|
|
21
|
+
* @returns The selected Stack ID
|
|
22
|
+
* @throws {Error} If the user does not have any Stacks or if the API call fails
|
|
23
|
+
*/
|
|
24
|
+
export declare function promptForStack({ projectId, token, }: {
|
|
16
25
|
projectId: string;
|
|
17
26
|
token: string;
|
|
18
|
-
}): Promise<
|
|
27
|
+
}): Promise<{
|
|
28
|
+
stackId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import { confirm, input, Separator, select } from '@inquirer/prompts';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
3
|
import { createEmptyStack, listStacks } from '../../actions/blueprints/stacks.js';
|
|
4
4
|
import { groupProjectsByOrganization } from '../../actions/sanity/projects.js';
|
|
5
5
|
import { niceId } from './presenters.js';
|
|
6
|
+
export async function promptForBlueprintType() {
|
|
7
|
+
return await select({
|
|
8
|
+
message: 'Choose a Blueprint file type:',
|
|
9
|
+
choices: [
|
|
10
|
+
{ name: 'TypeScript', value: 'ts' },
|
|
11
|
+
{ name: 'JavaScript', value: 'js' },
|
|
12
|
+
{ name: 'JSON', value: 'json' },
|
|
13
|
+
],
|
|
14
|
+
default: 'ts',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
6
17
|
/**
|
|
7
18
|
* Prompt the user for a Project after selecting an Organization.
|
|
8
19
|
* @param token - The Sanity API token
|
|
@@ -24,15 +35,11 @@ export async function promptForProject({ token, knownOrganizationId, knownProjec
|
|
|
24
35
|
value: { organization, projects },
|
|
25
36
|
disabled: !projects || projects.length === 0 ? '(0 Projects)' : false,
|
|
26
37
|
}));
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
choices: orgChoices,
|
|
33
|
-
default: knownOrganizationId,
|
|
34
|
-
},
|
|
35
|
-
]);
|
|
38
|
+
const pickedOrganization = await select({
|
|
39
|
+
message: 'Which Organization would you like to use?',
|
|
40
|
+
choices: orgChoices,
|
|
41
|
+
default: knownOrganizationId,
|
|
42
|
+
});
|
|
36
43
|
projects = pickedOrganization.projects;
|
|
37
44
|
}
|
|
38
45
|
else {
|
|
@@ -42,56 +49,68 @@ export async function promptForProject({ token, knownOrganizationId, knownProjec
|
|
|
42
49
|
name: `"${displayName}" ${niceId(projectId)}`,
|
|
43
50
|
value: { projectId, displayName },
|
|
44
51
|
}));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
let pickedProject;
|
|
53
|
+
if (projectChoices.length === 1) {
|
|
54
|
+
const onlyProject = projectChoices[0];
|
|
55
|
+
const confirmed = await confirm({
|
|
56
|
+
message: `Found 1 project. Use ${onlyProject.name}?`,
|
|
57
|
+
default: true,
|
|
58
|
+
});
|
|
59
|
+
if (confirmed)
|
|
60
|
+
pickedProject = onlyProject.value;
|
|
61
|
+
else
|
|
62
|
+
throw new Error('No project selected');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
pickedProject = await select({
|
|
49
66
|
message: 'Choose a Sanity Project:',
|
|
50
67
|
choices: projectChoices,
|
|
51
68
|
default: knownProjectId,
|
|
52
|
-
}
|
|
53
|
-
|
|
69
|
+
});
|
|
70
|
+
}
|
|
54
71
|
return pickedProject;
|
|
55
72
|
}
|
|
56
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Prompt the user for a Stack ID after selecting a Project.
|
|
75
|
+
* Can be used to create a new Stack or select an existing one.
|
|
76
|
+
* @param projectId - The ID of the Project
|
|
77
|
+
* @param token - The Sanity API token
|
|
78
|
+
* @returns The selected Stack ID
|
|
79
|
+
* @throws {Error} If the user does not have any Stacks or if the API call fails
|
|
80
|
+
*/
|
|
81
|
+
export async function promptForStack({ projectId, token, }) {
|
|
57
82
|
const { ok: stacksOk, error: stacksErr, stacks, } = await listStacks({ token, scopeType: 'project', scopeId: projectId });
|
|
58
83
|
if (!stacksOk) {
|
|
59
84
|
throw new Error(stacksErr || 'Failed to list Stacks');
|
|
60
85
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
86
|
+
const newStackValue = { id: 'new', name: 'new' };
|
|
87
|
+
const stackChoices = [];
|
|
88
|
+
stackChoices.push(new Separator(chalk.underline('Create a new Stack:')));
|
|
89
|
+
stackChoices.push({ name: chalk.bold('New Stack ✨'), value: newStackValue });
|
|
64
90
|
if (stacks.length > 0) {
|
|
65
|
-
stackChoices.push(new
|
|
91
|
+
stackChoices.push(new Separator(chalk.underline('Use an existing Stack:')));
|
|
66
92
|
stackChoices.push(...stacks.map((s) => ({
|
|
67
93
|
name: `"${s.name}" ${niceId(s.id)} ${chalk.dim(`(${s.resources.length} res)`)}`,
|
|
68
|
-
value: s.id,
|
|
94
|
+
value: { id: s.id, name: s.name },
|
|
69
95
|
})));
|
|
70
96
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
type: 'input',
|
|
83
|
-
name: 'stackName',
|
|
84
|
-
message: 'Enter a name for your Stack:',
|
|
85
|
-
validate: (input) => input.length > 0 || 'Stack name is required',
|
|
86
|
-
},
|
|
87
|
-
]);
|
|
97
|
+
const pickedStackId = await select({
|
|
98
|
+
message: 'Select an existing deployment or create a new one:',
|
|
99
|
+
choices: stackChoices,
|
|
100
|
+
default: newStackValue,
|
|
101
|
+
});
|
|
102
|
+
if (pickedStackId.id === 'new') {
|
|
103
|
+
const stackName = await input({
|
|
104
|
+
message: 'Enter a name for your Stack:',
|
|
105
|
+
validate: (input) => input.length > 0 || 'Stack name is required',
|
|
106
|
+
});
|
|
88
107
|
const stack = await createEmptyStack({
|
|
89
108
|
token,
|
|
90
109
|
scopeType: 'project',
|
|
91
110
|
scopeId: projectId,
|
|
92
111
|
name: stackName,
|
|
93
112
|
});
|
|
94
|
-
return stack.id;
|
|
113
|
+
return { stackId: stack.id, name: stackName };
|
|
95
114
|
}
|
|
96
|
-
return pickedStackId;
|
|
115
|
+
return { stackId: pickedStackId.id, name: pickedStackId.name };
|
|
97
116
|
}
|
package/dist/utils/types.d.ts
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -165,7 +165,6 @@
|
|
|
165
165
|
"description": "View or edit Blueprint configuration",
|
|
166
166
|
"examples": [
|
|
167
167
|
"<%= config.bin %> <%= command.id %>",
|
|
168
|
-
"<%= config.bin %> <%= command.id %> --test-config",
|
|
169
168
|
"<%= config.bin %> <%= command.id %> --edit",
|
|
170
169
|
"<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
|
|
171
170
|
"<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack-id <stackId>"
|
|
@@ -178,21 +177,9 @@
|
|
|
178
177
|
"allowNo": false,
|
|
179
178
|
"type": "boolean"
|
|
180
179
|
},
|
|
181
|
-
"test-config": {
|
|
182
|
-
"aliases": [
|
|
183
|
-
"test",
|
|
184
|
-
"validate"
|
|
185
|
-
],
|
|
186
|
-
"char": "t",
|
|
187
|
-
"deprecated": true,
|
|
188
|
-
"description": "Validate the configuration",
|
|
189
|
-
"name": "test-config",
|
|
190
|
-
"allowNo": false,
|
|
191
|
-
"type": "boolean"
|
|
192
|
-
},
|
|
193
180
|
"edit": {
|
|
194
181
|
"char": "e",
|
|
195
|
-
"description": "
|
|
182
|
+
"description": "Modify the configuration interactively, or directly when combined with ID flags.",
|
|
196
183
|
"name": "edit",
|
|
197
184
|
"allowNo": false,
|
|
198
185
|
"type": "boolean"
|
|
@@ -205,7 +192,7 @@
|
|
|
205
192
|
"dependsOn": [
|
|
206
193
|
"edit"
|
|
207
194
|
],
|
|
208
|
-
"description": "
|
|
195
|
+
"description": "Directly set the Project ID in the configuration. Requires --edit flag",
|
|
209
196
|
"name": "project-id",
|
|
210
197
|
"hasDynamicHelp": false,
|
|
211
198
|
"multiple": false,
|
|
@@ -220,7 +207,7 @@
|
|
|
220
207
|
"dependsOn": [
|
|
221
208
|
"edit"
|
|
222
209
|
],
|
|
223
|
-
"description": "
|
|
210
|
+
"description": "Directly set the Organization ID in the configuration. Requires --edit flag",
|
|
224
211
|
"name": "organization-id",
|
|
225
212
|
"hasDynamicHelp": false,
|
|
226
213
|
"multiple": false,
|
|
@@ -234,7 +221,7 @@
|
|
|
234
221
|
"dependsOn": [
|
|
235
222
|
"edit"
|
|
236
223
|
],
|
|
237
|
-
"description": "
|
|
224
|
+
"description": "Directly set the Stack ID in the configuration. Requires --edit flag",
|
|
238
225
|
"name": "stack-id",
|
|
239
226
|
"hasDynamicHelp": false,
|
|
240
227
|
"multiple": false,
|
|
@@ -274,7 +261,7 @@
|
|
|
274
261
|
"type": "boolean"
|
|
275
262
|
},
|
|
276
263
|
"no-wait": {
|
|
277
|
-
"description": "Do not wait for deployment to complete",
|
|
264
|
+
"description": "Do not wait for Stack deployment to complete",
|
|
278
265
|
"name": "no-wait",
|
|
279
266
|
"allowNo": false,
|
|
280
267
|
"type": "boolean"
|
|
@@ -299,7 +286,7 @@
|
|
|
299
286
|
"blueprints:destroy": {
|
|
300
287
|
"aliases": [],
|
|
301
288
|
"args": {},
|
|
302
|
-
"description": "Destroy a Blueprint deployment (will not delete local files)",
|
|
289
|
+
"description": "Destroy a Blueprint Stack deployment and its resources (will not delete local files)",
|
|
303
290
|
"examples": [
|
|
304
291
|
"<%= config.bin %> <%= command.id %>",
|
|
305
292
|
"<%= config.bin %> <%= command.id %> --stack-id <stackId> --project-id <projectId> --force --no-wait"
|
|
@@ -316,7 +303,7 @@
|
|
|
316
303
|
"aliases": [
|
|
317
304
|
"f"
|
|
318
305
|
],
|
|
319
|
-
"description": "Force
|
|
306
|
+
"description": "Force Stack destruction (skip confirmation)",
|
|
320
307
|
"name": "force",
|
|
321
308
|
"allowNo": false,
|
|
322
309
|
"type": "boolean"
|
|
@@ -364,7 +351,7 @@
|
|
|
364
351
|
"type": "option"
|
|
365
352
|
},
|
|
366
353
|
"no-wait": {
|
|
367
|
-
"description": "Do not wait for destruction to complete",
|
|
354
|
+
"description": "Do not wait for Stack destruction to complete",
|
|
368
355
|
"name": "no-wait",
|
|
369
356
|
"allowNo": false,
|
|
370
357
|
"type": "boolean"
|
|
@@ -425,7 +412,7 @@
|
|
|
425
412
|
"blueprints:info": {
|
|
426
413
|
"aliases": [],
|
|
427
414
|
"args": {},
|
|
428
|
-
"description": "Show information about a Blueprint deployment",
|
|
415
|
+
"description": "Show information about a Blueprint Stack deployment",
|
|
429
416
|
"examples": [
|
|
430
417
|
"<%= config.bin %> <%= command.id %>",
|
|
431
418
|
"<%= config.bin %> <%= command.id %> --stack-id <stackId>"
|
|
@@ -439,7 +426,7 @@
|
|
|
439
426
|
"type": "boolean"
|
|
440
427
|
},
|
|
441
428
|
"id": {
|
|
442
|
-
"description": "Stack ID to show info for (defaults to current
|
|
429
|
+
"description": "Stack ID to show info for (defaults to current Stack)",
|
|
443
430
|
"name": "id",
|
|
444
431
|
"hasDynamicHelp": false,
|
|
445
432
|
"multiple": false,
|
|
@@ -568,6 +555,12 @@
|
|
|
568
555
|
"hasDynamicHelp": false,
|
|
569
556
|
"multiple": false,
|
|
570
557
|
"type": "option"
|
|
558
|
+
},
|
|
559
|
+
"verbose": {
|
|
560
|
+
"description": "Verbose output",
|
|
561
|
+
"name": "verbose",
|
|
562
|
+
"allowNo": false,
|
|
563
|
+
"type": "boolean"
|
|
571
564
|
}
|
|
572
565
|
},
|
|
573
566
|
"hasDynamicHelp": false,
|
|
@@ -589,7 +582,7 @@
|
|
|
589
582
|
"blueprints:logs": {
|
|
590
583
|
"aliases": [],
|
|
591
584
|
"args": {},
|
|
592
|
-
"description": "Display logs for a Blueprint deployment",
|
|
585
|
+
"description": "Display logs for a Blueprint Stack deployment",
|
|
593
586
|
"examples": [
|
|
594
587
|
"<%= config.bin %> <%= command.id %>",
|
|
595
588
|
"<%= config.bin %> <%= command.id %> --watch"
|
|
@@ -607,7 +600,7 @@
|
|
|
607
600
|
"follow"
|
|
608
601
|
],
|
|
609
602
|
"char": "w",
|
|
610
|
-
"description": "Watch for new logs (streaming mode)",
|
|
603
|
+
"description": "Watch for new Stack logs (streaming mode)",
|
|
611
604
|
"name": "watch",
|
|
612
605
|
"allowNo": false,
|
|
613
606
|
"type": "boolean"
|
|
@@ -1417,5 +1410,5 @@
|
|
|
1417
1410
|
]
|
|
1418
1411
|
}
|
|
1419
1412
|
},
|
|
1420
|
-
"version": "
|
|
1413
|
+
"version": "12.0.0"
|
|
1421
1414
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/runtime-cli",
|
|
3
3
|
"description": "Sanity's Runtime CLI for Blueprints and Functions",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "12.0.0",
|
|
5
5
|
"author": "Sanity Runtime Team",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
70
70
|
"test": "vitest run && npm run lint",
|
|
71
71
|
"test:depmgmt": "vitest run --config ./test-depmgmt/vitest.config.ts",
|
|
72
|
-
"test:
|
|
72
|
+
"test:api": "cd test/api-types && npm install && npm run typecheck",
|
|
73
73
|
"test:watch": "vitest",
|
|
74
74
|
"typecheck": "tsc --project tsconfig.typecheck.json",
|
|
75
75
|
"watch": "tsc --watch"
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@architect/hydrate": "^5.0.1",
|
|
79
79
|
"@architect/inventory": "^5.0.0",
|
|
80
|
+
"@inquirer/prompts": "^8.0.1",
|
|
80
81
|
"@oclif/core": "^4.8.0",
|
|
81
82
|
"@oclif/plugin-help": "^6.2.36",
|
|
82
83
|
"@sanity/blueprints-parser": "^0.3.0",
|
|
@@ -137,7 +138,7 @@
|
|
|
137
138
|
"topicSeparator": " ",
|
|
138
139
|
"topics": {
|
|
139
140
|
"blueprints": {
|
|
140
|
-
"description": "Blueprint deployment and management commands"
|
|
141
|
+
"description": "Blueprint Stack deployment and management commands"
|
|
141
142
|
},
|
|
142
143
|
"functions": {
|
|
143
144
|
"description": "Sanity Function development and management commands"
|