@marko/compiler 5.39.63 → 5.39.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/babel.web.js CHANGED
@@ -7,7 +7,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
11
11
  var __copyProps = (to, from, except, desc) => {
12
12
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
13
  key = keys[i];
@@ -15224,11 +15224,10 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
15224
15224
  for (const reasonCode of Object.keys(argument)) {
15225
15225
  const template = argument[reasonCode];
15226
15226
  const _ref = typeof template === "string" ? { message: () => template } : typeof template === "function" ? { message: template } : template, { message } = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
15227
- const toMessage = typeof message === "string" ? () => message : message;
15228
15227
  ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
15229
15228
  code: "BABEL_PARSER_SYNTAX_ERROR",
15230
15229
  reasonCode,
15231
- toMessage
15230
+ toMessage: typeof message === "string" ? () => message : message
15232
15231
  }, syntaxPlugin ? { syntaxPlugin } : {}, rest));
15233
15232
  }
15234
15233
  return ParseErrorConstructors;
@@ -17448,7 +17447,7 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
17448
17447
  }
17449
17448
  flowParseDeclareVariable(node) {
17450
17449
  this.next();
17451
- node.id = this.flowParseTypeAnnotatableIdentifier(true);
17450
+ node.id = this.flowParseTypeAnnotatableIdentifier();
17452
17451
  this.scope.declareName(node.id.name, 5, node.id.loc.start);
17453
17452
  this.semicolon();
17454
17453
  return this.finishNode(node, "DeclareVariable");
@@ -17592,9 +17591,14 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
17592
17591
  if (!reservedTypes.has(word)) return;
17593
17592
  this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { reservedType: word });
17594
17593
  }
