@marko/compiler 5.39.13 → 5.39.14

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,6 +1,6 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
2
  var babelTypes = _interopRequireWildcard(require("@babel/types"));
3
- var _utils = _interopRequireDefault(require("@babel/types/lib/definitions/utils"));
3
+ var definitionUtils = _interopRequireWildcard(require("@babel/types/lib/definitions/utils"));
4
4
  var generatedValidators = _interopRequireWildcard(require("@babel/types/lib/validators/generated"));
5
5
  var referencedValidators = _interopRequireWildcard(require("@babel/types/lib/validators/isReferenced"));
6
6
  var _validate = _interopRequireDefault(require("@babel/types/lib/validators/validate"));
@@ -21,7 +21,7 @@ getBindingIdentifiers.keys.MarkoTag = ["var"];
21
21
  getBindingIdentifiers.keys.MarkoTagBody = ["params"];
22
22
 
23
23
  _definitions.MARKO_TYPES.forEach((typeName) => {
24
- (0, _utils.default)(typeName, _definitions.default[typeName]);
24
+ definitionUtils.default(typeName, _definitions.default[typeName]);
25
25
  });
26
26
 
27
27
  babelTypes.NODE_FIELDS.Program.params =
@@ -65,6 +65,17 @@ referencedValidators.default = (node, parent, grandparent) => {
65
65
  }
66
66
  };
67
67
 
