@sanity/cli 3.54.0 → 3.54.1-ref-focus-repro.4

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.
@@ -5145,6 +5145,7 @@ const fs$j = require$$0__default$1.default, path$p = require$$0__default.default
5145
5145
  if (isBool && !isString && field === "")
5146
5146
  return !0;
5147
5147
  switch (field) {
5148
+ // eslint-disable-line default-case
5148
5149
  case "true":
5149
5150
  return !0;
5150
5151
  case "false":
@@ -8979,8 +8980,10 @@ function tomlType$1(value) {
8979
8980
  return "inline-table";
8980
8981
  case INLINE_LIST:
8981
8982
  return "inline-list";
8983
+ /* istanbul ignore next */
8982
8984
  case TABLE:
8983
8985
  return "table";
8986
+ /* istanbul ignore next */
8984
8987
  case LIST:
8985
8988
  return "list";
8986
8989
  case FLOAT:
@@ -9909,6 +9912,7 @@ function isInline(value) {
9909
9912
  return value.length === 0 || tomlType(value[0]) !== "table";
9910
9913
  case "table":
9911
9914
  return Object.keys(value).length === 0;
9915
+ /* istanbul ignore next */
9912
9916
  default:
9913
9917
  return !1;
9914
9918
  }
@@ -9964,6 +9968,7 @@ function stringifyInline(value, type2) {
9964
9968
  return stringifyInlineArray(value.filter((_2) => tomlType(_2) !== "null" && tomlType(_2) !== "undefined" && tomlType(_2) !== "nan"));
9965
9969
  case "table":
9966
9970
  return stringifyInlineTable(value);
9971
+ /* istanbul ignore next */
9967
9972
  default:
9968
9973
  throw typeError(type2);
9969
9974
  }
@@ -12303,11 +12308,14 @@ function parse$b(pattern, isSub) {
12303
12308
  continue;
12304
12309
  }
12305
12310
  switch (c2) {
12311
+ /* istanbul ignore next */
12306
12312
  case "/":
12307
12313
  return !1;
12308
12314
  case "\\":
12309
12315
  clearStateChar(), escaping = !0;
12310
12316
  continue;
12317
+ // the various stateChar values
12318
+ // for the "extglob" stuff.
12311
12319
  case "?":
12312
12320
  case "*":
12313
12321
  case "+":
@@ -12352,6 +12360,7 @@ function parse$b(pattern, isSub) {
12352
12360
  }
12353
12361
  clearStateChar(), re += "|";
12354
12362
  continue;
12363
+ // these are mostly the same in regexp and glob
12355
12364
  case "[":
12356
12365
  if (clearStateChar(), inClass) {
12357
12366
  re += "\\" + c2;
@@ -15150,6 +15159,7 @@ globstar while`, file2, fr, pattern, pr, swallowee), this.matchOne(file2.slice(f
15150
15159
  continue;
15151
15160
  }
15152
15161
  switch (c2) {
15162
+ /* istanbul ignore next */
15153
15163
  case "/":
15154
15164
  return !1;
15155
15165
  case "\\":
@@ -15159,6 +15169,8 @@ globstar while`, file2, fr, pattern, pr, swallowee), this.matchOne(file2.slice(f
15159
15169
  }
15160
15170
  clearStateChar(), escaping = !0;
15161
15171
  continue;
15172
+ // the various stateChar values
15173
+ // for the "extglob" stuff.
15162
15174
  case "?":
15163
15175
  case "*":
15164
15176
  case "+":
@@ -15207,6 +15219,7 @@ globstar while`, file2, fr, pattern, pr, swallowee), this.matchOne(file2.slice(f
15207
15219
  clearStateChar(), re += "|", plEntry.start === 0 && plEntry.type !== "!" && (dotTravAllowed = !0, re += subPatternStart(pattern.slice(i2 + 1)));
15208
15220
  continue;
15209
15221
  }
15222
+ // these are mostly the same in regexp and glob
15210
15223
  case "[":
15211
15224
  if (clearStateChar(), inClass) {
15212
15225
  re += "\\" + c2;
@@ -15487,6 +15500,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
15487
15500
  n++;
15488
15501
  var prefix;
15489
15502
  switch (n) {
15503
+ // if not, then this is rather simple
15490
15504
  case pattern.length:
15491
15505
  this._processSimple(pattern.join("/"), index);
15492
15506
  return;
@@ -15582,6 +15596,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
15582
15596
  }, GlobSync.prototype._readdirError = function(f2, er) {
15583
15597
  switch (er.code) {
15584
15598
  case "ENOTSUP":
15599
+ // https://github.com/isaacs/node-glob/issues/205
15585
15600
  case "ENOTDIR":
15586
15601
  var abs = this._makeAbs(f2);
15587
15602
  if (this.cache[abs] = "FILE", abs === this.cwdAbs) {
@@ -15590,6 +15605,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
15590
15605
  }
15591
15606
  break;
15592
15607
  case "ENOENT":
15608
+ // not terribly unusual
15593
15609
  case "ELOOP":
15594
15610
  case "ENAMETOOLONG":
15595
15611
  case "UNKNOWN":
@@ -15880,6 +15896,7 @@ function requireGlob$1() {
15880
15896
  n++;
15881
15897
  var prefix;
15882
15898
  switch (n) {
15899
+ // if not, then this is rather simple
15883
15900
  case pattern.length:
15884
15901
  this._processSimple(pattern.join("/"), index, cb);
15885
15902
  return;
@@ -15996,6 +16013,7 @@ function requireGlob$1() {
15996
16013
  if (!this.aborted) {
15997
16014
  switch (er.code) {
15998
16015
  case "ENOTSUP":
16016
+ // https://github.com/isaacs/node-glob/issues/205
15999
16017
  case "ENOTDIR":
16000
16018
  var abs = this._makeAbs(f2);
16001
16019
  if (this.cache[abs] = "FILE", abs === this.cwdAbs) {
@@ -16004,6 +16022,7 @@ function requireGlob$1() {
16004
16022
  }
16005
16023
  break;
16006
16024
  case "ENOENT":
16025
+ // not terribly unusual
16007
16026
  case "ELOOP":
16008
16027
  case "ENAMETOOLONG":
16009
16028
  case "UNKNOWN":
@@ -23601,6 +23620,7 @@ function requireTypes() {
23601
23620
  switch (len) {
23602
23621
  case 0:
23603
23622
  return "";
23623
+ // If there's only one initial capital letter, just lower-case it.
23604
23624
  case 1:
23605
23625
  return upperCasePrefix.toLowerCase();
23606
23626
  default:
@@ -30630,11 +30650,15 @@ function requireLines() {
30630
30650
  break;
30631
30651
  }
30632
30652
  case 11:
30653
+ // '\v'
30633
30654
  case 12:
30655
+ // '\f'
30634
30656
  case 13:
30657
+ // '\r'
30635
30658
  case 65279:
30636
30659
  break;
30637
30660
  case 32:
30661
+ // ' '
30638
30662
  default:
30639
30663
  count2 += 1;
30640
30664
  break;
@@ -31136,6 +31160,7 @@ function requireFastPath() {
31136
31160
  return parent.type === "NullableTypeAnnotation";
31137
31161
  case "Literal":
31138
31162
  return parent.type === "MemberExpression" && isNumber2.check(node.value) && name === "object" && parent.object === node;
31163
+ // Babel 6 Literal split
31139
31164
  case "NumericLiteral":
31140
31165
  return parent.type === "MemberExpression" && name === "object" && parent.object === node;
31141
31166
  case "YieldExpression":
@@ -31521,6 +31546,7 @@ function requirePrinter() {
31521
31546
  return printStatementSequence(bodyPath, options2, print);
31522
31547
  }, "body")), (0, lines_1.concat)(parts);
31523
31548
  case "Noop":
31549
+ // Babel extension.
31524
31550
  case "EmptyStatement":
31525
31551
  return (0, lines_1.fromString)("");
31526
31552
  case "ExpressionStatement":
@@ -31568,6 +31594,7 @@ function requirePrinter() {
31568
31594
  case "SpreadElement":
31569
31595
  case "SpreadElementPattern":
31570
31596
  case "RestProperty":
31597
+ // Babel 6 for ObjectPattern
31571
31598
  case "SpreadProperty":
31572
31599
  case "SpreadPropertyPattern":
31573
31600
  case "ObjectTypeSpreadProperty":
@@ -31625,6 +31652,10 @@ function requirePrinter() {
31625
31652
  return path2.call(print, "exported");
31626
31653
  case "Import":
31627
31654
  return (0, lines_1.fromString)("import", options2);
31655
+ // Recast and ast-types currently support dynamic import(...) using
31656
+ // either this dedicated ImportExpression type or a CallExpression
31657
+ // whose callee has type Import.
31658
+ // https://github.com/benjamn/ast-types/pull/365#issuecomment-605214486
31628
31659
  case "ImportExpression":
31629
31660
  return (0, lines_1.concat)(["import(", path2.call(print, "source"), ")"]);
31630
31661
  case "ImportDeclaration": {
@@ -31653,6 +31684,7 @@ function requirePrinter() {
31653
31684
  return (0, lines_1.concat)([path2.call(print, "key"), ": ", path2.call(print, "value")]);
31654
31685
  case "StaticBlock":
31655
31686
  parts.push("static ");
31687
+ // Intentionally fall through to BlockStatement below.
31656
31688
  case "BlockStatement": {
31657
31689
  var naked_1 = path2.call(function(bodyPath) {
31658
31690
  return printStatementSequence(bodyPath, options2, print);
@@ -31678,6 +31710,7 @@ function requirePrinter() {
31678
31710
  return parts.push(path2.call(print, "callee")), n.typeParameters && parts.push(path2.call(print, "typeParameters")), n.typeArguments && parts.push(path2.call(print, "typeArguments")), types2.getFieldValue(n, "optional") && parts.push("?."), parts.push(printArgumentsList(path2, options2, print)), (0, lines_1.concat)(parts);
31679
31711
  case "RecordExpression":
31680
31712
  parts.push("#");
31713
+ // Intentionally fall through to printing the object literal...
31681
31714
  case "ObjectExpression":
31682
31715
  case "ObjectPattern":
31683
31716
  case "ObjectTypeAnnotation": {
@@ -31717,6 +31750,7 @@ function requirePrinter() {
31717
31750
  path2.call(print, "pattern")
31718
31751
  ]);
31719
31752
  case "ObjectProperty":
31753
+ // Babel 6
31720
31754
  case "Property": {
31721
31755
  if (n.method || n.kind === "get" || n.kind === "set")
31722
31756
  return printMethod(path2, options2, print);
@@ -31726,7 +31760,9 @@ function requirePrinter() {
31726
31760
  return n.computed ? parts.push("[", key2, "]") : parts.push(key2), (!n.shorthand || n.key.name !== n.value.name) && parts.push(": ", path2.call(print, "value")), (0, lines_1.concat)(parts);
31727
31761
  }
31728
31762
  case "ClassMethod":
31763
+ // Babel 6
31729
31764
  case "ObjectMethod":
31765
+ // Babel 6
31730
31766
  case "ClassPrivateMethod":
31731
31767
  case "TSDeclareMethod":
31732
31768
  return printMethod(path2, options2, print);
@@ -31736,6 +31772,7 @@ function requirePrinter() {
31736
31772
  return (0, lines_1.concat)(["@", path2.call(print, "expression")]);
31737
31773
  case "TupleExpression":
31738
31774
  parts.push("#");
31775
+ // Intentionally fall through to printing the tuple elements...
31739
31776
  case "ArrayExpression":
31740
31777
  case "ArrayPattern": {
31741
31778
  var elems = n.elements, len_2 = elems.length, printed_1 = path2.map(print, "elements"), joined = (0, lines_1.fromString)(", ").join(printed_1), oneLine_2 = joined.getLineLength(1) <= options2.wrapColumn;
@@ -31770,6 +31807,7 @@ function requirePrinter() {
31770
31807
  case "StringLiteral":
31771
31808
  return (0, lines_1.fromString)(nodeStr(n.value, options2));
31772
31809
  case "BooleanLiteral":
31810
+ // Babel 6 Literal split
31773
31811
  case "Literal":
31774
31812
  return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value == "string" ? nodeStr(n.value, options2) : n.value), options2);
31775
31813
  case "Directive":
@@ -31899,6 +31937,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
31899
31937
  `
31900
31938
  }`
31901
31939
  ]);
31940
+ // Note: ignoring n.lexical because it has no printing consequences.
31902
31941
  case "SwitchCase":
31903
31942
  return n.test ? parts.push("case ", path2.call(print, "test"), ":") : parts.push("default:"), n.consequent.length > 0 && parts.push(`
31904
31943
  `, path2.call(function(consequentPath) {
@@ -31906,6 +31945,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
31906
31945
  }, "consequent").indent(options2.tabWidth)), (0, lines_1.concat)(parts);
31907
31946
  case "DebuggerStatement":
31908
31947
  return (0, lines_1.fromString)("debugger;");
31948
+ // JSX extensions below.
31909
31949
  case "JSXAttribute":
31910
31950
  return parts.push(path2.call(print, "name")), n.value && parts.push("=", path2.call(print, "value")), (0, lines_1.concat)(parts);
31911
31951
  case "JSXIdentifier":
@@ -32012,6 +32052,8 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32012
32052
  }
32013
32053
  case "TaggedTemplateExpression":
32014
32054
  return (0, lines_1.concat)([path2.call(print, "tag"), path2.call(print, "quasi")]);
32055
+ // These types are unprintable because they serve as abstract
32056
+ // supertypes for other (printable) types.
32015
32057
  case "Node":
32016
32058
  case "Printable":
32017
32059
  case "SourceLocation":
@@ -32024,22 +32066,32 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32024
32066
  case "Specifier":
32025
32067
  case "NamedSpecifier":
32026
32068
  case "Comment":
32069
+ // Supertype of Block and Line
32027
32070
  case "Flow":
32071
+ // Supertype of all Flow AST node types
32028
32072
  case "FlowType":
32073
+ // Supertype of all Flow types
32029
32074
  case "FlowPredicate":
32075
+ // Supertype of InferredPredicate and DeclaredPredicate
32030
32076
  case "MemberTypeAnnotation":
32077
+ // Flow
32031
32078
  case "Type":
32079
+ // Flow
32032
32080
  case "TSHasOptionalTypeParameterInstantiation":
32033
32081
  case "TSHasOptionalTypeParameters":
32034
32082
  case "TSHasOptionalTypeAnnotation":
32035
32083
  case "ChainElement":
32036
32084
  throw new Error("unprintable type: " + JSON.stringify(n.type));
32037
32085
  case "CommentBlock":
32086
+ // Babel block comment.
32038
32087
  case "Block":
32039
32088
  return (0, lines_1.concat)(["/*", (0, lines_1.fromString)(n.value, options2), "*/"]);
32040
32089
  case "CommentLine":
32090
+ // Babel line comment.
32041
32091
  case "Line":
32042
32092
  return (0, lines_1.concat)(["//", (0, lines_1.fromString)(n.value, options2)]);
32093
+ // Type Annotations for Facebook Flow, typically stripped out or
32094
+ // transformed away before printing.
32043
32095
  case "TypeAnnotation":
32044
32096
  return n.typeAnnotation ? (n.typeAnnotation.type !== "FunctionTypeAnnotation" && parts.push(": "), parts.push(path2.call(print, "typeAnnotation")), (0, lines_1.concat)(parts)) : (0, lines_1.fromString)("");
32045
32097
  case "ExistentialTypeParam":
@@ -32146,6 +32198,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32146
32198
  ]);
32147
32199
  case "DeclareInterface":
32148
32200
  parts.push("declare ");
32201
+ // Fall through to InterfaceDeclaration...
32149
32202
  case "InterfaceDeclaration":
32150
32203
  case "TSInterfaceDeclaration":
32151
32204
  return n.declare && parts.push("declare "), parts.push("interface ", path2.call(print, "id"), path2.call(print, "typeParameters"), " "), n.extends && n.extends.length > 0 && parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print, "extends")), " "), n.body && parts.push(path2.call(print, "body")), (0, lines_1.concat)(parts);
@@ -32204,6 +32257,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32204
32257
  return (0, lines_1.fromString)("string", options2);
32205
32258
  case "DeclareTypeAlias":
32206
32259
  parts.push("declare ");
32260
+ // Fall through to TypeAlias...
32207
32261
  case "TypeAlias":
32208
32262
  return (0, lines_1.concat)([
32209
32263
  "type ",
@@ -32215,6 +32269,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32215
32269
  ]);
32216
32270
  case "DeclareOpaqueType":
32217
32271
  parts.push("declare ");
32272
+ // Fall through to OpaqueType...
32218
32273
  case "OpaqueType":
32219
32274
  return parts.push("opaque type ", path2.call(print, "id"), path2.call(print, "typeParameters")), n.supertype && parts.push(": ", path2.call(print, "supertype")), n.impltype && parts.push(" = ", path2.call(print, "impltype")), parts.push(";"), (0, lines_1.concat)(parts);
32220
32275
  case "TypeCastExpression":
@@ -32259,6 +32314,7 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32259
32314
  return (0, lines_1.fromString)("symbol", options2);
32260
32315
  case "BigIntTypeAnnotation":
32261
32316
  return (0, lines_1.fromString)("bigint", options2);
32317
+ // Type Annotations for TypeScript (when using Babylon as parser)
32262
32318
  case "TSType":
32263
32319
  throw new Error("unprintable type: " + JSON.stringify(n.type));
32264
32320
  case "TSNumberKeyword":
@@ -32487,19 +32543,33 @@ while`), parts.push(" (", path2.call(print, "test"), ");"), (0, lines_1.concat)(
32487
32543
  }
32488
32544
  case "TSInstantiationExpression":
32489
32545
  return parts.push(path2.call(print, "expression"), path2.call(print, "typeParameters")), (0, lines_1.concat)(parts);
32546
+ // https://github.com/babel/babel/pull/10148
32490
32547
  case "V8IntrinsicIdentifier":
32491
32548
  return (0, lines_1.concat)(["%", path2.call(print, "name")]);
32549
+ // https://github.com/babel/babel/pull/13191
32492
32550
  case "TopicReference":
32493
32551
  return (0, lines_1.fromString)("#");
32552
+ // Unhandled types below. If encountered, nodes of these types should
32553
+ // be either left alone or desugared into AST types that are fully
32554
+ // supported by the pretty-printer.
32494
32555
  case "ClassHeritage":
32556
+ // TODO
32495
32557
  case "ComprehensionBlock":
32558
+ // TODO
32496
32559
  case "ComprehensionExpression":
32560
+ // TODO
32497
32561
  case "Glob":
32562
+ // TODO
32498
32563
  case "GeneratorExpression":
32564
+ // TODO
32499
32565
  case "LetStatement":
32566
+ // TODO
32500
32567
  case "LetExpression":
32568
+ // TODO
32501
32569
  case "GraphExpression":
32570
+ // TODO
32502
32571
  case "GraphIndexExpression":
32572
+ // TODO
32503
32573
  case "XMLDefaultDeclaration":
32504
32574
  case "XMLAnyName":
32505
32575
  case "XMLQualifiedIdentifier":
@@ -42559,6 +42629,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
42559
42629
  n++;
42560
42630
  var prefix;
42561
42631
  switch (n) {
42632
+ // if not, then this is rather simple
42562
42633
  case pattern.length:
42563
42634
  this._processSimple(pattern.join("/"), index);
42564
42635
  return;
@@ -42654,6 +42725,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
42654
42725
  }, GlobSync.prototype._readdirError = function(f2, er) {
42655
42726
  switch (er.code) {
42656
42727
  case "ENOTSUP":
42728
+ // https://github.com/isaacs/node-glob/issues/205
42657
42729
  case "ENOTDIR":
42658
42730
  var abs = this._makeAbs(f2);
42659
42731
  if (this.cache[abs] = "FILE", abs === this.cwdAbs) {
@@ -42662,6 +42734,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
42662
42734
  }
42663
42735
  break;
42664
42736
  case "ENOENT":
42737
+ // not terribly unusual
42665
42738
  case "ELOOP":
42666
42739
  case "ENAMETOOLONG":
42667
42740
  case "UNKNOWN":
@@ -42868,6 +42941,7 @@ function requireGlob() {
42868
42941
  n++;
42869
42942
  var prefix;
42870
42943
  switch (n) {
42944
+ // if not, then this is rather simple
42871
42945
  case pattern.length:
42872
42946
  this._processSimple(pattern.join("/"), index, cb);
42873
42947
  return;
@@ -42984,6 +43058,7 @@ function requireGlob() {
42984
43058
  if (!this.aborted) {
42985
43059
  switch (er.code) {
42986
43060
  case "ENOTSUP":
43061
+ // https://github.com/isaacs/node-glob/issues/205
42987
43062
  case "ENOTDIR":
42988
43063
  var abs = this._makeAbs(f2);
42989
43064
  if (this.cache[abs] = "FILE", abs === this.cwdAbs) {
@@ -42992,6 +43067,7 @@ function requireGlob() {
42992
43067
  }
42993
43068
  break;
42994
43069
  case "ENOENT":
43070
+ // not terribly unusual
42995
43071
  case "ELOOP":
42996
43072
  case "ENAMETOOLONG":
42997
43073
  case "UNKNOWN":