@sanity/cli 5.0.0-next-major.14 → 5.0.0-next-major.6
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 +319 -134
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +12 -12
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -3771,7 +3771,7 @@ const BlueprintsAddExampleUsed = telemetry.defineEvent({
|
|
|
3771
3771
|
version: 1,
|
|
3772
3772
|
name: "Blueprints Add Example Used",
|
|
3773
3773
|
description: "User used --example flag with blueprints add command"
|
|
3774
|
-
}), helpText$
|
|
3774
|
+
}), helpText$t = `
|
|
3775
3775
|
Arguments
|
|
3776
3776
|
<type> Type of Resource to add (currently only 'function' is supported)
|
|
3777
3777
|
|
|
@@ -3807,13 +3807,13 @@ 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 = {
|
|
3814
3814
|
name: "add",
|
|
3815
3815
|
group: "blueprints",
|
|
3816
|
-
helpText: helpText$
|
|
3816
|
+
helpText: helpText$t,
|
|
3817
3817
|
signature: "<type> [--name <name>] [--fn-type <document-create|document-delete|document-update|document-publish>] [--fn-lang <ts|js>] [--javascript]",
|
|
3818
3818
|
description: "Add a Resource to a Blueprint",
|
|
3819
3819
|
async action(args, context) {
|
|
@@ -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();
|
|
@@ -3876,11 +3876,12 @@ Examples:
|
|
|
3876
3876
|
signature: "[COMMAND]",
|
|
3877
3877
|
isGroupRoot: !0,
|
|
3878
3878
|
description: "Deploy and manage Sanity Blueprints and Stacks (IaC)"
|
|
3879
|
-
}, helpText$
|
|
3879
|
+
}, helpText$s = `
|
|
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
|
-
helpText: helpText$
|
|
3903
|
-
signature: "[--edit] [-
|
|
3897
|
+
helpText: helpText$s,
|
|
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
|
-
}, helpText$
|
|
3924
|
+
}, helpText$r = `
|
|
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
|
-
helpText: helpText$
|
|
3939
|
+
helpText: helpText$r,
|
|
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();
|
|
@@ -3964,8 +3959,10 @@ Examples:
|
|
|
3964
3959
|
});
|
|
3965
3960
|
if (!success) throw new Error(error2);
|
|
3966
3961
|
}
|
|
3967
|
-
}, helpText$
|
|
3962
|
+
}, helpText$q = `
|
|
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
|
-
helpText: helpText$
|
|
3987
|
-
signature: "[--
|
|
3988
|
-
description: "Destroy a Blueprint deployment",
|
|
3983
|
+
helpText: helpText$q,
|
|
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();
|
|
@@ -4009,20 +4006,23 @@ Examples:
|
|
|
4009
4006
|
});
|
|
4010
4007
|
if (!success) throw new Error(error2);
|
|
4011
4008
|
}
|
|
4012
|
-
}, helpText$
|
|
4009
|
+
}, helpText$p = `
|
|
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
|
-
helpText: helpText$
|
|
4021
|
+
helpText: helpText$p,
|
|
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();
|
|
@@ -4039,20 +4039,20 @@ Examples:
|
|
|
4039
4039
|
});
|
|
4040
4040
|
if (!success) throw new Error(error2);
|
|
4041
4041
|
}
|
|
4042
|
-
}, helpText$
|
|
4042
|
+
}, helpText$o = `
|
|
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
|
-
helpText: helpText$
|
|
4051
|
+
helpText: helpText$o,
|
|
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();
|
|
@@ -4069,13 +4069,16 @@ Examples:
|
|
|
4069
4069
|
});
|
|
4070
4070
|
if (!success) throw new Error(error2);
|
|
4071
4071
|
}
|
|
4072
|
-
}, helpText$
|
|
4072
|
+
}, helpText$n = `
|
|
4073
4073
|
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
|
-
helpText: helpText$
|
|
4097
|
+
helpText: helpText$n,
|
|
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
|
-
}, helpText$
|
|
4138
|
+
}, helpText$m = `
|
|
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
|
-
helpText: helpText$
|
|
4153
|
+
helpText: helpText$m,
|
|
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();
|
|
@@ -4169,20 +4173,25 @@ Examples:
|
|
|
4169
4173
|
});
|
|
4170
4174
|
if (streaming && await streaming, !success) throw new Error(error2);
|
|
4171
4175
|
}
|
|
4172
|
-
}, helpText$
|
|
4176
|
+
}, helpText$l = `
|
|
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
|
-
helpText: helpText$
|
|
4190
|
+
helpText: helpText$l,
|
|
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
|
-
}, helpText$
|
|
4213
|
+
}, helpText$k = `
|
|
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
|
|
@@ -4213,10 +4225,10 @@ Examples:
|
|
|
4213
4225
|
}, stacksBlueprintsCommand = {
|
|
4214
4226
|
name: "stacks",
|
|
4215
4227
|
group: "blueprints",
|
|
4216
|
-
helpText: helpText$
|
|
4217
|
-
signature: "[--project-id <
|
|
4218
|
-
description: "List all Blueprint Stacks
|
|
4219
|
-
hideFromHelp: !
|
|
4228
|
+
helpText: helpText$k,
|
|
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);
|
|
@@ -4381,7 +4394,7 @@ function ensureNpx() {
|
|
|
4381
4394
|
);
|
|
4382
4395
|
}
|
|
4383
4396
|
}
|
|
4384
|
-
const helpText$
|
|
4397
|
+
const helpText$j = `
|
|
4385
4398
|
Runs a given code modification script on the current studio folder.
|
|
4386
4399
|
Running the command without a specified codemod name will list available transformations.
|
|
4387
4400
|
|
|
@@ -4403,7 +4416,7 @@ Examples
|
|
|
4403
4416
|
name: "codemod",
|
|
4404
4417
|
signature: "[CODEMOD_NAME]",
|
|
4405
4418
|
description: "Updates Sanity Studio codebase with a code modification script",
|
|
4406
|
-
helpText: helpText$
|
|
4419
|
+
helpText: helpText$j,
|
|
4407
4420
|
action: codemodAction
|
|
4408
4421
|
};
|
|
4409
4422
|
var lodash_isplainobject, hasRequiredLodash_isplainobject;
|
|
@@ -4586,7 +4599,7 @@ function isPinnedVersion(version2) {
|
|
|
4586
4599
|
function trimHash(version2) {
|
|
4587
4600
|
return version2.replace(/\+[a-z0-9]{8,}$/, "");
|
|
4588
4601
|
}
|
|
4589
|
-
const BASE_URL = "https://
|
|
4602
|
+
const BASE_URL = "https://www.sanity.io/docs/help/";
|
|
4590
4603
|
function generateHelpUrl(slug) {
|
|
4591
4604
|
return BASE_URL + slug;
|
|
4592
4605
|
}
|
|
@@ -4871,7 +4884,7 @@ function requireGracefulFs() {
|
|
|
4871
4884
|
if (hasRequiredGracefulFs) return gracefulFs;
|
|
4872
4885
|
hasRequiredGracefulFs = 1;
|
|
4873
4886
|
var fs2 = require$$0__default.default, polyfills2 = requirePolyfills(), legacy = requireLegacyStreams(), clone = requireClone(), util2 = require$$0__default$5.default, gracefulQueue, previousSymbol;
|
|
4874
|
-
typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = Symbol.for("graceful-fs.queue"), previousSymbol = Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");
|
|
4887
|
+
typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"), previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");
|
|
4875
4888
|
function noop2() {
|
|
4876
4889
|
}
|
|
4877
4890
|
function publishQueue(context, queue3) {
|
|
@@ -6096,7 +6109,7 @@ function normalizePath(input2) {
|
|
|
6096
6109
|
const sanityDocsPrefix = "https://www.sanity.io";
|
|
6097
6110
|
return input2.startsWith(sanityDocsPrefix) ? input2.replace(sanityDocsPrefix, "") : input2;
|
|
6098
6111
|
}
|
|
6099
|
-
const helpText$
|
|
6112
|
+
const helpText$i = `
|
|
6100
6113
|
Arguments
|
|
6101
6114
|
<path> Path or URL to article, found in search results and docs content as links
|
|
6102
6115
|
|
|
@@ -6114,13 +6127,13 @@ Examples
|
|
|
6114
6127
|
`, readCommand = {
|
|
6115
6128
|
name: "read",
|
|
6116
6129
|
group: "docs",
|
|
6117
|
-
helpText: helpText$
|
|
6130
|
+
helpText: helpText$i,
|
|
6118
6131
|
signature: "<path|url> [-w, --web]",
|
|
6119
6132
|
description: "Read an article in terminal",
|
|
6120
6133
|
async action(args, context) {
|
|
6121
6134
|
const { output } = context, flags = args.extOptions, input2 = args.argsWithoutOptions[0];
|
|
6122
6135
|
if (!input2 || typeof input2 != "string") {
|
|
6123
|
-
output.error("Please provide an article path or URL"), output.print(""), output.print(helpText$
|
|
6136
|
+
output.error("Please provide an article path or URL"), output.print(""), output.print(helpText$i), process.exit(1);
|
|
6124
6137
|
return;
|
|
6125
6138
|
}
|
|
6126
6139
|
const path2 = normalizePath(input2);
|
|
@@ -6150,7 +6163,7 @@ async function searchDocs(options2, context) {
|
|
|
6150
6163
|
const results = await response.json();
|
|
6151
6164
|
return Array.isArray(results) ? results.slice(0, limit) : [];
|
|
6152
6165
|
}
|
|
6153
|
-
const isInteractive$1 = process.stdout.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env), helpText$
|
|
6166
|
+
const isInteractive$1 = process.stdout.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env), helpText$h = `
|
|
6154
6167
|
Arguments
|
|
6155
6168
|
<query> Search query for documentation
|
|
6156
6169
|
|
|
@@ -6171,7 +6184,7 @@ Examples
|
|
|
6171
6184
|
}, searchCommand = {
|
|
6172
6185
|
name: "search",
|
|
6173
6186
|
group: "docs",
|
|
6174
|
-
helpText: helpText$
|
|
6187
|
+
helpText: helpText$h,
|
|
6175
6188
|
signature: "<query> [--limit <limit>]",
|
|
6176
6189
|
description: "Search Sanity docs",
|
|
6177
6190
|
async action(args, context) {
|
|
@@ -6225,7 +6238,7 @@ Found ${results.length} result(s):
|
|
|
6225
6238
|
}
|
|
6226
6239
|
}
|
|
6227
6240
|
}
|
|
6228
|
-
}, helpText$
|
|
6241
|
+
}, helpText$g = `
|
|
6229
6242
|
Options
|
|
6230
6243
|
--port <port> Port to start emulator on
|
|
6231
6244
|
--open Open dev server in a new browser tab
|
|
@@ -6249,7 +6262,7 @@ Examples
|
|
|
6249
6262
|
}, devFunctionsCommand = {
|
|
6250
6263
|
name: "dev",
|
|
6251
6264
|
group: "functions",
|
|
6252
|
-
helpText: helpText$
|
|
6265
|
+
helpText: helpText$g,
|
|
6253
6266
|
signature: "[--host <host> --port <port> --open]",
|
|
6254
6267
|
description: "Start the Sanity Function emulator",
|
|
6255
6268
|
async action(args, context) {
|
|
@@ -6271,7 +6284,7 @@ Examples
|
|
|
6271
6284
|
if (!success) throw new Error(error2);
|
|
6272
6285
|
shouldOpen && await open(`http://${flags.host}:${flags.port}`);
|
|
6273
6286
|
}
|
|
6274
|
-
}, helpText$
|
|
6287
|
+
}, helpText$f = `
|
|
6275
6288
|
Commands
|
|
6276
6289
|
add Add or update an environment variable
|
|
6277
6290
|
list List the environment variables
|
|
@@ -6294,7 +6307,7 @@ Examples
|
|
|
6294
6307
|
`, envFunctionsCommand = {
|
|
6295
6308
|
name: "env",
|
|
6296
6309
|
group: "functions",
|
|
6297
|
-
helpText: helpText$
|
|
6310
|
+
helpText: helpText$f,
|
|
6298
6311
|
signature: "<add|list|remove> <name> [key] [value]",
|
|
6299
6312
|
description: "Add or remove an environment variable or list environment variables for a Sanity function",
|
|
6300
6313
|
async action(args, context) {
|
|
@@ -6350,7 +6363,7 @@ Examples
|
|
|
6350
6363
|
signature: "[COMMAND]",
|
|
6351
6364
|
isGroupRoot: !0,
|
|
6352
6365
|
description: "Manage, test, and observe Sanity Functions"
|
|
6353
|
-
}, helpText$
|
|
6366
|
+
}, helpText$e = `
|
|
6354
6367
|
Arguments
|
|
6355
6368
|
<name> The name of the Function to retrieve logs for
|
|
6356
6369
|
|
|
@@ -6387,7 +6400,7 @@ Examples
|
|
|
6387
6400
|
}, logsFunctionsCommand = {
|
|
6388
6401
|
name: "logs",
|
|
6389
6402
|
group: "functions",
|
|
6390
|
-
helpText: helpText$
|
|
6403
|
+
helpText: helpText$e,
|
|
6391
6404
|
signature: "<name> [--limit <number>] [--json] [--utc] [--delete [--force]] [--watch]",
|
|
6392
6405
|
description: "Retrieve or delete logs for a Sanity Function",
|
|
6393
6406
|
async action(args, context) {
|
|
@@ -6412,7 +6425,7 @@ Examples
|
|
|
6412
6425
|
});
|
|
6413
6426
|
if (!success) throw new Error(error2);
|
|
6414
6427
|
}
|
|
6415
|
-
}, helpText$
|
|
6428
|
+
}, helpText$d = `
|
|
6416
6429
|
Arguments
|
|
6417
6430
|
<name> The name of the Sanity Function
|
|
6418
6431
|
|
|
@@ -6454,7 +6467,7 @@ Examples
|
|
|
6454
6467
|
}, testFunctionsCommand = {
|
|
6455
6468
|
name: "test",
|
|
6456
6469
|
group: "functions",
|
|
6457
|
-
helpText: helpText$
|
|
6470
|
+
helpText: helpText$d,
|
|
6458
6471
|
signature: "<name> [--event create|update|delete] [--data <json>] [--data-before <json>] [--data-after <json>] [--file <filename>] [--file-before <filename>] [--file-after <filename>] [--document-id <id>] [--document-id-before <id>] [--document-id-before <id>] [--timeout <seconds>] [--api <version>] [--dataset <name>] [--project-id <id>] [--media-library-id <id>] [--with-user-token]",
|
|
6459
6472
|
description: "Invoke a local Sanity Function",
|
|
6460
6473
|
async action(args, context) {
|
|
@@ -6561,11 +6574,11 @@ const commonMistakes = { get: "list" }, levenThreshold = 3, coreCommands = [
|
|
|
6561
6574
|
"undeploy",
|
|
6562
6575
|
"uninstall",
|
|
6563
6576
|
"users"
|
|
6564
|
-
], discouragedCommands = ["upgrade", "check", "configcheck", "uninstall"], helpText$
|
|
6577
|
+
], discouragedCommands = ["upgrade", "check", "configcheck", "uninstall"], helpText$c = `
|
|
6565
6578
|
Run the command again within a Sanity project directory, where "sanity"
|
|
6566
6579
|
is installed as a dependency.`;
|
|
6567
6580
|
function getNoSuchCommandText(cmdName, parentGroupName, groups) {
|
|
6568
|
-
return parentGroupName && groups && groups[parentGroupName] ? suggestCommand(cmdName, groups[parentGroupName], parentGroupName) : coreCommands.includes(cmdName) ? `Command "${cmdName}" is not available outside of a Sanity project context.${helpText$
|
|
6581
|
+
return parentGroupName && groups && groups[parentGroupName] ? suggestCommand(cmdName, groups[parentGroupName], parentGroupName) : coreCommands.includes(cmdName) ? `Command "${cmdName}" is not available outside of a Sanity project context.${helpText$c}` : suggestCommand(cmdName, groups ? groups.default : []);
|
|
6569
6582
|
}
|
|
6570
6583
|
function suggestCommand(cmdName, group, parentGroupName = null) {
|
|
6571
6584
|
const closest = group.filter((command2) => !discouragedCommands.includes(command2.name)).map((command2) => leven(command2.name, cmdName)).reduce(
|
|
@@ -8333,11 +8346,11 @@ function requireTomlParser() {
|
|
|
8333
8346
|
function isAlphaNumHyphen(cp) {
|
|
8334
8347
|
return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
|
|
8335
8348
|
}
|
|
8336
|
-
const _type = Symbol("type"), _declared = Symbol("declared"), hasOwnProperty = Object.prototype.hasOwnProperty, defineProperty = Object.defineProperty, descriptor = { configurable: !0, enumerable: !0, writable: !0, value: void 0 };
|
|
8349
|
+
const _type = /* @__PURE__ */ Symbol("type"), _declared = /* @__PURE__ */ Symbol("declared"), hasOwnProperty = Object.prototype.hasOwnProperty, defineProperty = Object.defineProperty, descriptor = { configurable: !0, enumerable: !0, writable: !0, value: void 0 };
|
|
8337
8350
|
function hasKey(obj, key2) {
|
|
8338
8351
|
return hasOwnProperty.call(obj, key2) ? !0 : (key2 === "__proto__" && defineProperty(obj, "__proto__", descriptor), !1);
|
|
8339
8352
|
}
|
|
8340
|
-
const INLINE_TABLE = Symbol("inline-table");
|
|
8353
|
+
const INLINE_TABLE = /* @__PURE__ */ Symbol("inline-table");
|
|
8341
8354
|
function InlineTable() {
|
|
8342
8355
|
return Object.defineProperties({}, {
|
|
8343
8356
|
[_type]: { value: INLINE_TABLE }
|
|
@@ -8346,7 +8359,7 @@ function requireTomlParser() {
|
|
|
8346
8359
|
function isInlineTable(obj) {
|
|
8347
8360
|
return obj === null || typeof obj != "object" ? !1 : obj[_type] === INLINE_TABLE;
|
|
8348
8361
|
}
|
|
8349
|
-
const TABLE = Symbol("table");
|
|
8362
|
+
const TABLE = /* @__PURE__ */ Symbol("table");
|
|
8350
8363
|
function Table() {
|
|
8351
8364
|
return Object.defineProperties({}, {
|
|
8352
8365
|
[_type]: { value: TABLE },
|
|
@@ -8356,7 +8369,7 @@ function requireTomlParser() {
|
|
|
8356
8369
|
function isTable(obj) {
|
|
8357
8370
|
return obj === null || typeof obj != "object" ? !1 : obj[_type] === TABLE;
|
|
8358
8371
|
}
|
|
8359
|
-
const _contentType = Symbol("content-type"), INLINE_LIST = Symbol("inline-list");
|
|
8372
|
+
const _contentType = /* @__PURE__ */ Symbol("content-type"), INLINE_LIST = /* @__PURE__ */ Symbol("inline-list");
|
|
8360
8373
|
function InlineList(type2) {
|
|
8361
8374
|
return Object.defineProperties([], {
|
|
8362
8375
|
[_type]: { value: INLINE_LIST },
|
|
@@ -8366,7 +8379,7 @@ function requireTomlParser() {
|
|
|
8366
8379
|
function isInlineList(obj) {
|
|
8367
8380
|
return obj === null || typeof obj != "object" ? !1 : obj[_type] === INLINE_LIST;
|
|
8368
8381
|
}
|
|
8369
|
-
const LIST = Symbol("list");
|
|
8382
|
+
const LIST = /* @__PURE__ */ Symbol("list");
|
|
8370
8383
|
function List() {
|
|
8371
8384
|
return Object.defineProperties([], {
|
|
8372
8385
|
[_type]: { value: LIST }
|
|
@@ -8406,7 +8419,7 @@ function requireTomlParser() {
|
|
|
8406
8419
|
return this.value;
|
|
8407
8420
|
}
|
|
8408
8421
|
}
|
|
8409
|
-
const INTEGER = Symbol("integer");
|
|
8422
|
+
const INTEGER = /* @__PURE__ */ Symbol("integer");
|
|
8410
8423
|
function Integer(value) {
|
|
8411
8424
|
let num = Number(value);
|
|
8412
8425
|
return Object.is(num, -0) && (num = 0), loadEnv.commonjsGlobal.BigInt && !Number.isSafeInteger(num) ? new BoxedBigInt(value) : Object.defineProperties(new Number(num), {
|
|
@@ -8420,7 +8433,7 @@ function requireTomlParser() {
|
|
|
8420
8433
|
function isInteger(obj) {
|
|
8421
8434
|
return obj === null || typeof obj != "object" ? !1 : obj[_type] === INTEGER;
|
|
8422
8435
|
}
|
|
8423
|
-
const FLOAT = Symbol("float");
|
|
8436
|
+
const FLOAT = /* @__PURE__ */ Symbol("float");
|
|
8424
8437
|
function Float(value) {
|
|
8425
8438
|
return Object.defineProperties(new Number(value), {
|
|
8426
8439
|
[_type]: { value: FLOAT },
|
|
@@ -14667,7 +14680,7 @@ function requireMinimatch() {
|
|
|
14667
14680
|
minimatch_1 = minimatch2;
|
|
14668
14681
|
const path2 = requirePath$1();
|
|
14669
14682
|
minimatch2.sep = path2.sep;
|
|
14670
|
-
const GLOBSTAR2 = Symbol("globstar **");
|
|
14683
|
+
const GLOBSTAR2 = /* @__PURE__ */ Symbol("globstar **");
|
|
14671
14684
|
minimatch2.GLOBSTAR = GLOBSTAR2;
|
|
14672
14685
|
const expand2 = requireBraceExpansion(), plTypes = {
|
|
14673
14686
|
"!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
|
|
@@ -14696,7 +14709,7 @@ function requireMinimatch() {
|
|
|
14696
14709
|
throw new TypeError("invalid pattern");
|
|
14697
14710
|
if (pattern.length > MAX_PATTERN_LENGTH2)
|
|
14698
14711
|
throw new TypeError("pattern is too long");
|
|
14699
|
-
}, SUBPARSE = Symbol("subparse");
|
|
14712
|
+
}, SUBPARSE = /* @__PURE__ */ Symbol("subparse");
|
|
14700
14713
|
minimatch2.makeRe = (pattern, options2) => new Minimatch2(pattern, options2 || {}).makeRe(), minimatch2.match = (list2, pattern, options2 = {}) => {
|
|
14701
14714
|
const mm = new Minimatch2(pattern, options2);
|
|
14702
14715
|
return list2 = list2.filter((f) => mm.match(f)), mm.options.nonull && !list2.length && list2.push(pattern), list2;
|
|
@@ -22223,7 +22236,7 @@ function requireMinipass$1() {
|
|
|
22223
22236
|
const proc2 = typeof process == "object" && process ? process : {
|
|
22224
22237
|
stdout: null,
|
|
22225
22238
|
stderr: null
|
|
22226
|
-
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = Symbol("EOF"), MAYBE_EMIT_END2 = Symbol("maybeEmitEnd"), EMITTED_END2 = Symbol("emittedEnd"), EMITTING_END2 = Symbol("emittingEnd"), EMITTED_ERROR2 = Symbol("emittedError"), CLOSED2 = Symbol("closed"), READ2 = Symbol("read"), FLUSH2 = Symbol("flush"), FLUSHCHUNK2 = Symbol("flushChunk"), ENCODING2 = Symbol("encoding"), DECODER2 = Symbol("decoder"), FLOWING2 = Symbol("flowing"), PAUSED2 = Symbol("paused"), RESUME2 = Symbol("resume"), BUFFER2 = Symbol("buffer"), PIPES2 = Symbol("pipes"), BUFFERLENGTH2 = Symbol("bufferLength"), BUFFERPUSH2 = Symbol("bufferPush"), BUFFERSHIFT2 = Symbol("bufferShift"), OBJECTMODE2 = Symbol("objectMode"), DESTROYED2 = Symbol("destroyed"), ERROR2 = Symbol("error"), EMITDATA2 = Symbol("emitData"), EMITEND3 = Symbol("emitEnd"), EMITEND22 = Symbol("emitEnd2"), ASYNC2 = Symbol("async"), ABORT2 = Symbol("abort"), ABORTED2 = Symbol("aborted"), SIGNAL2 = Symbol("signal"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
22239
|
+
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = /* @__PURE__ */ Symbol("EOF"), MAYBE_EMIT_END2 = /* @__PURE__ */ Symbol("maybeEmitEnd"), EMITTED_END2 = /* @__PURE__ */ Symbol("emittedEnd"), EMITTING_END2 = /* @__PURE__ */ Symbol("emittingEnd"), EMITTED_ERROR2 = /* @__PURE__ */ Symbol("emittedError"), CLOSED2 = /* @__PURE__ */ Symbol("closed"), READ2 = /* @__PURE__ */ Symbol("read"), FLUSH2 = /* @__PURE__ */ Symbol("flush"), FLUSHCHUNK2 = /* @__PURE__ */ Symbol("flushChunk"), ENCODING2 = /* @__PURE__ */ Symbol("encoding"), DECODER2 = /* @__PURE__ */ Symbol("decoder"), FLOWING2 = /* @__PURE__ */ Symbol("flowing"), PAUSED2 = /* @__PURE__ */ Symbol("paused"), RESUME2 = /* @__PURE__ */ Symbol("resume"), BUFFER2 = /* @__PURE__ */ Symbol("buffer"), PIPES2 = /* @__PURE__ */ Symbol("pipes"), BUFFERLENGTH2 = /* @__PURE__ */ Symbol("bufferLength"), BUFFERPUSH2 = /* @__PURE__ */ Symbol("bufferPush"), BUFFERSHIFT2 = /* @__PURE__ */ Symbol("bufferShift"), OBJECTMODE2 = /* @__PURE__ */ Symbol("objectMode"), DESTROYED2 = /* @__PURE__ */ Symbol("destroyed"), ERROR2 = /* @__PURE__ */ Symbol("error"), EMITDATA2 = /* @__PURE__ */ Symbol("emitData"), EMITEND3 = /* @__PURE__ */ Symbol("emitEnd"), EMITEND22 = /* @__PURE__ */ Symbol("emitEnd2"), ASYNC2 = /* @__PURE__ */ Symbol("async"), ABORT2 = /* @__PURE__ */ Symbol("abort"), ABORTED2 = /* @__PURE__ */ Symbol("aborted"), SIGNAL2 = /* @__PURE__ */ Symbol("signal"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || /* @__PURE__ */ Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
22227
22240
|
class Pipe2 {
|
|
22228
22241
|
constructor(src, dest, opts) {
|
|
22229
22242
|
this.src = src, this.dest = dest, this.opts = opts, this.ondrain = () => src[RESUME2](), dest.on("drain", this.ondrain);
|
|
@@ -22622,7 +22635,7 @@ function requireMinipass() {
|
|
|
22622
22635
|
const proc2 = typeof process == "object" && process ? process : {
|
|
22623
22636
|
stdout: null,
|
|
22624
22637
|
stderr: null
|
|
22625
|
-
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = Symbol("EOF"), MAYBE_EMIT_END2 = Symbol("maybeEmitEnd"), EMITTED_END2 = Symbol("emittedEnd"), EMITTING_END2 = Symbol("emittingEnd"), EMITTED_ERROR2 = Symbol("emittedError"), CLOSED2 = Symbol("closed"), READ2 = Symbol("read"), FLUSH2 = Symbol("flush"), FLUSHCHUNK2 = Symbol("flushChunk"), ENCODING2 = Symbol("encoding"), DECODER2 = Symbol("decoder"), FLOWING2 = Symbol("flowing"), PAUSED2 = Symbol("paused"), RESUME2 = Symbol("resume"), BUFFERLENGTH2 = Symbol("bufferLength"), BUFFERPUSH2 = Symbol("bufferPush"), BUFFERSHIFT2 = Symbol("bufferShift"), OBJECTMODE2 = Symbol("objectMode"), DESTROYED2 = Symbol("destroyed"), EMITDATA2 = Symbol("emitData"), EMITEND3 = Symbol("emitEnd"), EMITEND22 = Symbol("emitEnd2"), ASYNC2 = Symbol("async"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
22638
|
+
}, EE = require$$0__default$7.default, Stream2 = require$$0__default$4.default, SD = require$$2__default.default.StringDecoder, EOF2 = /* @__PURE__ */ Symbol("EOF"), MAYBE_EMIT_END2 = /* @__PURE__ */ Symbol("maybeEmitEnd"), EMITTED_END2 = /* @__PURE__ */ Symbol("emittedEnd"), EMITTING_END2 = /* @__PURE__ */ Symbol("emittingEnd"), EMITTED_ERROR2 = /* @__PURE__ */ Symbol("emittedError"), CLOSED2 = /* @__PURE__ */ Symbol("closed"), READ2 = /* @__PURE__ */ Symbol("read"), FLUSH2 = /* @__PURE__ */ Symbol("flush"), FLUSHCHUNK2 = /* @__PURE__ */ Symbol("flushChunk"), ENCODING2 = /* @__PURE__ */ Symbol("encoding"), DECODER2 = /* @__PURE__ */ Symbol("decoder"), FLOWING2 = /* @__PURE__ */ Symbol("flowing"), PAUSED2 = /* @__PURE__ */ Symbol("paused"), RESUME2 = /* @__PURE__ */ Symbol("resume"), BUFFERLENGTH2 = /* @__PURE__ */ Symbol("bufferLength"), BUFFERPUSH2 = /* @__PURE__ */ Symbol("bufferPush"), BUFFERSHIFT2 = /* @__PURE__ */ Symbol("bufferShift"), OBJECTMODE2 = /* @__PURE__ */ Symbol("objectMode"), DESTROYED2 = /* @__PURE__ */ Symbol("destroyed"), EMITDATA2 = /* @__PURE__ */ Symbol("emitData"), EMITEND3 = /* @__PURE__ */ Symbol("emitEnd"), EMITEND22 = /* @__PURE__ */ Symbol("emitEnd2"), ASYNC2 = /* @__PURE__ */ Symbol("async"), defer2 = (fn) => Promise.resolve().then(fn), doIter = loadEnv.commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", ASYNCITERATOR = doIter && Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator not implemented"), ITERATOR = doIter && Symbol.iterator || /* @__PURE__ */ Symbol("iterator not implemented"), isEndish2 = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBuffer = (b) => b instanceof ArrayBuffer || typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
22626
22639
|
class Pipe2 {
|
|
22627
22640
|
constructor(src, dest, opts) {
|
|
22628
22641
|
this.src = src, this.dest = dest, this.opts = opts, this.ondrain = () => src[RESUME2](), dest.on("drain", this.ondrain);
|
|
@@ -22871,7 +22884,7 @@ var hasRequiredMinizlib;
|
|
|
22871
22884
|
function requireMinizlib() {
|
|
22872
22885
|
if (hasRequiredMinizlib) return minizlib;
|
|
22873
22886
|
hasRequiredMinizlib = 1;
|
|
22874
|
-
const assert = require$$0__default$6.default, Buffer2 = require$$0__default$9.default.Buffer, realZlib = require$$0__default$a.default, constants2 = minizlib.constants = requireConstants(), Minipass2 = requireMinipass(), OriginalBufferConcat = Buffer2.concat, _superWrite = Symbol("_superWrite");
|
|
22887
|
+
const assert = require$$0__default$6.default, Buffer2 = require$$0__default$9.default.Buffer, realZlib = require$$0__default$a.default, constants2 = minizlib.constants = requireConstants(), Minipass2 = requireMinipass(), OriginalBufferConcat = Buffer2.concat, _superWrite = /* @__PURE__ */ Symbol("_superWrite");
|
|
22875
22888
|
class ZlibError extends Error {
|
|
22876
22889
|
constructor(err) {
|
|
22877
22890
|
super("zlib: " + err.message), this.code = err.code, this.errno = err.errno, this.code || (this.code = "ZLIB_ERROR"), this.message = "zlib: " + err.message, Error.captureStackTrace(this, this.constructor);
|
|
@@ -22880,7 +22893,7 @@ function requireMinizlib() {
|
|
|
22880
22893
|
return "ZlibError";
|
|
22881
22894
|
}
|
|
22882
22895
|
}
|
|
22883
|
-
const _opts = Symbol("opts"), _flushFlag = Symbol("flushFlag"), _finishFlushFlag = Symbol("finishFlushFlag"), _fullFlushFlag = Symbol("fullFlushFlag"), _handle = Symbol("handle"), _onError = Symbol("onError"), _sawError = Symbol("sawError"), _level = Symbol("level"), _strategy = Symbol("strategy"), _ended = Symbol("ended");
|
|
22896
|
+
const _opts = /* @__PURE__ */ Symbol("opts"), _flushFlag = /* @__PURE__ */ Symbol("flushFlag"), _finishFlushFlag = /* @__PURE__ */ Symbol("finishFlushFlag"), _fullFlushFlag = /* @__PURE__ */ Symbol("fullFlushFlag"), _handle = /* @__PURE__ */ Symbol("handle"), _onError = /* @__PURE__ */ Symbol("onError"), _sawError = /* @__PURE__ */ Symbol("sawError"), _level = /* @__PURE__ */ Symbol("level"), _strategy = /* @__PURE__ */ Symbol("strategy"), _ended = /* @__PURE__ */ Symbol("ended");
|
|
22884
22897
|
class ZlibBase extends Minipass2 {
|
|
22885
22898
|
constructor(opts, mode2) {
|
|
22886
22899
|
if (!opts || typeof opts != "object")
|
|
@@ -22981,7 +22994,7 @@ function requireMinizlib() {
|
|
|
22981
22994
|
super(opts, "Inflate");
|
|
22982
22995
|
}
|
|
22983
22996
|
}
|
|
22984
|
-
const _portable = Symbol("_portable");
|
|
22997
|
+
const _portable = /* @__PURE__ */ Symbol("_portable");
|
|
22985
22998
|
class Gzip extends Zlib {
|
|
22986
22999
|
constructor(opts) {
|
|
22987
23000
|
super(opts, "Gzip"), this[_portable] = opts && !!opts.portable;
|
|
@@ -23039,7 +23052,7 @@ var readEntry, hasRequiredReadEntry;
|
|
|
23039
23052
|
function requireReadEntry() {
|
|
23040
23053
|
if (hasRequiredReadEntry) return readEntry;
|
|
23041
23054
|
hasRequiredReadEntry = 1;
|
|
23042
|
-
const { Minipass: Minipass2 } = requireMinipass$1(), normPath = requireNormalizeWindowsPath(), SLURP = Symbol("slurp");
|
|
23055
|
+
const { Minipass: Minipass2 } = requireMinipass$1(), normPath = requireNormalizeWindowsPath(), SLURP = /* @__PURE__ */ Symbol("slurp");
|
|
23043
23056
|
return readEntry = class extends Minipass2 {
|
|
23044
23057
|
constructor(header2, ex, gex) {
|
|
23045
23058
|
switch (super(), this.pause(), this.extended = ex, this.globalExtended = gex, this.header = header2, this.startBlockSize = 512 * Math.ceil(header2.size / 512), this.blockRemain = this.startBlockSize, this.remain = header2.size, this.type = header2.type, this.meta = !1, this.ignore = !1, this.type) {
|
|
@@ -23176,7 +23189,7 @@ var header, hasRequiredHeader;
|
|
|
23176
23189
|
function requireHeader() {
|
|
23177
23190
|
if (hasRequiredHeader) return header;
|
|
23178
23191
|
hasRequiredHeader = 1;
|
|
23179
|
-
const types2 = requireTypes$1(), pathModule = require$$0__default$1.default.posix, large = requireLargeNumbers(), SLURP = Symbol("slurp"), TYPE = Symbol("type");
|
|
23192
|
+
const types2 = requireTypes$1(), pathModule = require$$0__default$1.default.posix, large = requireLargeNumbers(), SLURP = /* @__PURE__ */ Symbol("slurp"), TYPE = /* @__PURE__ */ Symbol("type");
|
|
23180
23193
|
class Header {
|
|
23181
23194
|
constructor(data, off, ex, gex) {
|
|
23182
23195
|
this.cksumValid = !1, this.needPax = !1, this.nullBlock = !1, this.block = null, this.path = null, this.mode = null, this.uid = null, this.gid = null, this.size = null, this.mtime = null, this.cksum = null, this[TYPE] = "0", this.linkpath = null, this.uname = null, this.gname = null, this.devmaj = 0, this.devmin = 0, this.atime = null, this.ctime = null, Buffer.isBuffer(data) ? this.decode(data, off || 0, ex, gex) : data && this.set(data);
|
|
@@ -23372,7 +23385,7 @@ var writeEntry, hasRequiredWriteEntry;
|
|
|
23372
23385
|
function requireWriteEntry() {
|
|
23373
23386
|
if (hasRequiredWriteEntry) return writeEntry;
|
|
23374
23387
|
hasRequiredWriteEntry = 1;
|
|
23375
|
-
const { Minipass: Minipass2 } = requireMinipass$1(), Pax = requirePax(), Header = requireHeader(), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, normPath = requireNormalizeWindowsPath(), stripSlash = requireStripTrailingSlashes(), prefixPath = (path3, prefix) => prefix ? (path3 = normPath(path3).replace(/^\.(\/|$)/, ""), stripSlash(prefix) + "/" + path3) : normPath(path3), maxReadSize = 16 * 1024 * 1024, PROCESS2 = Symbol("process"), FILE = Symbol("file"), DIRECTORY = Symbol("directory"), SYMLINK = Symbol("symlink"), HARDLINK = Symbol("hardlink"), HEADER = Symbol("header"), READ2 = Symbol("read"), LSTAT = Symbol("lstat"), ONLSTAT = Symbol("onlstat"), ONREAD = Symbol("onread"), ONREADLINK = Symbol("onreadlink"), OPENFILE = Symbol("openfile"), ONOPENFILE = Symbol("onopenfile"), CLOSE = Symbol("close"), MODE = Symbol("mode"), AWAITDRAIN = Symbol("awaitDrain"), ONDRAIN = Symbol("ondrain"), PREFIX = Symbol("prefix"), HAD_ERROR = Symbol("hadError"), warner = requireWarnMixin(), winchars2 = requireWinchars(), stripAbsolutePath2 = requireStripAbsolutePath(), modeFix2 = requireModeFix(), WriteEntry = warner(class extends Minipass2 {
|
|
23388
|
+
const { Minipass: Minipass2 } = requireMinipass$1(), Pax = requirePax(), Header = requireHeader(), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, normPath = requireNormalizeWindowsPath(), stripSlash = requireStripTrailingSlashes(), prefixPath = (path3, prefix) => prefix ? (path3 = normPath(path3).replace(/^\.(\/|$)/, ""), stripSlash(prefix) + "/" + path3) : normPath(path3), maxReadSize = 16 * 1024 * 1024, PROCESS2 = /* @__PURE__ */ Symbol("process"), FILE = /* @__PURE__ */ Symbol("file"), DIRECTORY = /* @__PURE__ */ Symbol("directory"), SYMLINK = /* @__PURE__ */ Symbol("symlink"), HARDLINK = /* @__PURE__ */ Symbol("hardlink"), HEADER = /* @__PURE__ */ Symbol("header"), READ2 = /* @__PURE__ */ Symbol("read"), LSTAT = /* @__PURE__ */ Symbol("lstat"), ONLSTAT = /* @__PURE__ */ Symbol("onlstat"), ONREAD = /* @__PURE__ */ Symbol("onread"), ONREADLINK = /* @__PURE__ */ Symbol("onreadlink"), OPENFILE = /* @__PURE__ */ Symbol("openfile"), ONOPENFILE = /* @__PURE__ */ Symbol("onopenfile"), CLOSE = /* @__PURE__ */ Symbol("close"), MODE = /* @__PURE__ */ Symbol("mode"), AWAITDRAIN = /* @__PURE__ */ Symbol("awaitDrain"), ONDRAIN = /* @__PURE__ */ Symbol("ondrain"), PREFIX = /* @__PURE__ */ Symbol("prefix"), HAD_ERROR = /* @__PURE__ */ Symbol("hadError"), warner = requireWarnMixin(), winchars2 = requireWinchars(), stripAbsolutePath2 = requireStripAbsolutePath(), modeFix2 = requireModeFix(), WriteEntry = warner(class extends Minipass2 {
|
|
23376
23389
|
constructor(p, opt) {
|
|
23377
23390
|
if (opt = opt || {}, super(opt), typeof p != "string")
|
|
23378
23391
|
throw new TypeError("path is required");
|
|
@@ -23813,7 +23826,7 @@ function requirePack() {
|
|
|
23813
23826
|
this.path = path3 || "./", this.absolute = absolute, this.entry = null, this.stat = null, this.readdir = null, this.pending = !1, this.ignore = !1, this.piped = !1;
|
|
23814
23827
|
}
|
|
23815
23828
|
}
|
|
23816
|
-
const { Minipass: Minipass2 } = requireMinipass$1(), zlib = requireMinizlib(), ReadEntry = requireReadEntry(), WriteEntry = requireWriteEntry(), WriteEntrySync = WriteEntry.Sync, WriteEntryTar = WriteEntry.Tar, Yallist = requireYallist(), EOF2 = Buffer.alloc(1024), ONSTAT = Symbol("onStat"), ENDED = Symbol("ended"), QUEUE = Symbol("queue"), CURRENT = Symbol("current"), PROCESS2 = Symbol("process"), PROCESSING = Symbol("processing"), PROCESSJOB = Symbol("processJob"), JOBS = Symbol("jobs"), JOBDONE = Symbol("jobDone"), ADDFSENTRY = Symbol("addFSEntry"), ADDTARENTRY = Symbol("addTarEntry"), STAT = Symbol("stat"), READDIR = Symbol("readdir"), ONREADDIR = Symbol("onreaddir"), PIPE = Symbol("pipe"), ENTRY = Symbol("entry"), ENTRYOPT = Symbol("entryOpt"), WRITEENTRYCLASS = Symbol("writeEntryClass"), WRITE = Symbol("write"), ONDRAIN = Symbol("ondrain"), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, warner = requireWarnMixin(), normPath = requireNormalizeWindowsPath(), Pack = warner(class extends Minipass2 {
|
|
23829
|
+
const { Minipass: Minipass2 } = requireMinipass$1(), zlib = requireMinizlib(), ReadEntry = requireReadEntry(), WriteEntry = requireWriteEntry(), WriteEntrySync = WriteEntry.Sync, WriteEntryTar = WriteEntry.Tar, Yallist = requireYallist(), EOF2 = Buffer.alloc(1024), ONSTAT = /* @__PURE__ */ Symbol("onStat"), ENDED = /* @__PURE__ */ Symbol("ended"), QUEUE = /* @__PURE__ */ Symbol("queue"), CURRENT = /* @__PURE__ */ Symbol("current"), PROCESS2 = /* @__PURE__ */ Symbol("process"), PROCESSING = /* @__PURE__ */ Symbol("processing"), PROCESSJOB = /* @__PURE__ */ Symbol("processJob"), JOBS = /* @__PURE__ */ Symbol("jobs"), JOBDONE = /* @__PURE__ */ Symbol("jobDone"), ADDFSENTRY = /* @__PURE__ */ Symbol("addFSEntry"), ADDTARENTRY = /* @__PURE__ */ Symbol("addTarEntry"), STAT = /* @__PURE__ */ Symbol("stat"), READDIR = /* @__PURE__ */ Symbol("readdir"), ONREADDIR = /* @__PURE__ */ Symbol("onreaddir"), PIPE = /* @__PURE__ */ Symbol("pipe"), ENTRY = /* @__PURE__ */ Symbol("entry"), ENTRYOPT = /* @__PURE__ */ Symbol("entryOpt"), WRITEENTRYCLASS = /* @__PURE__ */ Symbol("writeEntryClass"), WRITE = /* @__PURE__ */ Symbol("write"), ONDRAIN = /* @__PURE__ */ Symbol("ondrain"), fs2 = require$$0__default.default, path2 = require$$0__default$1.default, warner = requireWarnMixin(), normPath = requireNormalizeWindowsPath(), Pack = warner(class extends Minipass2 {
|
|
23817
23830
|
constructor(opt) {
|
|
23818
23831
|
if (super(opt), opt = opt || /* @__PURE__ */ Object.create(null), this.opt = opt, this.file = opt.file || "", this.cwd = opt.cwd || process.cwd(), this.maxReadSize = opt.maxReadSize, this.preservePaths = !!opt.preservePaths, this.strict = !!opt.strict, this.noPax = !!opt.noPax, this.prefix = normPath(opt.prefix || ""), this.linkCache = opt.linkCache || /* @__PURE__ */ new Map(), this.statCache = opt.statCache || /* @__PURE__ */ new Map(), this.readdirCache = opt.readdirCache || /* @__PURE__ */ new Map(), this[WRITEENTRYCLASS] = WriteEntry, typeof opt.onwarn == "function" && this.on("warn", opt.onwarn), this.portable = !!opt.portable, this.zip = null, opt.gzip || opt.brotli) {
|
|
23819
23832
|
if (opt.gzip && opt.brotli)
|
|
@@ -23992,7 +24005,7 @@ function requireFsMinipass() {
|
|
|
23992
24005
|
req.oncomplete = done, binding.writeBuffers(fd, iovec, pos2, req);
|
|
23993
24006
|
};
|
|
23994
24007
|
}
|
|
23995
|
-
const _autoClose = Symbol("_autoClose"), _close = Symbol("_close"), _ended = Symbol("_ended"), _fd = Symbol("_fd"), _finished = Symbol("_finished"), _flags = Symbol("_flags"), _flush = Symbol("_flush"), _handleChunk = Symbol("_handleChunk"), _makeBuf = Symbol("_makeBuf"), _mode = Symbol("_mode"), _needDrain = Symbol("_needDrain"), _onerror = Symbol("_onerror"), _onopen = Symbol("_onopen"), _onread = Symbol("_onread"), _onwrite = Symbol("_onwrite"), _open = Symbol("_open"), _path = Symbol("_path"), _pos = Symbol("_pos"), _queue = Symbol("_queue"), _read = Symbol("_read"), _readSize = Symbol("_readSize"), _reading = Symbol("_reading"), _remain = Symbol("_remain"), _size = Symbol("_size"), _write = Symbol("_write"), _writing = Symbol("_writing"), _defaultFlag = Symbol("_defaultFlag"), _errored = Symbol("_errored");
|
|
24008
|
+
const _autoClose = /* @__PURE__ */ Symbol("_autoClose"), _close = /* @__PURE__ */ Symbol("_close"), _ended = /* @__PURE__ */ Symbol("_ended"), _fd = /* @__PURE__ */ Symbol("_fd"), _finished = /* @__PURE__ */ Symbol("_finished"), _flags = /* @__PURE__ */ Symbol("_flags"), _flush = /* @__PURE__ */ Symbol("_flush"), _handleChunk = /* @__PURE__ */ Symbol("_handleChunk"), _makeBuf = /* @__PURE__ */ Symbol("_makeBuf"), _mode = /* @__PURE__ */ Symbol("_mode"), _needDrain = /* @__PURE__ */ Symbol("_needDrain"), _onerror = /* @__PURE__ */ Symbol("_onerror"), _onopen = /* @__PURE__ */ Symbol("_onopen"), _onread = /* @__PURE__ */ Symbol("_onread"), _onwrite = /* @__PURE__ */ Symbol("_onwrite"), _open = /* @__PURE__ */ Symbol("_open"), _path = /* @__PURE__ */ Symbol("_path"), _pos = /* @__PURE__ */ Symbol("_pos"), _queue = /* @__PURE__ */ Symbol("_queue"), _read = /* @__PURE__ */ Symbol("_read"), _readSize = /* @__PURE__ */ Symbol("_readSize"), _reading = /* @__PURE__ */ Symbol("_reading"), _remain = /* @__PURE__ */ Symbol("_remain"), _size = /* @__PURE__ */ Symbol("_size"), _write = /* @__PURE__ */ Symbol("_write"), _writing = /* @__PURE__ */ Symbol("_writing"), _defaultFlag = /* @__PURE__ */ Symbol("_defaultFlag"), _errored = /* @__PURE__ */ Symbol("_errored");
|
|
23996
24009
|
class ReadStream extends MiniPass {
|
|
23997
24010
|
constructor(path2, opt) {
|
|
23998
24011
|
if (opt = opt || {}, super(opt), this.readable = !0, this.writable = !1, typeof path2 != "string")
|
|
@@ -24204,7 +24217,7 @@ var parse, hasRequiredParse;
|
|
|
24204
24217
|
function requireParse() {
|
|
24205
24218
|
if (hasRequiredParse) return parse;
|
|
24206
24219
|
hasRequiredParse = 1;
|
|
24207
|
-
const warner = requireWarnMixin(), Header = requireHeader(), EE = require$$0__default$7.default, Yallist = requireYallist(), maxMetaEntrySize = 1024 * 1024, Entry = requireReadEntry(), Pax = requirePax(), zlib = requireMinizlib(), { nextTick } = require$$7__default.default, gzipHeader = Buffer.from([31, 139]), STATE = Symbol("state"), WRITEENTRY = Symbol("writeEntry"), READENTRY = Symbol("readEntry"), NEXTENTRY = Symbol("nextEntry"), PROCESSENTRY = Symbol("processEntry"), EX = Symbol("extendedHeader"), GEX = Symbol("globalExtendedHeader"), META = Symbol("meta"), EMITMETA = Symbol("emitMeta"), BUFFER2 = Symbol("buffer"), QUEUE = Symbol("queue"), ENDED = Symbol("ended"), EMITTEDEND = Symbol("emittedEnd"), EMIT = Symbol("emit"), UNZIP = Symbol("unzip"), CONSUMECHUNK = Symbol("consumeChunk"), CONSUMECHUNKSUB = Symbol("consumeChunkSub"), CONSUMEBODY = Symbol("consumeBody"), CONSUMEMETA = Symbol("consumeMeta"), CONSUMEHEADER = Symbol("consumeHeader"), CONSUMING = Symbol("consuming"), BUFFERCONCAT = Symbol("bufferConcat"), MAYBEEND = Symbol("maybeEnd"), WRITING = Symbol("writing"), ABORTED2 = Symbol("aborted"), DONE = Symbol("onDone"), SAW_VALID_ENTRY = Symbol("sawValidEntry"), SAW_NULL_BLOCK = Symbol("sawNullBlock"), SAW_EOF = Symbol("sawEOF"), CLOSESTREAM = Symbol("closeStream"), noop2 = (_) => !0;
|
|
24220
|
+
const warner = requireWarnMixin(), Header = requireHeader(), EE = require$$0__default$7.default, Yallist = requireYallist(), maxMetaEntrySize = 1024 * 1024, Entry = requireReadEntry(), Pax = requirePax(), zlib = requireMinizlib(), { nextTick } = require$$7__default.default, gzipHeader = Buffer.from([31, 139]), STATE = /* @__PURE__ */ Symbol("state"), WRITEENTRY = /* @__PURE__ */ Symbol("writeEntry"), READENTRY = /* @__PURE__ */ Symbol("readEntry"), NEXTENTRY = /* @__PURE__ */ Symbol("nextEntry"), PROCESSENTRY = /* @__PURE__ */ Symbol("processEntry"), EX = /* @__PURE__ */ Symbol("extendedHeader"), GEX = /* @__PURE__ */ Symbol("globalExtendedHeader"), META = /* @__PURE__ */ Symbol("meta"), EMITMETA = /* @__PURE__ */ Symbol("emitMeta"), BUFFER2 = /* @__PURE__ */ Symbol("buffer"), QUEUE = /* @__PURE__ */ Symbol("queue"), ENDED = /* @__PURE__ */ Symbol("ended"), EMITTEDEND = /* @__PURE__ */ Symbol("emittedEnd"), EMIT = /* @__PURE__ */ Symbol("emit"), UNZIP = /* @__PURE__ */ Symbol("unzip"), CONSUMECHUNK = /* @__PURE__ */ Symbol("consumeChunk"), CONSUMECHUNKSUB = /* @__PURE__ */ Symbol("consumeChunkSub"), CONSUMEBODY = /* @__PURE__ */ Symbol("consumeBody"), CONSUMEMETA = /* @__PURE__ */ Symbol("consumeMeta"), CONSUMEHEADER = /* @__PURE__ */ Symbol("consumeHeader"), CONSUMING = /* @__PURE__ */ Symbol("consuming"), BUFFERCONCAT = /* @__PURE__ */ Symbol("bufferConcat"), MAYBEEND = /* @__PURE__ */ Symbol("maybeEnd"), WRITING = /* @__PURE__ */ Symbol("writing"), ABORTED2 = /* @__PURE__ */ Symbol("aborted"), DONE = /* @__PURE__ */ Symbol("onDone"), SAW_VALID_ENTRY = /* @__PURE__ */ Symbol("sawValidEntry"), SAW_NULL_BLOCK = /* @__PURE__ */ Symbol("sawNullBlock"), SAW_EOF = /* @__PURE__ */ Symbol("sawEOF"), CLOSESTREAM = /* @__PURE__ */ Symbol("closeStream"), noop2 = (_) => !0;
|
|
24208
24221
|
return parse = warner(class extends EE {
|
|
24209
24222
|
constructor(opt) {
|
|
24210
24223
|
opt = opt || {}, super(opt), this.file = opt.file || "", this[SAW_VALID_ENTRY] = null, this.on(DONE, (_) => {
|
|
@@ -25107,7 +25120,7 @@ var unpack, hasRequiredUnpack;
|
|
|
25107
25120
|
function requireUnpack() {
|
|
25108
25121
|
if (hasRequiredUnpack) return unpack;
|
|
25109
25122
|
hasRequiredUnpack = 1;
|
|
25110
|
-
const assert = require$$0__default$6.default, Parser = requireParse(), fs2 = require$$0__default.default, fsm = requireFsMinipass(), path2 = require$$0__default$1.default, mkdir2 = requireMkdir(), wc = requireWinchars(), pathReservations2 = requirePathReservations(), stripAbsolutePath2 = requireStripAbsolutePath(), normPath = requireNormalizeWindowsPath(), stripSlash = requireStripTrailingSlashes(), normalize2 = requireNormalizeUnicode(), ONENTRY = Symbol("onEntry"), CHECKFS = Symbol("checkFs"), CHECKFS2 = Symbol("checkFs2"), PRUNECACHE = Symbol("pruneCache"), ISREUSABLE = Symbol("isReusable"), MAKEFS = Symbol("makeFs"), FILE = Symbol("file"), DIRECTORY = Symbol("directory"), LINK = Symbol("link"), SYMLINK = Symbol("symlink"), HARDLINK = Symbol("hardlink"), UNSUPPORTED = Symbol("unsupported"), CHECKPATH = Symbol("checkPath"), MKDIR = Symbol("mkdir"), ONERROR = Symbol("onError"), PENDING = Symbol("pending"), PEND = Symbol("pend"), UNPEND = Symbol("unpend"), ENDED = Symbol("ended"), MAYBECLOSE = Symbol("maybeClose"), SKIP = Symbol("skip"), DOCHOWN = Symbol("doChown"), UID = Symbol("uid"), GID = Symbol("gid"), CHECKED_CWD = Symbol("checkedCwd"), crypto = require$$3__default.default, getFlag = requireGetWriteFlag(), isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", DEFAULT_MAX_DEPTH = 1024, unlinkFile = (path3, cb) => {
|
|
25123
|
+
const assert = require$$0__default$6.default, Parser = requireParse(), fs2 = require$$0__default.default, fsm = requireFsMinipass(), path2 = require$$0__default$1.default, mkdir2 = requireMkdir(), wc = requireWinchars(), pathReservations2 = requirePathReservations(), stripAbsolutePath2 = requireStripAbsolutePath(), normPath = requireNormalizeWindowsPath(), stripSlash = requireStripTrailingSlashes(), normalize2 = requireNormalizeUnicode(), ONENTRY = /* @__PURE__ */ Symbol("onEntry"), CHECKFS = /* @__PURE__ */ Symbol("checkFs"), CHECKFS2 = /* @__PURE__ */ Symbol("checkFs2"), PRUNECACHE = /* @__PURE__ */ Symbol("pruneCache"), ISREUSABLE = /* @__PURE__ */ Symbol("isReusable"), MAKEFS = /* @__PURE__ */ Symbol("makeFs"), FILE = /* @__PURE__ */ Symbol("file"), DIRECTORY = /* @__PURE__ */ Symbol("directory"), LINK = /* @__PURE__ */ Symbol("link"), SYMLINK = /* @__PURE__ */ Symbol("symlink"), HARDLINK = /* @__PURE__ */ Symbol("hardlink"), UNSUPPORTED = /* @__PURE__ */ Symbol("unsupported"), CHECKPATH = /* @__PURE__ */ Symbol("checkPath"), MKDIR = /* @__PURE__ */ Symbol("mkdir"), ONERROR = /* @__PURE__ */ Symbol("onError"), PENDING = /* @__PURE__ */ Symbol("pending"), PEND = /* @__PURE__ */ Symbol("pend"), UNPEND = /* @__PURE__ */ Symbol("unpend"), ENDED = /* @__PURE__ */ Symbol("ended"), MAYBECLOSE = /* @__PURE__ */ Symbol("maybeClose"), SKIP = /* @__PURE__ */ Symbol("skip"), DOCHOWN = /* @__PURE__ */ Symbol("doChown"), UID = /* @__PURE__ */ Symbol("uid"), GID = /* @__PURE__ */ Symbol("gid"), CHECKED_CWD = /* @__PURE__ */ Symbol("checkedCwd"), crypto = require$$3__default.default, getFlag = requireGetWriteFlag(), isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", DEFAULT_MAX_DEPTH = 1024, unlinkFile = (path3, cb) => {
|
|
25111
25124
|
if (!isWindows)
|
|
25112
25125
|
return fs2.unlink(path3, cb);
|
|
25113
25126
|
const name = path3 + ".DELETE." + crypto.randomBytes(16).toString("hex");
|
|
@@ -37398,7 +37411,7 @@ const escape = (s, { windowsPathsNoEscape = !1 } = {}) => windowsPathsNoEscape ?
|
|
|
37398
37411
|
posix: { sep: "/" }
|
|
37399
37412
|
}, sep = defaultPlatform$2 === "win32" ? path.win32.sep : path.posix.sep;
|
|
37400
37413
|
minimatch.sep = sep;
|
|
37401
|
-
const GLOBSTAR = Symbol("globstar **");
|
|
37414
|
+
const GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
37402
37415
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
37403
37416
|
const qmark = "[^/]", star$1 = qmark + "*?", twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter$1 = (pattern, options2 = {}) => (p) => minimatch(p, pattern, options2);
|
|
37404
37417
|
minimatch.filter = filter$1;
|
|
@@ -38718,7 +38731,7 @@ const proc = typeof process == "object" && process ? process : {
|
|
|
38718
38731
|
stdout: null,
|
|
38719
38732
|
stderr: null
|
|
38720
38733
|
}, isStream = (s) => !!s && typeof s == "object" && (s instanceof Minipass || s instanceof Stream__default.default || isReadable(s) || isWritable(s)), isReadable = (s) => !!s && typeof s == "object" && s instanceof node_events.EventEmitter && typeof s.pipe == "function" && // node core Writable streams have a pipe() method, but it throws
|
|
38721
|
-
s.pipe !== Stream__default.default.Writable.prototype.pipe, isWritable = (s) => !!s && typeof s == "object" && s instanceof node_events.EventEmitter && typeof s.write == "function" && typeof s.end == "function", EOF = Symbol("EOF"), MAYBE_EMIT_END = Symbol("maybeEmitEnd"), EMITTED_END = Symbol("emittedEnd"), EMITTING_END = Symbol("emittingEnd"), EMITTED_ERROR = Symbol("emittedError"), CLOSED = Symbol("closed"), READ = Symbol("read"), FLUSH = Symbol("flush"), FLUSHCHUNK = Symbol("flushChunk"), ENCODING = Symbol("encoding"), DECODER = Symbol("decoder"), FLOWING = Symbol("flowing"), PAUSED = Symbol("paused"), RESUME = Symbol("resume"), BUFFER = Symbol("buffer"), PIPES = Symbol("pipes"), BUFFERLENGTH = Symbol("bufferLength"), BUFFERPUSH = Symbol("bufferPush"), BUFFERSHIFT = Symbol("bufferShift"), OBJECTMODE = Symbol("objectMode"), DESTROYED = Symbol("destroyed"), ERROR = Symbol("error"), EMITDATA = Symbol("emitData"), EMITEND = Symbol("emitEnd"), EMITEND2 = Symbol("emitEnd2"), ASYNC = Symbol("async"), ABORT = Symbol("abort"), ABORTED = Symbol("aborted"), SIGNAL = Symbol("signal"), DATALISTENERS = Symbol("dataListeners"), DISCARDED = Symbol("discarded"), defer$1 = (fn) => Promise.resolve().then(fn), nodefer = (fn) => fn(), isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
38734
|
+
s.pipe !== Stream__default.default.Writable.prototype.pipe, isWritable = (s) => !!s && typeof s == "object" && s instanceof node_events.EventEmitter && typeof s.write == "function" && typeof s.end == "function", EOF = /* @__PURE__ */ Symbol("EOF"), MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"), EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"), EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"), EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"), CLOSED = /* @__PURE__ */ Symbol("closed"), READ = /* @__PURE__ */ Symbol("read"), FLUSH = /* @__PURE__ */ Symbol("flush"), FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"), ENCODING = /* @__PURE__ */ Symbol("encoding"), DECODER = /* @__PURE__ */ Symbol("decoder"), FLOWING = /* @__PURE__ */ Symbol("flowing"), PAUSED = /* @__PURE__ */ Symbol("paused"), RESUME = /* @__PURE__ */ Symbol("resume"), BUFFER = /* @__PURE__ */ Symbol("buffer"), PIPES = /* @__PURE__ */ Symbol("pipes"), BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"), BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"), BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"), OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"), DESTROYED = /* @__PURE__ */ Symbol("destroyed"), ERROR = /* @__PURE__ */ Symbol("error"), EMITDATA = /* @__PURE__ */ Symbol("emitData"), EMITEND = /* @__PURE__ */ Symbol("emitEnd"), EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"), ASYNC = /* @__PURE__ */ Symbol("async"), ABORT = /* @__PURE__ */ Symbol("abort"), ABORTED = /* @__PURE__ */ Symbol("aborted"), SIGNAL = /* @__PURE__ */ Symbol("signal"), DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"), DISCARDED = /* @__PURE__ */ Symbol("discarded"), defer$1 = (fn) => Promise.resolve().then(fn), nodefer = (fn) => fn(), isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish", isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b == "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0, isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
|
|
38722
38735
|
class Pipe {
|
|
38723
38736
|
src;
|
|
38724
38737
|
dest;
|
|
@@ -39321,7 +39334,7 @@ class ChildrenCache extends LRUCache {
|
|
|
39321
39334
|
});
|
|
39322
39335
|
}
|
|
39323
39336
|
}
|
|
39324
|
-
const setAsCwd = Symbol("PathScurry setAsCwd");
|
|
39337
|
+
const setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd");
|
|
39325
39338
|
class PathBase {
|
|
39326
39339
|
/**
|
|
39327
39340
|
* the basename of this path
|
|
@@ -41692,7 +41705,7 @@ const pathArg = (path2, opt = {}) => {
|
|
|
41692
41705
|
return rimrafMoveRemoveSync(path2, options2);
|
|
41693
41706
|
throw er;
|
|
41694
41707
|
}
|
|
41695
|
-
}, START = Symbol("start"), CHILD = Symbol("child"), FINISH = Symbol("finish"), rimrafWindows = async (path2, opt) => {
|
|
41708
|
+
}, START = /* @__PURE__ */ Symbol("start"), CHILD = /* @__PURE__ */ Symbol("child"), FINISH = /* @__PURE__ */ Symbol("finish"), rimrafWindows = async (path2, opt) => {
|
|
41696
41709
|
if (opt?.signal?.aborted)
|
|
41697
41710
|
throw opt.signal.reason;
|
|
41698
41711
|
try {
|
|
@@ -41996,6 +42009,126 @@ function readPackageJson(filePath) {
|
|
|
41996
42009
|
return;
|
|
41997
42010
|
}
|
|
41998
42011
|
}
|
|
42012
|
+
const MCP_SERVER_URL = "https://mcp.sanity.io";
|
|
42013
|
+
async function detectAvailableEditors() {
|
|
42014
|
+
const editors = [], homeDir = os__default.default.homedir(), cursorDir = path__default.default.join(homeDir, ".cursor");
|
|
42015
|
+
fs$1.existsSync(cursorDir) && editors.push({
|
|
42016
|
+
name: "Cursor",
|
|
42017
|
+
configPath: path__default.default.join(cursorDir, "mcp.json"),
|
|
42018
|
+
configKey: "mcpServers"
|
|
42019
|
+
});
|
|
42020
|
+
let vscodeConfigDir = null;
|
|
42021
|
+
switch (process.platform) {
|
|
42022
|
+
case "darwin":
|
|
42023
|
+
vscodeConfigDir = path__default.default.join(homeDir, "Library/Application Support/Code/User");
|
|
42024
|
+
break;
|
|
42025
|
+
case "win32":
|
|
42026
|
+
process.env.APPDATA && (vscodeConfigDir = path__default.default.join(process.env.APPDATA, "Code/User"));
|
|
42027
|
+
break;
|
|
42028
|
+
default:
|
|
42029
|
+
vscodeConfigDir = path__default.default.join(homeDir, ".config/Code/User");
|
|
42030
|
+
}
|
|
42031
|
+
vscodeConfigDir && fs$1.existsSync(vscodeConfigDir) && editors.push({
|
|
42032
|
+
name: "VS Code",
|
|
42033
|
+
configPath: path__default.default.join(vscodeConfigDir, "mcp.json"),
|
|
42034
|
+
configKey: "servers"
|
|
42035
|
+
});
|
|
42036
|
+
try {
|
|
42037
|
+
await execa("claude", ["--version"], { stdio: "pipe", timeout: 5e3 }), editors.push({
|
|
42038
|
+
name: "Claude Code",
|
|
42039
|
+
configPath: path__default.default.join(homeDir, ".claude.json"),
|
|
42040
|
+
configKey: "mcpServers"
|
|
42041
|
+
});
|
|
42042
|
+
} catch {
|
|
42043
|
+
}
|
|
42044
|
+
return editors;
|
|
42045
|
+
}
|
|
42046
|
+
async function promptForMCPSetup(prompt2, detectedEditors, editorsWithExisting) {
|
|
42047
|
+
const editorChoices = detectedEditors.map((e) => {
|
|
42048
|
+
const isConfigured = editorsWithExisting.some((existing) => existing.name === e.name);
|
|
42049
|
+
return {
|
|
42050
|
+
name: isConfigured ? `${e.name} (already installed)` : e.name,
|
|
42051
|
+
value: e.name,
|
|
42052
|
+
checked: !isConfigured
|
|
42053
|
+
// Only pre-select if NOT already configured
|
|
42054
|
+
};
|
|
42055
|
+
}), selectedNames = (await prompt2([
|
|
42056
|
+
{
|
|
42057
|
+
type: "checkbox",
|
|
42058
|
+
name: "selectedEditors",
|
|
42059
|
+
message: "Configure Sanity MCP server",
|
|
42060
|
+
choices: editorChoices
|
|
42061
|
+
}
|
|
42062
|
+
])).selectedEditors;
|
|
42063
|
+
return !selectedNames || selectedNames.length === 0 ? null : detectedEditors.filter((e) => selectedNames.includes(e.name));
|
|
42064
|
+
}
|
|
42065
|
+
async function createMCPToken(apiClient) {
|
|
42066
|
+
if (!getCliToken())
|
|
42067
|
+
throw new Error("Not authenticated. Please run `sanity login` first.");
|
|
42068
|
+
const client2 = apiClient({ requireUser: !0, requireProject: !1 }).clone().config({ apiVersion: "2025-12-09" }), sessionResponse = await client2.request({
|
|
42069
|
+
method: "POST",
|
|
42070
|
+
uri: "/auth/session/create",
|
|
42071
|
+
body: {
|
|
42072
|
+
sourceId: "sanity-mcp",
|
|
42073
|
+
withStamp: !1
|
|
42074
|
+
}
|
|
42075
|
+
});
|
|
42076
|
+
return (await client2.request({
|
|
42077
|
+
method: "GET",
|
|
42078
|
+
uri: "/auth/fetch",
|
|
42079
|
+
query: { sid: sessionResponse.sid }
|
|
42080
|
+
})).token;
|
|
42081
|
+
}
|
|
42082
|
+
async function getEditorsWithExistingConfig(editors) {
|
|
42083
|
+
const configured = [];
|
|
42084
|
+
for (const editor2 of editors)
|
|
42085
|
+
if (fs$1.existsSync(editor2.configPath))
|
|
42086
|
+
try {
|
|
42087
|
+
const content = await fs__default.default.readFile(editor2.configPath, "utf-8");
|
|
42088
|
+
JSON.parse(content)[editor2.configKey]?.Sanity && configured.push(editor2);
|
|
42089
|
+
} catch (err) {
|
|
42090
|
+
getCliConfig.debug("Could not read MCP config for %s: %s", editor2.name, err);
|
|
42091
|
+
}
|
|
42092
|
+
return configured;
|
|
42093
|
+
}
|
|
42094
|
+
async function writeMCPConfig(editor2, token2) {
|
|
42095
|
+
const configPath = editor2.configPath;
|
|
42096
|
+
let existingConfig = {};
|
|
42097
|
+
if (fs$1.existsSync(configPath))
|
|
42098
|
+
try {
|
|
42099
|
+
const content = await fs__default.default.readFile(configPath, "utf-8");
|
|
42100
|
+
existingConfig = JSON.parse(content);
|
|
42101
|
+
} catch {
|
|
42102
|
+
getCliConfig.debug(`Warning: Could not parse ${configPath}. Creating new config.`);
|
|
42103
|
+
}
|
|
42104
|
+
const serverKey = editor2.configKey;
|
|
42105
|
+
existingConfig[serverKey] || (existingConfig[serverKey] = {}), existingConfig[serverKey].Sanity = {
|
|
42106
|
+
type: "http",
|
|
42107
|
+
url: MCP_SERVER_URL,
|
|
42108
|
+
headers: {
|
|
42109
|
+
Authorization: `Bearer ${token2}`
|
|
42110
|
+
}
|
|
42111
|
+
}, await fs__default.default.mkdir(path__default.default.dirname(configPath), { recursive: !0 }), await fs__default.default.writeFile(configPath, JSON.stringify(existingConfig, null, 2), "utf-8");
|
|
42112
|
+
}
|
|
42113
|
+
async function setupMCP(context, options2) {
|
|
42114
|
+
const { output, prompt: prompt2 } = context;
|
|
42115
|
+
try {
|
|
42116
|
+
if (options2.mcp === !1)
|
|
42117
|
+
return output.warn("Skipping MCP configuration due to --no-mcp flag"), null;
|
|
42118
|
+
const detected = await detectAvailableEditors();
|
|
42119
|
+
if (detected.length === 0)
|
|
42120
|
+
return output.warn("No supported AI editors detected (Cursor, VS Code, Claude Code)"), null;
|
|
42121
|
+
const editorsWithExisting = await getEditorsWithExistingConfig(detected), selected = await promptForMCPSetup(prompt2, detected, editorsWithExisting);
|
|
42122
|
+
if (!selected || selected.length === 0)
|
|
42123
|
+
return null;
|
|
42124
|
+
const token2 = await createMCPToken(context.apiClient);
|
|
42125
|
+
for (const editor2 of selected)
|
|
42126
|
+
await writeMCPConfig(editor2, token2), output.success(`MCP configured for ${editor2.name}`);
|
|
42127
|
+
return selected;
|
|
42128
|
+
} catch (error2) {
|
|
42129
|
+
return output.warn(`Could not configure MCP: ${error2 instanceof Error ? error2.message : `${error2}`}`), output.warn("You can set up MCP manually later using https://mcp.sanity.io"), null;
|
|
42130
|
+
}
|
|
42131
|
+
}
|
|
41999
42132
|
const authorType = `import {UserIcon} from '@sanity/icons'
|
|
42000
42133
|
import {defineArrayMember, defineField, defineType} from 'sanity'
|
|
42001
42134
|
|
|
@@ -42561,7 +42694,7 @@ You can find your project on Sanity Manage \u2014 https://www.sanity.io/manage/p
|
|
|
42561
42694
|
semver__default.default.coerce(detectedFramework?.detectedVersion)?.major === 15 && isUsingReact19 && (warn("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"), warn("\u2502 \u2502"), warn("\u2502 It looks like you are using Next.js 15 and React 19 \u2502"), warn("\u2502 Please read our compatibility guide. \u2502"), warn("\u2502 https://www.sanity.io/help/react-19 \u2502"), warn("\u2502 \u2502"), warn("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"));
|
|
42562
42695
|
}
|
|
42563
42696
|
}
|
|
42564
|
-
let useTypeScript = flagOrDefault("typescript", !0);
|
|
42697
|
+
let useTypeScript = flagOrDefault("typescript", !0), mcpConfigured = null;
|
|
42565
42698
|
if (initNext) {
|
|
42566
42699
|
shouldPromptFor("typescript") && (useTypeScript = await promptForTypeScript(prompt2)), trace.log({ step: "useTypeScript", selectedOption: useTypeScript ? "yes" : "no" });
|
|
42567
42700
|
const fileExtension = useTypeScript ? "ts" : "js";
|
|
@@ -42636,6 +42769,7 @@ You can find your project on Sanity Manage \u2014 https://www.sanity.io/manage/p
|
|
|
42636
42769
|
print(`Failed to add ${nextjsLocalDevOrigin} to CORS origins`, error2);
|
|
42637
42770
|
});
|
|
42638
42771
|
}
|
|
42772
|
+
mcpConfigured = await setupMCP(context, { mcp: cliFlags.mcp });
|
|
42639
42773
|
const chosen = await resolvePackageManager(workDir);
|
|
42640
42774
|
trace.log({ step: "selectPackageManager", selectedOption: chosen });
|
|
42641
42775
|
const packages = ["@sanity/vision@4", "sanity@4", "@sanity/image-url@1", "styled-components@6"];
|
|
@@ -42655,10 +42789,16 @@ You can find your project on Sanity Manage \u2014 https://www.sanity.io/manage/p
|
|
|
42655
42789
|
cwd: workDir,
|
|
42656
42790
|
stdio: "inherit"
|
|
42657
42791
|
};
|
|
42658
|
-
chosen === "npm" ? await execa("npm", ["install", "--legacy-peer-deps", "next-sanity@11"], execOptions) : chosen === "yarn" ? await execa("npx", ["install-peerdeps", "--yarn", "next-sanity@11"], execOptions) : chosen === "pnpm" && await execa("pnpm", ["install", "next-sanity@11"], execOptions), print(
|
|
42792
|
+
if (chosen === "npm" ? await execa("npm", ["install", "--legacy-peer-deps", "next-sanity@11"], execOptions) : chosen === "yarn" ? await execa("npx", ["install-peerdeps", "--yarn", "next-sanity@11"], execOptions) : chosen === "pnpm" && await execa("pnpm", ["install", "next-sanity@11"], execOptions), print(
|
|
42659
42793
|
`
|
|
42660
42794
|
${chalk2.green("Success!")} Your Sanity configuration files has been added to this project`
|
|
42661
|
-
)
|
|
42795
|
+
), mcpConfigured && mcpConfigured.length > 0) {
|
|
42796
|
+
const editorNames = new Intl.ListFormat("en").format(mcpConfigured.map((e) => e.name));
|
|
42797
|
+
print(
|
|
42798
|
+
`
|
|
42799
|
+
Sanity MCP server has been configured for ${editorNames}. You might need to restart your editor for this to take effect.`
|
|
42800
|
+
), print(`Learn more: ${chalk2.cyan("https://mcp.sanity.io")}`);
|
|
42801
|
+
}
|
|
42662
42802
|
return;
|
|
42663
42803
|
}
|
|
42664
42804
|
function countNestedFolders(path2) {
|
|
@@ -42691,7 +42831,7 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
|
|
|
42691
42831
|
const template = templates[templateName];
|
|
42692
42832
|
if (!remoteTemplateInfo && !template)
|
|
42693
42833
|
throw new Error(`Template "${templateName}" not found`);
|
|
42694
|
-
!remoteTemplateInfo && template && (template.typescriptOnly === !0 ? useTypeScript = !0 : shouldPromptFor("typescript") && (useTypeScript = await promptForTypeScript(prompt2), trace.log({ step: "useTypeScript", selectedOption: useTypeScript ? "yes" : "no" })));
|
|
42834
|
+
!remoteTemplateInfo && template && (template.typescriptOnly === !0 ? useTypeScript = !0 : shouldPromptFor("typescript") && (useTypeScript = await promptForTypeScript(prompt2), trace.log({ step: "useTypeScript", selectedOption: useTypeScript ? "yes" : "no" }))), mcpConfigured = await setupMCP(context, { mcp: cliFlags.mcp });
|
|
42695
42835
|
let autoUpdates = !0;
|
|
42696
42836
|
typeof cliFlags["auto-updates"] == "boolean" && (autoUpdates = cliFlags["auto-updates"]);
|
|
42697
42837
|
const shouldImport = !unattended && template?.datasetUrl && await promptForDatasetImport(template.importPrompt);
|
|
@@ -42722,14 +42862,33 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
|
|
|
42722
42862
|
bun: "bun dev",
|
|
42723
42863
|
manual: "npm run dev"
|
|
42724
42864
|
}[pkgManager], isCurrentDir = outputPath === process.cwd(), goToProjectDir = `(${chalk2.cyan(`cd ${outputPath}`)} to navigate to your new project directory)`;
|
|
42725
|
-
|
|
42726
|
-
|
|
42865
|
+
if (isAppTemplate) {
|
|
42866
|
+
if (print(`\u2705 ${chalk2.green.bold("Success!")} Your custom app has been scaffolded.`), isCurrentDir || print(goToProjectDir), print(
|
|
42867
|
+
`
|
|
42727
42868
|
${chalk2.bold("Next")}, configure the project(s) and dataset(s) your app should work with.`
|
|
42728
|
-
|
|
42729
|
-
|
|
42730
|
-
|
|
42731
|
-
|
|
42732
|
-
|
|
42869
|
+
), print("\nGet started in `src/App.tsx`, or refer to our documentation for a walkthrough:"), print(chalk2.blue.underline("https://www.sanity.io/docs/app-sdk/sdk-configuration")), mcpConfigured && mcpConfigured.length > 0) {
|
|
42870
|
+
const editorNames = new Intl.ListFormat("en").format(mcpConfigured.map((e) => e.name));
|
|
42871
|
+
print(
|
|
42872
|
+
`
|
|
42873
|
+
Sanity MCP server has been configured for ${editorNames}. You might need to restart your editor for this to take effect.`
|
|
42874
|
+
), print(`Learn more: ${chalk2.cyan("https://mcp.sanity.io")}`);
|
|
42875
|
+
}
|
|
42876
|
+
print(`
|
|
42877
|
+
`), print("Other helpful commands:"), print("npx sanity docs to open the documentation in a browser"), print("npx sanity dev to start the development server for your app"), print("npx sanity deploy to deploy your app");
|
|
42878
|
+
} else {
|
|
42879
|
+
if (print(`\u2705 ${chalk2.green.bold("Success!")} Your Studio has been created.`), isCurrentDir || print(goToProjectDir), print(
|
|
42880
|
+
`Get started by running ${chalk2.cyan(devCommand)} to launch your Studio\u2019s development server`
|
|
42881
|
+
), mcpConfigured && mcpConfigured.length > 0) {
|
|
42882
|
+
const editorNames = new Intl.ListFormat("en").format(mcpConfigured.map((e) => e.name));
|
|
42883
|
+
print(
|
|
42884
|
+
`
|
|
42885
|
+
Sanity MCP server has been configured for ${editorNames}. You might need to restart your editor for this to take effect.`
|
|
42886
|
+
), print(`Learn more: ${chalk2.cyan("https://mcp.sanity.io")}`);
|
|
42887
|
+
}
|
|
42888
|
+
print(`
|
|
42889
|
+
`), print("Other helpful commands:"), print("npx sanity docs to open the documentation in a browser"), print("npx sanity manage to open the project settings in a browser"), print("npx sanity help to explore the CLI manual");
|
|
42890
|
+
}
|
|
42891
|
+
isFirstProject && (trace.log({ step: "sendCommunityInvite", selectedOption: "yes" }), print(`
|
|
42733
42892
|
Join the Sanity community: ${chalk2.cyan("https://www.sanity.io/community/join")}`), print(`We look forward to seeing you there!
|
|
42734
42893
|
`)), trace.complete();
|
|
42735
42894
|
async function getOrCreateUser() {
|
|
@@ -43297,7 +43456,7 @@ function getImportCommand(outputPath, studioVersion) {
|
|
|
43297
43456
|
);
|
|
43298
43457
|
}
|
|
43299
43458
|
}
|
|
43300
|
-
const helpText$
|
|
43459
|
+
const helpText$b = `
|
|
43301
43460
|
Options
|
|
43302
43461
|
-y, --yes Use unattended mode, accepting defaults and using only flags for choices
|
|
43303
43462
|
--project, --project-id <projectId> Project ID to use for the studio
|
|
@@ -43317,6 +43476,7 @@ Options
|
|
|
43317
43476
|
--package-manager <name> Specify which package manager to use [allowed: ${allowedPackageManagersString}]
|
|
43318
43477
|
--auto-updates Enable/disable auto updates of studio versions (default: true)
|
|
43319
43478
|
--overwrite-files Overwrite existing files (default: false)
|
|
43479
|
+
--no-mcp Skip AI editor integration (MCP) setup
|
|
43320
43480
|
|
|
43321
43481
|
Some flags are used when initializing a project in a specific framework.
|
|
43322
43482
|
|
|
@@ -43324,7 +43484,7 @@ Next.js
|
|
|
43324
43484
|
--nextjs-add-config-files Add config files to Next.js project (default: true)
|
|
43325
43485
|
--nextjs-embed-studio Embed the Studio in Next.js application (default: true)
|
|
43326
43486
|
--nextjs-append-env Append project ID and dataset to .env file (default: true)
|
|
43327
|
-
|
|
43487
|
+
|
|
43328
43488
|
Examples
|
|
43329
43489
|
# Initialize a new project, prompt for required information along the way
|
|
43330
43490
|
sanity init
|
|
@@ -43350,7 +43510,7 @@ Examples
|
|
|
43350
43510
|
name: "init",
|
|
43351
43511
|
signature: "",
|
|
43352
43512
|
description: "Initializes a new Sanity Studio and/or project",
|
|
43353
|
-
helpText: helpText$
|
|
43513
|
+
helpText: helpText$b,
|
|
43354
43514
|
action: async (args, context) => {
|
|
43355
43515
|
const [type2] = args.argsWithoutOptions;
|
|
43356
43516
|
if (type2)
|
|
@@ -43385,7 +43545,7 @@ Examples
|
|
|
43385
43545
|
const { output } = context, { print } = output, url = "https://www.sanity.io/learn";
|
|
43386
43546
|
print(`Opening ${url}`), await open(url);
|
|
43387
43547
|
}
|
|
43388
|
-
}, helpText$
|
|
43548
|
+
}, helpText$a = `
|
|
43389
43549
|
Options
|
|
43390
43550
|
--sso <slug> Log in using Single Sign On, using the given slug
|
|
43391
43551
|
--provider <providerId> Authenticate against a specific provider
|
|
@@ -43403,16 +43563,16 @@ Examples
|
|
|
43403
43563
|
`, loginCommand = {
|
|
43404
43564
|
name: "login",
|
|
43405
43565
|
signature: "[--sso <slug>] [--provider <providerId>] [--no-open]",
|
|
43406
|
-
helpText: helpText$
|
|
43566
|
+
helpText: helpText$a,
|
|
43407
43567
|
description: "Authenticates the CLI for access to Sanity projects",
|
|
43408
43568
|
action: login
|
|
43409
|
-
}, helpText$
|
|
43569
|
+
}, helpText$9 = `
|
|
43410
43570
|
Examples
|
|
43411
43571
|
# Log out of the CLI
|
|
43412
43572
|
sanity logout
|
|
43413
43573
|
`, logoutCommand = {
|
|
43414
43574
|
name: "logout",
|
|
43415
|
-
helpText: helpText$
|
|
43575
|
+
helpText: helpText$9,
|
|
43416
43576
|
signature: "logout",
|
|
43417
43577
|
description: "Logs out the CLI from the current user session",
|
|
43418
43578
|
async action(args, { output, apiClient }) {
|
|
@@ -43442,6 +43602,29 @@ ${err.message}`));
|
|
|
43442
43602
|
const { output, cliConfig } = context, { print } = output, projectId = cliConfig?.api?.projectId, url = projectId ? `https://www.sanity.io/manage/project/${projectId}` : "https://www.sanity.io/manage/";
|
|
43443
43603
|
print(`Opening ${url}`), await open(url);
|
|
43444
43604
|
}
|
|
43605
|
+
}, helpText$8 = `
|
|
43606
|
+
Examples
|
|
43607
|
+
# Configure Sanity MCP server for detected AI editors
|
|
43608
|
+
sanity mcp configure
|
|
43609
|
+
`, configureMcpCommand = {
|
|
43610
|
+
name: "configure",
|
|
43611
|
+
group: "mcp",
|
|
43612
|
+
helpText: helpText$8,
|
|
43613
|
+
signature: "",
|
|
43614
|
+
description: "Configure Sanity MCP server for AI editors (Cursor, VS Code, Claude Code)",
|
|
43615
|
+
async action(args, context) {
|
|
43616
|
+
const { output } = context;
|
|
43617
|
+
if ((await detectAvailableEditors()).length === 0) {
|
|
43618
|
+
output.print("No supported AI editors detected (Cursor, VS Code, Claude Code)."), output.print("Visit https://mcp.sanity.io for manual setup instructions.");
|
|
43619
|
+
return;
|
|
43620
|
+
}
|
|
43621
|
+
await setupMCP(context, { mcp: !0 });
|
|
43622
|
+
}
|
|
43623
|
+
}, mcpGroup = {
|
|
43624
|
+
name: "mcp",
|
|
43625
|
+
signature: "[COMMAND]",
|
|
43626
|
+
isGroupRoot: !0,
|
|
43627
|
+
description: "Manages MCP (Model Context Protocol) server configuration for AI editors"
|
|
43445
43628
|
};
|
|
43446
43629
|
async function getSpec(options2, context) {
|
|
43447
43630
|
const { output } = context;
|
|
@@ -44085,6 +44268,8 @@ const baseCommands = [
|
|
|
44085
44268
|
disableTelemetryCommand,
|
|
44086
44269
|
enableTelemetryCommand,
|
|
44087
44270
|
telemetryStatusCommand,
|
|
44271
|
+
mcpGroup,
|
|
44272
|
+
configureMcpCommand,
|
|
44088
44273
|
generateTypegenCommand,
|
|
44089
44274
|
typegenGroup,
|
|
44090
44275
|
functionsGroup,
|
|
@@ -44100,9 +44285,9 @@ const baseCommands = [
|
|
|
44100
44285
|
doctorBlueprintsCommand,
|
|
44101
44286
|
infoBlueprintsCommand,
|
|
44102
44287
|
initBlueprintsCommand,
|
|
44103
|
-
stacksBlueprintsCommand,
|
|
44104
44288
|
logsBlueprintsCommand,
|
|
44105
|
-
planBlueprintsCommand
|
|
44289
|
+
planBlueprintsCommand,
|
|
44290
|
+
stacksBlueprintsCommand
|
|
44106
44291
|
], copyProperty = (to, from2, property, ignoreNonConfigurable) => {
|
|
44107
44292
|
if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
|
|
44108
44293
|
return;
|
|
@@ -44162,7 +44347,7 @@ process.platform !== "win32" && signals.push(
|
|
|
44162
44347
|
// 'SIGPROF'
|
|
44163
44348
|
);
|
|
44164
44349
|
process.platform === "linux" && signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
44165
|
-
const processOk = (process2) => !!process2 && typeof process2 == "object" && typeof process2.removeListener == "function" && typeof process2.emit == "function" && typeof process2.reallyExit == "function" && typeof process2.listeners == "function" && typeof process2.kill == "function" && typeof process2.pid == "number" && typeof process2.on == "function", kExitEmitter = Symbol.for("signal-exit emitter"), global = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
44350
|
+
const processOk = (process2) => !!process2 && typeof process2 == "object" && typeof process2.removeListener == "function" && typeof process2.emit == "function" && typeof process2.reallyExit == "function" && typeof process2.listeners == "function" && typeof process2.kill == "function" && typeof process2.pid == "number" && typeof process2.on == "function", kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter"), global = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
44166
44351
|
class Emitter {
|
|
44167
44352
|
emitted = {
|
|
44168
44353
|
afterExit: !1,
|