@sanity/cli 3.72.0 → 3.72.1-corel.566

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.
@@ -37615,7 +37615,7 @@ function requireLib$1() {
37615
37615
  StrictWith: "'with' in strict mode."
37616
37616
  };
37617
37617
  const UnparenthesizedPipeBodyDescriptions = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
37618
- var PipelineOperatorErrors = Object.assign({
37618
+ var PipelineOperatorErrors = {
37619
37619
  PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
37620
37620
  PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
37621
37621
  PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
@@ -37627,15 +37627,14 @@ function requireLib$1() {
37627
37627
  type: type2
37628
37628
  }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
37629
37629
  type: type2
37630
- })}; please wrap it in parentheses.`
37631
- }, {
37630
+ })}; please wrap it in parentheses.`,
37632
37631
  PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
37633
37632
  PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
37634
37633
  PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
37635
37634
  PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
37636
37635
  PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
37637
37636
  PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
37638
- });
37637
+ };
37639
37638
  const _excluded = ["message"];
37640
37639
  function defineHidden(obj, key2, value) {
37641
37640
  Object.defineProperty(obj, key2, {
@@ -37859,7 +37858,7 @@ function requireLib$1() {
37859
37858
  const {
37860
37859
  typeParameters
37861
37860
  } = node;
37862
- return typeParameters && (delete node.typeParameters, funcNode.typeParameters = typeParameters, this.resetStartLocationFromNode(funcNode, typeParameters)), type2 === "ClassPrivateMethod" && (node.computed = !1), this.finishNode(node, "MethodDefinition");
37861
+ return typeParameters && (delete node.typeParameters, funcNode.typeParameters = typeParameters, funcNode.start = typeParameters.start, funcNode.loc.start = typeParameters.loc.start), type2 === "ClassPrivateMethod" && (node.computed = !1), this.finishNode(node, "MethodDefinition");
37863
37862
  }
37864
37863
  nameIsConstructor(key2) {
37865
37864
  return key2.type === "Literal" ? key2.value === "constructor" : super.nameIsConstructor(key2);
@@ -42777,28 +42776,19 @@ function requireLib$1() {
42777
42776
  }
42778
42777
  tsParseImportType() {
42779
42778
  const node = this.startNode();
42780
- return this.expect(83), this.expect(10), this.match(134) ? node.argument = this.parseStringLiteral(this.state.value) : (this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom()), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName(3)), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
42779
+ return this.expect(83), this.expect(10), this.match(134) ? node.argument = this.parseStringLiteral(this.state.value) : (this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom()), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
42781
42780
  }
42782
- tsParseEntityName(flags) {
42783
- let entity;
42784
- if (flags & 1 && this.match(78))
42785
- if (flags & 2)
42786
- entity = this.parseIdentifier(!0);
42787
- else {
42788
- const node = this.startNode();
42789
- this.next(), entity = this.finishNode(node, "ThisExpression");
42790
- }
42791
- else
42792
- entity = this.parseIdentifier(!!(flags & 1));
42781
+ tsParseEntityName(allowReservedWords = !0) {
42782
+ let entity = this.parseIdentifier(allowReservedWords);
42793
42783
  for (; this.eat(16); ) {
42794
42784
  const node = this.startNodeAtNode(entity);
42795
- node.left = entity, node.right = this.parseIdentifier(!!(flags & 1)), entity = this.finishNode(node, "TSQualifiedName");
42785
+ node.left = entity, node.right = this.parseIdentifier(allowReservedWords), entity = this.finishNode(node, "TSQualifiedName");
42796
42786
  }
42797
42787
  return entity;
42798
42788
  }
42799
42789
  tsParseTypeReference() {
42800
42790
  const node = this.startNode();
42801
- return node.typeName = this.tsParseEntityName(1), !this.hasPrecedingLineBreak() && this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSTypeReference");
42791
+ return node.typeName = this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSTypeReference");
42802
42792
  }
42803
42793
  tsParseThisTypePredicate(lhs) {
42804
42794
  this.next();
@@ -42811,7 +42801,7 @@ function requireLib$1() {
42811
42801
  }
42812
42802
  tsParseTypeQuery() {
42813
42803
  const node = this.startNode();
42814
- return this.expect(87), this.match(83) ? node.exprName = this.tsParseImportType() : node.exprName = this.tsParseEntityName(3), !this.hasPrecedingLineBreak() && this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSTypeQuery");
42804
+ return this.expect(87), this.match(83) ? node.exprName = this.tsParseImportType() : node.exprName = this.tsParseEntityName(), !this.hasPrecedingLineBreak() && this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSTypeQuery");
42815
42805
  }
42816
42806
  tsParseTypeParameter(parseModifiers) {
42817
42807
  const node = this.startNode();
@@ -43197,7 +43187,7 @@ function requireLib$1() {
43197
43187
  tsParseHeritageClause(token2) {
43198
43188
  const originalStartLoc = this.state.startLoc, delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
43199
43189
  const node = this.startNode();
43200
- return node.expression = this.tsParseEntityName(3), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSExpressionWithTypeArguments");
43190
+ return node.expression = this.tsParseEntityName(), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSExpressionWithTypeArguments");
43201
43191
  });
43202
43192
  return delimitedList.length || this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
43203
43193
  token: token2
@@ -43302,7 +43292,7 @@ function requireLib$1() {
43302
43292
  return this.isContextual(119) && this.lookaheadCharCode() === 40;
43303
43293
  }
43304
43294
  tsParseModuleReference() {
43305
- return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0);
43295
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(!1);
43306
43296
  }
43307
43297
  tsParseExternalModuleReference() {
43308
43298
  const node = this.startNode();
@@ -44420,15 +44410,15 @@ function requireLib$1() {
44420
44410
  switch (this.getPluginOption("pipelineOperator", "proposal")) {
44421
44411
  case "hack":
44422
44412
  return this.withTopicBindingContext(() => this.parseHackPipeBody());
44413
+ case "smart":
44414
+ return this.withTopicBindingContext(() => {
44415
+ if (this.prodParam.hasYield && this.isContextual(108))
44416
+ throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
44417
+ return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
44418
+ });
44423
44419
  case "fsharp":
44424
44420
  return this.withSoloAwaitPermittingContext(() => this.parseFSharpPipelineBody(prec));
44425
44421
  }
44426
- if (this.getPluginOption("pipelineOperator", "proposal") === "smart")
44427
- return this.withTopicBindingContext(() => {
44428
- if (this.prodParam.hasYield && this.isContextual(108))
44429
- throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
44430
- return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
44431
- });
44432
44422
  default:
44433
44423
  return this.parseExprOpBaseRightExpr(op, prec);
44434
44424
  }
@@ -44714,11 +44704,13 @@ function requireLib$1() {
44714
44704
  return this.next(), this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
44715
44705
  }
44716
44706
  finishTopicReference(node, startLoc, pipeProposal, tokenType) {
44717
- if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType))
44718
- return pipeProposal === "hack" ? (this.topicReferenceIsAllowedInCurrentContext() || this.raise(Errors.PipeTopicUnbound, startLoc), this.registerTopicReference(), this.finishNode(node, "TopicReference")) : (this.topicReferenceIsAllowedInCurrentContext() || this.raise(Errors.PrimaryTopicNotAllowed, startLoc), this.registerTopicReference(), this.finishNode(node, "PipelinePrimaryTopicReference"));
44719
- throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
44720
- token: tokenLabelName(tokenType)
44721
- });
44707
+ if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
44708
+ const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
44709
+ return this.topicReferenceIsAllowedInCurrentContext() || this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc), this.registerTopicReference(), this.finishNode(node, nodeType);
44710
+ } else
44711
+ throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
44712
+ token: tokenLabelName(tokenType)
44713
+ });
44722
44714
  }
44723
44715
  testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
44724
44716
  switch (pipeProposal) {