@sanity/cli 3.92.1-next.40.1f1bdfec39 → 3.92.1-next.42.40eccef023
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/codemods/partsTypeDirective.js +1 -2
- package/lib/_chunks-cjs/cli.js +121 -81
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/cliWorker.js.map +1 -1
- package/lib/_chunks-cjs/getCliConfig.js +4 -2
- package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
- package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
- package/lib/_chunks-cjs/loadEnv.js +3 -3
- package/lib/_chunks-cjs/loadEnv.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/workers/typegenGenerate.js +3 -4
- package/lib/workers/typegenGenerate.js.map +1 -1
- package/package.json +11 -9
- package/src/actions/codemod/codemodAction.ts +1 -1
- package/src/actions/codemod/mods/reactIconsV3.ts +1 -1
- package/src/actions/init-plugin/bootstrapFromTemplate.ts +2 -3
- package/src/actions/init-project/bootstrapLocalTemplate.ts +2 -2
- package/src/actions/init-project/git.ts +4 -4
- package/src/actions/init-project/initProject.ts +2 -2
- package/src/actions/init-project/readPackageJson.ts +1 -2
- package/src/actions/versions/findSanityModuleVersions.ts +1 -1
- package/src/commands/init/initCommand.ts +1 -1
- package/src/util/cliWorker.ts +1 -1
- package/src/util/clientWrapper.ts +2 -2
- package/src/util/getCliConfig.ts +3 -3
- package/src/util/getLocalVersion.ts +1 -1
- package/src/util/journeyConfig.ts +2 -2
- package/src/util/remoteTemplate.ts +2 -2
- package/src/workers/typegenGenerate.ts +0 -1
- package/templates/.eslintrc +0 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1
2
|
const path = require('node:path')
|
|
2
3
|
|
|
3
4
|
partsTypeDirective.parser = 'tsx'
|
|
@@ -13,7 +14,6 @@ function partsTypeDirective(fileInfo, api) {
|
|
|
13
14
|
return fileInfo.source
|
|
14
15
|
}
|
|
15
16
|
const partImports = root.find(api.jscodeshift.ImportDeclaration, (node) =>
|
|
16
|
-
// eslint-disable-next-line no-use-before-define
|
|
17
17
|
isSanityPart(node.source.value),
|
|
18
18
|
)
|
|
19
19
|
if (partImports.length === 0) {
|
|
@@ -21,7 +21,6 @@ function partsTypeDirective(fileInfo, api) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const existingDirectives = root.find(api.jscodeshift.Comment, (node) =>
|
|
24
|
-
// eslint-disable-next-line no-use-before-define
|
|
25
24
|
isSanityTypesReferenceDirective(node),
|
|
26
25
|
)
|
|
27
26
|
if (existingDirectives.length > 0) {
|
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -7516,8 +7516,8 @@ function getClientWrapper(cliApiConfig, configPath) {
|
|
|
7516
7516
|
const requester = client$1.requester.clone();
|
|
7517
7517
|
return requester.use(authErrors()), function(opts) {
|
|
7518
7518
|
const sanityEnv2 = process.env.SANITY_INTERNAL_ENV || "production", { requireUser, requireProject, api } = { ...defaults$1, ...opts }, token2 = getCliToken(), apiHost = apiHosts[sanityEnv2], apiConfig = {
|
|
7519
|
-
...cliApiConfig
|
|
7520
|
-
...api
|
|
7519
|
+
...cliApiConfig,
|
|
7520
|
+
...api
|
|
7521
7521
|
};
|
|
7522
7522
|
if (apiHost && (apiConfig.apiHost = apiHost), requireUser && !token2)
|
|
7523
7523
|
throw new Error('You must login first - run "sanity login"');
|
|
@@ -38175,9 +38175,6 @@ function requireLib$1() {
|
|
|
38175
38175
|
}) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
|
|
38176
38176
|
DuplicateProto: "Redefinition of __proto__ property.",
|
|
38177
38177
|
DuplicateRegExpFlags: "Duplicate regular expression flag.",
|
|
38178
|
-
DynamicImportPhaseRequiresImportExpressions: ({
|
|
38179
|
-
phase
|
|
38180
|
-
}) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,
|
|
38181
38178
|
ElementAfterRest: "Rest element must be last element.",
|
|
38182
38179
|
EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
|
|
38183
38180
|
ExportBindingIsString: ({
|
|
@@ -38328,7 +38325,7 @@ function requireLib$1() {
|
|
|
38328
38325
|
unexpected
|
|
38329
38326
|
}) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
|
|
38330
38327
|
UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
|
|
38331
|
-
UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script
|
|
38328
|
+
UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",
|
|
38332
38329
|
UnsupportedBind: "Binding should be performed on object property.",
|
|
38333
38330
|
UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
|
|
38334
38331
|
UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
|
|
@@ -38365,6 +38362,11 @@ function requireLib$1() {
|
|
|
38365
38362
|
StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
|
|
38366
38363
|
StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
|
|
38367
38364
|
StrictWith: "'with' in strict mode."
|
|
38365
|
+
}, ParseExpressionErrors = {
|
|
38366
|
+
ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.",
|
|
38367
|
+
ParseExpressionExpectsEOF: ({
|
|
38368
|
+
unexpected
|
|
38369
|
+
}) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(unexpected)}\`.`
|
|
38368
38370
|
};
|
|
38369
38371
|
const UnparenthesizedPipeBodyDescriptions = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
|
|
38370
38372
|
var PipelineOperatorErrors = Object.assign({
|
|
@@ -38461,7 +38463,7 @@ function requireLib$1() {
|
|
|
38461
38463
|
}
|
|
38462
38464
|
return ParseErrorConstructors;
|
|
38463
38465
|
}
|
|
38464
|
-
const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
|
|
38466
|
+
const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(ParseExpressionErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
|
|
38465
38467
|
function createDefaultOptions() {
|
|
38466
38468
|
return {
|
|
38467
38469
|
sourceType: "script",
|
|
@@ -39334,13 +39336,16 @@ function requireLib$1() {
|
|
|
39334
39336
|
} = this.scopeStack[i];
|
|
39335
39337
|
if (flags & 128)
|
|
39336
39338
|
return !0;
|
|
39337
|
-
if (flags &
|
|
39339
|
+
if (flags & 707)
|
|
39338
39340
|
return !1;
|
|
39339
39341
|
}
|
|
39340
39342
|
}
|
|
39341
39343
|
get inNonArrowFunction() {
|
|
39342
39344
|
return (this.currentThisScopeFlags() & 2) > 0;
|
|
39343
39345
|
}
|
|
39346
|
+
get inBareCaseStatement() {
|
|
39347
|
+
return (this.currentScope().flags & 256) > 0;
|
|
39348
|
+
}
|
|
39344
39349
|
get treatFunctionsAsVar() {
|
|
39345
39350
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
39346
39351
|
}
|
|
@@ -39363,7 +39368,7 @@ function requireLib$1() {
|
|
|
39363
39368
|
let type2 = scope2.names.get(name) || 0;
|
|
39364
39369
|
bindingType & 16 ? type2 = type2 | 4 : (scope2.firstLexicalName || (scope2.firstLexicalName = name), type2 = type2 | 2), scope2.names.set(name, type2), bindingType & 8 && this.maybeExportDefined(scope2, name);
|
|
39365
39370
|
} else if (bindingType & 4)
|
|
39366
|
-
for (let i = this.scopeStack.length - 1; i >= 0 && (scope2 = this.scopeStack[i], this.checkRedeclarationInScope(scope2, name, bindingType, loc), scope2.names.set(name, (scope2.names.get(name) || 0) | 1), this.maybeExportDefined(scope2, name), !(scope2.flags &
|
|
39371
|
+
for (let i = this.scopeStack.length - 1; i >= 0 && (scope2 = this.scopeStack[i], this.checkRedeclarationInScope(scope2, name, bindingType, loc), scope2.names.set(name, (scope2.names.get(name) || 0) | 1), this.maybeExportDefined(scope2, name), !(scope2.flags & 643)); --i)
|
|
39367
39372
|
;
|
|
39368
39373
|
this.parser.inModule && scope2.flags & 1 && this.undefinedExports.delete(name);
|
|
39369
39374
|
}
|
|
@@ -39396,7 +39401,7 @@ function requireLib$1() {
|
|
|
39396
39401
|
const {
|
|
39397
39402
|
flags
|
|
39398
39403
|
} = this.scopeStack[i];
|
|
39399
|
-
if (flags &
|
|
39404
|
+
if (flags & 643)
|
|
39400
39405
|
return flags;
|
|
39401
39406
|
}
|
|
39402
39407
|
}
|
|
@@ -39405,7 +39410,7 @@ function requireLib$1() {
|
|
|
39405
39410
|
const {
|
|
39406
39411
|
flags
|
|
39407
39412
|
} = this.scopeStack[i];
|
|
39408
|
-
if (flags &
|
|
39413
|
+
if (flags & 707 && !(flags & 4))
|
|
39409
39414
|
return flags;
|
|
39410
39415
|
}
|
|
39411
39416
|
}
|
|
@@ -41408,11 +41413,11 @@ function requireLib$1() {
|
|
|
41408
41413
|
return this.importsStack.push(/* @__PURE__ */ new Set()), new TypeScriptScope(flags);
|
|
41409
41414
|
}
|
|
41410
41415
|
enter(flags) {
|
|
41411
|
-
flags ===
|
|
41416
|
+
flags === 512 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(flags);
|
|
41412
41417
|
}
|
|
41413
41418
|
exit() {
|
|
41414
41419
|
const flags = super.exit();
|
|
41415
|
-
return flags ===
|
|
41420
|
+
return flags === 512 && this.importsStack.pop(), flags;
|
|
41416
41421
|
}
|
|
41417
41422
|
hasImport(name, allowShadow) {
|
|
41418
41423
|
const len = this.importsStack.length;
|
|
@@ -41567,6 +41572,7 @@ function requireLib$1() {
|
|
|
41567
41572
|
}
|
|
41568
41573
|
}
|
|
41569
41574
|
finalizeComment(commentWS) {
|
|
41575
|
+
var _node$options;
|
|
41570
41576
|
const {
|
|
41571
41577
|
comments: comments2
|
|
41572
41578
|
} = commentWS;
|
|
@@ -41588,6 +41594,9 @@ function requireLib$1() {
|
|
|
41588
41594
|
case "OptionalCallExpression":
|
|
41589
41595
|
adjustInnerComments(node, node.arguments, commentWS);
|
|
41590
41596
|
break;
|
|
41597
|
+
case "ImportExpression":
|
|
41598
|
+
adjustInnerComments(node, [node.source, (_node$options = node.options) != null ? _node$options : null], commentWS);
|
|
41599
|
+
break;
|
|
41591
41600
|
case "FunctionDeclaration":
|
|
41592
41601
|
case "FunctionExpression":
|
|
41593
41602
|
case "ArrowFunctionExpression":
|
|
@@ -41636,14 +41645,6 @@ function requireLib$1() {
|
|
|
41636
41645
|
const commentWS = commentStack[length - 1];
|
|
41637
41646
|
commentWS.leadingNode === node && (commentWS.leadingNode = null);
|
|
41638
41647
|
}
|
|
41639
|
-
resetPreviousIdentifierLeadingComments(node) {
|
|
41640
|
-
const {
|
|
41641
|
-
commentStack
|
|
41642
|
-
} = this.state, {
|
|
41643
|
-
length
|
|
41644
|
-
} = commentStack;
|
|
41645
|
-
length !== 0 && (commentStack[length - 1].trailingNode === node ? commentStack[length - 1].trailingNode = null : length >= 2 && commentStack[length - 2].trailingNode === node && (commentStack[length - 2].trailingNode = null));
|
|
41646
|
-
}
|
|
41647
41648
|
takeSurroundingComments(node, start, end) {
|
|
41648
41649
|
const {
|
|
41649
41650
|
commentStack
|
|
@@ -43337,7 +43338,7 @@ function requireLib$1() {
|
|
|
43337
43338
|
DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
|
|
43338
43339
|
DuplicateAccessibilityModifier: ({
|
|
43339
43340
|
modifier
|
|
43340
|
-
}) =>
|
|
43341
|
+
}) => `Accessibility modifier already seen: '${modifier}'.`,
|
|
43341
43342
|
DuplicateModifier: ({
|
|
43342
43343
|
modifier
|
|
43343
43344
|
}) => `Duplicate modifier: '${modifier}'.`,
|
|
@@ -43363,6 +43364,7 @@ function requireLib$1() {
|
|
|
43363
43364
|
InvalidHeritageClauseType: ({
|
|
43364
43365
|
token: token2
|
|
43365
43366
|
}) => `'${token2}' list can only include identifiers or qualified-names with optional type arguments.`,
|
|
43367
|
+
InvalidModifierOnAwaitUsingDeclaration: (modifier) => `'${modifier}' modifier cannot appear on an await using declaration.`,
|
|
43366
43368
|
InvalidModifierOnTypeMember: ({
|
|
43367
43369
|
modifier
|
|
43368
43370
|
}) => `'${modifier}' modifier cannot appear on a type member.`,
|
|
@@ -43372,6 +43374,7 @@ function requireLib$1() {
|
|
|
43372
43374
|
InvalidModifierOnTypeParameterPositions: ({
|
|
43373
43375
|
modifier
|
|
43374
43376
|
}) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,
|
|
43377
|
+
InvalidModifierOnUsingDeclaration: (modifier) => `'${modifier}' modifier cannot appear on a using declaration.`,
|
|
43375
43378
|
InvalidModifiersOrder: ({
|
|
43376
43379
|
orderedModifiers
|
|
43377
43380
|
}) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,
|
|
@@ -43379,7 +43382,7 @@ function requireLib$1() {
|
|
|
43379
43382
|
InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
|
|
43380
43383
|
MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
|
|
43381
43384
|
NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
|
|
43382
|
-
|
|
43385
|
+
NonClassMethodPropertyHasAbstractModifier: "'abstract' modifier can only appear on a class, method, or property declaration.",
|
|
43383
43386
|
OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
|
|
43384
43387
|
OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
|
|
43385
43388
|
PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
|
|
@@ -43475,12 +43478,12 @@ function requireLib$1() {
|
|
|
43475
43478
|
tsNextTokenCanFollowModifier() {
|
|
43476
43479
|
return this.match(106) ? (this.next(), this.tsTokenCanFollowModifier()) : this.tsNextTokenOnSameLineAndCanFollowModifier();
|
|
43477
43480
|
}
|
|
43478
|
-
tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
|
|
43481
|
+
tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
|
|
43479
43482
|
if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75)
|
|
43480
43483
|
return;
|
|
43481
43484
|
const modifier = this.state.value;
|
|
43482
43485
|
if (allowedModifiers.includes(modifier)) {
|
|
43483
|
-
if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks())
|
|
43486
|
+
if (hasSeenStaticModifier && this.match(106) || stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks())
|
|
43484
43487
|
return;
|
|
43485
43488
|
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))
|
|
43486
43489
|
return modifier;
|
|
@@ -43504,7 +43507,7 @@ function requireLib$1() {
|
|
|
43504
43507
|
for (; ; ) {
|
|
43505
43508
|
const {
|
|
43506
43509
|
startLoc
|
|
43507
|
-
} = this.state, modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers ?? []), stopOnStartOfClassStaticBlock);
|
|
43510
|
+
} = this.state, modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers ?? []), stopOnStartOfClassStaticBlock, modified.static);
|
|
43508
43511
|
if (!modifier) break;
|
|
43509
43512
|
tsIsAccessModifier(modifier) ? modified.accessibility ? this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
|
|
43510
43513
|
modifier
|
|
@@ -44094,11 +44097,11 @@ function requireLib$1() {
|
|
|
44094
44097
|
const inner = this.startNode();
|
|
44095
44098
|
this.tsParseModuleOrNamespaceDeclaration(inner, !0), node.body = inner;
|
|
44096
44099
|
} else
|
|
44097
|
-
this.scope.enter(
|
|
44100
|
+
this.scope.enter(512), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit();
|
|
44098
44101
|
return this.finishNode(node, "TSModuleDeclaration");
|
|
44099
44102
|
}
|
|
44100
44103
|
tsParseAmbientExternalModuleDeclaration(node) {
|
|
44101
|
-
return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(
|
|
44104
|
+
return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(512), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit()) : this.semicolon(), this.finishNode(node, "TSModuleDeclaration");
|
|
44102
44105
|
}
|
|
44103
44106
|
tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
|
|
44104
44107
|
node.isExport = isExport || !1, node.id = maybeDefaultIdentifier || this.parseIdentifier(), this.checkIdentifier(node.id, 4096), this.expect(29);
|
|
@@ -44130,37 +44133,48 @@ function requireLib$1() {
|
|
|
44130
44133
|
return result;
|
|
44131
44134
|
this.state = state;
|
|
44132
44135
|
}
|
|
44133
|
-
tsTryParseDeclare(
|
|
44136
|
+
tsTryParseDeclare(node) {
|
|
44134
44137
|
if (this.isLineTerminator())
|
|
44135
44138
|
return;
|
|
44136
|
-
|
|
44137
|
-
return this.
|
|
44139
|
+
const startType = this.state.type;
|
|
44140
|
+
return this.tsInAmbientContext(() => {
|
|
44138
44141
|
switch (startType) {
|
|
44139
44142
|
case 68:
|
|
44140
|
-
return
|
|
44143
|
+
return node.declare = !0, super.parseFunctionStatement(node, !1, !1);
|
|
44141
44144
|
case 80:
|
|
44142
|
-
return
|
|
44145
|
+
return node.declare = !0, this.parseClass(node, !0, !1);
|
|
44143
44146
|
case 126:
|
|
44144
|
-
return this.tsParseEnumDeclaration(
|
|
44147
|
+
return this.tsParseEnumDeclaration(node, {
|
|
44145
44148
|
declare: !0
|
|
44146
44149
|
});
|
|
44147
44150
|
case 112:
|
|
44148
|
-
return this.tsParseAmbientExternalModuleDeclaration(
|
|
44151
|
+
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
44152
|
+
case 100:
|
|
44153
|
+
if (this.state.containsEsc)
|
|
44154
|
+
return;
|
|
44149
44155
|
case 75:
|
|
44150
44156
|
case 74:
|
|
44151
|
-
return !this.match(75) || !this.isLookaheadContextual("enum") ? (
|
|
44157
|
+
return !this.match(75) || !this.isLookaheadContextual("enum") ? (node.declare = !0, this.parseVarStatement(node, this.state.value, !0)) : (this.expect(75), this.tsParseEnumDeclaration(node, {
|
|
44152
44158
|
const: !0,
|
|
44153
44159
|
declare: !0
|
|
44154
44160
|
}));
|
|
44161
|
+
case 107:
|
|
44162
|
+
if (this.hasPlugin("explicitResourceManagement") && this.isUsing())
|
|
44163
|
+
return this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"), node.declare = !0, this.parseVarStatement(node, "using", !0);
|
|
44164
|
+
break;
|
|
44165
|
+
case 96:
|
|
44166
|
+
if (this.hasPlugin("explicitResourceManagement") && this.isAwaitUsing())
|
|
44167
|
+
return this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"), node.declare = !0, this.next(), this.parseVarStatement(node, "await using", !0);
|
|
44168
|
+
break;
|
|
44155
44169
|
case 129: {
|
|
44156
|
-
const result = this.tsParseInterfaceDeclaration(
|
|
44170
|
+
const result = this.tsParseInterfaceDeclaration(node, {
|
|
44157
44171
|
declare: !0
|
|
44158
44172
|
});
|
|
44159
44173
|
if (result) return result;
|
|
44160
44174
|
}
|
|
44161
44175
|
default:
|
|
44162
44176
|
if (tokenIsIdentifier(startType))
|
|
44163
|
-
return this.tsParseDeclaration(
|
|
44177
|
+
return this.tsParseDeclaration(node, this.state.value, !0, null);
|
|
44164
44178
|
}
|
|
44165
44179
|
});
|
|
44166
44180
|
}
|
|
@@ -44175,7 +44189,7 @@ function requireLib$1() {
|
|
|
44175
44189
|
}
|
|
44176
44190
|
case "global":
|
|
44177
44191
|
if (this.match(5)) {
|
|
44178
|
-
this.scope.enter(
|
|
44192
|
+
this.scope.enter(512), this.prodParam.enter(0);
|
|
44179
44193
|
const mod = node;
|
|
44180
44194
|
return mod.kind = "global", node.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
|
|
44181
44195
|
}
|
|
@@ -44417,7 +44431,7 @@ function requireLib$1() {
|
|
|
44417
44431
|
id,
|
|
44418
44432
|
init
|
|
44419
44433
|
} of declaration.declarations)
|
|
44420
|
-
init && (kind
|
|
44434
|
+
init && (kind === "var" || kind === "let" || id.typeAnnotation ? this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init) : isValidAmbientConstInitializer(init, this.hasPlugin("estree")) || this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init));
|
|
44421
44435
|
return declaration;
|
|
44422
44436
|
}
|
|
44423
44437
|
parseStatementContent(flags, decorators) {
|
|
@@ -44802,7 +44816,7 @@ function requireLib$1() {
|
|
|
44802
44816
|
return node.abstract = !0, this.maybeTakeDecorators(decorators, this.parseClass(node, !0, !1));
|
|
44803
44817
|
if (this.isContextual(129)) {
|
|
44804
44818
|
if (!this.hasFollowingLineBreak())
|
|
44805
|
-
return node.abstract = !0, this.raise(TSErrors.
|
|
44819
|
+
return node.abstract = !0, this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node), this.tsParseInterfaceDeclaration(node);
|
|
44806
44820
|
} else
|
|
44807
44821
|
this.unexpected(null, 80);
|
|
44808
44822
|
}
|
|
@@ -45196,9 +45210,14 @@ function requireLib$1() {
|
|
|
45196
45210
|
return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
|
|
45197
45211
|
}
|
|
45198
45212
|
getExpression() {
|
|
45199
|
-
this.enterInitialScopes(), this.nextToken()
|
|
45213
|
+
if (this.enterInitialScopes(), this.nextToken(), this.match(140))
|
|
45214
|
+
throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc);
|
|
45200
45215
|
const expr = this.parseExpression();
|
|
45201
|
-
|
|
45216
|
+
if (!this.match(140))
|
|
45217
|
+
throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, {
|
|
45218
|
+
unexpected: this.input.codePointAt(this.state.start)
|
|
45219
|
+
});
|
|
45220
|
+
return this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.optionFlags & 256 && (expr.tokens = this.tokens), expr;
|
|
45202
45221
|
}
|
|
45203
45222
|
parseExpression(disallowIn, refExpressionErrors) {
|
|
45204
45223
|
return disallowIn ? this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)) : this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
|
@@ -45498,7 +45517,7 @@ function requireLib$1() {
|
|
|
45498
45517
|
case 79:
|
|
45499
45518
|
return this.parseSuper();
|
|
45500
45519
|
case 83:
|
|
45501
|
-
return node = this.startNode(), this.next(), this.match(16) ? this.
|
|
45520
|
+
return node = this.startNode(), this.next(), this.match(16) ? this.parseImportMetaPropertyOrPhaseCall(node) : this.match(10) ? this.optionFlags & 512 ? this.parseImportCall(node) : this.finishNode(node, "Import") : (this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc), this.finishNode(node, "Import"));
|
|
45502
45521
|
case 78:
|
|
45503
45522
|
return node = this.startNode(), this.next(), this.finishNode(node, "ThisExpression");
|
|
45504
45523
|
case 90:
|
|
@@ -45661,19 +45680,14 @@ function requireLib$1() {
|
|
|
45661
45680
|
onlyValidPropertyName: propertyName
|
|
45662
45681
|
}), this.finishNode(node, "MetaProperty");
|
|
45663
45682
|
}
|
|
45664
|
-
|
|
45665
|
-
|
|
45666
|
-
if (this.next(), this.isContextual(101))
|
|
45667
|
-
this.inModule || this.raise(Errors.ImportMetaOutsideModule, id), this.sawUnambiguousESM = !0;
|
|
45668
|
-
else if (this.isContextual(105) || this.isContextual(97)) {
|
|
45683
|
+
parseImportMetaPropertyOrPhaseCall(node) {
|
|
45684
|
+
if (this.next(), this.isContextual(105) || this.isContextual(97)) {
|
|
45669
45685
|
const isSource = this.isContextual(105);
|
|
45670
|
-
|
|
45671
|
-
|
|
45672
|
-
|
|
45673
|
-
|
|
45674
|
-
return this.next(), node.phase = isSource ? "source" : "defer", this.parseImportCall(node);
|
|
45686
|
+
return this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"), this.next(), node.phase = isSource ? "source" : "defer", this.parseImportCall(node);
|
|
45687
|
+
} else {
|
|
45688
|
+
const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc);
|
|
45689
|
+
return this.isContextual(101) && (this.inModule || this.raise(Errors.ImportMetaOutsideModule, id), this.sawUnambiguousESM = !0), this.parseMetaProperty(node, id, "meta");
|
|
45675
45690
|
}
|
|
45676
|
-
return this.parseMetaProperty(node, id, "meta");
|
|
45677
45691
|
}
|
|
45678
45692
|
parseLiteralAtNode(value, type2, node) {
|
|
45679
45693
|
return this.addExtra(node, "rawValue", value), this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)), node.value = value, this.next(), this.finishNode(node, type2);
|
|
@@ -46021,6 +46035,9 @@ function requireLib$1() {
|
|
|
46021
46035
|
createIdentifier(node, name) {
|
|
46022
46036
|
return node.name = name, node.loc.identifierName = name, this.finishNode(node, "Identifier");
|
|
46023
46037
|
}
|
|
46038
|
+
createIdentifierAt(node, name, endLoc) {
|
|
46039
|
+
return node.name = name, node.loc.identifierName = name, this.finishNodeAt(node, "Identifier", endLoc);
|
|
46040
|
+
}
|
|
46024
46041
|
parseIdentifierName(liberal) {
|
|
46025
46042
|
let name;
|
|
46026
46043
|
const {
|
|
@@ -46101,11 +46118,15 @@ function requireLib$1() {
|
|
|
46101
46118
|
return node.delegate = delegating, node.argument = argument, this.finishNode(node, "YieldExpression");
|
|
46102
46119
|
}
|
|
46103
46120
|
parseImportCall(node) {
|
|
46104
|
-
if (this.next(), node.source = this.parseMaybeAssignAllowIn(), node.options = null, this.eat(12)
|
|
46105
|
-
|
|
46106
|
-
this.
|
|
46107
|
-
|
|
46108
|
-
|
|
46121
|
+
if (this.next(), node.source = this.parseMaybeAssignAllowIn(), node.options = null, this.eat(12)) {
|
|
46122
|
+
if (this.match(11))
|
|
46123
|
+
this.addTrailingCommaExtraToNode(node.source);
|
|
46124
|
+
else if (node.options = this.parseMaybeAssignAllowIn(), this.eat(12) && (this.addTrailingCommaExtraToNode(node.options), !this.match(11))) {
|
|
46125
|
+
do
|
|
46126
|
+
this.parseMaybeAssignAllowIn();
|
|
46127
|
+
while (this.eat(12) && !this.match(11));
|
|
46128
|
+
this.raise(Errors.ImportCallArity, node);
|
|
46129
|
+
}
|
|
46109
46130
|
}
|
|
46110
46131
|
return this.expect(11), this.finishNode(node, "ImportExpression");
|
|
46111
46132
|
}
|
|
@@ -46354,6 +46375,24 @@ function requireLib$1() {
|
|
|
46354
46375
|
isLet() {
|
|
46355
46376
|
return this.isContextual(100) ? this.hasFollowingBindingAtom() : !1;
|
|
46356
46377
|
}
|
|
46378
|
+
isUsing() {
|
|
46379
|
+
if (!this.isContextual(107))
|
|
46380
|
+
return !1;
|
|
46381
|
+
const next = this.nextTokenInLineStart(), nextCh = this.codePointAtPos(next);
|
|
46382
|
+
return this.chStartsBindingIdentifier(nextCh, next);
|
|
46383
|
+
}
|
|
46384
|
+
isAwaitUsing() {
|
|
46385
|
+
if (!this.isContextual(96))
|
|
46386
|
+
return !1;
|
|
46387
|
+
let next = this.nextTokenInLineStart();
|
|
46388
|
+
if (this.isUnparsedContextual(next, "using")) {
|
|
46389
|
+
next = this.nextTokenInLineStartSince(next + 5);
|
|
46390
|
+
const nextCh = this.codePointAtPos(next);
|
|
46391
|
+
if (this.chStartsBindingIdentifier(nextCh, next))
|
|
46392
|
+
return this.expectPlugin("explicitResourceManagement"), !0;
|
|
46393
|
+
}
|
|
46394
|
+
return !1;
|
|
46395
|
+
}
|
|
46357
46396
|
chStartsBindingIdentifier(ch, pos2) {
|
|
46358
46397
|
if (isIdentifierStart(ch)) {
|
|
46359
46398
|
if (keywordRelationalOperator.lastIndex = pos2, keywordRelationalOperator.test(this.input)) {
|
|
@@ -46388,15 +46427,8 @@ function requireLib$1() {
|
|
|
46388
46427
|
}
|
|
46389
46428
|
return tokenIsIdentifier(type2) && !this.hasFollowingLineBreak() ? (this.expectPlugin("explicitResourceManagement"), !0) : !1;
|
|
46390
46429
|
}
|
|
46391
|
-
|
|
46392
|
-
|
|
46393
|
-
if (this.isUnparsedContextual(next, "using")) {
|
|
46394
|
-
next = this.nextTokenInLineStartSince(next + 5);
|
|
46395
|
-
const nextCh = this.codePointAtPos(next);
|
|
46396
|
-
if (this.chStartsBindingIdentifier(nextCh, next))
|
|
46397
|
-
return this.expectPlugin("explicitResourceManagement"), !0;
|
|
46398
|
-
}
|
|
46399
|
-
return !1;
|
|
46430
|
+
allowsUsing() {
|
|
46431
|
+
return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement;
|
|
46400
46432
|
}
|
|
46401
46433
|
parseModuleItem() {
|
|
46402
46434
|
return this.parseStatementLike(15);
|
|
@@ -46444,13 +46476,13 @@ function requireLib$1() {
|
|
|
46444
46476
|
case 73:
|
|
46445
46477
|
return this.parseTryStatement(node);
|
|
46446
46478
|
case 96:
|
|
46447
|
-
if (
|
|
46448
|
-
return this.
|
|
46479
|
+
if (this.isAwaitUsing())
|
|
46480
|
+
return this.allowsUsing() ? allowDeclaration ? this.recordAwaitIfAllowed() || this.raise(Errors.AwaitUsingNotInAsyncContext, node) : this.raise(Errors.UnexpectedLexicalDeclaration, node) : this.raise(Errors.UnexpectedUsingDeclaration, node), this.next(), this.parseVarStatement(node, "await using");
|
|
46449
46481
|
break;
|
|
46450
46482
|
case 107:
|
|
46451
46483
|
if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace())
|
|
46452
46484
|
break;
|
|
46453
|
-
return this.expectPlugin("explicitResourceManagement"),
|
|
46485
|
+
return this.expectPlugin("explicitResourceManagement"), this.allowsUsing() ? allowDeclaration || this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc) : this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc), this.parseVarStatement(node, "using");
|
|
46454
46486
|
case 100: {
|
|
46455
46487
|
if (this.state.containsEsc)
|
|
46456
46488
|
break;
|
|
@@ -46580,7 +46612,7 @@ function requireLib$1() {
|
|
|
46580
46612
|
return awaitAt !== null && this.unexpected(awaitAt), this.parseFor(node, null);
|
|
46581
46613
|
const startsWithLet = this.isContextual(100);
|
|
46582
46614
|
{
|
|
46583
|
-
const startsWithAwaitUsing = this.
|
|
46615
|
+
const startsWithAwaitUsing = this.isAwaitUsing(), starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.allowsForUsing(), isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
|
|
46584
46616
|
if (this.match(74) || this.match(75) || isLetOrUsing) {
|
|
46585
46617
|
const initNode = this.startNode();
|
|
46586
46618
|
let kind;
|
|
@@ -46612,7 +46644,7 @@ function requireLib$1() {
|
|
|
46612
46644
|
parseSwitchStatement(node) {
|
|
46613
46645
|
this.next(), node.discriminant = this.parseHeaderExpression();
|
|
46614
46646
|
const cases = node.cases = [];
|
|
46615
|
-
this.expect(5), this.state.labels.push(switchLabel), this.scope.enter(
|
|
46647
|
+
this.expect(5), this.state.labels.push(switchLabel), this.scope.enter(256);
|
|
46616
46648
|
let cur;
|
|
46617
46649
|
for (let sawDefault; !this.match(8); )
|
|
46618
46650
|
if (this.match(61) || this.match(65)) {
|
|
@@ -46822,7 +46854,7 @@ function requireLib$1() {
|
|
|
46822
46854
|
if (member.static = isStatic, this.parsePropertyNamePrefixOperator(member), this.eat(55)) {
|
|
46823
46855
|
method.kind = "method";
|
|
46824
46856
|
const isPrivateName = this.match(139);
|
|
46825
|
-
if (this.parseClassElementName(method), isPrivateName) {
|
|
46857
|
+
if (this.parseClassElementName(method), this.parsePostMemberNameModifiers(method), isPrivateName) {
|
|
46826
46858
|
this.pushClassPrivateMethod(classBody, privateMethod, !0, !1);
|
|
46827
46859
|
return;
|
|
46828
46860
|
}
|
|
@@ -47007,7 +47039,7 @@ function requireLib$1() {
|
|
|
47007
47039
|
return this.parseClass(expr, !0, !0);
|
|
47008
47040
|
if (this.match(26))
|
|
47009
47041
|
return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === !0 && this.raise(Errors.DecoratorBeforeExport, this.state.startLoc), this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1), this.startNode()), !0, !0);
|
|
47010
|
-
if (this.match(75) || this.match(74) || this.isLet())
|
|
47042
|
+
if (this.match(75) || this.match(74) || this.isLet() || this.hasPlugin("explicitResourceManagement") && (this.isUsing() || this.isAwaitUsing()))
|
|
47011
47043
|
throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
|
|
47012
47044
|
const res = this.parseMaybeAssignAllowIn();
|
|
47013
47045
|
return this.semicolon(), res;
|
|
@@ -47047,7 +47079,15 @@ function requireLib$1() {
|
|
|
47047
47079
|
const {
|
|
47048
47080
|
type: type2
|
|
47049
47081
|
} = this.state;
|
|
47050
|
-
|
|
47082
|
+
if (type2 === 26 && (this.expectOnePlugin(["decorators", "decorators-legacy"]), this.hasPlugin("decorators")))
|
|
47083
|
+
return this.getPluginOption("decorators", "decoratorsBeforeExport") === !0 && this.raise(Errors.DecoratorBeforeExport, this.state.startLoc), !0;
|
|
47084
|
+
if (this.hasPlugin("explicitResourceManagement")) {
|
|
47085
|
+
if (this.isUsing())
|
|
47086
|
+
return this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0;
|
|
47087
|
+
if (this.isAwaitUsing())
|
|
47088
|
+
return this.raise(Errors.UsingDeclarationExport, this.state.startLoc), !0;
|
|
47089
|
+
}
|
|
47090
|
+
return type2 === 74 || type2 === 75 || type2 === 68 || type2 === 80 || this.isLet() || this.isAsyncFunction();
|
|
47051
47091
|
}
|
|
47052
47092
|
checkExport(node, checkNames, isDefault, isFrom) {
|
|
47053
47093
|
if (checkNames) {
|
|
@@ -47170,10 +47210,10 @@ function requireLib$1() {
|
|
|
47170
47210
|
parseMaybeImportPhase(node, isExport) {
|
|
47171
47211
|
if (!this.isPotentialImportPhase(isExport))
|
|
47172
47212
|
return this.applyImportPhase(node, isExport, null), null;
|
|
47173
|
-
const phaseIdentifier = this.
|
|
47213
|
+
const phaseIdentifier = this.startNode(), phaseIdentifierName = this.parseIdentifierName(!0), {
|
|
47174
47214
|
type: type2
|
|
47175
47215
|
} = this.state;
|
|
47176
|
-
return (tokenIsKeywordOrIdentifier(type2) ? type2 !== 98 || this.lookaheadCharCode() === 102 : type2 !== 12) ? (this.
|
|
47216
|
+
return (tokenIsKeywordOrIdentifier(type2) ? type2 !== 98 || this.lookaheadCharCode() === 102 : type2 !== 12) ? (this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start), null) : (this.applyImportPhase(node, isExport, null), this.createIdentifier(phaseIdentifier, phaseIdentifierName));
|
|
47177
47217
|
}
|
|
47178
47218
|
isPrecedingIdImportPhase(phase) {
|
|
47179
47219
|
const {
|
|
@@ -47884,8 +47924,8 @@ async function bootstrapLocalTemplate(opts, context) {
|
|
|
47884
47924
|
const dependencyVersions = await resolveLatestVersions({
|
|
47885
47925
|
...isAppTemplate ? {} : studioDependencies.dependencies,
|
|
47886
47926
|
...isAppTemplate ? {} : studioDependencies.devDependencies,
|
|
47887
|
-
...template.dependencies
|
|
47888
|
-
...template.devDependencies
|
|
47927
|
+
...template.dependencies,
|
|
47928
|
+
...template.devDependencies
|
|
47889
47929
|
});
|
|
47890
47930
|
spinner.succeed();
|
|
47891
47931
|
const dependencies = Object.keys({
|