@sanity/cli 4.20.4-next.7 → 4.21.0-next.9
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/lib/_chunks-cjs/cli.js +64 -51
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +9 -9
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -3807,7 +3807,7 @@ Examples:
|
|
|
3807
3807
|
|
|
3808
3808
|
# Add a document-publish .js Function with helpers and install with npm
|
|
3809
3809
|
sanity blueprints add function -n roboto --fn-type document-publish --js -i
|
|
3810
|
-
`, defaultFlags$
|
|
3810
|
+
`, defaultFlags$e = {
|
|
3811
3811
|
"fn-language": "ts"
|
|
3812
3812
|
// 'fn-helpers': true, // ask, for now
|
|
3813
3813
|
}, addBlueprintsCommand = {
|
|
@@ -3839,7 +3839,7 @@ Examples:
|
|
|
3839
3839
|
example: extOptions.example
|
|
3840
3840
|
});
|
|
3841
3841
|
}
|
|
3842
|
-
const flags = { ...defaultFlags$
|
|
3842
|
+
const flags = { ...defaultFlags$e, ...extOptions }, client2 = apiClient({
|
|
3843
3843
|
requireUser: !0,
|
|
3844
3844
|
requireProject: !1
|
|
3845
3845
|
}), { token: token2 } = client2.config();
|
|
@@ -3878,9 +3878,10 @@ Examples:
|
|
|
3878
3878
|
description: "Deploy and manage Sanity Blueprints and Stacks (IaC)"
|
|
3879
3879
|
}, helpText$r = `
|
|
3880
3880
|
Options
|
|
3881
|
-
--edit, -e
|
|
3882
|
-
--
|
|
3883
|
-
--
|
|
3881
|
+
--edit, -e Modify the configuration interactively, or directly when combined with ID flags.
|
|
3882
|
+
--project-id <id> Directly set the Project ID in the configuration. Requires --edit flag
|
|
3883
|
+
--stack-id <id> Directly set the Stack ID in the configuration. Requires --edit flag
|
|
3884
|
+
--verbose Output verbose logs
|
|
3884
3885
|
|
|
3885
3886
|
Examples:
|
|
3886
3887
|
# View current configuration
|
|
@@ -3888,22 +3889,16 @@ Examples:
|
|
|
3888
3889
|
|
|
3889
3890
|
# Edit configuration
|
|
3890
3891
|
sanity blueprints config --edit
|
|
3891
|
-
|
|
3892
|
-
# Test configuration
|
|
3893
|
-
sanity blueprints config --test
|
|
3894
|
-
|
|
3895
|
-
# Edit and test configuration
|
|
3896
|
-
sanity blueprints config -et
|
|
3897
|
-
`, defaultFlags$c = {
|
|
3892
|
+
`, defaultFlags$d = {
|
|
3898
3893
|
//
|
|
3899
3894
|
}, configBlueprintsCommand = {
|
|
3900
3895
|
name: "config",
|
|
3901
3896
|
group: "blueprints",
|
|
3902
3897
|
helpText: helpText$r,
|
|
3903
|
-
signature: "[--edit] [-
|
|
3898
|
+
signature: "[--edit] [--project-id <id>] [--stack-id <id>] [--verbose]",
|
|
3904
3899
|
description: "View or edit local Blueprints configuration",
|
|
3905
3900
|
async action(args, context) {
|
|
3906
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3901
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$d, ...args.extOptions }, client2 = apiClient({
|
|
3907
3902
|
requireUser: !0,
|
|
3908
3903
|
requireProject: !1
|
|
3909
3904
|
}), { token: token2 } = client2.config();
|
|
@@ -3920,15 +3915,15 @@ Examples:
|
|
|
3920
3915
|
flags: {
|
|
3921
3916
|
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project,
|
|
3922
3917
|
"stack-id": flags["stack-id"] ?? flags.stackId ?? flags.stack,
|
|
3923
|
-
|
|
3924
|
-
|
|
3918
|
+
edit: flags.edit ?? flags.e,
|
|
3919
|
+
verbose: flags.verbose
|
|
3925
3920
|
}
|
|
3926
3921
|
});
|
|
3927
3922
|
if (!success) throw new Error(error2);
|
|
3928
3923
|
}
|
|
3929
3924
|
}, helpText$q = `
|
|
3930
3925
|
Options
|
|
3931
|
-
--no-wait Do not wait for deployment to complete
|
|
3926
|
+
--no-wait Do not wait for Stack deployment to complete
|
|
3932
3927
|
|
|
3933
3928
|
Examples:
|
|
3934
3929
|
# Deploy the current blueprint
|
|
@@ -3936,16 +3931,16 @@ Examples:
|
|
|
3936
3931
|
|
|
3937
3932
|
# Deploy the current blueprint without waiting for completion
|
|
3938
3933
|
sanity blueprints deploy --no-wait
|
|
3939
|
-
`, defaultFlags$
|
|
3934
|
+
`, defaultFlags$c = {
|
|
3940
3935
|
//
|
|
3941
3936
|
}, deployBlueprintsCommand = {
|
|
3942
3937
|
name: "deploy",
|
|
3943
3938
|
group: "blueprints",
|
|
3944
3939
|
helpText: helpText$q,
|
|
3945
3940
|
signature: "[--no-wait]",
|
|
3946
|
-
description: "Deploy a Blueprint
|
|
3941
|
+
description: "Deploy a Blueprint",
|
|
3947
3942
|
async action(args, context) {
|
|
3948
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3943
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$c, ...args.extOptions }, client2 = apiClient({
|
|
3949
3944
|
requireUser: !0,
|
|
3950
3945
|
requireProject: !1
|
|
3951
3946
|
}), { token: token2 } = client2.config();
|
|
@@ -3966,6 +3961,8 @@ Examples:
|
|
|
3966
3961
|
}
|
|
3967
3962
|
}, helpText$p = `
|
|
3968
3963
|
Options
|
|
3964
|
+
--project-id Project associated with the Stack
|
|
3965
|
+
--stack-id Stack ID to destroy (defaults to current Stack)
|
|
3969
3966
|
--force, -f Force destroy without confirmation
|
|
3970
3967
|
--no-wait Do not wait for destroy to complete
|
|
3971
3968
|
|
|
@@ -3978,16 +3975,16 @@ Examples:
|
|
|
3978
3975
|
|
|
3979
3976
|
# Destroy without waiting for completion
|
|
3980
3977
|
sanity blueprints destroy --no-wait
|
|
3981
|
-
`, defaultFlags$
|
|
3978
|
+
`, defaultFlags$b = {
|
|
3982
3979
|
//
|
|
3983
3980
|
}, destroyBlueprintsCommand = {
|
|
3984
3981
|
name: "destroy",
|
|
3985
3982
|
group: "blueprints",
|
|
3986
3983
|
helpText: helpText$p,
|
|
3987
|
-
signature: "[--
|
|
3988
|
-
description: "Destroy a Blueprint deployment",
|
|
3984
|
+
signature: "[--project-id <value> --stack-id <value> --force] [--no-wait]",
|
|
3985
|
+
description: "Destroy a Blueprint Stack deployment and its resources (will not delete local files)",
|
|
3989
3986
|
async action(args, context) {
|
|
3990
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3987
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$b, ...args.extOptions }, client2 = apiClient({
|
|
3991
3988
|
requireUser: !0,
|
|
3992
3989
|
requireProject: !1
|
|
3993
3990
|
}), { token: token2 } = client2.config();
|
|
@@ -4010,19 +4007,22 @@ Examples:
|
|
|
4010
4007
|
if (!success) throw new Error(error2);
|
|
4011
4008
|
}
|
|
4012
4009
|
}, helpText$o = `
|
|
4010
|
+
Options
|
|
4011
|
+
--verbose Provide detailed information about issues
|
|
4012
|
+
|
|
4013
4013
|
Examples:
|
|
4014
4014
|
# Check the health of the current Blueprint project
|
|
4015
4015
|
sanity blueprints doctor --verbose
|
|
4016
|
-
`, defaultFlags$
|
|
4016
|
+
`, defaultFlags$a = {
|
|
4017
4017
|
verbose: !1
|
|
4018
4018
|
}, doctorBlueprintsCommand = {
|
|
4019
4019
|
name: "doctor",
|
|
4020
4020
|
group: "blueprints",
|
|
4021
4021
|
helpText: helpText$o,
|
|
4022
4022
|
signature: "[--verbose]",
|
|
4023
|
-
description: "
|
|
4023
|
+
description: "Diagnose potential issues with Blueprint configuration",
|
|
4024
4024
|
async action(args, context) {
|
|
4025
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4025
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$a, ...args.extOptions }, client2 = apiClient({
|
|
4026
4026
|
requireUser: !0,
|
|
4027
4027
|
requireProject: !1
|
|
4028
4028
|
}), { token: token2 } = client2.config();
|
|
@@ -4043,16 +4043,16 @@ Examples:
|
|
|
4043
4043
|
Examples:
|
|
4044
4044
|
# Retrieve information about the current Stack
|
|
4045
4045
|
sanity blueprints info
|
|
4046
|
-
`, defaultFlags$
|
|
4046
|
+
`, defaultFlags$9 = {
|
|
4047
4047
|
//
|
|
4048
4048
|
}, infoBlueprintsCommand = {
|
|
4049
4049
|
name: "info",
|
|
4050
4050
|
group: "blueprints",
|
|
4051
4051
|
helpText: helpText$n,
|
|
4052
4052
|
signature: "",
|
|
4053
|
-
description: "
|
|
4053
|
+
description: "Show information about a Blueprint Stack deployment",
|
|
4054
4054
|
async action(args, context) {
|
|
4055
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4055
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$9, ...args.extOptions }, client2 = apiClient({
|
|
4056
4056
|
requireUser: !0,
|
|
4057
4057
|
requireProject: !1
|
|
4058
4058
|
}), { token: token2 } = client2.config();
|
|
@@ -4074,8 +4074,11 @@ Arguments
|
|
|
4074
4074
|
[dir] Path to initialize the Blueprint in
|
|
4075
4075
|
|
|
4076
4076
|
Options
|
|
4077
|
-
--blueprint-type, --type <json>
|
|
4078
|
-
--project-id <id> Project ID to use
|
|
4077
|
+
--blueprint-type, --type <json> Blueprint manifest type to use for the Blueprint (json|js|ts)
|
|
4078
|
+
--project-id <id> Sanity Project ID to use for the Blueprint
|
|
4079
|
+
--stack-id <id> Existing Stack ID to use for the Blueprint
|
|
4080
|
+
--stack-name <id> Name to use for a NEW Stack
|
|
4081
|
+
--verbose Verbose output
|
|
4079
4082
|
|
|
4080
4083
|
Examples:
|
|
4081
4084
|
# Create a new Blueprint project in the current directory
|
|
@@ -4086,16 +4089,16 @@ Examples:
|
|
|
4086
4089
|
|
|
4087
4090
|
# Create a new Blueprint project in a specific directory with an example
|
|
4088
4091
|
sanity blueprints init --example example-name
|
|
4089
|
-
`, defaultFlags$
|
|
4092
|
+
`, defaultFlags$8 = {
|
|
4090
4093
|
//
|
|
4091
4094
|
}, initBlueprintsCommand = {
|
|
4092
4095
|
name: "init",
|
|
4093
4096
|
group: "blueprints",
|
|
4094
4097
|
helpText: helpText$m,
|
|
4095
4098
|
signature: "[dir] [--blueprint-type <type>] [--project-id <id>]",
|
|
4096
|
-
description: "Initialize a new Blueprint
|
|
4099
|
+
description: "Initialize a new Blueprint",
|
|
4097
4100
|
async action(args, context) {
|
|
4098
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4101
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$8, ...args.extOptions }, [dir] = args.argsWithoutOptions, client2 = apiClient({
|
|
4099
4102
|
requireUser: !0,
|
|
4100
4103
|
requireProject: !1
|
|
4101
4104
|
}), { token: token2 } = client2.config();
|
|
@@ -4126,14 +4129,15 @@ Examples:
|
|
|
4126
4129
|
"blueprint-type": flags["blueprint-type"] ?? flags.type,
|
|
4127
4130
|
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project,
|
|
4128
4131
|
"stack-id": flags["stack-id"] ?? flags.stackId ?? flags.stack,
|
|
4129
|
-
"stack-name": flags["stack-name"] ?? flags.name
|
|
4132
|
+
"stack-name": flags["stack-name"] ?? flags.name,
|
|
4133
|
+
verbose: flags.verbose
|
|
4130
4134
|
}
|
|
4131
4135
|
});
|
|
4132
4136
|
if (!success) throw new Error(error2);
|
|
4133
4137
|
}
|
|
4134
4138
|
}, helpText$l = `
|
|
4135
4139
|
Options
|
|
4136
|
-
--watch, -w Watch for new logs (streaming mode)
|
|
4140
|
+
--watch, -w Watch for new Stack logs (streaming mode)
|
|
4137
4141
|
|
|
4138
4142
|
Examples:
|
|
4139
4143
|
# Show logs for the current Stack
|
|
@@ -4141,16 +4145,16 @@ Examples:
|
|
|
4141
4145
|
|
|
4142
4146
|
# Watch for new logs (streaming mode)
|
|
4143
4147
|
sanity blueprints logs --watch
|
|
4144
|
-
`, defaultFlags$
|
|
4148
|
+
`, defaultFlags$7 = {
|
|
4145
4149
|
//
|
|
4146
4150
|
}, logsBlueprintsCommand = {
|
|
4147
4151
|
name: "logs",
|
|
4148
4152
|
group: "blueprints",
|
|
4149
4153
|
helpText: helpText$l,
|
|
4150
4154
|
signature: "[--watch] [-w]",
|
|
4151
|
-
description: "Display logs for
|
|
4155
|
+
description: "Display logs for a Blueprint Stack deployment",
|
|
4152
4156
|
async action(args, context) {
|
|
4153
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4157
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$7, ...args.extOptions }, client2 = apiClient({
|
|
4154
4158
|
requireUser: !0,
|
|
4155
4159
|
requireProject: !1
|
|
4156
4160
|
}), { token: token2 } = client2.config();
|
|
@@ -4172,17 +4176,22 @@ Examples:
|
|
|
4172
4176
|
}, helpText$k = `
|
|
4173
4177
|
Safe to run at any time. Will not modify any Resources.
|
|
4174
4178
|
|
|
4179
|
+
Options
|
|
4180
|
+
--version Verbose output
|
|
4181
|
+
|
|
4175
4182
|
Examples:
|
|
4176
4183
|
# Show deployment plan for the current Blueprint
|
|
4177
4184
|
sanity blueprints plan
|
|
4178
|
-
`,
|
|
4185
|
+
`, defaultFlags$6 = {
|
|
4186
|
+
//
|
|
4187
|
+
}, planBlueprintsCommand = {
|
|
4179
4188
|
name: "plan",
|
|
4180
4189
|
group: "blueprints",
|
|
4181
4190
|
helpText: helpText$k,
|
|
4182
4191
|
signature: "",
|
|
4183
|
-
description: "Enumerate
|
|
4192
|
+
description: "Enumerate resources to be deployed - will not modify any resources",
|
|
4184
4193
|
async action(args, context) {
|
|
4185
|
-
const { apiClient, output } = context, client2 = apiClient({
|
|
4194
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$6, ...args.extOptions }, client2 = apiClient({
|
|
4186
4195
|
requireUser: !0,
|
|
4187
4196
|
requireProject: !1
|
|
4188
4197
|
}), { token: token2 } = client2.config();
|
|
@@ -4194,13 +4203,16 @@ Examples:
|
|
|
4194
4203
|
});
|
|
4195
4204
|
if (!cmdConfig.ok) throw new Error(cmdConfig.error);
|
|
4196
4205
|
const { success, error: error2 } = await blueprintPlanCore({
|
|
4197
|
-
...cmdConfig.value
|
|
4206
|
+
...cmdConfig.value,
|
|
4207
|
+
flags: {
|
|
4208
|
+
verbose: flags.verbose
|
|
4209
|
+
}
|
|
4198
4210
|
});
|
|
4199
4211
|
if (!success) throw new Error(error2);
|
|
4200
4212
|
}
|
|
4201
4213
|
}, helpText$j = `
|
|
4202
4214
|
Options
|
|
4203
|
-
--project-id <id>
|
|
4215
|
+
--project-id <id> Project ID to use
|
|
4204
4216
|
|
|
4205
4217
|
Examples:
|
|
4206
4218
|
# List all Stacks for the current Project
|
|
@@ -4214,9 +4226,9 @@ Examples:
|
|
|
4214
4226
|
name: "stacks",
|
|
4215
4227
|
group: "blueprints",
|
|
4216
4228
|
helpText: helpText$j,
|
|
4217
|
-
signature: "[--project-id <
|
|
4218
|
-
description: "List all Blueprint Stacks
|
|
4219
|
-
hideFromHelp: !
|
|
4229
|
+
signature: "[--project-id <value>]",
|
|
4230
|
+
description: "List all Blueprint Stacks",
|
|
4231
|
+
hideFromHelp: !1,
|
|
4220
4232
|
async action(args, context) {
|
|
4221
4233
|
const { apiClient, output } = context, flags = { ...defaultFlags$5, ...args.extOptions }, client2 = apiClient({
|
|
4222
4234
|
requireUser: !0,
|
|
@@ -4232,7 +4244,8 @@ Examples:
|
|
|
4232
4244
|
const { success, error: error2 } = await blueprintStacksCore({
|
|
4233
4245
|
...cmdConfig.value,
|
|
4234
4246
|
flags: {
|
|
4235
|
-
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project
|
|
4247
|
+
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project,
|
|
4248
|
+
verbose: flags.verbose
|
|
4236
4249
|
}
|
|
4237
4250
|
});
|
|
4238
4251
|
if (!success) throw new Error(error2);
|
|
@@ -44100,9 +44113,9 @@ const baseCommands = [
|
|
|
44100
44113
|
doctorBlueprintsCommand,
|
|
44101
44114
|
infoBlueprintsCommand,
|
|
44102
44115
|
initBlueprintsCommand,
|
|
44103
|
-
stacksBlueprintsCommand,
|
|
44104
44116
|
logsBlueprintsCommand,
|
|
44105
|
-
planBlueprintsCommand
|
|
44117
|
+
planBlueprintsCommand,
|
|
44118
|
+
stacksBlueprintsCommand
|
|
44106
44119
|
], copyProperty = (to, from2, property, ignoreNonConfigurable) => {
|
|
44107
44120
|
if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
|
|
44108
44121
|
return;
|