@absolutejs/absolute 0.19.0-beta.843 → 0.19.0-beta.845

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.
@@ -4245,16 +4245,17 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4245
4245
  ].join(", ")}`);
4246
4246
  }
4247
4247
  const original = await traceAngularPhase("wrapper/read-server-output", () => fs.readFile(rawServerFile, "utf-8"), { entry: resolvedEntry });
4248
- const detectExportedComponentClass = (source, fallback) => {
4248
+ const detectExportedComponentClass = (source) => {
4249
4249
  const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
4250
4250
  if (defaultMatch)
4251
4251
  return defaultMatch[1];
4252
4252
  const exportClassMatch = source.match(/export\s+(?:default\s+)?class\s+([A-Za-z_$][\w$]*)/);
4253
4253
  if (exportClassMatch)
4254
4254
  return exportClassMatch[1];
4255
- return fallback;
4255
+ return null;
4256
4256
  };
4257
- const componentClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original, `${toPascal(fileBase)}Component`), { entry: resolvedEntry });
4257
+ const detectedClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original), { entry: resolvedEntry });
4258
+ const componentClassName = detectedClassName ?? `${toPascal(fileBase)}Component`;
4258
4259
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
4259
4260
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
4260
4261
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
@@ -4274,7 +4275,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4274
4275
  ${rewritten}`;
4275
4276
  }
4276
4277
  rewritten = rewritten.replace(new RegExp(`templateUrl:\\s*['"]\\.\\/${fileBase}\\.html['"]`), `templateUrl: '../../pages/${fileBase}.html'`);
4277
- if (!rewritten.includes("export default")) {
4278
+ if (detectedClassName && !rewritten.includes("export default")) {
4278
4279
  rewritten += `
4279
4280
  export default ${componentClassName};
4280
4281
  `;
@@ -5658,5 +5659,5 @@ export {
5658
5659
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
5659
5660
  };
5660
5661
 
5661
- //# debugId=668A000B3193816564756E2164756E21
5662
+ //# debugId=128D4BE2020C59DD64756E2164756E21
5662
5663
  //# sourceMappingURL=server.js.map