@sanity/cli 4.21.0-next.9 → 5.0.0-next-major.14
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 +52 -65
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/generateAction.js +93 -112
- package/lib/_chunks-cjs/generateAction.js.map +1 -1
- package/lib/workers/typegenGenerate.d.ts +14 -34
- package/lib/workers/typegenGenerate.js +35 -111
- package/lib/workers/typegenGenerate.js.map +1 -1
- package/package.json +12 -12
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$d = {
|
|
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$d, ...extOptions }, client2 = apiClient({
|
|
3843
3843
|
requireUser: !0,
|
|
3844
3844
|
requireProject: !1
|
|
3845
3845
|
}), { token: token2 } = client2.config();
|
|
@@ -3878,10 +3878,9 @@ Examples:
|
|
|
3878
3878
|
description: "Deploy and manage Sanity Blueprints and Stacks (IaC)"
|
|
3879
3879
|
}, helpText$r = `
|
|
3880
3880
|
Options
|
|
3881
|
-
--edit, -e
|
|
3882
|
-
--
|
|
3883
|
-
--
|
|
3884
|
-
--verbose Output verbose logs
|
|
3881
|
+
--edit, -e Edit the configuration
|
|
3882
|
+
--test, -t Test the configuration
|
|
3883
|
+
--project-id <id> Project ID to use
|
|
3885
3884
|
|
|
3886
3885
|
Examples:
|
|
3887
3886
|
# View current configuration
|
|
@@ -3889,16 +3888,22 @@ Examples:
|
|
|
3889
3888
|
|
|
3890
3889
|
# Edit configuration
|
|
3891
3890
|
sanity blueprints config --edit
|
|
3892
|
-
|
|
3891
|
+
|
|
3892
|
+
# Test configuration
|
|
3893
|
+
sanity blueprints config --test
|
|
3894
|
+
|
|
3895
|
+
# Edit and test configuration
|
|
3896
|
+
sanity blueprints config -et
|
|
3897
|
+
`, defaultFlags$c = {
|
|
3893
3898
|
//
|
|
3894
3899
|
}, configBlueprintsCommand = {
|
|
3895
3900
|
name: "config",
|
|
3896
3901
|
group: "blueprints",
|
|
3897
3902
|
helpText: helpText$r,
|
|
3898
|
-
signature: "[--edit] [
|
|
3903
|
+
signature: "[--edit] [-e] [--test] [-t] [--project-id <id>]",
|
|
3899
3904
|
description: "View or edit local Blueprints configuration",
|
|
3900
3905
|
async action(args, context) {
|
|
3901
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3906
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$c, ...args.extOptions }, client2 = apiClient({
|
|
3902
3907
|
requireUser: !0,
|
|
3903
3908
|
requireProject: !1
|
|
3904
3909
|
}), { token: token2 } = client2.config();
|
|
@@ -3915,15 +3920,15 @@ Examples:
|
|
|
3915
3920
|
flags: {
|
|
3916
3921
|
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project,
|
|
3917
3922
|
"stack-id": flags["stack-id"] ?? flags.stackId ?? flags.stack,
|
|
3918
|
-
|
|
3919
|
-
|
|
3923
|
+
"test-config": flags["test-config"] ?? flags.test ?? flags.t,
|
|
3924
|
+
edit: flags.edit ?? flags.e
|
|
3920
3925
|
}
|
|
3921
3926
|
});
|
|
3922
3927
|
if (!success) throw new Error(error2);
|
|
3923
3928
|
}
|
|
3924
3929
|
}, helpText$q = `
|
|
3925
3930
|
Options
|
|
3926
|
-
--no-wait Do not wait for
|
|
3931
|
+
--no-wait Do not wait for deployment to complete
|
|
3927
3932
|
|
|
3928
3933
|
Examples:
|
|
3929
3934
|
# Deploy the current blueprint
|
|
@@ -3931,16 +3936,16 @@ Examples:
|
|
|
3931
3936
|
|
|
3932
3937
|
# Deploy the current blueprint without waiting for completion
|
|
3933
3938
|
sanity blueprints deploy --no-wait
|
|
3934
|
-
`, defaultFlags$
|
|
3939
|
+
`, defaultFlags$b = {
|
|
3935
3940
|
//
|
|
3936
3941
|
}, deployBlueprintsCommand = {
|
|
3937
3942
|
name: "deploy",
|
|
3938
3943
|
group: "blueprints",
|
|
3939
3944
|
helpText: helpText$q,
|
|
3940
3945
|
signature: "[--no-wait]",
|
|
3941
|
-
description: "Deploy a Blueprint",
|
|
3946
|
+
description: "Deploy a Blueprint to create or update a Stack",
|
|
3942
3947
|
async action(args, context) {
|
|
3943
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3948
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$b, ...args.extOptions }, client2 = apiClient({
|
|
3944
3949
|
requireUser: !0,
|
|
3945
3950
|
requireProject: !1
|
|
3946
3951
|
}), { token: token2 } = client2.config();
|
|
@@ -3961,8 +3966,6 @@ Examples:
|
|
|
3961
3966
|
}
|
|
3962
3967
|
}, helpText$p = `
|
|
3963
3968
|
Options
|
|
3964
|
-
--project-id Project associated with the Stack
|
|
3965
|
-
--stack-id Stack ID to destroy (defaults to current Stack)
|
|
3966
3969
|
--force, -f Force destroy without confirmation
|
|
3967
3970
|
--no-wait Do not wait for destroy to complete
|
|
3968
3971
|
|
|
@@ -3975,16 +3978,16 @@ Examples:
|
|
|
3975
3978
|
|
|
3976
3979
|
# Destroy without waiting for completion
|
|
3977
3980
|
sanity blueprints destroy --no-wait
|
|
3978
|
-
`, defaultFlags$
|
|
3981
|
+
`, defaultFlags$a = {
|
|
3979
3982
|
//
|
|
3980
3983
|
}, destroyBlueprintsCommand = {
|
|
3981
3984
|
name: "destroy",
|
|
3982
3985
|
group: "blueprints",
|
|
3983
3986
|
helpText: helpText$p,
|
|
3984
|
-
signature: "[--
|
|
3985
|
-
description: "Destroy a Blueprint
|
|
3987
|
+
signature: "[--force] [-f] [--no-wait]",
|
|
3988
|
+
description: "Destroy a Blueprint deployment",
|
|
3986
3989
|
async action(args, context) {
|
|
3987
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
3990
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$a, ...args.extOptions }, client2 = apiClient({
|
|
3988
3991
|
requireUser: !0,
|
|
3989
3992
|
requireProject: !1
|
|
3990
3993
|
}), { token: token2 } = client2.config();
|
|
@@ -4007,22 +4010,19 @@ Examples:
|
|
|
4007
4010
|
if (!success) throw new Error(error2);
|
|
4008
4011
|
}
|
|
4009
4012
|
}, 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$9 = {
|
|
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: "Check the health of a Blueprint project",
|
|
4024
4024
|
async action(args, context) {
|
|
4025
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4025
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$9, ...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$8 = {
|
|
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: "Retrieve information about a Blueprint Stack",
|
|
4054
4054
|
async action(args, context) {
|
|
4055
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4055
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$8, ...args.extOptions }, client2 = apiClient({
|
|
4056
4056
|
requireUser: !0,
|
|
4057
4057
|
requireProject: !1
|
|
4058
4058
|
}), { token: token2 } = client2.config();
|
|
@@ -4074,11 +4074,8 @@ Arguments
|
|
|
4074
4074
|
[dir] Path to initialize the Blueprint in
|
|
4075
4075
|
|
|
4076
4076
|
Options
|
|
4077
|
-
--blueprint-type, --type <json>
|
|
4078
|
-
--project-id <id>
|
|
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
|
|
4077
|
+
--blueprint-type, --type <json> Type of Blueprint to create
|
|
4078
|
+
--project-id <id> Project ID to use
|
|
4082
4079
|
|
|
4083
4080
|
Examples:
|
|
4084
4081
|
# Create a new Blueprint project in the current directory
|
|
@@ -4089,16 +4086,16 @@ Examples:
|
|
|
4089
4086
|
|
|
4090
4087
|
# Create a new Blueprint project in a specific directory with an example
|
|
4091
4088
|
sanity blueprints init --example example-name
|
|
4092
|
-
`, defaultFlags$
|
|
4089
|
+
`, defaultFlags$7 = {
|
|
4093
4090
|
//
|
|
4094
4091
|
}, initBlueprintsCommand = {
|
|
4095
4092
|
name: "init",
|
|
4096
4093
|
group: "blueprints",
|
|
4097
4094
|
helpText: helpText$m,
|
|
4098
4095
|
signature: "[dir] [--blueprint-type <type>] [--project-id <id>]",
|
|
4099
|
-
description: "Initialize a new Blueprint",
|
|
4096
|
+
description: "Initialize a new Blueprint manifest file",
|
|
4100
4097
|
async action(args, context) {
|
|
4101
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4098
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$7, ...args.extOptions }, [dir] = args.argsWithoutOptions, client2 = apiClient({
|
|
4102
4099
|
requireUser: !0,
|
|
4103
4100
|
requireProject: !1
|
|
4104
4101
|
}), { token: token2 } = client2.config();
|
|
@@ -4129,15 +4126,14 @@ Examples:
|
|
|
4129
4126
|
"blueprint-type": flags["blueprint-type"] ?? flags.type,
|
|
4130
4127
|
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project,
|
|
4131
4128
|
"stack-id": flags["stack-id"] ?? flags.stackId ?? flags.stack,
|
|
4132
|
-
"stack-name": flags["stack-name"] ?? flags.name
|
|
4133
|
-
verbose: flags.verbose
|
|
4129
|
+
"stack-name": flags["stack-name"] ?? flags.name
|
|
4134
4130
|
}
|
|
4135
4131
|
});
|
|
4136
4132
|
if (!success) throw new Error(error2);
|
|
4137
4133
|
}
|
|
4138
4134
|
}, helpText$l = `
|
|
4139
4135
|
Options
|
|
4140
|
-
--watch, -w Watch for new
|
|
4136
|
+
--watch, -w Watch for new logs (streaming mode)
|
|
4141
4137
|
|
|
4142
4138
|
Examples:
|
|
4143
4139
|
# Show logs for the current Stack
|
|
@@ -4145,16 +4141,16 @@ Examples:
|
|
|
4145
4141
|
|
|
4146
4142
|
# Watch for new logs (streaming mode)
|
|
4147
4143
|
sanity blueprints logs --watch
|
|
4148
|
-
`, defaultFlags$
|
|
4144
|
+
`, defaultFlags$6 = {
|
|
4149
4145
|
//
|
|
4150
4146
|
}, logsBlueprintsCommand = {
|
|
4151
4147
|
name: "logs",
|
|
4152
4148
|
group: "blueprints",
|
|
4153
4149
|
helpText: helpText$l,
|
|
4154
4150
|
signature: "[--watch] [-w]",
|
|
4155
|
-
description: "Display logs for
|
|
4151
|
+
description: "Display logs for the current Blueprint Stack",
|
|
4156
4152
|
async action(args, context) {
|
|
4157
|
-
const { apiClient, output } = context, flags = { ...defaultFlags$
|
|
4153
|
+
const { apiClient, output } = context, flags = { ...defaultFlags$6, ...args.extOptions }, client2 = apiClient({
|
|
4158
4154
|
requireUser: !0,
|
|
4159
4155
|
requireProject: !1
|
|
4160
4156
|
}), { token: token2 } = client2.config();
|
|
@@ -4176,22 +4172,17 @@ Examples:
|
|
|
4176
4172
|
}, helpText$k = `
|
|
4177
4173
|
Safe to run at any time. Will not modify any Resources.
|
|
4178
4174
|
|
|
4179
|
-
Options
|
|
4180
|
-
--version Verbose output
|
|
4181
|
-
|
|
4182
4175
|
Examples:
|
|
4183
4176
|
# Show deployment plan for the current Blueprint
|
|
4184
4177
|
sanity blueprints plan
|
|
4185
|
-
`,
|
|
4186
|
-
//
|
|
4187
|
-
}, planBlueprintsCommand = {
|
|
4178
|
+
`, planBlueprintsCommand = {
|
|
4188
4179
|
name: "plan",
|
|
4189
4180
|
group: "blueprints",
|
|
4190
4181
|
helpText: helpText$k,
|
|
4191
4182
|
signature: "",
|
|
4192
|
-
description: "Enumerate
|
|
4183
|
+
description: "Enumerate Resources to be deployed",
|
|
4193
4184
|
async action(args, context) {
|
|
4194
|
-
const { apiClient, output } = context,
|
|
4185
|
+
const { apiClient, output } = context, client2 = apiClient({
|
|
4195
4186
|
requireUser: !0,
|
|
4196
4187
|
requireProject: !1
|
|
4197
4188
|
}), { token: token2 } = client2.config();
|
|
@@ -4203,16 +4194,13 @@ Examples:
|
|
|
4203
4194
|
});
|
|
4204
4195
|
if (!cmdConfig.ok) throw new Error(cmdConfig.error);
|
|
4205
4196
|
const { success, error: error2 } = await blueprintPlanCore({
|
|
4206
|
-
...cmdConfig.value
|
|
4207
|
-
flags: {
|
|
4208
|
-
verbose: flags.verbose
|
|
4209
|
-
}
|
|
4197
|
+
...cmdConfig.value
|
|
4210
4198
|
});
|
|
4211
4199
|
if (!success) throw new Error(error2);
|
|
4212
4200
|
}
|
|
4213
4201
|
}, helpText$j = `
|
|
4214
4202
|
Options
|
|
4215
|
-
--project-id <id>
|
|
4203
|
+
--project-id <id> Project ID to use
|
|
4216
4204
|
|
|
4217
4205
|
Examples:
|
|
4218
4206
|
# List all Stacks for the current Project
|
|
@@ -4226,9 +4214,9 @@ Examples:
|
|
|
4226
4214
|
name: "stacks",
|
|
4227
4215
|
group: "blueprints",
|
|
4228
4216
|
helpText: helpText$j,
|
|
4229
|
-
signature: "[--project-id <
|
|
4230
|
-
description: "List all Blueprint Stacks",
|
|
4231
|
-
hideFromHelp: !
|
|
4217
|
+
signature: "[--project-id <id>]",
|
|
4218
|
+
description: "List all Blueprint Stacks for the current Project",
|
|
4219
|
+
hideFromHelp: !0,
|
|
4232
4220
|
async action(args, context) {
|
|
4233
4221
|
const { apiClient, output } = context, flags = { ...defaultFlags$5, ...args.extOptions }, client2 = apiClient({
|
|
4234
4222
|
requireUser: !0,
|
|
@@ -4244,8 +4232,7 @@ Examples:
|
|
|
4244
4232
|
const { success, error: error2 } = await blueprintStacksCore({
|
|
4245
4233
|
...cmdConfig.value,
|
|
4246
4234
|
flags: {
|
|
4247
|
-
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project
|
|
4248
|
-
verbose: flags.verbose
|
|
4235
|
+
"project-id": flags["project-id"] ?? flags.projectId ?? flags.project
|
|
4249
4236
|
}
|
|
4250
4237
|
});
|
|
4251
4238
|
if (!success) throw new Error(error2);
|
|
@@ -4599,7 +4586,7 @@ function isPinnedVersion(version2) {
|
|
|
4599
4586
|
function trimHash(version2) {
|
|
4600
4587
|
return version2.replace(/\+[a-z0-9]{8,}$/, "");
|
|
4601
4588
|
}
|
|
4602
|
-
const BASE_URL = "https://
|
|
4589
|
+
const BASE_URL = "https://docs.sanity.io/help/";
|
|
4603
4590
|
function generateHelpUrl(slug) {
|
|
4604
4591
|
return BASE_URL + slug;
|
|
4605
4592
|
}
|
|
@@ -44113,9 +44100,9 @@ const baseCommands = [
|
|
|
44113
44100
|
doctorBlueprintsCommand,
|
|
44114
44101
|
infoBlueprintsCommand,
|
|
44115
44102
|
initBlueprintsCommand,
|
|
44103
|
+
stacksBlueprintsCommand,
|
|
44116
44104
|
logsBlueprintsCommand,
|
|
44117
|
-
planBlueprintsCommand
|
|
44118
|
-
stacksBlueprintsCommand
|
|
44105
|
+
planBlueprintsCommand
|
|
44119
44106
|
], copyProperty = (to, from2, property, ignoreNonConfigurable) => {
|
|
44120
44107
|
if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
|
|
44121
44108
|
return;
|