@marko/compiler 5.16.1 → 5.17.10

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,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.getMarkoFile = getMarkoFile;exports.default = void 0;var _path = _interopRequireDefault(require("path"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.default = void 0;exports.getMarkoFile = getMarkoFile;var _path = _interopRequireDefault(require("path"));
2
2
  var _crypto = require("crypto");
3
3
  var t = _interopRequireWildcard(require("../babel-types"));
4
4
  var _babelUtils = require("@marko/babel-utils");
@@ -37,6 +37,7 @@ _traverse.Scope.prototype.crawl = function () {
37
37
  const path = this.path;
38
38
  const originalTraverse = path.traverse;
39
39
  path.traverse = function (visitor, state) {
40
+ state.hoistableTagVarsByScope = new Map();
40
41
  path.traverse = originalTraverse;
41
42
 
42
43
  if (!patchedVisitors.has(visitor)) {
@@ -49,7 +50,7 @@ _traverse.Scope.prototype.crawl = function () {
49
50
  body.scope.registerBinding("param", param);
50
51
  }
51
52
  },
52
- MarkoTag(tag) {
53
+ MarkoTag(tag, state) {
53
54
  const tagVar = tag.get("var");
54
55
  if (tagVar.node) {
55
56
  tag.scope.registerBinding("local", tagVar, tag);
@@ -58,17 +59,17 @@ _traverse.Scope.prototype.crawl = function () {
58
59
  const binding = curScope.getBinding(name);
59
60
 
60
61
  while (curScope = curScope.parent) {
61
- curScope.hoistableTagVars =
62
- curScope.hoistableTagVars || (
63
- curScope.hoistableTagVars = {});
64
- const existingBinding = curScope.hoistableTagVars[name];
65
-
66
- if (existingBinding) {
67
- if (existingBinding !== binding) {
68
- curScope.hoistableTagVars[name] = true;
69
- }
62
+ const hoistableTagVars =
63
+ state.hoistableTagVarsByScope.get(curScope);
64
+
65
+ if (hoistableTagVars) {
66
+ hoistableTagVars[name] = hoistableTagVars[name] ?
67
+ true :
68
+ binding;
70
69
  } else {
71
- curScope.hoistableTagVars[name] = binding;
70
+ state.hoistableTagVarsByScope.set(curScope, {
71
+ [name]: binding });
72
+
72
73
  }
73
74
  }
74
75
  }
@@ -87,9 +88,10 @@ _traverse.Scope.prototype.crawl = function () {
87
88
  let curScope = ref.scope;
88
89
  if (curScope.hasBinding(name)) continue;
89
90
 
90
- do {
91
- const hoistableBinding =
92
- curScope.hoistableTagVars && curScope.hoistableTagVars[name];
91
+ do {var _state$hoistableTagVa;
92
+ const hoistableBinding = (_state$hoistableTagVa =
93
+ state.hoistableTagVarsByScope.get(curScope)) == null ? void 0 : _state$hoistableTagVa[name];
94
+
93
95
  if (hoistableBinding) {
94
96
  if (hoistableBinding === true) {
95
97
  throw ref.buildCodeFrameError(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/babel-types/traverse/patch.js"],"names":["MARKO_TYPES","forEach","typeName","checkKey","assertKey","checkFn","t","assertFn","NodePath","prototype","opts","node","MARKO_ALIAS_TYPES","aliasName","originalProtoCheck","is","call","originalCrawl","Scope","crawl","patchedVisitors","WeakSet","path","originalTraverse","traverse","visitor","state","has","add","Object","assign","explode","MarkoTagBody","body","param","get","scope","registerBinding","MarkoTag","tag","tagVar","name","getBindingIdentifiers","curScope","binding","getBinding","parent","hoistableTagVars","existingBinding","references","length","movedBindings","Map","ref","hasBinding","hoistableBinding","buildCodeFrameError","movedBinding","getScopeDepth","set","moveBindingTo","identifier","depth","cur"],"mappings":"aAAA;;AAEA;AACA;AACA,mD;;AAEAA,yBAAYC,OAAZ,CAAoB,CAAAC,QAAQ,KAAI;AAC9B,QAAMC,QAAQ,GAAI,KAAID,QAAS,EAA/B;AACA,QAAME,SAAS,GAAI,SAAQF,QAAS,EAApC;AACA,QAAMG,OAAO,GAAGC,CAAC,CAACH,QAAD,CAAjB;AACA,QAAMI,QAAQ,GAAGD,CAAC,CAACF,SAAD,CAAlB;AACAI,qBAASC,SAAT,CAAmBN,QAAn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AqFA,SAASmC,aAAT,CAAuBtB,KAAvB,EAA8B;AAC5B,MAAI0B,KAAK,GAAG,CAAZ;AACA,MAAIC,GAAG,GAAG3B,KAAV;AACA,SAAQ2B,GAAG,GAAGA,GAAG,CAACjB,MAAlB,EAA2BgB,KAAK;AAChC,SAAOA,KAAP;AACD","sourcesContent":["import \"../types/patch\";\n\nimport * as t from \"@babel/types\";\nimport traverse, { NodePath, Scope } from \"@babel/traverse\";\nimport { MARKO_TYPES, MARKO_ALIAS_TYPES } from \"../types/definitions\";\n\nMARKO_TYPES.forEach(typeName => {\n const checkKey = `is${typeName}`;\n const assertKey = `assert${typeName}`;\n const checkFn = t[checkKey];\n const assertFn = t[assertKey];\n NodePath.prototype[checkKey] = function (opts) {\n return checkFn(this.node, opts);\n };\n NodePath.prototype[assertKey] = function (opts) {\n assertFn(this.node, opts);\n };\n});\n\nMARKO_ALIAS_TYPES.forEach(aliasName => {\n const checkKey = `is${aliasName}`;\n const originalProtoCheck = NodePath.prototype[checkKey];\n NodePath.prototype[checkKey] = function (opts) {\n return (\n t.is(aliasName, this.node, opts) ||\n originalProtoCheck.call(this, this.node, opts)\n );\n };\n});\n\n// Adds a one time patch to the scope collector visitors to include\n// Marko bindings for params and tag vars.\nconst originalCrawl = Scope.prototype.crawl;\nconst patchedVisitors = new WeakSet();\n\nScope.prototype.crawl = function () {\n const path = this.path;\n const originalTraverse = path.traverse;\n path.traverse = function (visitor, state) {\n path.traverse = originalTraverse;\n\n if (!patchedVisitors.has(visitor)) {\n patchedVisitors.add(visitor);\n Object.assign(\n traverse.explode(visitor),\n traverse.explode({\n MarkoTagBody(body) {\n for (const param of body.get(\"params\")) {\n body.scope.registerBinding(\"param\", param);\n }\n },\n MarkoTag(tag) {\n const tagVar = tag.get(\"var\");\n if (tagVar.node) {\n tag.scope.registerBinding(\"local\", tagVar, tag);\n for (const name in tagVar.getBindingIdentifiers()) {\n let curScope = tag.scope;\n const binding = curScope.getBinding(name);\n\n while ((curScope = curScope.parent)) {\n curScope.hoistableTagVars =\n curScope.hoistableTagVars ||\n (curScope.hoistableTagVars = {});\n const existingBinding = curScope.hoistableTagVars[name];\n\n if (existingBinding) {\n if (existingBinding !== binding) {\n curScope.hoistableTagVars[name] = true;\n }\n } else {\n curScope.hoistableTagVars[name] = binding;\n }\n }\n }\n }\n }\n })\n );\n }\n\n this.traverse(visitor, state);\n\n if (state.references.length) {\n const movedBindings = new Map();\n for (const ref of state.references) {\n const { name } = ref.node;\n let curScope = ref.scope;\n if (curScope.hasBinding(name)) continue;\n\n do {\n const hoistableBinding =\n curScope.hoistableTagVars && curScope.hoistableTagVars[name];\n if (hoistableBinding) {\n if (hoistableBinding === true) {\n throw ref.buildCodeFrameError(\n \"Ambiguous reference, variable was defined in multiple places and was not shadowed.\"\n );\n }\n\n const movedBinding = movedBindings.get(hoistableBinding);\n if (\n !movedBinding ||\n getScopeDepth(movedBinding) < getScopeDepth(curScope)\n ) {\n movedBindings.set(hoistableBinding, curScope);\n }\n }\n } while ((curScope = curScope.parent));\n }\n\n for (const [binding, scope] of movedBindings) {\n binding.scope.moveBindingTo(binding.identifier.name, scope);\n }\n }\n };\n\n originalCrawl.call(this);\n path.traverse = originalTraverse;\n};\n\nfunction getScopeDepth(scope) {\n let depth = 0;\n let cur = scope;\n while ((cur = cur.parent)) depth++;\n return depth;\n}\n"],"file":"patch.js"}
1
+ {"version":3,"sources":["../../../src/babel-types/traverse/patch.js"],"names":["MARKO_TYPES","forEach","typeName","checkKey","assertKey","checkFn","t","assertFn","NodePath","prototype","opts","node","MARKO_ALIAS_TYPES","aliasName","originalProtoCheck","is","call","originalCrawl","Scope","crawl","patchedVisitors","WeakSet","path","originalTraverse","traverse","visitor","state","hoistableTagVarsByScope","Map","has","add","Object","assign","explode","MarkoTagBody","body","param","get","scope","registerBinding","MarkoTag","tag","tagVar","name","getBindingIdentifiers","curScope","binding","getBinding","parent","hoistableTagVars","set","references","length","movedBindings","ref","hasBinding","hoistableBinding","buildCodeFrameError","mov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D;AACF;AACF,SAnBD,QAmBUA,QAAQ,GAAGA,QAAQ,CAACG,MAnB9B;AAoBD;;AAED,WAAK,MAAM,CAACF,OAAD,EAAUR,KAAV,CAAX,IAA+Be,aAA/B,EAA8C;AAC5CP,QAAAA,OAAO,CAACR,KAAR,CAAcsB,aAAd,CAA4Bd,OAAO,CAACe,UAAR,CAAmBlB,IAA/C,EAAqDL,KAArD;AACD;AACF;AACF,GA9ED;;AAgFArB,EAAAA,aAAa,CAACD,IAAd,CAAmB,IAAnB;AACAM,EAAAA,IAAI,CAACE,QAAL,GAAgBD,gBAAhB;AACD,CArFD;;AAuFA,SAASoC,aAAT,CAAuBrB,KAAvB,EAA8B;AAC5B,MAAIwB,KAAK,GAAG,CAAZ;AACA,MAAIC,GAAG,GAAGzB,KAAV;AACA,SAAQyB,GAAG,GAAGA,GAAG,CAACf,MAAlB,EAA2Bc,KAAK;AAChC,SAAOA,KAAP;AACD","sourcesContent":["import \"../types/patch\";\n\nimport * as t from \"@babel/types\";\nimport traverse, { NodePath, Scope } from \"@babel/traverse\";\nimport { MARKO_TYPES, MARKO_ALIAS_TYPES } from \"../types/definitions\";\n\nMARKO_TYPES.forEach(typeName => {\n const checkKey = `is${typeName}`;\n const assertKey = `assert${typeName}`;\n const checkFn = t[checkKey];\n const assertFn = t[assertKey];\n NodePath.prototype[checkKey] = function (opts) {\n return checkFn(this.node, opts);\n };\n NodePath.prototype[assertKey] = function (opts) {\n assertFn(this.node, opts);\n };\n});\n\nMARKO_ALIAS_TYPES.forEach(aliasName => {\n const checkKey = `is${aliasName}`;\n const originalProtoCheck = NodePath.prototype[checkKey];\n NodePath.prototype[checkKey] = function (opts) {\n return (\n t.is(aliasName, this.node, opts) ||\n originalProtoCheck.call(this, this.node, opts)\n );\n };\n});\n\n// Adds a one time patch to the scope collector visitors to include\n// Marko bindings for params and tag vars.\nconst originalCrawl = Scope.prototype.crawl;\nconst patchedVisitors = new WeakSet();\n\nScope.prototype.crawl = function () {\n const path = this.path;\n const originalTraverse = path.traverse;\n path.traverse = function (visitor, state) {\n state.hoistableTagVarsByScope = new Map();\n path.traverse = originalTraverse;\n\n if (!patchedVisitors.has(visitor)) {\n patchedVisitors.add(visitor);\n Object.assign(\n traverse.explode(visitor),\n traverse.explode({\n MarkoTagBody(body) {\n for (const param of body.get(\"params\")) {\n body.scope.registerBinding(\"param\", param);\n }\n },\n MarkoTag(tag, state) {\n const tagVar = tag.get(\"var\");\n if (tagVar.node) {\n tag.scope.registerBinding(\"local\", tagVar, tag);\n for (const name in tagVar.getBindingIdentifiers()) {\n let curScope = tag.scope;\n const binding = curScope.getBinding(name);\n\n while ((curScope = curScope.parent)) {\n const hoistableTagVars =\n state.hoistableTagVarsByScope.get(curScope);\n\n if (hoistableTagVars) {\n hoistableTagVars[name] = hoistableTagVars[name]\n ? true\n : binding;\n } else {\n state.hoistableTagVarsByScope.set(curScope, {\n [name]: binding\n });\n }\n }\n }\n }\n }\n })\n );\n }\n\n this.traverse(visitor, state);\n\n if (state.references.length) {\n const movedBindings = new Map();\n for (const ref of state.references) {\n const { name } = ref.node;\n let curScope = ref.scope;\n if (curScope.hasBinding(name)) continue;\n\n do {\n const hoistableBinding =\n state.hoistableTagVarsByScope.get(curScope)?.[name];\n\n if (hoistableBinding) {\n if (hoistableBinding === true) {\n throw ref.buildCodeFrameError(\n \"Ambiguous reference, variable was defined in multiple places and was not shadowed.\"\n );\n }\n\n const movedBinding = movedBindings.get(hoistableBinding);\n if (\n !movedBinding ||\n getScopeDepth(movedBinding) < getScopeDepth(curScope)\n ) {\n movedBindings.set(hoistableBinding, curScope);\n }\n }\n } while ((curScope = curScope.parent));\n }\n\n for (const [binding, scope] of movedBindings) {\n binding.scope.moveBindingTo(binding.identifier.name, scope);\n }\n }\n };\n\n originalCrawl.call(this);\n path.traverse = originalTraverse;\n};\n\nfunction getScopeDepth(scope) {\n let depth = 0;\n let cur = scope;\n while ((cur = cur.parent)) depth++;\n return depth;\n}\n"],"file":"patch.js"}
@@ -1,4 +1,4 @@
1
- "use strict";exports.__esModule = true;exports.MARKO_ALIAS_TYPES = exports.MARKO_TYPES = exports.default = void 0;var _utils = require("@babel/types/lib/definitions/utils");
1
+ "use strict";exports.__esModule = true;exports.default = exports.MARKO_TYPES = exports.MARKO_ALIAS_TYPES = void 0;var _utils = require("@babel/types/lib/definitions/utils");
2
2
 
3
3
 
4
4
 
@@ -36,8 +36,9 @@ _definitions.MARKO_TYPES.forEach((typeName) => {
36
36
  const assertKey = `assert${typeName}`;
37
37
  babelTypes[checkKey] = (node, opts) => is(typeName, node, opts);
38
38
  babelTypes[assertKey] = (node, opts) => assert(typeName, node, opts);
39
- babelTypes[typeName] = babelTypes[lowerName] = (...args) =>
40
- (0, _builder.default)(typeName, ...args);
39
+ babelTypes[typeName] = babelTypes[lowerName] = function () {
40
+ return _builder.default.apply(typeName, arguments);
41
+ };
41
42
  });
42
43
 
43
44
  _definitions.MARKO_ALIAS_TYPES.forEach((aliasName) => {
@@ -49,10 +50,14 @@ _definitions.MARKO_ALIAS_TYPES.forEach((aliasName) => {
49
50
 
50
51
  const originalIsReferenced = referencedValidators.default;
51
52
  referencedValidators.default = (node, parent, grandparent) => {
52
- if (parent.type === "MarkoTag" || parent.type === "MarkoTagBody") {
53
- return false;
54
- }
55
- return originalIsReferenced(node, parent, grandparent);
53
+ switch (parent.type) {
54
+ case "MarkoTag":
55
+ return parent.var !== node;
56
+ case "MarkoTagBody":
57
+ return false;
58
+ default:
59
+ return originalIsReferenced(node, parent, grandparent);}
60
+
56
61
  };
57
62
 
58
63
  function assert(typeName, node, opts) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/babel-types/types/patch.js"],"names":["TYPES","VISITOR_KEYS","FLIPPED_ALIAS_KEYS","DEPRECATED_KEYS","is","getBindingIdentifiers","babelTypes","keys","MARKO_TYPES","forEach","typeName","definitions","type","Object","includes","push","lowerName","toLowerCase","slice","checkKey","assertKey","node","opts","assert","args","MARKO_ALIAS_TYPES","aliasName","originalCheck","generatedValidators","originalIsReferenced","referencedValidators","default","parent","grandparent","Error","JSON","stringify"],"mappings":";AACA;AACA;AACA;AACA;AACA;AACA,qE,yjCANA;;AAQA,MAAM;AACJA,EAAAA,KADI;AAEJC,EAAAA,YAFI;AAGJC,EAAAA,kBAHI;AAIJC,EAAAA,eAJI;AAKJC,EAAAA,EALI;AAMJC,EAAAA,qBANI;AAOFC,UAPJ;;AASAD,qBAAqB,CAACE,IAAtB,CAA2B,UAA3B,IAAyC,CAAC,KAAD,CAAzC;AACAF,qBAAqB,CAACE,IAAtB,CAA2B,cAA3B,IAA6C,CAAC,QAAD,CAA7C;;AAEAC,yBAAYC,OAAZ,CAAoB,CAAAC,QAAQ,KAAI;AAC9B,sBAAWA,QAAX,EAAqBC,qBAAYD,QAAZ,CAArB;AACD,CAFD;;AAIA,KAAK,MAAME,IAAX,IAAmB;AACjB,GAAGC,MAAM,CAACN,IAAP,CAAYN,YAAZ,CADc;AAEjB,GAAGY,MAAM,CAACN,IAAP,CAAYL,kBAAZ,CAFc;AAGjB,GAAGW,MAAM,CAACN,IAAP,CAAYJ,eAAZ,CAHc,CAAnB;AAIG;AACD,MAAI,CAACH,KAAK,CAACc,QAAN,CAAeF,IAAf,CAAL,EAA2BZ,KAAK,CAACe,IAAN,CAAWH,IAAX;AAC5B;;AAEDJ,yBAAYC,OAAZ,CAAoB,CAAAC,QAAQ,KAAI;AAC9B,QAAMM,SAAS,GAAGN,QAAQ,CAAC,CAAD,CAAR,CAAYO,WAAZ,KAA4BP,QAAQ,CAACQ,KAAT,CAAe,CAAf,CAA9C;AACA,QAAMC,QAAQ,GAAI,KAAIT,QAAS,EAA/B;AACA,QAAMU,SAAS,GAAI,SAAQV,QAAS,EAApC;AACAJ,EAAAA,UAAU,CAACa,QAAD,CAAV,GAAuB,CAACE,IAAD,EAAOC,IAAP,KAAgBlB,EAAE,CAACM,QAAD,EAAWW,IAAX,EAAiBC,IAAjB,CAAzC;AACAhB,EAAAA,UAAU,CAACc,S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,IAH7B,CAAN;;AAKD;AACF","sourcesContent":["/* eslint-disable no-import-assign */\nimport * as babelTypes from \"@babel/types\";\nimport builder from \"@babel/types/lib/builders/builder\";\nimport defineType from \"@babel/types/lib/definitions/utils\";\nimport * as generatedValidators from \"@babel/types/lib/validators/generated\";\nimport * as referencedValidators from \"@babel/types/lib/validators/isReferenced\";\nimport definitions, { MARKO_TYPES, MARKO_ALIAS_TYPES } from \"./definitions\";\n\nconst {\n TYPES,\n VISITOR_KEYS,\n FLIPPED_ALIAS_KEYS,\n DEPRECATED_KEYS,\n is,\n getBindingIdentifiers\n} = babelTypes;\n\ngetBindingIdentifiers.keys[\"MarkoTag\"] = [\"var\"];\ngetBindingIdentifiers.keys[\"MarkoTagBody\"] = [\"params\"];\n\nMARKO_TYPES.forEach(typeName => {\n defineType(typeName, definitions[typeName]);\n});\n\nfor (const type of [\n ...Object.keys(VISITOR_KEYS),\n ...Object.keys(FLIPPED_ALIAS_KEYS),\n ...Object.keys(DEPRECATED_KEYS)\n]) {\n if (!TYPES.includes(type)) TYPES.push(type);\n}\n\nMARKO_TYPES.forEach(typeName => {\n const lowerName = typeName[0].toLowerCase() + typeName.slice(1);\n const checkKey = `is${typeName}`;\n const assertKey = `assert${typeName}`;\n babelTypes[checkKey] = (node, opts) => is(typeName, node, opts);\n babelTypes[assertKey] = (node, opts) => assert(typeName, node, opts);\n babelTypes[typeName] = babelTypes[lowerName] = (...args) =>\n builder(typeName, ...args);\n});\n\nMARKO_ALIAS_TYPES.forEach(aliasName => {\n const checkKey = `is${aliasName}`;\n const originalCheck = generatedValidators[checkKey];\n generatedValidators[checkKey] = (node, opts) =>\n is(aliasName, node, opts) || originalCheck(node, opts);\n});\n\nconst originalIsReferenced = referencedValidators.default;\nreferencedValidators.default = (node, parent, grandparent) => {\n if (parent.type === \"MarkoTag\" || parent.type === \"MarkoTagBody\") {\n return false;\n }\n return originalIsReferenced(node, parent, grandparent);\n};\n\nfunction assert(typeName, node, opts) {\n if (!is(typeName, node, opts)) {\n throw new Error(\n `Expected type \"${typeName}\" with option ${JSON.stringify(\n opts\n )}, but instead got \"${node.type}\".`\n );\n }\n}\n"],"file":"patch.js"}
1
+ {"version":3,"sources":["../../../src/babel-types/types/patch.js"],"names":["TYPES","VISITOR_KEYS","FLIPPED_ALIAS_KEYS","DEPRECATED_KEYS","is","getBindingIdentifiers","babelTypes","keys","MARKO_TYPES","forEach","typeName","definitions","type","Object","includes","push","lowerName","toLowerCase","slice","checkKey","assertKey","node","opts","assert","builder","apply","arguments","MARKO_ALIAS_TYPES","aliasName","originalCheck","generatedValidators","originalIsReferenced","referencedValidators","default","parent","grandparent","var","Error","JSON","stringify"],"mappings":";AACA;AACA;AACA;AACA;AACA;AACA,qE,yjCANA;;AAQA,MAAM;AACJA,EAAAA,KADI;AAEJC,EAAAA,YAFI;AAGJC,EAAAA,kBAHI;AAIJC,EAAAA,eAJI;AAKJC,EAAAA,EALI;AAMJC,EAAAA,qBANI;AAOFC,UAPJ;;AASAD,qBAAqB,CAACE,IAAtB,CAA2B,UAA3B,IAAyC,CAAC,KAAD,CAAzC;AACAF,qBAAqB,CAACE,IAAtB,CAA2B,cAA3B,IAA6C,CAAC,QAAD,CAA7C;;AAEAC,yBAAYC,OAAZ,CAAoB,CAAAC,QAAQ,KAAI;AAC9B,sBAAWA,QAAX,EAAqBC,qBAAYD,QAAZ,CAArB;AACD,CAFD;;AAIA,KAAK,MAAME,IAAX,IAAmB;AACjB,GAAGC,MAAM,CAACN,IAAP,CAAYN,YAAZ,CADc;AAEjB,GAAGY,MAAM,CAACN,IAAP,CAAYL,kBAAZ,CAFc;AAGjB,GAAGW,MAAM,CAACN,IAAP,CAAYJ,eAAZ,CAHc,CAAnB;AAIG;AACD,MAAI,CAACH,KAAK,CAACc,QAAN,CAAeF,IAAf,CAAL,EAA2BZ,KAAK,CAACe,IAAN,CAAWH,IAAX;AAC5B;;AAEDJ,yBAAYC,OAAZ,CAAoB,CAAAC,QAAQ,KAAI;AAC9B,Q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AAL;AACE,aAAO,KAAP;AACF;AACE,aAAOU,oBAAoB,CAACV,IAAD,EAAOa,MAAP,EAAeC,WAAf,CAA3B,CANJ;;AAQD,CATD;;AAWA,SAASZ,MAAT,CAAgBb,QAAhB,EAA0BW,IAA1B,EAAgCC,IAAhC,EAAsC;AACpC,MAAI,CAAClB,EAAE,CAACM,QAAD,EAAWW,IAAX,EAAiBC,IAAjB,CAAP,EAA+B;AAC7B,UAAM,IAAIe,KAAJ;AACH,sBAAiB3B,QAAS,iBAAgB4B,IAAI,CAACC,SAAL;AACzCjB,IAAAA,IADyC;AAEzC,0BAAqBD,IAAI,CAACT,IAAK,IAH7B,CAAN;;AAKD;AACF","sourcesContent":["/* eslint-disable no-import-assign */\nimport * as babelTypes from \"@babel/types\";\nimport builder from \"@babel/types/lib/builders/builder\";\nimport defineType from \"@babel/types/lib/definitions/utils\";\nimport * as generatedValidators from \"@babel/types/lib/validators/generated\";\nimport * as referencedValidators from \"@babel/types/lib/validators/isReferenced\";\nimport definitions, { MARKO_TYPES, MARKO_ALIAS_TYPES } from \"./definitions\";\n\nconst {\n TYPES,\n VISITOR_KEYS,\n FLIPPED_ALIAS_KEYS,\n DEPRECATED_KEYS,\n is,\n getBindingIdentifiers\n} = babelTypes;\n\ngetBindingIdentifiers.keys[\"MarkoTag\"] = [\"var\"];\ngetBindingIdentifiers.keys[\"MarkoTagBody\"] = [\"params\"];\n\nMARKO_TYPES.forEach(typeName => {\n defineType(typeName, definitions[typeName]);\n});\n\nfor (const type of [\n ...Object.keys(VISITOR_KEYS),\n ...Object.keys(FLIPPED_ALIAS_KEYS),\n ...Object.keys(DEPRECATED_KEYS)\n]) {\n if (!TYPES.includes(type)) TYPES.push(type);\n}\n\nMARKO_TYPES.forEach(typeName => {\n const lowerName = typeName[0].toLowerCase() + typeName.slice(1);\n const checkKey = `is${typeName}`;\n const assertKey = `assert${typeName}`;\n babelTypes[checkKey] = (node, opts) => is(typeName, node, opts);\n babelTypes[assertKey] = (node, opts) => assert(typeName, node, opts);\n babelTypes[typeName] = babelTypes[lowerName] = function () {\n return builder.apply(typeName, arguments);\n };\n});\n\nMARKO_ALIAS_TYPES.forEach(aliasName => {\n const checkKey = `is${aliasName}`;\n const originalCheck = generatedValidators[checkKey];\n generatedValidators[checkKey] = (node, opts) =>\n is(aliasName, node, opts) || originalCheck(node, opts);\n});\n\nconst originalIsReferenced = referencedValidators.default;\nreferencedValidators.default = (node, parent, grandparent) => {\n switch (parent.type) {\n case \"MarkoTag\":\n return parent.var !== node;\n case \"MarkoTagBody\":\n return false;\n default:\n return originalIsReferenced(node, parent, grandparent);\n }\n};\n\nfunction assert(typeName, node, opts) {\n if (!is(typeName, node, opts)) {\n throw new Error(\n `Expected type \"${typeName}\" with option ${JSON.stringify(\n opts\n )}, but instead got \"${node.type}\".`\n );\n }\n}\n"],"file":"patch.js"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.configure = configure;exports.compile = compile;exports.compileSync = compileSync;exports.compileFile = compileFile;exports.compileFileSync = compileFileSync;exports.getRuntimeEntryFiles = getRuntimeEntryFiles;exports._clearDefaults = _clearDefaults;exports.taglib = exports.types = void 0;var _types = _interopRequireWildcard(require("./babel-types"));exports.types = _types;
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports._clearDefaults = _clearDefaults;exports.compile = compile;exports.compileFile = compileFile;exports.compileFileSync = compileFileSync;exports.compileSync = compileSync;exports.configure = configure;exports.getRuntimeEntryFiles = getRuntimeEntryFiles;exports.types = exports.taglib = void 0;var _types = _interopRequireWildcard(require("./babel-types"));exports.types = _types;
2
2
  var _path = _interopRequireDefault(require("path"));
3
3
  var babel = _interopRequireWildcard(require("@babel/core"));
4
4
  var _babelPlugin = _interopRequireDefault(require("./babel-plugin"));
package/dist/taglib/fs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";exports.__esModule = true;exports.setFS = setFS;exports.curFS = void 0;let curFS;exports.curFS = curFS;
1
+ "use strict";exports.__esModule = true;exports.curFS = void 0;exports.setFS = setFS;let curFS;exports.curFS = curFS;
2
2
  function setFS(fs) {
3
3
  exports.curFS = curFS = fs;
4
4
  }
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.buildLookup = buildLookup;exports.register = register;exports.clearCaches = clearCaches;exports._finder = exports._loader = exports.excludePackage = exports.excludeDir = void 0;var _loader2 = _interopRequireDefault(require("./loader"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports._loader = exports._finder = void 0;exports.buildLookup = buildLookup;exports.clearCaches = clearCaches;exports.excludePackage = exports.excludeDir = void 0;exports.register = register;var _loader2 = _interopRequireDefault(require("./loader"));
2
2
  var _finder2 = _interopRequireDefault(require("./finder"));
3
3
  var _lookup = _interopRequireDefault(require("./lookup"));
4
4
  var _tryLoadTranslator = _interopRequireDefault(require("../util/try-load-translator"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/taglib/index.js"],"names":["excludeDir","finder","excludePackage","registeredTaglibs","loadedTranslatorsTaglibs","Map","lookupCache","Object","create","register","require","resolve","buildLookup","dirname","requestedTranslator","translator","Array","isArray","taglibs","Error","has","set","map","id","props","loadTaglib","taglibsForDir","find","concat","get","cacheKey","it","join","lookup","Lookup","i","length","taglib","addTaglib","imports","importedTaglib","hasTaglib","push","clearCaches","loader","clearCache","_loader","_finder","loadTaglibFromProps","createTaglib"],"mappings":"qTAAA;AACA;AACA;AACA;;AAEO,MAAMA,UAAU,GAAGC,iBAAOD,UAA1B,C;AACA,MAAME,cAAc,GAAGD,iBAAOC,cAA9B,C;;AAEP,MAAMC,iBAAiB,GAAG,EAA1B;AACA,MAAMC,wBAAwB,GAAG,IAAIC,GAAJ,EAAjC;AACA,IAAIC,WAAW,GAAGC,MAAM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AL,EAAa;AACXA,IAAAA,MAAM,GAAG3B,WAAW,CAACwB,QAAD,CAAX,GAAwB,IAAII,eAAJ,EAAjC;AACA,SAAK,IAAIC,CAAC,GAAGT,aAAa,CAACU,MAA3B,EAAmCD,CAAC,EAApC,GAA0C;AACxC,YAAME,MAAM,GAAGX,aAAa,CAACS,CAAD,CAA5B;AACAF,MAAAA,MAAM,CAACK,SAAP,CAAiBD,MAAjB;AACA,UAAIA,MAAM,CAACE,OAAX,EAAoB;AAClB,aAAK,MAAMC,cAAX,IAA6BH,MAAM,CAACE,OAApC,EAA6C;AAC3C,cAAI,CAACN,MAAM,CAACQ,SAAP,CAAiBD,cAAjB,CAAL,EAAuC;AACrCP,YAAAA,MAAM,CAACK,SAAP,CAAiBE,cAAjB;AACD;AACF;AACF;AACF;AACF;;AAED,SAAOP,MAAP;AACD;;AAEM,SAASxB,QAAT,CAAkBc,EAAlB,EAAsBC,KAAtB,EAA6B;AAClCrB,EAAAA,iBAAiB,CAACuC,IAAlB,CAAuBjB,UAAU,CAACF,EAAD,EAAKC,KAAL,CAAjC;AACD;;AAEM,SAASmB,WAAT,GAAuB;AAC5BC,mBAAOC,UAAP;AACA5C,mBAAO4C,UAAP;AACAvC,EAAAA,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc,IAAd,CAAd;AACD;;AAED;AACO,MAAMsC,OAAO,GAAGF,gBAAhB,C;AACA,MAAMG,OAAO,GAAG9C,gBAAhB,C;;AAEP,SAASwB,UAAT,CAAoBF,EAApB,EAAwBC,KAAxB,EAA+B;AAC7B,SAAOoB,iBAAOI,mBAAP,CAA2BJ,iBAAOK,YAAP,CAAoB1B,EAApB,CAA3B,EAAoDC,KAApD,CAAP;AACD","sourcesContent":["import loader from \"./loader\";\nimport finder from \"./finder\";\nimport Lookup from \"./lookup\";\nimport tryLoadTranslator from \"../util/try-load-translator\";\n\nexport const excludeDir = finder.excludeDir;\nexport const excludePackage = finder.excludePackage;\n\nconst registeredTaglibs = [];\nconst loadedTranslatorsTaglibs = new Map();\nlet lookupCache = Object.create(null);\n\nregister(require.resolve(\"./marko-html.json\"), require(\"./marko-html.json\"));\nregister(require.resolve(\"./marko-svg.json\"), require(\"./marko-svg.json\"));\nregister(require.resolve(\"./marko-math.json\"), require(\"./marko-math.json\"));\n\nexport function buildLookup(dirname, requestedTranslator) {\n const translator = tryLoadTranslator(requestedTranslator);\n if (!translator || !Array.isArray(translator.taglibs)) {\n throw new Error(\n \"@marko/compiler: Invalid translator provided to buildLookup(dir, translator)\"\n );\n }\n\n if (!loadedTranslatorsTaglibs.has(translator)) {\n loadedTranslatorsTaglibs.set(\n translator,\n translator.taglibs.map(([id, props]) => loadTaglib(id, props))\n );\n }\n\n const taglibsForDir = finder.find(\n dirname,\n registeredTaglibs.concat(loadedTranslatorsTaglibs.get(translator))\n );\n\n const cacheKey = taglibsForDir.map(it => it.id).join();\n let lookup = lookupCache[cacheKey];\n\n if (!lookup) {\n lookup = lookupCache[cacheKey] = new Lookup();\n for (let i = taglibsForDir.length; i--; ) {\n const taglib = taglibsForDir[i];\n lookup.addTaglib(taglib);\n if (taglib.imports) {\n for (const importedTaglib of taglib.imports) {\n if (!lookup.hasTaglib(importedTaglib)) {\n lookup.addTaglib(importedTaglib);\n }\n }\n }\n }\n }\n\n return lookup;\n}\n\nexport function register(id, props) {\n registeredTaglibs.push(loadTaglib(id, props));\n}\n\nexport function clearCaches() {\n loader.clearCache();\n finder.clearCache();\n lookupCache = Object.create(null);\n}\n\n// Used by legacy compiler api.\nexport const _loader = loader;\nexport const _finder = finder;\n\nfunction loadTaglib(id, props) {\n return loader.loadTaglibFromProps(loader.createTaglib(id), props);\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/taglib/index.js"],"names":["excludeDir","finder","excludePackage","registeredTaglibs","loadedTranslatorsTaglibs","Map","lookupCache","Object","create","register","require","resolve","buildLookup","dirname","requestedTranslator","translator","Array","isArray","taglibs","Error","has","set","map","id","props","loadTaglib","taglibsForDir","find","concat","get","cacheKey","it","join","lookup","Lookup","i","length","taglib","addTaglib","imports","importedTaglib","hasTaglib","push","clearCaches","loader","clearCache","_loader","_finder","loadTaglibFromProps","createTaglib"],"mappings":"4TAAA;AACA;AACA;AACA;;AAEO,MAAMA,UAAU,GAAGC,iBAAOD,UAA1B,C;AACA,MAAME,cAAc,GAAGD,iBAAOC,cAA9B,C;;AAEP,MAAMC,iBAAiB,GAAG,EAA1B;AACA,MAAMC,wBAAwB,GAAG,IAAIC,GAAJ,EAAjC;AACA,IAAIC,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc,IAAd,CAAlB;;AAEAC,QAAQ,CAACC,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CAAD,EAAuCD,OAAO,CAAC,mBAAD,CAA9C,CAAR;AACAD,QAAQ,CAACC,OAAO,CAACC,OAAR,CAAgB,kBAAhB,CAAD,EAAsCD,OAAO,CAAC,kBAAD,CAA7C,CAAR;AACAD,QAAQ,CAACC,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CAAD,EAAuCD,OAAO,CAAC,mBAAD,CAA9C,CAAR;;AAEO,SAASE,WAAT,CAAqBC,OAArB,EAA8BC,mBAA9B,EAAmD;AACxD,QAAMC,UAAU,GAAG,gCAAkBD,mBAAlB,CAAnB;AACA,MAAI,CAACC,UAAD,IAAe,CAACC,KAAK,CAACC,OAAN,CAAcF,UAAU,CAACG,OAAzB,CAApB,EAAuD;AACrD,UAAM,IAAIC,KAAJ;AACJ,kFADI,CAAN;;AAGD;;AAED,MAAI,CAACf,wBAAwB,CAACgB,GAAzB,CAA6BL,UAA7B,CAAL,EAA+C;AAC7CX,IAAAA,wBAAwB,CAACiB,GAAzB;AACEN,IAAAA,UADF;AAEEA,IAAAA,UAAU,CAACG,OAAX,CAAmBI,GAAnB,CAAuB,CAAC,CAACC,EAAD,EAAKC,KAAL,CAAD,KAAiBC,UAAU,CAACF,EAAD,EAAKC,KAAL,CAAlD,CAFF;;AAID;;AAED,QAAME,aAAa,GAA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,gBAAhB,C;;AAEP,SAASwB,UAAT,CAAoBF,EAApB,EAAwBC,KAAxB,EAA+B;AAC7B,SAAOoB,iBAAOI,mBAAP,CAA2BJ,iBAAOK,YAAP,CAAoB1B,EAApB,CAA3B,EAAoDC,KAApD,CAAP;AACD","sourcesContent":["import loader from \"./loader\";\nimport finder from \"./finder\";\nimport Lookup from \"./lookup\";\nimport tryLoadTranslator from \"../util/try-load-translator\";\n\nexport const excludeDir = finder.excludeDir;\nexport const excludePackage = finder.excludePackage;\n\nconst registeredTaglibs = [];\nconst loadedTranslatorsTaglibs = new Map();\nlet lookupCache = Object.create(null);\n\nregister(require.resolve(\"./marko-html.json\"), require(\"./marko-html.json\"));\nregister(require.resolve(\"./marko-svg.json\"), require(\"./marko-svg.json\"));\nregister(require.resolve(\"./marko-math.json\"), require(\"./marko-math.json\"));\n\nexport function buildLookup(dirname, requestedTranslator) {\n const translator = tryLoadTranslator(requestedTranslator);\n if (!translator || !Array.isArray(translator.taglibs)) {\n throw new Error(\n \"@marko/compiler: Invalid translator provided to buildLookup(dir, translator)\"\n );\n }\n\n if (!loadedTranslatorsTaglibs.has(translator)) {\n loadedTranslatorsTaglibs.set(\n translator,\n translator.taglibs.map(([id, props]) => loadTaglib(id, props))\n );\n }\n\n const taglibsForDir = finder.find(\n dirname,\n registeredTaglibs.concat(loadedTranslatorsTaglibs.get(translator))\n );\n\n const cacheKey = taglibsForDir.map(it => it.id).join();\n let lookup = lookupCache[cacheKey];\n\n if (!lookup) {\n lookup = lookupCache[cacheKey] = new Lookup();\n for (let i = taglibsForDir.length; i--; ) {\n const taglib = taglibsForDir[i];\n lookup.addTaglib(taglib);\n if (taglib.imports) {\n for (const importedTaglib of taglib.imports) {\n if (!lookup.hasTaglib(importedTaglib)) {\n lookup.addTaglib(importedTaglib);\n }\n }\n }\n }\n }\n\n return lookup;\n}\n\nexport function register(id, props) {\n registeredTaglibs.push(loadTaglib(id, props));\n}\n\nexport function clearCaches() {\n loader.clearCache();\n finder.clearCache();\n lookupCache = Object.create(null);\n}\n\n// Used by legacy compiler api.\nexport const _loader = loader;\nexport const _finder = finder;\n\nfunction loadTaglib(id, props) {\n return loader.loadTaglibFromProps(loader.createTaglib(id), props);\n}\n"],"file":"index.js"}
package/dist/types.d.ts CHANGED
@@ -42,7 +42,7 @@ interface BaseNode {
42
42
  extra?: Record<string, unknown>;
43
43
  }
44
44
 
45
- export type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | 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 | ImportNamespaceSpecifier | 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 | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | 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 | 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 | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | 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 | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
45
+ export type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | 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 | ImportNamespaceSpecifier | 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 | 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 | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | 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;
46
46
 
47
47
  export interface ArrayExpression extends BaseNode {
48
48
  type: "ArrayExpression";
@@ -462,6 +462,7 @@ export interface ExportSpecifier extends BaseNode {
462
462
  type: "ExportSpecifier";
463
463
  local: Identifier;
464
464
  exported: Identifier | StringLiteral;
465
+ exportKind: "type" | "value" | null;
465
466
  }
466
467
 
467
468
  export interface ForOfStatement extends BaseNode {
@@ -494,7 +495,7 @@ export interface ImportSpecifier extends BaseNode {
494
495
  type: "ImportSpecifier";
495
496
  local: Identifier;
496
497
  imported: Identifier | StringLiteral;
497
- importKind: "type" | "typeof" | null;
498
+ importKind: "type" | "typeof" | "value" | null;
498
499
  }
499
500
 
500
501
  export interface MetaProperty extends BaseNode {
@@ -655,6 +656,11 @@ export interface PrivateName extends BaseNode {
655
656
  id: Identifier;
656
657
  }
657
658
 
659
+ export interface StaticBlock extends BaseNode {
660
+ type: "StaticBlock";
661
+ body: Array<Statement>;
662
+ }
663
+
658
664
  export interface AnyTypeAnnotation extends BaseNode {
659
665
  type: "AnyTypeAnnotation";
660
666
  }
@@ -1195,11 +1201,6 @@ export interface DecimalLiteral extends BaseNode {
1195
1201
  value: string;
1196
1202
  }
1197
1203
 
1198
- export interface StaticBlock extends BaseNode {
1199
- type: "StaticBlock";
1200
- body: Array<Statement>;
1201
- }
1202
-
1203
1204
  export interface ModuleExpression extends BaseNode {
1204
1205
  type: "ModuleExpression";
1205
1206
  body: Program;
@@ -1705,6 +1706,7 @@ export type RestProperty = RestElement;
1705
1706
  */
1706
1707
  export type SpreadProperty = SpreadElement;
1707
1708
 
1709
+ 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 | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
1708
1710
  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 | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSAsExpression | TSTypeAssertion | TSNonNullExpression;
1709
1711
  export type Binary = BinaryExpression | LogicalExpression;
1710
1712
  export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
@@ -1720,7 +1722,7 @@ export type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression |
1720
1722
  export type For = ForInStatement | ForStatement | ForOfStatement;
1721
1723
  export type ForXStatement = ForInStatement | ForOfStatement;
1722
1724
  export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;
1723
- export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;
1725
+ export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock;
1724
1726
  export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral;
1725
1727
  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;
1726
1728
  export type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern;
@@ -1739,7 +1741,7 @@ export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration
1739
1741
  export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
1740
1742
  export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportNamespaceSpecifier | ExportDefaultSpecifier;
1741
1743
  export type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName;
1742
- export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType;
1744
+ export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | IndexedAccessType | OptionalIndexedAccessType;
1743
1745
  export type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType;
1744
1746
  export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation;
1745
1747
  export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias;
@@ -1747,6 +1749,8 @@ export type FlowPredicate = DeclaredPredicate | InferredPredicate;
1747
1749
  export type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody;
1748
1750
  export type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember;
1749
1751
  export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment;
1752
+ export type Miscellaneous = Noop | Placeholder | V8IntrinsicIdentifier;
1753
+ 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 | TSAsExpression | TSTypeAssertion | TSEnumDeclaration | TSEnumMember | TSModuleDeclaration | TSModuleBlock | TSImportType | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | TSExportAssignment | TSNamespaceExportDeclaration | TSTypeAnnotation | TSTypeParameterInstantiation | TSTypeParameterDeclaration | TSTypeParameter;
1750
1754
  export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;
1751
1755
  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;
1752
1756
  export type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType;
@@ -1754,6 +1758,7 @@ export type Marko = MarkoDocumentType | MarkoDeclaration | MarkoCDATA | MarkoCom
1754
1758
  export type Scope = MarkoTagBody;
1755
1759
 
1756
1760
  export interface Aliases {
1761
+ Standardized: Standardized;
1757
1762
  Expression: Expression;
1758
1763
  Binary: Binary;
1759
1764
  Scopable: Scopable;
@@ -1796,6 +1801,8 @@ export interface Aliases {
1796
1801
  EnumBody: EnumBody;
1797
1802
  EnumMember: EnumMember;
1798
1803
  JSX: JSX;
1804
+ Miscellaneous: Miscellaneous;
1805
+ TypeScript: TypeScript;
1799
1806
  TSTypeElement: TSTypeElement;
1800
1807
  TSType: TSType;
1801
1808
  TSBaseType: TSBaseType;
@@ -1890,6 +1897,7 @@ export function classProperty(key: Identifier | StringLiteral | NumericLiteral |
1890
1897
  export function classPrivateProperty(key: PrivateName, value: Expression | null | undefined, decorators: Array<Decorator> | null | undefined, _static: any): ClassPrivateProperty;
1891
1898
  export function classPrivateMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: PrivateName, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, _static?: boolean): ClassPrivateMethod;
1892
1899
  export function privateName(id: Identifier): PrivateName;
1900
+ export function staticBlock(body: Array<Statement>): StaticBlock;
1893
1901
  export function anyTypeAnnotation(): AnyTypeAnnotation;
1894
1902
  export function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation;
1895
1903
  export function booleanTypeAnnotation(): BooleanTypeAnnotation;
@@ -1982,7 +1990,6 @@ export function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpeci
1982
1990
  export function recordExpression(properties: Array<ObjectProperty | SpreadElement>): RecordExpression;
1983
1991
  export function tupleExpression(elements?: Array<Expression | SpreadElement>): TupleExpression;
1984
1992
  export function decimalLiteral(value: string): DecimalLiteral;
1985
- export function staticBlock(body: Array<Statement>): StaticBlock;
1986
1993
  export function moduleExpression(body: Program): ModuleExpression;
1987
1994
  export function topicReference(): TopicReference;
1988
1995
  export function pipelineTopicExpression(expression: Expression): PipelineTopicExpression;
@@ -2361,6 +2368,8 @@ export function isMetaProperty(node: object | null | undefined, opts?: object |
2361
2368
  export function assertMetaProperty(node: object | null | undefined, opts?: object | null): void;
2362
2369
  export function isMethod(node: object | null | undefined, opts?: object | null): node is Method;
2363
2370
  export function assertMethod(node: object | null | undefined, opts?: object | null): void;
2371
+ export function isMiscellaneous(node: object | null | undefined, opts?: object | null): node is Miscellaneous;
2372
+ export function assertMiscellaneous(node: object | null | undefined, opts?: object | null): void;
2364
2373
  export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): node is MixedTypeAnnotation;
2365
2374
  export function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): void;
2366
2375
  export function isModuleDeclaration(node: object | null | undefined, opts?: object | null): node is ModuleDeclaration;
@@ -2473,6 +2482,8 @@ export function assertSpreadElement(node: object | null | undefined, opts?: obje
2473
2482
  export function isSpreadProperty(node: object | null | undefined, opts?: object | null): node is SpreadElement;
2474
2483
  /** @deprecated Use `assertSpreadElement` */
2475
2484
  export function assertSpreadProperty(node: object | null | undefined, opts?: object | null): void;
2485
+ export function isStandardized(node: object | null | undefined, opts?: object | null): node is Standardized;
2486
+ export function assertStandardized(node: object | null | undefined, opts?: object | null): void;
2476
2487
  export function isStatement(node: object | null | undefined, opts?: object | null): node is Statement;
2477
2488
  export function assertStatement(node: object | null | undefined, opts?: object | null): void;
2478
2489
  export function isStaticBlock(node: object | null | undefined, opts?: object | null): node is StaticBlock;
@@ -2659,6 +2670,8 @@ export function isTypeParameterDeclaration(node: object | null | undefined, opts
2659
2670
  export function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): void;
2660
2671
  export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TypeParameterInstantiation;
2661
2672
  export function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): void;
2673
+ export function isTypeScript(node: object | null | undefined, opts?: object | null): node is TypeScript;
2674
+ export function assertTypeScript(node: object | null | undefined, opts?: object | null): void;
2662
2675
  export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeofTypeAnnotation;
2663
2676
  export function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): void;
2664
2677
  export function isUnaryExpression(node: object | null | undefined, opts?: object | null): node is UnaryExpression;
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
3
  "description": "Marko template to JS compiler.",
4
- "version": "5.16.1",
4
+ "version": "5.17.10",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
7
7
  "dependencies": {
8
- "@babel/code-frame": "^7.12.13",
9
- "@babel/core": "^7.13.10",
10
- "@babel/generator": "^7.13.9",
11
- "@babel/parser": "^7.13.11",
12
- "@babel/plugin-transform-modules-commonjs": "^7.13.8",
13
- "@babel/runtime": "^7.13.10",
14
- "@babel/traverse": "^7.13.0",
15
- "@babel/types": "^7.13.0",
16
- "@marko/babel-utils": "^5.16.1",
8
+ "@babel/code-frame": "^7.16.0",
9
+ "@babel/core": "^7.16.0",
10
+ "@babel/generator": "^7.16.0",
11
+ "@babel/parser": "^7.16.0",
12
+ "@babel/plugin-transform-modules-commonjs": "^7.16.0",
13
+ "@babel/runtime": "^7.16.0",
14
+ "@babel/traverse": "^7.16.0",
15
+ "@babel/types": "^7.16.0",
16
+ "@marko/babel-utils": "^5.17.10",
17
17
  "complain": "^1.6.0",
18
18
  "enhanced-resolve": "5.7.0",
19
19
  "he": "^1.2.0",
@@ -29,7 +29,7 @@
29
29
  "strip-json-comments": "^3.1.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@marko/translator-default": "^5.16.1"
32
+ "@marko/translator-default": "^5.17.10"
33
33
  },
34
34
  "files": [
35
35
  "dist",
@@ -60,5 +60,5 @@
60
60
  "url": "https://github.com/marko-js/marko/tree/master/packages/compiler"
61
61
  },
62
62
  "types": "index.d.ts",
63
- "gitHead": "85ef55427a385bf25a559d286f0124f358fa50df"
63
+ "gitHead": "9da2b9c479b3a243258fbff05ad43b43e78ac775"
64
64
  }