68
+ for (const { types, set } of definitionUtils.allExpandedTypes || []) {
69
+ for (const type of types) {
70
+ const aliases = FLIPPED_ALIAS_KEYS[type];
71
+ if (aliases) {
72
+ aliases.forEach(set.add, set);
73
+ } else {
74
+ set.add(type);
75
+ }
76
+ }
77
+ }
78
+
68
79
  function assert(typeName, node, opts) {
69
80
  if (!is(typeName, node, opts)) {
70
81
  throw new Error(
@@ -746,6 +746,7 @@ export class NodePath<T = Node> {
746
746
  getAllNextSiblings(): NodePath[];
747
747
 
748
748
  get<K extends keyof T>(key: K, context?: boolean | TraversalContext): NodePathResult<T[K]>;
749
+ get<P extends string>(path: P, context?: boolean | TraversalContext): NodePathResult<ImplGetRecursive<T, P>>;
749
750
 
750
751
 
751
752
  getBindingIdentifiers(duplicates: true): Record<string, t.Identifier[]>;
@@ -1488,6 +1489,27 @@ export interface TraversalContext<S = unknown> {
1488
1489
  opts: TraverseOptions;
1489
1490
  }
1490
1491
 
1492
+ // Based on `GetFieldType`s from `@types/lodash/common/object.d.ts`:
1493
+ // dprint-ignore
1494
+ type ImplGetOfArray<T extends readonly unknown[], K extends string> =
1495
+ K extends `${infer N extends number}` ? T[N]
1496
+ : K extends keyof T ? T[K]
1497
+ : never;
1498
+
1499
+ // dprint-ignore
1500
+ type ImplGetByKey<T, K extends string>
1501
+ = T extends readonly unknown[] ? ImplGetOfArray<T, K>
1502
+ : K extends keyof T ? T[K]
1503
+ : K extends `${infer N extends number}`
1504
+ ? N extends keyof T ? T[N] : never
1505
+ : never;
1506
+
1507
+ // dprint-ignore
1508
+ type ImplGetRecursive<T, K extends string>
1509
+ = K extends `${infer L}.${infer R}`
1510
+ ? ImplGetRecursive<ImplGetByKey<T, L>, R>
1511
+ : ImplGetByKey<T, K>;
1512
+
1491
1513
  export type NodePathResult<T> =
1492
1514
  | (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>)
1493
1515
  | (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
package/dist/types.d.ts CHANGED
@@ -46,7 +46,7 @@ interface BaseNode {
46
46
  extra?: NodeExtra;
47
47
  }
48
48
 
49
- export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
49
+ export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
50
50
 
51
51
  export interface ArrayExpression extends BaseNode {
52
52
  type: "ArrayExpression";
@@ -665,6 +665,7 @@ export interface ClassPrivateProperty extends BaseNode {
665
665
  decorators: Array<Decorator> | null;
666
666
  static: boolean;
667
667
  definite: boolean | null;
668
+ optional: boolean | null;
668
669
  readonly: boolean | null;
669
670
  typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
670
671
  variance: Variance | null;
@@ -700,6 +701,12 @@ export interface StaticBlock extends BaseNode {
700
701
  body: Array<Statement>;
701
702
  }
702
703
 
704
+ export interface ImportAttribute extends BaseNode {
705
+ type: "ImportAttribute";
706
+ key: Identifier | StringLiteral;
707
+ value: StringLiteral;
708
+ }
709
+
703
710
  export interface AnyTypeAnnotation extends BaseNode {
704
711
  type: "AnyTypeAnnotation";
705
712
  }
@@ -1150,7 +1157,8 @@ export interface JSXOpeningElement extends BaseNode {
1150
1157
  name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
1151
1158
  attributes: Array<JSXAttribute | JSXSpreadAttribute>;
1152
1159
  selfClosing: boolean;
1153
- typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null;
1160
+ typeArguments: TypeParameterInstantiation | null;
1161
+ typeParameters: TSTypeParameterInstantiation | null;
1154
1162
  }
1155
1163
 
1156
1164
  export interface JSXSpreadAttribute extends BaseNode {
@@ -1206,12 +1214,6 @@ export interface BindExpression extends BaseNode {
1206
1214
  callee: Expression;
1207
1215
  }
1208
1216
 
1209
- export interface ImportAttribute extends BaseNode {
1210
- type: "ImportAttribute";
1211
- key: Identifier | StringLiteral;
1212
- value: StringLiteral;
1213
- }
1214
-
1215
1217
  export interface Decorator extends BaseNode {
1216
1218
  type: "Decorator";
1217
1219
  expression: Expression;
@@ -1330,7 +1332,7 @@ export interface TSPropertySignature extends BaseNode {
1330
1332
  key: Expression;
1331
1333
  typeAnnotation: TSTypeAnnotation | null;
1332
1334
  computed: boolean;
1333
- kind: "get" | "set";
1335
+ kind: "get" | "set" | null;
1334
1336
  optional: boolean | null;
1335
1337
  readonly: boolean | null;
1336
1338
  }
@@ -1525,6 +1527,12 @@ export interface TSMappedType extends BaseNode {
1525
1527
  readonly: true | false | "+" | "-" | null;
1526
1528
  }
1527
1529
 
1530
+ export interface TSTemplateLiteralType extends BaseNode {
1531
+ type: "TSTemplateLiteralType";
1532
+ quasis: Array<TemplateElement>;
1533
+ types: Array<TSType>;
1534
+ }
1535
+
1528
1536
  export interface TSLiteralType extends BaseNode {
1529
1537
  type: "TSLiteralType";
1530
1538
  literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression;
@@ -1582,10 +1590,16 @@ export interface TSTypeAssertion extends BaseNode {
1582
1590
  expression: Expression;
1583
1591
  }
1584
1592
 
1593
+ export interface TSEnumBody extends BaseNode {
1594
+ type: "TSEnumBody";
1595
+ members: Array<TSEnumMember>;
1596
+ }
1597
+
1585
1598
  export interface TSEnumDeclaration extends BaseNode {
1586
1599
  type: "TSEnumDeclaration";
1587
1600
  id: Identifier;
1588
1601
  members: Array<TSEnumMember>;
1602
+ body: TSEnumBody | null;
1589
1603
  const: boolean | null;
1590
1604
  declare: boolean | null;
1591
1605
  initializer: Expression | null;
@@ -1777,7 +1791,7 @@ export type RestProperty = RestElement;
1777
1791
  */
1778
1792
  export type SpreadProperty = SpreadElement;
1779
1793
 
1780
- export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ImportExpression | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
1794
+ export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ImportExpression | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock | ImportAttribute;
1781
1795
  export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | ImportExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | MarkoParseError;
1782
1796
  export type Binary = BinaryExpression | LogicalExpression;
1783
1797
  export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
@@ -1795,7 +1809,7 @@ export type ForXStatement = ForInStatement | ForOfStatement;
1795
1809
  export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;
1796
1810
  export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
1797
1811
  export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral;
1798
- export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration;
1812
+ export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration;
1799
1813
  export type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression;
1800
1814
  export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression;
1801
1815
  export type TSEntityName = Identifier | TSQualifiedName;
@@ -1822,10 +1836,10 @@ export type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumS
1822
1836
  export type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember;
1823
1837
  export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment;
1824
1838
  export type Miscellaneous = Noop | Placeholder | V8IntrinsicIdentifier;
1825
- export type TypeScript = TSParameterProperty | TSDeclareFunction | TSDeclareMethod | TSQualifiedName | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature | TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSNamedTupleMember | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSInterfaceDeclaration | TSInterfaceBody | TSTypeAliasDeclaration | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSEnumDeclaration | TSEnumMember | TSModuleDeclaration | TSModuleBlock | TSImportType | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | TSExportAssignment | TSNamespaceExportDeclaration | TSTypeAnnotation | TSTypeParameterInstantiation | TSTypeParameterDeclaration | TSTypeParameter;
1839
+ export type TypeScript = TSParameterProperty | TSDeclareFunction | TSDeclareMethod | TSQualifiedName | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature | TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSNamedTupleMember | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSTemplateLiteralType | TSLiteralType | TSExpressionWithTypeArguments | TSInterfaceDeclaration | TSInterfaceBody | TSTypeAliasDeclaration | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSModuleDeclaration | TSModuleBlock | TSImportType | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | TSExportAssignment | TSNamespaceExportDeclaration | TSTypeAnnotation | TSTypeParameterInstantiation | TSTypeParameterDeclaration | TSTypeParameter;
1826
1840
  export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;
1827
- export type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType;
1828
- export type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType;
1841
+ export type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSTemplateLiteralType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType;
1842
+ export type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSTemplateLiteralType | TSLiteralType;
1829
1843
  export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration;
1830
1844
  export type Marko = MarkoParseError | MarkoDocumentType | MarkoDeclaration | MarkoCDATA | MarkoComment | MarkoText | MarkoPlaceholder | MarkoScriptlet | MarkoClass | MarkoAttribute | MarkoSpreadAttribute | MarkoTagBody | MarkoTag;
1831
1845
  export type Scope = MarkoTagBody;
@@ -1975,6 +1989,7 @@ export function classPrivateProperty(key: PrivateName, value?: Expression | null
1975
1989
  export function classPrivateMethod(kind: "get" | "set" | "method" | undefined, key: PrivateName, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, _static?: boolean): ClassPrivateMethod;
1976
1990
  export function privateName(id: Identifier): PrivateName;
1977
1991
  export function staticBlock(body: Array<Statement>): StaticBlock;
1992
+ export function importAttribute(key: Identifier | StringLiteral, value: StringLiteral): ImportAttribute;
1978
1993
  export function anyTypeAnnotation(): AnyTypeAnnotation;
1979
1994
  export function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation;
1980
1995
  export function booleanTypeAnnotation(): BooleanTypeAnnotation;
@@ -2060,7 +2075,6 @@ export function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expr
2060
2075
  export function v8IntrinsicIdentifier(name: string): V8IntrinsicIdentifier;
2061
2076
  export function argumentPlaceholder(): ArgumentPlaceholder;
2062
2077
  export function bindExpression(object: Expression, callee: Expression): BindExpression;
2063
- export function importAttribute(key: Identifier | StringLiteral, value: StringLiteral): ImportAttribute;
2064
2078
  export function decorator(expression: Expression): Decorator;
2065
2079
  export function doExpression(body: BlockStatement, async?: boolean): DoExpression;
2066
2080
  export function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpecifier;
@@ -2114,6 +2128,7 @@ export function tsParenthesizedType(typeAnnotation: TSType): TSParenthesizedType
2114
2128
  export function tsTypeOperator(typeAnnotation: TSType): TSTypeOperator;
2115
2129
  export function tsIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType;
2116
2130
  export function tsMappedType(typeParameter: TSTypeParameter, typeAnnotation?: TSType | null, nameType?: TSType | null): TSMappedType;
2131
+ export function tsTemplateLiteralType(quasis: Array<TemplateElement>, types: Array<TSType>): TSTemplateLiteralType;
2117
2132
  export function tsLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression): TSLiteralType;
2118
2133
  export function tsExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSExpressionWithTypeArguments;
2119
2134
  export function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: Array<TSExpressionWithTypeArguments> | null | undefined, body: TSInterfaceBody): TSInterfaceDeclaration;
@@ -2123,6 +2138,7 @@ export function tsInstantiationExpression(expression: Expression, typeParameters
2123
2138
  export function tsAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression;
2124
2139
  export function tsSatisfiesExpression(expression: Expression, typeAnnotation: TSType): TSSatisfiesExpression;
2125
2140
  export function tsTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion;
2141
+ export function tsEnumBody(members: Array<TSEnumMember>): TSEnumBody;
2126
2142
  export function tsEnumDeclaration(id: Identifier, members: Array<TSEnumMember>): TSEnumDeclaration;
2127
2143
  export function tsEnumMember(id: Identifier | StringLiteral, initializer?: Expression | null): TSEnumMember;
2128
2144
  export function tsModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration): TSModuleDeclaration;
@@ -2618,6 +2634,8 @@ export function isTSDeclareMethod(node: object | null | undefined, opts?: object
2618
2634
  export function assertTSDeclareMethod(node: object | null | undefined, opts?: object | null): void;
2619
2635
  export function isTSEntityName(node: object | null | undefined, opts?: object | null): node is TSEntityName;
2620
2636
  export function assertTSEntityName(node: object | null | undefined, opts?: object | null): void;
2637
+ export function isTSEnumBody(node: object | null | undefined, opts?: object | null): node is TSEnumBody;
2638
+ export function assertTSEnumBody(node: object | null | undefined, opts?: object | null): void;
2621
2639
  export function isTSEnumDeclaration(node: object | null | undefined, opts?: object | null): node is TSEnumDeclaration;
2622
2640
  export function assertTSEnumDeclaration(node: object | null | undefined, opts?: object | null): void;
2623
2641
  export function isTSEnumMember(node: object | null | undefined, opts?: object | null): node is TSEnumMember;
@@ -2692,6 +2710,8 @@ export function isTSStringKeyword(node: object | null | undefined, opts?: object
2692
2710
  export function assertTSStringKeyword(node: object | null | undefined, opts?: object | null): void;
2693
2711
  export function isTSSymbolKeyword(node: object | null | undefined, opts?: object | null): node is TSSymbolKeyword;
2694
2712
  export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object | null): void;
2713
+ export function isTSTemplateLiteralType(node: object | null | undefined, opts?: object | null): node is TSTemplateLiteralType;
2714
+ export function assertTSTemplateLiteralType(node: object | null | undefined, opts?: object | null): void;
2695
2715
  export function isTSThisType(node: object | null | undefined, opts?: object | null): node is TSThisType;
2696
2716
  export function assertTSThisType(node: object | null | undefined, opts?: object | null): void;
2697
2717
  export function isTSTupleType(node: object | null | undefined, opts?: object | null): node is TSTupleType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.39.13",
3
+ "version": "5.39.14",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -63,19 +63,19 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@babel/code-frame": "^7.26.2",
66
- "@babel/core": "^7.26.0",
67
- "@babel/generator": "^7.26.3",
68
- "@babel/parser": "^7.26.3",
66
+ "@babel/core": "^7.26.10",
67
+ "@babel/generator": "^7.27.0",
68
+ "@babel/parser": "^7.27.0",
69
69
  "@babel/plugin-syntax-typescript": "^7.25.9",
70
70
  "@babel/plugin-transform-modules-commonjs": "^7.26.3",
71
- "@babel/plugin-transform-typescript": "^7.26.3",
72
- "@babel/runtime": "^7.26.0",
73
- "@babel/traverse": "^7.26.4",
74
- "@babel/types": "^7.26.3",
75
- "@luxass/strip-json-comments": "^1.3.2",
71
+ "@babel/plugin-transform-typescript": "^7.27.0",
72
+ "@babel/runtime": "^7.27.0",
73
+ "@babel/traverse": "^7.27.0",
74
+ "@babel/types": "^7.27.0",
75
+ "@luxass/strip-json-comments": "^1.4.0",
76
76
  "complain": "^1.6.1",
77
77
  "he": "^1.2.0",
78
- "htmljs-parser": "^5.5.3",
78
+ "htmljs-parser": "^5.5.4",
79
79
  "jsesc": "^3.1.0",
80
80
  "kleur": "^4.1.5",
81
81
  "lasso-package-root": "^1.0.1",
@@ -87,7 +87,7 @@
87
87
  "source-map-support": "^0.5.21"
88
88
  },
89
89
  "devDependencies": {
90
- "marko": "^5.37.20"
90
+ "marko": "^5.37.24"
91
91
  },
92
92
  "engines": {
93
93
  "node": "18 || 20 || >=22"