@absolutejs/absolute 0.19.0-beta.985 → 0.19.0-beta.987

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
@@ -12183,6 +12183,12 @@ var findDefineConfigCall = (sf) => {
12183
12183
  }
12184
12184
  return null;
12185
12185
  }, resolveConfigPath = (projectRoot) => {
12186
+ const envOverride = process.env.ABSOLUTE_CONFIG;
12187
+ if (envOverride) {
12188
+ const resolved = isAbsolute3(envOverride) ? envOverride : join25(projectRoot, envOverride);
12189
+ if (existsSync20(resolved))
12190
+ return resolved;
12191
+ }
12186
12192
  const candidates = [
12187
12193
  join25(projectRoot, "absolute.config.ts"),
12188
12194
  join25(projectRoot, "absolute.config.mts"),
@@ -14950,7 +14956,19 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
14950
14956
  const detectedClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original), { entry: resolvedEntry });
14951
14957
  const componentClassName = detectedClassName ?? `${toPascal(fileBase)}Component`;
14952
14958
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
14953
- const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
14959
+ const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
14960
+ const providersHashInput = providersInjection ? (() => {
14961
+ let providersSourceContent = "";
14962
+ try {
14963
+ providersSourceContent = readFileSync18(providersInjection.appProvidersSource, "utf-8");
14964
+ } catch {}
14965
+ return JSON.stringify({
14966
+ basePath: pageInjectionForHash?.basePath ?? null,
14967
+ hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
14968
+ source: providersSourceContent
14969
+ });
14970
+ })() : "no-providers";
14971
+ const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
14954
14972
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
14955
14973
  const clientFile = join28(indexesDir, jsName);
14956
14974
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
@@ -14978,6 +14996,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
14978
14996
  `;
14979
14997
  }
14980
14998
  const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
14999
+ rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
14981
15000
  if (providersInjection && pageInjection) {
14982
15001
  const compiledAppProvidersPath = (() => {
14983
15002
  const angularDirAbs = resolve24(outRoot);
@@ -15002,9 +15021,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
15002
15021
  fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
15003
15022
  }
15004
15023
  rewritten += `
15024
+ /* __ABS_PROVIDERS_INJECTION_START */
15005
15025
  ${importLines.join(`
15006
15026
  `)}
15007
15027
  export const providers = [${fragments.join(", ")}];
15028
+ /* __ABS_PROVIDERS_INJECTION_END */
15008
15029
  `;
15009
15030
  }
15010
15031
  await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
@@ -24610,9 +24631,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
24610
24631
  const { runAngularHandlerScan: runAngularHandlerScan2 } = await Promise.resolve().then(() => (init_runAngularHandlerScan(), exports_runAngularHandlerScan));
24611
24632
  const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
24612
24633
  const projectRoot = process.cwd();
24634
+ const resolvedAngularDir = resolve41(angularDir);
24613
24635
  const providersImport = parseAngularProvidersImport2(projectRoot);
24614
24636
  const providersInjection = providersImport ? (() => {
24615
- const scan = runAngularHandlerScan2(projectRoot, angularDir);
24637
+ const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
24616
24638
  const basePathByKey = new Map;
24617
24639
  for (const call of scan.calls) {
24618
24640
  basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
@@ -24686,7 +24708,30 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
24686
24708
  state.fileHashes.set(resolve41(file5), computeFileHash(file5));
24687
24709
  }
24688
24710
  const angularPagesPath = resolve41(angularDir, "pages");
24689
- const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
24711
+ const initialPageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
24712
+ const projectRoot = process.cwd();
24713
+ const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
24714
+ const providersImport = parseAngularProvidersImport2(projectRoot);
24715
+ const editedProvidersChain = providersImport && angularFiles.some((file5) => resolve41(file5) === resolve41(providersImport.absolutePath) || resolve41(file5).startsWith(`${resolve41(angularDir)}/`));
24716
+ const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? (() => {
24717
+ const allPages = [];
24718
+ const { readdirSync: readdirSync7 } = __require("fs");
24719
+ const walk = (dir) => {
24720
+ for (const entry of readdirSync7(dir, {
24721
+ withFileTypes: true
24722
+ })) {
24723
+ const full = resolve41(dir, entry.name);
24724
+ if (entry.isDirectory())
24725
+ walk(full);
24726
+ else if (entry.isFile() && entry.name.endsWith(".ts"))
24727
+ allPages.push(full);
24728
+ }
24729
+ };
24730
+ try {
24731
+ walk(angularPagesPath);
24732
+ } catch {}
24733
+ return allPages;
24734
+ })() : initialPageEntries;
24690
24735
  const tierStart = performance.now();
24691
24736
  const verdict = await decideAngularTier(state, angularDir);
24692
24737
  const tierMs = (performance.now() - tierStart).toFixed(0);
@@ -35419,5 +35464,5 @@ export {
35419
35464
  ANGULAR_INIT_TIMEOUT_MS
35420
35465
  };
35421
35466
 
35422
- //# debugId=63243B5701EACFA064756E2164756E21
35467
+ //# debugId=BC09861E4889D03064756E2164756E21
35423
35468
  //# sourceMappingURL=index.js.map