@sanity/runtime-cli 17.3.2 → 17.4.0-blueprinit.g0ac8878
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 +19 -19
- package/SKILL.md +21 -0
- package/dist/actions/blueprinit/manifest.d.ts +15 -0
- package/dist/actions/blueprinit/manifest.js +76 -0
- package/dist/actions/blueprinit/studio.d.ts +6 -0
- package/dist/actions/blueprinit/studio.js +43 -0
- package/dist/actions/blueprinit/templates.d.ts +34 -0
- package/dist/actions/blueprinit/templates.js +83 -0
- package/dist/actions/blueprinit/workspace.d.ts +16 -0
- package/dist/actions/blueprinit/workspace.js +143 -0
- package/dist/actions/functions/list.d.ts +34 -0
- package/dist/actions/functions/list.js +33 -0
- package/dist/actions/sanity/datasets.d.ts +15 -0
- package/dist/actions/sanity/datasets.js +26 -0
- package/dist/baseCommands.d.ts +2 -0
- package/dist/baseCommands.js +3 -0
- package/dist/commands/blueprinit.d.ts +17 -0
- package/dist/commands/blueprinit.js +59 -0
- package/dist/commands/blueprints/deploy.d.ts +2 -0
- package/dist/commands/blueprints/deploy.js +19 -0
- package/dist/commands/functions/list.d.ts +14 -0
- package/dist/commands/functions/list.js +38 -0
- package/dist/cores/blueprinit/adopt.d.ts +6 -0
- package/dist/cores/blueprinit/adopt.js +119 -0
- package/dist/cores/blueprinit/finish.d.ts +14 -0
- package/dist/cores/blueprinit/finish.js +64 -0
- package/dist/cores/blueprinit/fresh.d.ts +3 -0
- package/dist/cores/blueprinit/fresh.js +120 -0
- package/dist/cores/blueprinit/preview.d.ts +15 -0
- package/dist/cores/blueprinit/preview.js +14 -0
- package/dist/cores/blueprinit/prompts.d.ts +5 -0
- package/dist/cores/blueprinit/prompts.js +22 -0
- package/dist/cores/blueprinit/selection.d.ts +15 -0
- package/dist/cores/blueprinit/selection.js +90 -0
- package/dist/cores/blueprinit/types.d.ts +16 -0
- package/dist/cores/blueprinit/types.js +1 -0
- package/dist/cores/blueprinit.d.ts +7 -0
- package/dist/cores/blueprinit.js +48 -0
- package/dist/cores/functions/list.d.ts +10 -0
- package/dist/cores/functions/list.js +34 -0
- package/dist/utils/display/functions-formatting.d.ts +7 -0
- package/dist/utils/display/functions-formatting.js +95 -0
- package/oclif.manifest.json +251 -1
- package/package.json +13 -9
- package/skills/blueprinit.md +155 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { confirm, input } from '@inquirer/prompts';
|
|
2
|
+
import { slugify } from '../../actions/blueprinit/manifest.js';
|
|
3
|
+
export const DEFAULT_STUDIO_NAME = 'studio';
|
|
4
|
+
export function resourceNamesCollide(stackName, studioName) {
|
|
5
|
+
return stackName === studioName;
|
|
6
|
+
}
|
|
7
|
+
export async function confirmUnlessSkipped(flags, interactive, message) {
|
|
8
|
+
if (flags.yes || !interactive)
|
|
9
|
+
return true;
|
|
10
|
+
return await confirm({ message, default: true });
|
|
11
|
+
}
|
|
12
|
+
export async function promptForStudioName(flags, interactive) {
|
|
13
|
+
if (flags.studioName)
|
|
14
|
+
return slugify(flags.studioName) || DEFAULT_STUDIO_NAME;
|
|
15
|
+
if (flags.yes || !interactive)
|
|
16
|
+
return DEFAULT_STUDIO_NAME;
|
|
17
|
+
const answer = await input({
|
|
18
|
+
message: 'Name your Studio and hosted slug?',
|
|
19
|
+
default: DEFAULT_STUDIO_NAME,
|
|
20
|
+
});
|
|
21
|
+
return slugify(answer) || DEFAULT_STUDIO_NAME;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Dataset } from '../../actions/sanity/datasets.js';
|
|
2
|
+
import type { GroupedProjects, Project } from '../../actions/sanity/projects.js';
|
|
3
|
+
import type { Result } from '../../utils/types.js';
|
|
4
|
+
interface SelectionError {
|
|
5
|
+
message: string;
|
|
6
|
+
suggestions?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function chooseOrganization(groups: GroupedProjects[], organizationId: string | undefined, interactive: boolean): Promise<Result<GroupedProjects, SelectionError>>;
|
|
9
|
+
export declare function chooseProject(projects: Project[], projectId: string | undefined, organizationName: string, interactive: boolean): Promise<Result<Project, SelectionError>>;
|
|
10
|
+
export declare function chooseDataset(datasets: Dataset[], datasetName: string | undefined, projectName: string, interactive: boolean): Promise<Result<Dataset, SelectionError>>;
|
|
11
|
+
export declare function findProject(groups: GroupedProjects[], projectId: string): {
|
|
12
|
+
organization: GroupedProjects['organization'];
|
|
13
|
+
project: Project;
|
|
14
|
+
} | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { select } from '@inquirer/prompts';
|
|
2
|
+
export async function chooseOrganization(groups, organizationId, interactive) {
|
|
3
|
+
if (groups.length === 0) {
|
|
4
|
+
return failure('No organizations found for this account.');
|
|
5
|
+
}
|
|
6
|
+
if (organizationId) {
|
|
7
|
+
const organization = groups.find((group) => group.organization.id === organizationId);
|
|
8
|
+
return organization
|
|
9
|
+
? { ok: true, value: organization }
|
|
10
|
+
: failure(`No organization "${organizationId}" found for this account.`);
|
|
11
|
+
}
|
|
12
|
+
if (groups.length === 1)
|
|
13
|
+
return { ok: true, value: groups[0] };
|
|
14
|
+
if (!interactive) {
|
|
15
|
+
return failure('Multiple organizations found.', ['Pass --organization-id <id> to choose one.']);
|
|
16
|
+
}
|
|
17
|
+
const selectedId = await select({
|
|
18
|
+
message: 'Choose a Sanity organization:',
|
|
19
|
+
choices: groups.map(({ organization, projects }) => ({
|
|
20
|
+
name: organization.name,
|
|
21
|
+
value: organization.id,
|
|
22
|
+
description: `${projects?.length ?? 0} projects`,
|
|
23
|
+
})),
|
|
24
|
+
});
|
|
25
|
+
const selected = groups.find(({ organization }) => organization.id === selectedId);
|
|
26
|
+
return selected ? { ok: true, value: selected } : failure('Organization not found.');
|
|
27
|
+
}
|
|
28
|
+
export async function chooseProject(projects, projectId, organizationName, interactive) {
|
|
29
|
+
if (projects.length === 0) {
|
|
30
|
+
return failure(`No projects found in ${organizationName}.`);
|
|
31
|
+
}
|
|
32
|
+
if (projectId) {
|
|
33
|
+
const project = projects.find(({ id }) => id === projectId);
|
|
34
|
+
return project
|
|
35
|
+
? { ok: true, value: project }
|
|
36
|
+
: failure(`No project "${projectId}" found in ${organizationName}.`);
|
|
37
|
+
}
|
|
38
|
+
if (projects.length === 1)
|
|
39
|
+
return { ok: true, value: projects[0] };
|
|
40
|
+
if (!interactive) {
|
|
41
|
+
return failure('Multiple projects found.', ['Pass --project-id <id> to choose one.']);
|
|
42
|
+
}
|
|
43
|
+
const selectedId = await select({
|
|
44
|
+
message: 'Choose a Sanity project:',
|
|
45
|
+
choices: projects.map((project) => ({ name: project.displayName, value: project.id })),
|
|
46
|
+
});
|
|
47
|
+
const selected = projects.find(({ id }) => id === selectedId);
|
|
48
|
+
return selected ? { ok: true, value: selected } : failure('Project not found.');
|
|
49
|
+
}
|
|
50
|
+
export async function chooseDataset(datasets, datasetName, projectName, interactive) {
|
|
51
|
+
if (datasets.length === 0) {
|
|
52
|
+
return failure(`No datasets found in ${projectName}.`);
|
|
53
|
+
}
|
|
54
|
+
if (datasetName) {
|
|
55
|
+
const dataset = datasets.find(({ name }) => name === datasetName);
|
|
56
|
+
return dataset
|
|
57
|
+
? { ok: true, value: dataset }
|
|
58
|
+
: failure(`No dataset "${datasetName}" found in ${projectName}.`);
|
|
59
|
+
}
|
|
60
|
+
if (datasets.length === 1)
|
|
61
|
+
return { ok: true, value: datasets[0] };
|
|
62
|
+
if (!interactive) {
|
|
63
|
+
return failure('Multiple datasets found.', ['Pass --dataset <name> to choose one.']);
|
|
64
|
+
}
|
|
65
|
+
const production = datasets.find(({ name }) => name === 'production');
|
|
66
|
+
const orderedDatasets = production
|
|
67
|
+
? [production, ...datasets.filter(({ name }) => name !== 'production')]
|
|
68
|
+
: datasets;
|
|
69
|
+
const selectedName = await select({
|
|
70
|
+
message: 'Choose a Sanity dataset:',
|
|
71
|
+
choices: orderedDatasets.map((dataset) => ({
|
|
72
|
+
name: dataset.name,
|
|
73
|
+
value: dataset.name,
|
|
74
|
+
description: dataset.aclMode,
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
const selected = datasets.find(({ name }) => name === selectedName);
|
|
78
|
+
return selected ? { ok: true, value: selected } : failure('Dataset not found.');
|
|
79
|
+
}
|
|
80
|
+
export function findProject(groups, projectId) {
|
|
81
|
+
for (const { organization, projects = [] } of groups) {
|
|
82
|
+
const project = projects.find(({ id }) => id === projectId);
|
|
83
|
+
if (project)
|
|
84
|
+
return { organization, project };
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
function failure(message, suggestions) {
|
|
89
|
+
return { ok: false, error: { message, suggestions } };
|
|
90
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Logger } from '../../utils/logger.js';
|
|
2
|
+
export interface BlueprinitFlags {
|
|
3
|
+
yes?: boolean;
|
|
4
|
+
organizationId?: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
datasetName?: string;
|
|
7
|
+
stackName?: string;
|
|
8
|
+
studioName?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BlueprinitFlowOptions {
|
|
11
|
+
bin: string;
|
|
12
|
+
dir: string;
|
|
13
|
+
flags: BlueprinitFlags;
|
|
14
|
+
log: Logger;
|
|
15
|
+
token: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlueprinitFlags } from './blueprinit/types.js';
|
|
2
|
+
import type { CoreConfig, CoreResult } from './index.js';
|
|
3
|
+
export interface BlueprinitOptions extends CoreConfig {
|
|
4
|
+
dir?: string;
|
|
5
|
+
flags?: BlueprinitFlags;
|
|
6
|
+
}
|
|
7
|
+
export declare function blueprinitCore(options: BlueprinitOptions): Promise<CoreResult>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cwd } from 'node:process';
|
|
2
|
+
import { detectStudio } from '../actions/blueprinit/studio.js';
|
|
3
|
+
import { findBlueprintFile } from '../actions/blueprints/blueprint.js';
|
|
4
|
+
import { readConfigFile } from '../actions/blueprints/config.js';
|
|
5
|
+
import { validTokenOrErrorMessage } from '../utils/validated-token.js';
|
|
6
|
+
import { adoptFlow } from './blueprinit/adopt.js';
|
|
7
|
+
import { freshFlow } from './blueprinit/fresh.js';
|
|
8
|
+
export async function blueprinitCore(options) {
|
|
9
|
+
const { bin, log, flags = {}, dir = cwd() } = options;
|
|
10
|
+
try {
|
|
11
|
+
const existingBlueprint = findBlueprintFile(dir);
|
|
12
|
+
if (existingBlueprint) {
|
|
13
|
+
const blueprintConfig = readConfigFile(existingBlueprint.blueprintFilePath);
|
|
14
|
+
if (!blueprintConfig?.stackId) {
|
|
15
|
+
return {
|
|
16
|
+
success: false,
|
|
17
|
+
error: `A Blueprint exists here (${existingBlueprint.fileName}), but it is not connected to a Stack.`,
|
|
18
|
+
suggestions: [`Finish setup with: npx ${bin} blueprints init`],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
log(`A blueprint already exists here (${existingBlueprint.fileName}).`);
|
|
22
|
+
log('');
|
|
23
|
+
log('Use these instead:');
|
|
24
|
+
log(` npx ${bin} blueprints config --edit`);
|
|
25
|
+
log(` npx ${bin} blueprints doctor`);
|
|
26
|
+
return {
|
|
27
|
+
success: true,
|
|
28
|
+
json: { alreadyInitialized: true, blueprintFile: existingBlueprint.fileName },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const tokenCheck = await validTokenOrErrorMessage(log);
|
|
32
|
+
if (!tokenCheck.ok) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
error: 'No Sanity session found.',
|
|
36
|
+
suggestions: ['Sign in first: npx sanity login', 'Then run blueprinit again.'],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
log('Setting up your Sanity workspace.');
|
|
40
|
+
log('');
|
|
41
|
+
const flowOptions = { bin, dir, flags, log, token: tokenCheck.value };
|
|
42
|
+
const studio = detectStudio(dir);
|
|
43
|
+
return studio ? await adoptFlow({ ...flowOptions, studio }) : await freshFlow(flowOptions);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuthParams } from '../../utils/types.js';
|
|
2
|
+
import type { CoreConfig, CoreResult } from '../index.js';
|
|
3
|
+
export interface FunctionListOptions extends Pick<CoreConfig, 'log'> {
|
|
4
|
+
auth: AuthParams;
|
|
5
|
+
flags: {
|
|
6
|
+
json?: boolean;
|
|
7
|
+
verbose?: boolean;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function functionListCore(options: FunctionListOptions): Promise<CoreResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { listFunctions } from '../../actions/functions/list.js';
|
|
2
|
+
import { formatFunctionsList } from '../../utils/display/functions-formatting.js';
|
|
3
|
+
import { capitalize, niceId } from '../../utils/display/presenters.js';
|
|
4
|
+
import { styleText } from '../../utils/style-text.js';
|
|
5
|
+
export async function functionListCore(options) {
|
|
6
|
+
const { auth, flags, log } = options;
|
|
7
|
+
const { scopeId, scopeType } = auth;
|
|
8
|
+
const spinner = flags.json ? undefined : log.ora('Fetching functions...').start();
|
|
9
|
+
const result = await listFunctions(auth, log);
|
|
10
|
+
if (!result.ok) {
|
|
11
|
+
spinner?.fail('Failed to list functions');
|
|
12
|
+
const suggestions = /access|permission|forbidden/i.test(result.error)
|
|
13
|
+
? [
|
|
14
|
+
`Verify you have access to ${scopeType} "${scopeId}".`,
|
|
15
|
+
'Try a different scope with --project-id or --organization-id.',
|
|
16
|
+
]
|
|
17
|
+
: undefined;
|
|
18
|
+
return { success: false, error: result.error, suggestions };
|
|
19
|
+
}
|
|
20
|
+
spinner?.stop().clear();
|
|
21
|
+
if (!flags.json) {
|
|
22
|
+
if (result.functions.length === 0) {
|
|
23
|
+
log(`No functions found for ${scopeType} ${niceId(scopeId)}`);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
log(`${styleText('bold', capitalize(scopeType))} ${niceId(scopeId)} ${styleText('bold', 'Functions')} [${result.functions.length}]:`);
|
|
27
|
+
log(formatFunctionsList(result.functions, { verbose: flags.verbose }));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
success: true,
|
|
32
|
+
json: { functions: result.functions, scopeType, scopeId },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeployedFunction } from '../../actions/functions/list.js';
|
|
2
|
+
export declare function formatFunctionsList(functions: DeployedFunction[], options?: {
|
|
3
|
+
verbose?: boolean;
|
|
4
|
+
}): string;
|
|
5
|
+
export declare function formatFunction(fn: DeployedFunction, options?: {
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
}): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { SANITY_FUNCTION_PREFIX } from '../../constants.js';
|
|
2
|
+
import { styleText } from '../style-text.js';
|
|
3
|
+
import { formatDateTime } from './dates.js';
|
|
4
|
+
import { niceId, renderSection } from './presenters.js';
|
|
5
|
+
export function formatFunctionsList(functions, options = {}) {
|
|
6
|
+
if (!options.verbose)
|
|
7
|
+
return formatCompactList(functions);
|
|
8
|
+
return functions.map((fn) => formatFunction(fn, options)).join('\n');
|
|
9
|
+
}
|
|
10
|
+
export function formatFunction(fn, options = {}) {
|
|
11
|
+
if (!options.verbose)
|
|
12
|
+
return formatCompactList([fn]);
|
|
13
|
+
const rows = [];
|
|
14
|
+
if (fn.type)
|
|
15
|
+
rows.push(['Type', shortType(fn.type)]);
|
|
16
|
+
if (fn.updatedAt) {
|
|
17
|
+
const updatedAt = formatDateTime(fn.updatedAt);
|
|
18
|
+
if (updatedAt)
|
|
19
|
+
rows.push(['Updated', updatedAt]);
|
|
20
|
+
}
|
|
21
|
+
if (typeof fn.memory === 'number')
|
|
22
|
+
rows.push(['Memory', `${fn.memory} MB`]);
|
|
23
|
+
if (typeof fn.timeout === 'number')
|
|
24
|
+
rows.push(['Timeout', `${fn.timeout}s`]);
|
|
25
|
+
const rule = formatEventRule(fn.eventRule);
|
|
26
|
+
if (rule)
|
|
27
|
+
rows.push(['Rule', rule]);
|
|
28
|
+
return renderSection(formatTitle(fn), rows);
|
|
29
|
+
}
|
|
30
|
+
function formatCompactList(functions) {
|
|
31
|
+
const titles = functions.map(plainTitle);
|
|
32
|
+
const ids = functions.map((fn) => `<${fn.id}>`);
|
|
33
|
+
const types = functions.map((fn) => (fn.type ? shortType(fn.type) : '-'));
|
|
34
|
+
const updated = functions.map((fn) => (fn.updatedAt ? formatDateTime(fn.updatedAt) || '-' : '-'));
|
|
35
|
+
const titlePad = Math.max(...titles.map((title) => title.length));
|
|
36
|
+
const idPad = Math.max(...ids.map((id) => id.length));
|
|
37
|
+
const typePad = Math.max(...types.map((type) => type.length));
|
|
38
|
+
return functions
|
|
39
|
+
.map((fn, index) => {
|
|
40
|
+
const title = formatIdentity(fn) + ' '.repeat(titlePad - titles[index].length);
|
|
41
|
+
const id = niceId(fn.id) + ' '.repeat(idPad - ids[index].length);
|
|
42
|
+
const type = styleText('dim', types[index].padEnd(typePad));
|
|
43
|
+
const timestamp = styleText('dim', updated[index]);
|
|
44
|
+
return ` ${title} ${id} ${type} ${timestamp}`;
|
|
45
|
+
})
|
|
46
|
+
.join('\n');
|
|
47
|
+
}
|
|
48
|
+
function formatTitle(fn) {
|
|
49
|
+
return `${formatIdentity(fn)} ${niceId(fn.id)}`;
|
|
50
|
+
}
|
|
51
|
+
function formatIdentity(fn) {
|
|
52
|
+
const parts = [];
|
|
53
|
+
if (fn.name)
|
|
54
|
+
parts.push(styleText('bold', fn.name));
|
|
55
|
+
if (fn.displayName && fn.displayName !== fn.name) {
|
|
56
|
+
parts.push(styleText('green', `"${fn.displayName}"`));
|
|
57
|
+
}
|
|
58
|
+
if (parts.length === 0)
|
|
59
|
+
parts.push(styleText('bold', 'Unnamed'));
|
|
60
|
+
return parts.join(' ');
|
|
61
|
+
}
|
|
62
|
+
function plainTitle(fn) {
|
|
63
|
+
const parts = [];
|
|
64
|
+
if (fn.name)
|
|
65
|
+
parts.push(fn.name);
|
|
66
|
+
if (fn.displayName && fn.displayName !== fn.name)
|
|
67
|
+
parts.push(`"${fn.displayName}"`);
|
|
68
|
+
return parts.length > 0 ? parts.join(' ') : 'Unnamed';
|
|
69
|
+
}
|
|
70
|
+
function shortType(type) {
|
|
71
|
+
return type.startsWith(SANITY_FUNCTION_PREFIX) ? type.slice(SANITY_FUNCTION_PREFIX.length) : type;
|
|
72
|
+
}
|
|
73
|
+
function formatEventRule(rule) {
|
|
74
|
+
if (rule === null || rule === undefined)
|
|
75
|
+
return undefined;
|
|
76
|
+
if (typeof rule !== 'object')
|
|
77
|
+
return String(rule);
|
|
78
|
+
if (Array.isArray(rule))
|
|
79
|
+
return rule.map(formatRuleValue).join(', ');
|
|
80
|
+
const entries = Object.entries(rule);
|
|
81
|
+
if (entries.length === 0)
|
|
82
|
+
return undefined;
|
|
83
|
+
return entries.map(([key, value]) => `${key}: ${formatRuleValue(value)}`).join(' · ');
|
|
84
|
+
}
|
|
85
|
+
function formatRuleValue(value) {
|
|
86
|
+
if (typeof value === 'string')
|
|
87
|
+
return value;
|
|
88
|
+
if (value === null || value === undefined)
|
|
89
|
+
return String(value);
|
|
90
|
+
if (Array.isArray(value))
|
|
91
|
+
return value.map(formatRuleValue).join(', ');
|
|
92
|
+
if (typeof value === 'object')
|
|
93
|
+
return JSON.stringify(value);
|
|
94
|
+
return String(value);
|
|
95
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,133 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"blueprinit": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Scaffolds a Blueprint, Studio, and starter function around an existing Sanity project.\n\nThis hidden command is an experiment; its interface and generated files are not stable.",
|
|
7
|
+
"examples": [
|
|
8
|
+
"<%= config.bin %> <%= command.id %>",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --yes",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --project-id <id> --dataset <name> --yes"
|
|
11
|
+
],
|
|
12
|
+
"flags": {
|
|
13
|
+
"json": {
|
|
14
|
+
"description": "Format output as json",
|
|
15
|
+
"name": "json",
|
|
16
|
+
"allowNo": false,
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
|
+
"path": {
|
|
20
|
+
"aliases": [
|
|
21
|
+
"blueprint-path"
|
|
22
|
+
],
|
|
23
|
+
"char": "p",
|
|
24
|
+
"description": "Path to a Blueprint file or directory containing one",
|
|
25
|
+
"env": "SANITY_BLUEPRINT_PATH",
|
|
26
|
+
"hidden": true,
|
|
27
|
+
"name": "path",
|
|
28
|
+
"hasDynamicHelp": false,
|
|
29
|
+
"multiple": false,
|
|
30
|
+
"type": "option"
|
|
31
|
+
},
|
|
32
|
+
"trace": {
|
|
33
|
+
"description": "Trace output",
|
|
34
|
+
"hidden": true,
|
|
35
|
+
"name": "trace",
|
|
36
|
+
"allowNo": false,
|
|
37
|
+
"type": "boolean"
|
|
38
|
+
},
|
|
39
|
+
"validate-resources": {
|
|
40
|
+
"description": "Validate resources",
|
|
41
|
+
"hidden": true,
|
|
42
|
+
"name": "validate-resources",
|
|
43
|
+
"allowNo": true,
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"verbose": {
|
|
47
|
+
"description": "Verbose output",
|
|
48
|
+
"hidden": true,
|
|
49
|
+
"name": "verbose",
|
|
50
|
+
"allowNo": false,
|
|
51
|
+
"type": "boolean"
|
|
52
|
+
},
|
|
53
|
+
"llms": {
|
|
54
|
+
"aliases": [
|
|
55
|
+
"skill"
|
|
56
|
+
],
|
|
57
|
+
"description": "Show agent-oriented guidance for this command",
|
|
58
|
+
"name": "llms",
|
|
59
|
+
"allowNo": false,
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"yes": {
|
|
63
|
+
"char": "y",
|
|
64
|
+
"description": "Skip confirmation prompts",
|
|
65
|
+
"name": "yes",
|
|
66
|
+
"allowNo": false,
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
},
|
|
69
|
+
"organization-id": {
|
|
70
|
+
"aliases": [
|
|
71
|
+
"organization",
|
|
72
|
+
"organizationId",
|
|
73
|
+
"org"
|
|
74
|
+
],
|
|
75
|
+
"description": "Organization to use when the account has several",
|
|
76
|
+
"name": "organization-id",
|
|
77
|
+
"hasDynamicHelp": false,
|
|
78
|
+
"multiple": false,
|
|
79
|
+
"type": "option"
|
|
80
|
+
},
|
|
81
|
+
"project-id": {
|
|
82
|
+
"aliases": [
|
|
83
|
+
"project",
|
|
84
|
+
"projectId"
|
|
85
|
+
],
|
|
86
|
+
"description": "Project to use when the organization has several",
|
|
87
|
+
"name": "project-id",
|
|
88
|
+
"hasDynamicHelp": false,
|
|
89
|
+
"multiple": false,
|
|
90
|
+
"type": "option"
|
|
91
|
+
},
|
|
92
|
+
"dataset": {
|
|
93
|
+
"description": "Dataset to attach",
|
|
94
|
+
"name": "dataset",
|
|
95
|
+
"hasDynamicHelp": false,
|
|
96
|
+
"multiple": false,
|
|
97
|
+
"type": "option"
|
|
98
|
+
},
|
|
99
|
+
"stack-name": {
|
|
100
|
+
"description": "Name for the new organization-scoped Stack",
|
|
101
|
+
"name": "stack-name",
|
|
102
|
+
"hasDynamicHelp": false,
|
|
103
|
+
"multiple": false,
|
|
104
|
+
"type": "option"
|
|
105
|
+
},
|
|
106
|
+
"studio-name": {
|
|
107
|
+
"description": "Name and hosted slug for the Studio resource",
|
|
108
|
+
"name": "studio-name",
|
|
109
|
+
"hasDynamicHelp": false,
|
|
110
|
+
"multiple": false,
|
|
111
|
+
"type": "option"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"hasDynamicHelp": false,
|
|
115
|
+
"hidden": true,
|
|
116
|
+
"hiddenAliases": [],
|
|
117
|
+
"id": "blueprinit",
|
|
118
|
+
"pluginAlias": "@sanity/runtime-cli",
|
|
119
|
+
"pluginName": "@sanity/runtime-cli",
|
|
120
|
+
"pluginType": "core",
|
|
121
|
+
"strict": true,
|
|
122
|
+
"summary": "Experimental blueprints-first project init",
|
|
123
|
+
"enableJsonFlag": true,
|
|
124
|
+
"isESM": true,
|
|
125
|
+
"relativePath": [
|
|
126
|
+
"dist",
|
|
127
|
+
"commands",
|
|
128
|
+
"blueprinit.js"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
3
131
|
"blueprints:add": {
|
|
4
132
|
"aliases": [],
|
|
5
133
|
"args": {
|
|
@@ -491,6 +619,17 @@
|
|
|
491
619
|
"allowNo": false,
|
|
492
620
|
"type": "boolean"
|
|
493
621
|
},
|
|
622
|
+
"configure": {
|
|
623
|
+
"aliases": [
|
|
624
|
+
"config",
|
|
625
|
+
"init"
|
|
626
|
+
],
|
|
627
|
+
"description": "Configure the local Blueprint interactively before deploying",
|
|
628
|
+
"hidden": true,
|
|
629
|
+
"name": "configure",
|
|
630
|
+
"allowNo": false,
|
|
631
|
+
"type": "boolean"
|
|
632
|
+
},
|
|
494
633
|
"new-stack-name": {
|
|
495
634
|
"description": "Set a new name for the Stack",
|
|
496
635
|
"name": "new-stack-name",
|
|
@@ -2146,6 +2285,117 @@
|
|
|
2146
2285
|
"dev.js"
|
|
2147
2286
|
]
|
|
2148
2287
|
},
|
|
2288
|
+
"functions:list": {
|
|
2289
|
+
"aliases": [],
|
|
2290
|
+
"args": {},
|
|
2291
|
+
"description": "Lists functions deployed directly in the selected project or organization scope. The local Blueprint config supplies the scope by default.\n\nUse --project-id or --organization-id to select a scope without a local Blueprint. Organization results include organization-scoped functions only.",
|
|
2292
|
+
"examples": [
|
|
2293
|
+
"<%= config.bin %> <%= command.id %>",
|
|
2294
|
+
"<%= config.bin %> <%= command.id %> --verbose",
|
|
2295
|
+
"<%= config.bin %> <%= command.id %> --project-id <projectId>",
|
|
2296
|
+
"<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
|
|
2297
|
+
"<%= config.bin %> <%= command.id %> --project-id <projectId> --json"
|
|
2298
|
+
],
|
|
2299
|
+
"flags": {
|
|
2300
|
+
"json": {
|
|
2301
|
+
"description": "Format output as json",
|
|
2302
|
+
"name": "json",
|
|
2303
|
+
"allowNo": false,
|
|
2304
|
+
"type": "boolean"
|
|
2305
|
+
},
|
|
2306
|
+
"path": {
|
|
2307
|
+
"aliases": [
|
|
2308
|
+
"blueprint-path"
|
|
2309
|
+
],
|
|
2310
|
+
"char": "p",
|
|
2311
|
+
"description": "Path to a Blueprint file or directory containing one",
|
|
2312
|
+
"env": "SANITY_BLUEPRINT_PATH",
|
|
2313
|
+
"hidden": true,
|
|
2314
|
+
"name": "path",
|
|
2315
|
+
"hasDynamicHelp": false,
|
|
2316
|
+
"multiple": false,
|
|
2317
|
+
"type": "option"
|
|
2318
|
+
},
|
|
2319
|
+
"trace": {
|
|
2320
|
+
"description": "Trace output",
|
|
2321
|
+
"hidden": true,
|
|
2322
|
+
"name": "trace",
|
|
2323
|
+
"allowNo": false,
|
|
2324
|
+
"type": "boolean"
|
|
2325
|
+
},
|
|
2326
|
+
"validate-resources": {
|
|
2327
|
+
"description": "Validate resources",
|
|
2328
|
+
"hidden": true,
|
|
2329
|
+
"name": "validate-resources",
|
|
2330
|
+
"allowNo": true,
|
|
2331
|
+
"type": "boolean"
|
|
2332
|
+
},
|
|
2333
|
+
"verbose": {
|
|
2334
|
+
"char": "v",
|
|
2335
|
+
"description": "Show function configuration details",
|
|
2336
|
+
"name": "verbose",
|
|
2337
|
+
"allowNo": false,
|
|
2338
|
+
"type": "boolean"
|
|
2339
|
+
},
|
|
2340
|
+
"stack": {
|
|
2341
|
+
"description": "Stack name or ID to use instead of the locally configured Stack",
|
|
2342
|
+
"hidden": true,
|
|
2343
|
+
"name": "stack",
|
|
2344
|
+
"hasDynamicHelp": false,
|
|
2345
|
+
"multiple": false,
|
|
2346
|
+
"type": "option"
|
|
2347
|
+
},
|
|
2348
|
+
"project-id": {
|
|
2349
|
+
"aliases": [
|
|
2350
|
+
"project",
|
|
2351
|
+
"projectId"
|
|
2352
|
+
],
|
|
2353
|
+
"description": "Sanity project ID used to scope Blueprint and Stack",
|
|
2354
|
+
"exclusive": [
|
|
2355
|
+
"organization-id"
|
|
2356
|
+
],
|
|
2357
|
+
"name": "project-id",
|
|
2358
|
+
"hasDynamicHelp": false,
|
|
2359
|
+
"multiple": false,
|
|
2360
|
+
"type": "option"
|
|
2361
|
+
},
|
|
2362
|
+
"organization-id": {
|
|
2363
|
+
"aliases": [
|
|
2364
|
+
"organization",
|
|
2365
|
+
"organizationId",
|
|
2366
|
+
"org"
|
|
2367
|
+
],
|
|
2368
|
+
"description": "Sanity organization ID used to scope Blueprint and Stack",
|
|
2369
|
+
"exclusive": [
|
|
2370
|
+
"project-id"
|
|
2371
|
+
],
|
|
2372
|
+
"name": "organization-id",
|
|
2373
|
+
"hasDynamicHelp": false,
|
|
2374
|
+
"multiple": false,
|
|
2375
|
+
"type": "option"
|
|
2376
|
+
}
|
|
2377
|
+
},
|
|
2378
|
+
"hasDynamicHelp": false,
|
|
2379
|
+
"hidden": true,
|
|
2380
|
+
"hiddenAliases": [],
|
|
2381
|
+
"id": "functions:list",
|
|
2382
|
+
"pluginAlias": "@sanity/runtime-cli",
|
|
2383
|
+
"pluginName": "@sanity/runtime-cli",
|
|
2384
|
+
"pluginType": "core",
|
|
2385
|
+
"strict": true,
|
|
2386
|
+
"summary": "List deployed Sanity Functions",
|
|
2387
|
+
"enableJsonFlag": true,
|
|
2388
|
+
"needs": [
|
|
2389
|
+
"scope"
|
|
2390
|
+
],
|
|
2391
|
+
"isESM": true,
|
|
2392
|
+
"relativePath": [
|
|
2393
|
+
"dist",
|
|
2394
|
+
"commands",
|
|
2395
|
+
"functions",
|
|
2396
|
+
"list.js"
|
|
2397
|
+
]
|
|
2398
|
+
},
|
|
2149
2399
|
"functions:logs": {
|
|
2150
2400
|
"aliases": [],
|
|
2151
2401
|
"args": {
|
|
@@ -2998,5 +3248,5 @@
|
|
|
2998
3248
|
]
|
|
2999
3249
|
}
|
|
3000
3250
|
},
|
|
3001
|
-
"version": "17.
|
|
3251
|
+
"version": "17.4.0-blueprinit.g0ac8878"
|
|
3002
3252
|
}
|