@marko/compiler 5.39.46 → 5.39.48

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.
@@ -149,7 +149,7 @@ const MarkoDefinitions = {
149
149
  },
150
150
 
151
151
  MarkoTagBody: {
152
- aliases: ["Marko", "BlockParent", "Scope"],
152
+ aliases: ["Marko", "BlockParent", "FunctionParent", "Scope"],
153
153
  builder: ["body", "params"],
154
154
  visitor: ["typeParameters", "params", "body"],
155
155
  fields: {
@@ -255,35 +255,17 @@ function loadFileForTag(tag) {
255
255
  const filename = def && def.template;
256
256
 
257
257
  if (filename) {
258
- const markoMeta = file.metadata.marko;
259
- const relativeFileName = (0, _imports.resolveRelativePath)(file, filename);
260
- const { analyzedTags } = markoMeta;
261
- if (analyzedTags) {
262
- analyzedTags.add(relativeFileName);
263
- } else {
264
- markoMeta.analyzedTags = new Set([relativeFileName]);
265
- }
266
-
267
258
  return resolveMarkoFile(file, filename);
268
259
  }
269
260
  }
270
261
 
271
262
  function loadFileForImport(file, request) {
272
263
  const relativeRequest = resolveTagImport(file.path, request);
273
-
274
264
  if (relativeRequest) {
275
265
  const filename =
276
266
  relativeRequest[0] === "." ?
277
267
  (0, _path.resolve)(file.opts.filename, "..", relativeRequest) :
278
268
  _modules.default.resolve(relativeRequest, (0, _path.dirname)(file.opts.filename));
279
- const markoMeta = file.metadata.marko;
280
- const { analyzedTags } = markoMeta;
281
- if (analyzedTags) {
282
- analyzedTags.add(relativeRequest);
283
- } else {
284
- markoMeta.analyzedTags = new Set([relativeRequest]);
285
- }
286
-
287
269
  return resolveMarkoFile(file, filename);
288
270
  }
289
271
  }
@@ -298,11 +280,14 @@ function resolveMarkoFile(file, filename) {
298
280
  }
299
281
 
300
282
  try {
301
- return file.___getMarkoFile(
283
+ const childFile = file.___getMarkoFile(
302
284
  file.markoOpts.fileSystem.readFileSync(filename).toString("utf-8"),
303
285
  createNewFileOpts(file.opts, filename),
304
286
  file.markoOpts
305
287
  );
288
+
289
+ (file.metadata.marko.analyzedTags ||= new Set()).add(filename);
290
+ return childFile;
306
291
  } catch (_) {
307
292
 
308
293
  // ignore
package/dist/types.d.ts CHANGED
@@ -1811,7 +1811,7 @@ export type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression |
1811
1811
  export type For = ForInStatement | ForStatement | ForOfStatement;
1812
1812
  export type ForXStatement = ForInStatement | ForOfStatement;
1813
1813
  export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;
1814
- export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
1814
+ export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock | MarkoTagBody;
1815
1815
  export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral;
1816
1816
  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;
1817
1817
  export type FunctionParameter = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | VoidPattern;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.39.46",
3
+ "version": "5.39.48",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -87,7 +87,7 @@
87
87
  "source-map-support": "^0.5.21"
88
88
  },
89
89
  "devDependencies": {
90
- "marko": "^5.38.1"
90
+ "marko": "^5.38.11"
91
91
  },
92
92
  "engines": {
93
93
  "node": "18 || 20 || >=22"