@absolutejs/absolute 0.19.0-beta.223 → 0.19.0-beta.224

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/index.js CHANGED
@@ -161,14 +161,14 @@ var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-
161
161
 
162
162
  // src/utils/resolveConvention.ts
163
163
  import { basename } from "path";
164
- var conventionsMap, setConventions = (map) => {
165
- conventionsMap = map;
164
+ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENTIONS_KEY] ?? {}, setConventions = (map) => {
165
+ globalThis[CONVENTIONS_KEY] = map;
166
166
  }, resolveErrorConventionPath = (framework, pageName) => {
167
- const fw = conventionsMap[framework];
167
+ const fw = getMap()[framework];
168
168
  if (!fw)
169
169
  return;
170
170
  return fw.pages?.[pageName]?.error ?? fw.defaults?.error;
171
- }, resolveNotFoundConventionPath = (framework) => conventionsMap[framework]?.defaults?.notFound, derivePageName = (pagePath) => {
171
+ }, resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound, derivePageName = (pagePath) => {
172
172
  const base = basename(pagePath);
173
173
  const dotIndex = base.indexOf(".");
174
174
  const name = dotIndex > 0 ? base.slice(0, dotIndex) : base;
@@ -300,7 +300,7 @@ var conventionsMap, setConventions = (map) => {
300
300
  return null;
301
301
  }, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
302
302
  for (const framework of NOT_FOUND_PRIORITY) {
303
- if (!conventionsMap[framework]?.defaults?.notFound)
303
+ if (!getMap()[framework]?.defaults?.notFound)
304
304
  continue;
305
305
  const response = await renderConventionNotFound(framework);
306
306
  if (response)
@@ -309,7 +309,6 @@ var conventionsMap, setConventions = (map) => {
309
309
  return null;
310
310
  };
311
311
  var init_resolveConvention = __esm(() => {
312
- conventionsMap = {};
313
312
  NOT_FOUND_PRIORITY = [
314
313
  "react",
315
314
  "svelte",
@@ -172370,15 +172369,15 @@ ${content.slice(firstUseIdx)}`;
172370
172369
  const allSvelteEntries = svelteConventionResult.pageFiles;
172371
172370
  const allVueEntries = vueConventionResult.pageFiles;
172372
172371
  const allAngularEntries = angularConventionResult.pageFiles;
172373
- const conventionsMap2 = {};
172372
+ const conventionsMap = {};
172374
172373
  if (reactConventionResult.conventions)
172375
- conventionsMap2.react = reactConventionResult.conventions;
172374
+ conventionsMap.react = reactConventionResult.conventions;
172376
172375
  if (svelteConventionResult.conventions)
172377
- conventionsMap2.svelte = svelteConventionResult.conventions;
172376
+ conventionsMap.svelte = svelteConventionResult.conventions;
172378
172377
  if (vueConventionResult.conventions)
172379
- conventionsMap2.vue = vueConventionResult.conventions;
172378
+ conventionsMap.vue = vueConventionResult.conventions;
172380
172379
  if (angularConventionResult.conventions)
172381
- conventionsMap2.angular = angularConventionResult.conventions;
172380
+ conventionsMap.angular = angularConventionResult.conventions;
172382
172381
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
172383
172382
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
172384
172383
  if (entry.startsWith(resolve13(reactIndexesPath))) {
@@ -172418,8 +172417,8 @@ ${content.slice(firstUseIdx)}`;
172418
172417
  serverPaths: [...emptyStringArray]
172419
172418
  }
172420
172419
  ]);
172421
- const svelteConventionSources = collectConventionSourceFiles(conventionsMap2.svelte);
172422
- const vueConventionSources = collectConventionSourceFiles(conventionsMap2.vue);
172420
+ const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
172421
+ const vueConventionSources = collectConventionSourceFiles(conventionsMap.vue);
172423
172422
  if (svelteConventionSources.length > 0 || vueConventionSources.length > 0) {
172424
172423
  const [svelteConvResult, vueConvResult] = await Promise.all([
172425
172424
  svelteConventionSources.length > 0 && svelteDir ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false)) : { svelteServerPaths: [] },
@@ -172438,8 +172437,8 @@ ${content.slice(firstUseIdx)}`;
172438
172437
  };
172439
172438
  const svelteDests = copyConventionFiles("svelte", svelteConventionSources, svelteConvResult.svelteServerPaths);
172440
172439
  const vueDests = copyConventionFiles("vue", vueConventionSources, vueConvResult.vueServerPaths);
172441
- updateConventionCompiledPaths(conventionsMap2.svelte, svelteConventionSources, svelteDests);
172442
- updateConventionCompiledPaths(conventionsMap2.vue, vueConventionSources, vueDests);
172440
+ updateConventionCompiledPaths(conventionsMap.svelte, svelteConventionSources, svelteDests);
172441
+ updateConventionCompiledPaths(conventionsMap.vue, vueConventionSources, vueDests);
172443
172442
  }
172444
172443
  const serverEntryPoints = [
172445
172444
  ...svelteServerPaths,
@@ -172807,11 +172806,11 @@ ${content.slice(firstUseIdx)}`;
172807
172806
  });
172808
172807
  if (!isIncremental) {
172809
172808
  writeFileSync4(join15(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
172810
- if (Object.keys(conventionsMap2).length > 0) {
172811
- writeFileSync4(join15(buildPath, "conventions.json"), JSON.stringify(conventionsMap2, null, "\t"));
172809
+ if (Object.keys(conventionsMap).length > 0) {
172810
+ writeFileSync4(join15(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
172812
172811
  }
172813
172812
  }
172814
- return { manifest, conventions: conventionsMap2 };
172813
+ return { manifest, conventions: conventionsMap };
172815
172814
  };
172816
172815
  var init_build = __esm(() => {
172817
172816
  init_constants();
@@ -178328,5 +178327,5 @@ export {
178328
178327
  ANGULAR_INIT_TIMEOUT_MS
178329
178328
  };
178330
178329
 
178331
- //# debugId=FE1792ADEC7373EA64756E2164756E21
178330
+ //# debugId=2DBD112ED081E22264756E2164756E21
178332
178331
  //# sourceMappingURL=index.js.map