17595
- flowParseRestrictedIdentifier(liberal, declaration) {
17594
+ flowParseRestrictedIdentifierName(liberal, declaration) {
17596
17595
  this.checkReservedType(this.state.value, this.state.startLoc, declaration);
17597
- return this.parseIdentifier(liberal);
17596
+ return this.parseIdentifierName(liberal);
17597
+ }
17598
+ flowParseRestrictedIdentifier(liberal, declaration) {
17599
+ const node = this.startNode();
17600
+ const name = this.flowParseRestrictedIdentifierName(liberal, declaration);
17601
+ return this.createIdentifier(node, name);
17598
17602
  }
17599
17603
  flowParseTypeAlias(node) {
17600
17604
  node.id = this.flowParseRestrictedIdentifier(false, true);
@@ -17618,14 +17622,21 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
17618
17622
  this.semicolon();
17619
17623
  return this.finishNode(node, "OpaqueType");
17620
17624
  }
17625
+ flowParseTypeParameterBound() {
17626
+ if (this.match(14) || this.isContextual(81)) {
17627
+ const node = this.startNode();
17628
+ this.next();
17629
+ node.typeAnnotation = this.flowParseType();
17630
+ return this.finishNode(node, "TypeAnnotation");
17631
+ }
17632
+ }
17621
17633
  flowParseTypeParameter(requireDefault = false) {
17622
17634
  const nodeStartLoc = this.state.startLoc;
17623
17635
  const node = this.startNode();
17624
17636
  const variance = this.flowParseVariance();
17625
- const ident = this.flowParseTypeAnnotatableIdentifier();
17626
- node.name = ident.name;
17637
+ node.name = this.flowParseRestrictedIdentifierName();
17627
17638
  node.variance = variance;
17628
- node.bound = ident.typeAnnotation;
17639
+ node.bound = this.flowParseTypeParameterBound();
17629
17640
  if (this.match(29)) {
17630
17641
  this.eat(29);
17631
17642
  node.default = this.flowParseType();
@@ -18183,13 +18194,11 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
18183
18194
  node.typeAnnotation = this.flowParseTypeInitialiser();
18184
18195
  return this.finishNode(node, "TypeAnnotation");
18185
18196
  }
18186
- flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
18187
- const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
18188
- if (this.match(14)) {
18189
- ident.typeAnnotation = this.flowParseTypeAnnotation();
18190
- this.resetEndLocation(ident);
18191
- }
18192
- return ident;
18197
+ flowParseTypeAnnotatableIdentifier() {
18198
+ const node = this.startNode();
18199
+ const name = this.parseIdentifierName();
18200
+ if (this.match(14)) node.typeAnnotation = this.flowParseTypeAnnotation();
18201
+ return this.createIdentifier(node, name);
18193
18202
  }
18194
18203
  typeCastToParameter(node) {
18195
18204
  node.expression.typeAnnotation = node.typeAnnotation;
@@ -19985,6 +19994,7 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
19985
19994
  adjustInnerComments(node, node.properties, commentWS);
19986
19995
  break;
19987
19996
  case "CallExpression":
19997
+ case "NewExpression":
19988
19998
  case "OptionalCallExpression":
19989
19999
  adjustInnerComments(node, node.arguments, commentWS);
19990
20000
  break;
@@ -19997,6 +20007,7 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
19997
20007
  case "ObjectMethod":
19998
20008
  case "ClassMethod":
19999
20009
  case "ClassPrivateMethod":
20010
+ case "TSTypeParameterDeclaration":
20000
20011
  adjustInnerComments(node, node.params, commentWS);
20001
20012
  break;
20002
20013
  case "ArrayExpression":
@@ -20013,6 +20024,9 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
20013
20024
  case "TSEnumBody":
20014
20025
  adjustInnerComments(node, node.members, commentWS);
20015
20026
  break;
20027
+ case "TSInterfaceBody":
20028
+ adjustInnerComments(node, node.body, commentWS);
20029
+ break;
20016
20030
  default:
20017
20031
  if (node.type === "RecordExpression") {
20018
20032
  adjustInnerComments(node, node.properties, commentWS);
@@ -21569,7 +21583,8 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
21569
21583
  const oldInModule = this.inModule;
21570
21584
  this.inModule = inModule;
21571
21585
  const oldScope = this.scope;
21572
- this.scope = new (this.getScopeHandler())(this, inModule);
21586
+ const ScopeHandler = this.getScopeHandler();
21587
+ this.scope = new ScopeHandler(this, inModule);
21573
21588
  const oldProdParam = this.prodParam;
21574
21589
  this.prodParam = new ProductionParameterHandler();
21575
21590
  const oldClassScope = this.classScope;
@@ -25016,7 +25031,7 @@ var require_lib$19 = /* @__PURE__ */ __commonJSMin(((exports) => {
25016
25031
  this.resetPreviousNodeTrailingComments(id);
25017
25032
  this.next();
25018
25033
  return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
25019
- } else if (tokenIsIdentifier(type)) if (this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
25034
+ } else if (tokenIsIdentifier(type)) if (canBeArrow && this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
25020
25035
  else return id;
25021
25036
  else if (type === 90) {
25022
25037
  this.resetPreviousNodeTrailingComments(id);
@@ -28789,7 +28804,7 @@ var require_helpers_generated = /* @__PURE__ */ __commonJSMin(((exports) => {
28789
28804
  dependencies: {},
28790
28805
  internal: false
28791
28806
  }),
28792
- wrapAsyncGenerator: helper("7.0.0-beta.0", "function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then(function(t){if(u){var i=\"return\"===r?\"return\":\"next\";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?\"return\":\"normal\",t)},function(e){resume(\"throw\",e)})}catch(e){settle(\"throw\",e)}}function settle(e,n){switch(e){case\"return\":r.resolve({value:n,done:!0});break;case\"throw\":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise(function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))})},\"function\"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype[\"function\"==typeof Symbol&&Symbol.asyncIterator||\"@@asyncIterator\"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke(\"next\",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke(\"throw\",e)},AsyncGenerator.prototype.return=function(e){return this._invoke(\"return\",e)};", {
28807
+ wrapAsyncGenerator: helper("7.0.0-beta.0", "function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i=\"return\"===t&&o.k?t:\"next\";if(!o.k||n.done)return resume(i,n);n=e[i](n).value}settle(!!r.done,n)},function(e){resume(\"throw\",e)})}catch(e){settle(2,e)}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r))})},\"function\"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype[\"function\"==typeof Symbol&&Symbol.asyncIterator||\"@@asyncIterator\"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke(\"next\",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke(\"throw\",e)},AsyncGenerator.prototype.return=function(e){return this._invoke(\"return\",e)};", {
28793
28808
  globals: ["Promise", "Symbol"],
28794
28809
  locals: {
28795
28810
  _wrapAsyncGenerator: ["body.0.id"],
@@ -32631,8 +32646,6 @@ var require_gen_mapping_umd = /* @__PURE__ */ __commonJSMin(((exports, module) =
32631
32646
  if (skipable && skipSourceless(line, index)) return;
32632
32647
  return insert(line, index, [genColumn]);
32633
32648
  }
32634
- assert(sourceLine);
32635
- assert(sourceColumn);
32636
32649
  const sourcesIndex = put(sources, source);
32637
32650
  const namesIndex = name ? put(names, name) : NO_NAME;
32638
32651
  if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
@@ -32650,7 +32663,6 @@ var require_gen_mapping_umd = /* @__PURE__ */ __commonJSMin(((exports, module) =
32650
32663
  sourceColumn
32651
32664
  ]);
32652
32665
  }
32653
- function assert(_val) {}
32654
32666
  function getIndex(arr, index) {
32655
32667
  for (let i = arr.length; i <= index; i++) arr[i] = [];
32656
32668
  return arr[index];
@@ -32686,7 +32698,6 @@ var require_gen_mapping_umd = /* @__PURE__ */ __commonJSMin(((exports, module) =
32686
32698
  function addMappingInternal(skipable, map, mapping) {
32687
32699
  const { generated, source, original, name, content } = mapping;
32688
32700
  if (!source) return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
32689
- assert(original);
32690
32701
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
32691
32702
  }
32692
32703
  }));
@@ -38452,10 +38463,7 @@ var require_modification = /* @__PURE__ */ __commonJSMin(((exports) => {
38452
38463
  else if (typeof node !== "object") msg = "contains a non-object node";
38453
38464
  else if (!node.type) msg = "without a type";
38454
38465
  else if (node instanceof _index.default) msg = "has a NodePath when it expected a raw object";
38455
- if (msg) {
38456
- const type = Array.isArray(node) ? "array" : typeof node;
38457
- throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
38458
- }
38466
+ if (msg) throw new Error(`Node list ${msg} with the index of ${i} and type of ${Array.isArray(node) ? "array" : typeof node}`);
38459
38467
  }
38460
38468
  return nodes;
38461
38469
  }
@@ -41473,6 +41481,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41473
41481
  break;
41474
41482
  case "<":
41475
41483
  case "<=": break;
41484
+ /* istanbul ignore next */
41476
41485
  default: throw new Error("Unexpected operation: " + comparator.operator);
41477
41486
  }
41478
41487
  });
@@ -43181,7 +43190,7 @@ var require_environment = /* @__PURE__ */ __commonJSMin(((exports) => {
43181
43190
  Object.defineProperty(exports, "__esModule", { value: true });
43182
43191
  exports.getEnv = getEnv;
43183
43192
  function getEnv(defaultValue = "development") {
43184
- return process.env.BABEL_ENV || "production";
43193
+ return process.env.BABEL_ENV || "development";
43185
43194
  }
43186
43195
  }));
43187
43196
  //#endregion
@@ -44572,11 +44581,11 @@ var require_debug = /* @__PURE__ */ __commonJSMin(((exports) => {
44572
44581
  var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44573
44582
  module.exports = {
44574
44583
  "transform-explicit-resource-management": {
44575
- "chrome": "134",
44576
- "edge": "134",
44584
+ "chrome": "141",
44585
+ "edge": "141",
44577
44586
  "firefox": "141",
44578
- "node": "24",
44579
- "electron": "35.0"
44587
+ "node": "25",
44588
+ "electron": "39.0"
44580
44589
  },
44581
44590
  "transform-duplicate-named-capturing-groups-regex": {
44582
44591
  "chrome": "126",
@@ -44586,6 +44595,7 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44586
44595
  "safari": "17.4",
44587
44596
  "node": "23",
44588
44597
  "ios": "17.4",
44598
+ "rhino": "1.9",
44589
44599
  "electron": "31.0"
44590
44600
  },
44591
44601
  "transform-regexp-modifiers": {
@@ -45004,6 +45014,7 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45004
45014
  "deno": "1",
45005
45015
  "ios": "11.3",
45006
45016
  "samsung": "9",
45017
+ "rhino": "1.9",
45007
45018
  "opera_mobile": "47",
45008
45019
  "electron": "3.0"
45009
45020
  },
@@ -45017,6 +45028,7 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45017
45028
  "deno": "1",
45018
45029
  "ios": "11.3",
45019
45030
  "samsung": "9",
45031
+ "rhino": "1.9",
45020
45032
  "opera_mobile": "47",
45021
45033
  "electron": "3.0"
45022
45034
  },
@@ -45030,6 +45042,7 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45030
45042
  "deno": "1",
45031
45043
  "ios": "11.3",
45032
45044
  "samsung": "9",
45045
+ "rhino": "1.9",
45033
45046
  "opera_mobile": "47",
45034
45047
  "electron": "3.0"
45035
45048
  },
@@ -45070,6 +45083,7 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45070
45083
  "deno": "1",
45071
45084
  "ios": "13",
45072
45085
  "samsung": "3.4",
45086
+ "rhino": "1.9",
45073
45087
  "opera_mobile": "28",
45074
45088
  "electron": "0.21"
45075
45089
  },
@@ -45267,10 +45281,10 @@ var require_plugins$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45267
45281
  "opera": "38",
45268
45282
  "edge": "15",
45269
45283
  "firefox": "53",
45270
- "safari": "10",
45284
+ "safari": "14.1",
45271
45285
  "node": "6.5",
45272
45286
  "deno": "1",
45273
- "ios": "10",
45287
+ "ios": "14.5",
45274
45288
  "samsung": "5",
45275
45289
  "opera_mobile": "41",
45276
45290
  "electron": "1.2"
@@ -46206,8 +46220,7 @@ var require_rewrite_stack_trace = /* @__PURE__ */ __commonJSMin(((exports) => {
46206
46220
  function setupPrepareStackTrace() {
46207
46221
  setupPrepareStackTrace = () => {};
46208
46222
  const { prepareStackTrace = defaultPrepareStackTrace } = Error;
46209
- const MIN_STACK_TRACE_LIMIT = 50;
46210
- Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT));
46223
+ Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, 50));
46211
46224
  Error.prepareStackTrace = function stackTraceRewriter(err, trace) {
46212
46225
  let newTrace = [];
46213
46226
  let status = expectedErrors.has(err) ? "hiding" : "unknown";
@@ -51472,6 +51485,14 @@ var require_decorators = /* @__PURE__ */ __commonJSMin(((exports) => {
51472
51485
  classLocals.push(classIdLocal, classInitLocal);
51473
51486
  const statics = [];
51474
51487
  path.get("body.body").forEach((element) => {
51488
+ if (element.isStaticBlock() || !element.isClassMethod() && element.node.static) new _helperReplaceSupers.default({
51489
+ constantSuper,
51490
+ methodPath: element,
51491
+ objectRef: classIdLocal,
51492
+ superRef: path.node.superClass,
51493
+ file: state.file,
51494
+ refToPreserve: classIdLocal
51495
+ }).replace();
51475
51496
  if (element.isStaticBlock()) {
51476
51497
  if (hasInstancePrivateAccess(element, instancePrivateNames)) {
51477
51498
  const staticBlockClosureId = memoiseExpression(staticBlockToFunctionClosure(element.node), "staticBlock", staticClosures);
@@ -51495,14 +51516,6 @@ var require_decorators = /* @__PURE__ */ __commonJSMin(((exports) => {
51495
51516
  element.remove();
51496
51517
  } else if (element.isClassPrivateMethod({ static: true })) {
51497
51518
  if (hasInstancePrivateAccess(element, instancePrivateNames)) {
51498
- new _helperReplaceSupers.default({
51499
- constantSuper,
51500
- methodPath: element,
51501
- objectRef: classIdLocal,
51502
- superRef: path.node.superClass,
51503
- file: state.file,
51504
- refToPreserve: classIdLocal
51505
- }).replace();
51506
51519
  const privateMethodDelegateId = memoiseExpression(createFunctionExpressionFromPrivateMethod(element.node), element.get("key.id").node.name, staticClosures);
51507
51520
  if (ignoreFunctionLength) {
51508
51521
  element.node.params = [_core.types.restElement(_core.types.identifier("arg"))];
@@ -52071,14 +52084,14 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
52071
52084
  pre(file) {
52072
52085
  (0, _features.enableFeature)(file, feature, loose);
52073
52086
  if (typeof file.get(versionKey) === "number") {
52074
- file.set(versionKey, "7.28.6");
52087
+ file.set(versionKey, "7.29.3");
52075
52088
  return;
52076
52089
  }
52077
- if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.6")) file.set(versionKey, "7.28.6");
52090
+ if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.29.3")) file.set(versionKey, "7.29.3");
52078
52091
  },
52079
52092
  visitor: {
52080
52093
  Class(path, { file }) {
52081
- if (file.get(versionKey) !== "7.28.6") return;
52094
+ if (file.get(versionKey) !== "7.29.3") return;
52082
52095
  if (!(0, _features.shouldTransform)(path, file)) return;
52083
52096
  const pathIsClassDeclaration = path.isClassDeclaration();
52084
52097
  if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
@@ -52154,7 +52167,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
52154
52167
  if (classBindingNode != null && pathIsClassDeclaration) wrappedPath.insertAfter(classBindingNode);
52155
52168
  },
52156
52169
  ExportDefaultDeclaration(path, { file }) {
52157
- if (file.get(versionKey) !== "7.28.6") return;
52170
+ if (file.get(versionKey) !== "7.29.3") return;
52158
52171
  const decl = path.get("declaration");
52159
52172
  if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) if (decl.node.id) {
52160
52173
  path.splitExportDeclaration ??= require_lib$15().NodePath.prototype.splitExportDeclaration;
package/dist/config.js CHANGED
@@ -171,6 +171,14 @@ var _fs = _interopRequireDefault(require("fs"));
171
171
 
172
172
 
173
173
 
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
174
182
 
175
183
 
176
184
 
@@ -181,7 +189,10 @@ var _fs = _interopRequireDefault(require("fs"));
181
189
 
182
190
 
183
191
  var _config = _interopRequireDefault(require("./taglib/config"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}const config = { // The default output mode for compiled templates
184
- output: "html", // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.
192
+ output: "html", // Specifies whether this is a page or load entry point.
193
+ entry: undefined, /**
194
+ * Provides browser asset resolution and runtime hooks for lazy loading and server entries.
195
+ */linkAssets: undefined, // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.
185
196
  runtimeId: null, /**
186
197
  * Remove all typescript types from the output.
187
198
  * By default, the compiler will remove types from the output if the
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";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.taglib = exports.globalConfig = void 0;var _babelUtils = require("@marko/compiler/babel-utils");
1
+ "use strict";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.getRuntimeVersion = getRuntimeVersion;exports.version = exports.taglib = exports.globalConfig = void 0;var _babelUtils = require("@marko/compiler/babel-utils");
2
2
  var _babel = require("@marko/compiler/internal/babel");exports.types = _babel.types;
3
3
 
4
4
 
@@ -16,7 +16,8 @@ var taglib = _interopRequireWildcard(require("./taglib"));exports.taglib = tagli
16
16
  var _buildCodeFrame = require("./util/build-code-frame");
17
17
  var _mergeErrors = _interopRequireDefault(require("./util/merge-errors"));
18
18
  var _shouldOptimize = _interopRequireDefault(require("./util/should-optimize"));
19
- var _tryLoadTranslator = _interopRequireDefault(require("./util/try-load-translator"));function _interopRequireWildcard(e, t) {if ("function" == typeof WeakMap) var r = new WeakMap(),n = new WeakMap();return (_interopRequireWildcard = function (e, t) {if (!t && e && e.__esModule) return e;var o,i,f = { __proto__: null, default: e };if (null === e || "object" != typeof e && "function" != typeof e) return f;if (o = t ? n : r) {if (o.has(e)) return o.get(e);o.set(e, f);}for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);return f;})(e, t);}function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
19
+ var _tryLoadTranslator = _interopRequireDefault(require("./util/try-load-translator"));
20
+ var _package = require("../package.json");exports.version = _package.version;function _interopRequireWildcard(e, t) {if ("function" == typeof WeakMap) var r = new WeakMap(),n = new WeakMap();return (_interopRequireWildcard = function (e, t) {if (!t && e && e.__esModule) return e;var o,i,f = { __proto__: null, default: e };if (null === e || "object" != typeof e && "function" != typeof e) return f;if (o = t ? n : r) {if (o.has(e)) return o.get(e);o.set(e, f);}for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);return f;})(e, t);}function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
20
21
 
21
22
 
22
23
  const hasBabel = !!(
@@ -69,6 +70,10 @@ function getRuntimeEntryFiles(output, requestedTranslator) {
69
70
  return [];
70
71
  }
71
72
 
73
+ function getRuntimeVersion(requestedTranslator) {
74
+ return (0, _tryLoadTranslator.default)(requestedTranslator)?.version ?? "0.0.0";
75
+ }
76
+
72
77
  function loadMarkoConfig(config) {
73
78
  const markoConfig = { ...globalConfig, ...config };
74
79