@sanity/cli 3.57.2-manifests.67 → 3.57.2-manifests.74

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var fs$r = require("node:fs"), os$6 = require("node:os"), path$t = require("node:path"), chalk$2 = require("chalk"), loadEnv = require("./loadEnv.js"), nodeMachineId = require("node-machine-id"), require$$0$4 = require("path"), require$$1$2 = require("module"), require$$0$5 = require("fs"), telemetry = require("@sanity/telemetry"), childProcess$2 = require("node:child_process"), fs$q = require("node:fs/promises"), util$b = require("node:util"), require$$0$6 = require("os"), require$$0$a = require("url"), require$$1$3 = require("get-it"), require$$2$1 = require("get-it/middleware"), require$$0$7 = require("constants"), require$$0$8 = require("stream"), require$$0$9 = require("util"), require$$5$1 = require("assert"), require$$3$1 = require("events"), require$$6$1 = require("http"), semver$2 = require("semver"), pkgDir = require("pkg-dir"), client$1 = require("@sanity/client"), require$$3$2 = require("crypto"), require$$0$b = require("child_process"), require$$0$c = require("fs/promises"), fs$s = require("@sanity/util/fs"), decompress = require("decompress"), validateNpmPackageName = require("validate-npm-package-name"), getCliConfig = require("./getCliConfig.js"), require$$0$d = require("buffer"), silverFleece = require("silver-fleece"), journeyConfig = require("./journeyConfig.js"), http$1 = require("node:http"), traverse = require("@babel/traverse"), process$2 = require("node:process"), require$$2$2 = require("readline"), require$$0$e = require("tty");
2
+ var fs$r = require("node:fs"), os$6 = require("node:os"), path$t = require("node:path"), chalk$2 = require("chalk"), loadEnv = require("./loadEnv.js"), require$$0$4 = require("path"), require$$1$2 = require("module"), require$$0$5 = require("fs"), telemetry = require("@sanity/telemetry"), childProcess$2 = require("node:child_process"), fs$q = require("node:fs/promises"), util$b = require("node:util"), require$$0$6 = require("os"), require$$0$a = require("url"), require$$1$3 = require("get-it"), require$$2$1 = require("get-it/middleware"), require$$0$7 = require("constants"), require$$0$8 = require("stream"), require$$0$9 = require("util"), require$$5$1 = require("assert"), require$$3$1 = require("events"), require$$6$1 = require("http"), semver$2 = require("semver"), pkgDir = require("pkg-dir"), client$1 = require("@sanity/client"), require$$3$2 = require("crypto"), require$$0$b = require("child_process"), require$$0$c = require("fs/promises"), fs$s = require("@sanity/util/fs"), decompress = require("decompress"), validateNpmPackageName = require("validate-npm-package-name"), getCliConfig = require("./getCliConfig.js"), require$$0$d = require("buffer"), silverFleece = require("silver-fleece"), journeyConfig = require("./journeyConfig.js"), http$1 = require("node:http"), traverse = require("@babel/traverse"), process$2 = require("node:process"), require$$2$2 = require("readline"), require$$0$e = require("tty");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
@@ -33241,6 +33241,17 @@ function requireLib$1() {
33241
33241
  syntaxPlugin
33242
33242
  }) {
33243
33243
  const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
33244
+ {
33245
+ const oldReasonCodes = {
33246
+ AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter",
33247
+ AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters",
33248
+ ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",
33249
+ SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter",
33250
+ SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter",
33251
+ SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType"
33252
+ };
33253
+ oldReasonCodes[reasonCode] && (reasonCode = oldReasonCodes[reasonCode]);
33254
+ }
33244
33255
  return function constructor(loc, details) {
33245
33256
  const error2 = new SyntaxError();
33246
33257
  return error2.code = code2, error2.reasonCode = reasonCode, error2.loc = loc, error2.pos = loc.index, error2.syntaxPlugin = syntaxPlugin, hasMissingPlugin && (error2.missingPlugin = details.missingPlugin), defineHidden(error2, "clone", function(overrides = {}) {
@@ -38030,12 +38041,12 @@ function requireLib$1() {
38030
38041
  AbstractPropertyHasInitializer: ({
38031
38042
  propertyName
38032
38043
  }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
38033
- AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
38034
- AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
38035
38044
  AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
38045
+ AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
38046
+ AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
38036
38047
  ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
38037
38048
  ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
38038
- ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
38049
+ ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
38039
38050
  ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
38040
38051
  DeclareAccessor: ({
38041
38052
  kind
@@ -38094,9 +38105,9 @@ function requireLib$1() {
38094
38105
  ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
38095
38106
  ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",
38096
38107
  ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",
38097
- SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
38098
- SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
38099
- SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
38108
+ SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
38109
+ SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
38110
+ SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
38100
38111
  SingleTypeParameterWithoutTrailingComma: ({
38101
38112
  typeParameterName
38102
38113
  }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,
@@ -38171,10 +38182,13 @@ function requireLib$1() {
38171
38182
  return tokenIsIdentifier(this.state.type);
38172
38183
  }
38173
38184
  tsTokenCanFollowModifier() {
38174
- return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
38185
+ return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName();
38186
+ }
38187
+ tsNextTokenOnSameLineAndCanFollowModifier() {
38188
+ return this.next(), this.hasPrecedingLineBreak() ? !1 : this.tsTokenCanFollowModifier();
38175
38189
  }
38176
38190
  tsNextTokenCanFollowModifier() {
38177
- return this.next(), this.tsTokenCanFollowModifier();
38191
+ return this.match(106) ? (this.next(), this.tsTokenCanFollowModifier()) : this.tsNextTokenOnSameLineAndCanFollowModifier();
38178
38192
  }
38179
38193
  tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
38180
38194
  if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75)
@@ -38349,18 +38363,18 @@ function requireLib$1() {
38349
38363
  if (this.match(10) || this.match(47)) {
38350
38364
  readonly && this.raise(TSErrors.ReadonlyForMethodSignature, node);
38351
38365
  const method = nodeAny;
38352
- method.kind && this.match(47) && this.raise(TSErrors.AccesorCannotHaveTypeParameters, this.state.curPosition()), this.tsFillSignature(14, method), this.tsParseTypeMemberSemicolon();
38366
+ method.kind && this.match(47) && this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()), this.tsFillSignature(14, method), this.tsParseTypeMemberSemicolon();
38353
38367
  const paramsKey = "parameters", returnTypeKey = "typeAnnotation";
38354
38368
  if (method.kind === "get")
38355
- method[paramsKey].length > 0 && (this.raise(Errors.BadGetterArity, this.state.curPosition()), this.isThisParam(method[paramsKey][0]) && this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()));
38369
+ method[paramsKey].length > 0 && (this.raise(Errors.BadGetterArity, this.state.curPosition()), this.isThisParam(method[paramsKey][0]) && this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()));
38356
38370
  else if (method.kind === "set") {
38357
38371
  if (method[paramsKey].length !== 1)
38358
38372
  this.raise(Errors.BadSetterArity, this.state.curPosition());
38359
38373
  else {
38360
38374
  const firstParameter = method[paramsKey][0];
38361
- this.isThisParam(firstParameter) && this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()), firstParameter.type === "Identifier" && firstParameter.optional && this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, this.state.curPosition()), firstParameter.type === "RestElement" && this.raise(TSErrors.SetAccesorCannotHaveRestParameter, this.state.curPosition());
38375
+ this.isThisParam(firstParameter) && this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()), firstParameter.type === "Identifier" && firstParameter.optional && this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()), firstParameter.type === "RestElement" && this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition());
38362
38376
  }
38363
- method[returnTypeKey] && this.raise(TSErrors.SetAccesorCannotHaveReturnType, method[returnTypeKey]);
38377
+ method[returnTypeKey] && this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]);
38364
38378
  } else
38365
38379
  method.kind = "method";
38366
38380
  return this.finishNode(method, "TSMethodSignature");
@@ -38398,13 +38412,14 @@ function requireLib$1() {
38398
38412
  tsIsStartOfMappedType() {
38399
38413
  return this.next(), this.eat(53) ? this.isContextual(122) : (this.isContextual(122) && this.next(), !this.match(0) || (this.next(), !this.tsIsIdentifier()) ? !1 : (this.next(), this.match(58)));
38400
38414
  }
38401
- tsParseMappedTypeParameter() {
38402
- const node = this.startNode();
38403
- return node.name = this.tsParseTypeParameterName(), node.constraint = this.tsExpectThenParseType(58), this.finishNode(node, "TSTypeParameter");
38404
- }
38405
38415
  tsParseMappedType() {
38406
38416
  const node = this.startNode();
38407
- return this.expect(5), this.match(53) ? (node.readonly = this.state.value, this.next(), this.expectContextual(122)) : this.eatContextual(122) && (node.readonly = !0), this.expect(0), node.typeParameter = this.tsParseMappedTypeParameter(), node.nameType = this.eatContextual(93) ? this.tsParseType() : null, this.expect(3), this.match(53) ? (node.optional = this.state.value, this.next(), this.expect(17)) : this.eat(17) && (node.optional = !0), node.typeAnnotation = this.tsTryParseType(), this.semicolon(), this.expect(8), this.finishNode(node, "TSMappedType");
38417
+ this.expect(5), this.match(53) ? (node.readonly = this.state.value, this.next(), this.expectContextual(122)) : this.eatContextual(122) && (node.readonly = !0), this.expect(0);
38418
+ {
38419
+ const typeParameter = this.startNode();
38420
+ typeParameter.name = this.tsParseTypeParameterName(), typeParameter.constraint = this.tsExpectThenParseType(58), node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
38421
+ }
38422
+ return node.nameType = this.eatContextual(93) ? this.tsParseType() : null, this.expect(3), this.match(53) ? (node.optional = this.state.value, this.next(), this.expect(17)) : this.eat(17) && (node.optional = !0), node.typeAnnotation = this.tsTryParseType(), this.semicolon(), this.expect(8), this.finishNode(node, "TSMappedType");
38408
38423
  }
38409
38424
  tsParseTupleType() {
38410
38425
  const node = this.startNode();
@@ -39082,7 +39097,7 @@ function requireLib$1() {
39082
39097
  id,
39083
39098
  init
39084
39099
  } of declaration.declarations)
39085
- init && (kind !== "const" || id.typeAnnotation ? this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init) : isValidAmbientConstInitializer(init, this.hasPlugin("estree")) || this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init));
39100
+ init && (kind !== "const" || id.typeAnnotation ? this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init) : isValidAmbientConstInitializer(init, this.hasPlugin("estree")) || this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init));
39086
39101
  return declaration;
39087
39102
  }
39088
39103
  parseStatementContent(flags, decorators) {
@@ -70291,7 +70306,6 @@ async function runCli(cliRoot, { cliVersion }) {
70291
70306
  Promise.race([wait(2e3), flushTelemetry()])
70292
70307
  )
70293
70308
  ), telemetry2.updateUserProperties({
70294
- deviceId: await nodeMachineId.machineId(),
70295
70309
  runtimeVersion: process.version,
70296
70310
  runtime: detectRuntime(),
70297
70311
  cliVersion: pkg.version,