@absolutejs/absolute 0.19.0-beta.1129 → 0.19.0-beta.1130

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,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Wz7sEi/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-nz9YGZ/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Wz7sEi/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-nz9YGZ/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-Wz7sEi/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-nz9YGZ/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -0,0 +1 @@
1
+ export declare const resolveGeneratedVueModulePath: (pagePath: string) => Promise<string>;
package/dist/vue/index.js CHANGED
@@ -1585,7 +1585,7 @@ var init_telemetry = __esm(() => {
1585
1585
  // src/cli/telemetryEvent.ts
1586
1586
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
1587
1587
  import { arch, platform } from "os";
1588
- import { dirname as dirname2, join as join2, parse } from "path";
1588
+ import { dirname as dirname3, join as join2, parse } from "path";
1589
1589
  var checkCandidate = (candidate) => {
1590
1590
  if (!existsSync2(candidate)) {
1591
1591
  return null;
@@ -1610,7 +1610,7 @@ var checkCandidate = (candidate) => {
1610
1610
  if (version) {
1611
1611
  return version;
1612
1612
  }
1613
- dir = dirname2(dir);
1613
+ dir = dirname3(dir);
1614
1614
  }
1615
1615
  return "unknown";
1616
1616
  }, sendTelemetryEvent = (event, payload) => {
@@ -4694,12 +4694,9 @@ var registerStreamSlotForSsr = (props) => {
4694
4694
  });
4695
4695
  };
4696
4696
  // src/vue/pageHandler.ts
4697
- init_constants();
4698
4697
  init_inlinePageCss();
4699
4698
  init_spaRouteCss();
4700
4699
  init_spaRouteManifest();
4701
- import { readdir } from "fs/promises";
4702
- import { basename as basename3, dirname as dirname3 } from "path";
4703
4700
 
4704
4701
  // src/core/islandPageContext.ts
4705
4702
  var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient";
@@ -5036,6 +5033,42 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
5036
5033
 
5037
5034
  // src/vue/pageHandler.ts
5038
5035
  init_resolveConvention();
5036
+
5037
+ // src/vue/resolveGeneratedVueModulePath.ts
5038
+ init_constants();
5039
+ import { access, readdir, stat } from "fs/promises";
5040
+ import { basename as basename3, dirname as dirname2 } from "path";
5041
+ var canAccess = async (path) => {
5042
+ try {
5043
+ await access(path);
5044
+ return true;
5045
+ } catch {
5046
+ return false;
5047
+ }
5048
+ };
5049
+ var resolveGeneratedVueModulePath = async (pagePath) => {
5050
+ if (await canAccess(pagePath))
5051
+ return pagePath;
5052
+ const pageDirectory = dirname2(pagePath);
5053
+ const expectedPrefix = `${basename3(pagePath, ".js").split(".")[0]}.`;
5054
+ try {
5055
+ const pageEntries = await readdir(pageDirectory, {
5056
+ withFileTypes: true
5057
+ });
5058
+ const matchingEntries = pageEntries.filter((entry) => entry.isFile() && entry.name.endsWith(".js") && (entry.name === `${expectedPrefix.slice(0, EXCLUDE_LAST_OFFSET)}.js` || entry.name.startsWith(expectedPrefix)));
5059
+ const candidates = await Promise.all(matchingEntries.map(async (entry) => {
5060
+ const path = `${pageDirectory}/${entry.name}`;
5061
+ const metadata = await stat(path);
5062
+ return { modifiedAt: metadata.mtimeMs, path };
5063
+ }));
5064
+ candidates.sort((left, right) => right.modifiedAt - left.modifiedAt || left.path.localeCompare(right.path));
5065
+ return candidates[0]?.path ?? pagePath;
5066
+ } catch {
5067
+ return pagePath;
5068
+ }
5069
+ };
5070
+
5071
+ // src/vue/pageHandler.ts
5039
5072
  var isRecord2 = (value) => typeof value === "object" && value !== null;
5040
5073
  var isGenericVueComponent = (value) => typeof value === "function" || isRecord2(value);
5041
5074
  var readHasIslands = (value) => {
@@ -5053,22 +5086,6 @@ var readSetupAppHook = (value) => {
5053
5086
  };
5054
5087
  var readHasSpaRoutes = (value) => isRecord2(value) && Array.isArray(value["routes"]);
5055
5088
  var readDefaultExport = (value) => isRecord2(value) ? value.default : undefined;
5056
- var resolveCurrentGeneratedVueModulePath = async (pagePath) => {
5057
- const pageDirectory = dirname3(pagePath);
5058
- const expectedPrefix = `${basename3(pagePath, ".js").split(".")[0]}.`;
5059
- try {
5060
- const pageEntries = await readdir(pageDirectory, {
5061
- withFileTypes: true
5062
- });
5063
- const matchingEntry = pageEntries.find((entry) => entry.isFile() && entry.name.endsWith(".js") && (entry.name === `${expectedPrefix.slice(0, EXCLUDE_LAST_OFFSET)}.js` || entry.name.startsWith(expectedPrefix)));
5064
- if (!matchingEntry) {
5065
- return pagePath;
5066
- }
5067
- return `${pageDirectory}/${matchingEntry.name}`;
5068
- } catch {
5069
- return pagePath;
5070
- }
5071
- };
5072
5089
  var resolveRequestRenderUrl = (request) => {
5073
5090
  if (!request)
5074
5091
  return "/";
@@ -5131,7 +5148,7 @@ var handleVuePageRequest = async (input) => {
5131
5148
  setupApp
5132
5149
  };
5133
5150
  }
5134
- const generatedPagePath = await resolveCurrentGeneratedVueModulePath(resolvedPagePath);
5151
+ const generatedPagePath = await resolveGeneratedVueModulePath(resolvedPagePath);
5135
5152
  const importedPageModule = await import(generatedPagePath);
5136
5153
  const importedPageComponent = readDefaultExport(importedPageModule) ?? importedPageModule;
5137
5154
  if (!isGenericVueComponent(importedPageComponent)) {
@@ -5689,5 +5706,5 @@ export {
5689
5706
  Image
5690
5707
  };
5691
5708
 
5692
- //# debugId=42899B85D790652064756E2164756E21
5709
+ //# debugId=D394475FBFEAC62A64756E2164756E21
5693
5710
  //# sourceMappingURL=index.js.map