@absolutejs/absolute 0.19.0-beta.980 → 0.19.0-beta.982

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.
@@ -4402,7 +4402,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4402
4402
  }
4403
4403
  }
4404
4404
  return allOutputs;
4405
- }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
4405
+ }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors, providersInjection) => {
4406
4406
  const compiledParent = getFrameworkGeneratedDir("angular");
4407
4407
  if (entryPoints.length === 0) {
4408
4408
  const emptyPaths = [];
@@ -4517,25 +4517,40 @@ export default ${componentClassName};
4517
4517
  export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4518
4518
  `;
4519
4519
  }
4520
- const providersServerPath = join8(compiledParent, "providers", `${toPascal(fileBase)}.providers.js`);
4521
- if (existsSync5(providersServerPath)) {
4522
- const rel = relative4(dirname4(rawServerFile), providersServerPath).replace(/\\/g, "/");
4523
- const specifier = rel.startsWith(".") ? rel : `./${rel}`;
4520
+ const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
4521
+ if (providersInjection && pageInjection) {
4522
+ const compiledAppProvidersPath = (() => {
4523
+ const angularDirAbs = resolve6(outRoot);
4524
+ const appSourceAbs = resolve6(providersInjection.appProvidersSource);
4525
+ const rel = relative4(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
4526
+ return join8(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
4527
+ })();
4528
+ const appProvidersSpec = (() => {
4529
+ const rel = relative4(dirname4(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
4530
+ return rel.startsWith(".") ? rel : `./${rel}`;
4531
+ })();
4532
+ const importLines = [
4533
+ `import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`
4534
+ ];
4535
+ const fragments = ["...__abs_globalProviders"];
4536
+ if (pageInjection.hasRoutes) {
4537
+ importLines.push(`import { provideRouter as __abs_provideRouter, withComponentInputBinding as __abs_withComponentInputBinding, withViewTransitions as __abs_withViewTransitions } from "@angular/router";`);
4538
+ fragments.push("__abs_provideRouter(routes, __abs_withComponentInputBinding(), __abs_withViewTransitions())");
4539
+ }
4540
+ if (pageInjection.basePath !== null) {
4541
+ importLines.push(`import { APP_BASE_HREF as __abs_APP_BASE_HREF } from "@angular/common";`);
4542
+ fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
4543
+ }
4524
4544
  rewritten += `
4525
- export { providers } from "${specifier}";
4545
+ ${importLines.join(`
4546
+ `)}
4547
+ export const providers = [${fragments.join(", ")}];
4526
4548
  `;
4527
4549
  }
4528
4550
  await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
4529
4551
  const relativePath = relative4(indexesDir, rawServerFile).replace(/\\/g, "/");
4530
4552
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
4531
- const manifestKeyForProviders = toPascal(fileBase);
4532
- const providersServerFilePath = join8(compiledParent, "providers", `${manifestKeyForProviders}.providers.js`);
4533
- const hasGeneratedProviders = existsSync5(providersServerFilePath);
4534
- const providersImportPath = hasGeneratedProviders ? (() => {
4535
- const rel = relative4(indexesDir, providersServerFilePath.replace(/\.js$/, "")).replace(/\\/g, "/");
4536
- return rel.startsWith(".") ? rel : `./${rel}`;
4537
- })() : null;
4538
- const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
4553
+ const generatedProvidersImport = "var generatedProviders = null;";
4539
4554
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
4540
4555
  import "${hmrClientPath}";
4541
4556
  ` : "";
@@ -5973,5 +5988,5 @@ export {
5973
5988
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
5974
5989
  };
5975
5990
 
5976
- //# debugId=CD826AECD43C115964756E2164756E21
5991
+ //# debugId=01433CBA29C54C4364756E2164756E21
5977
5992
  //# sourceMappingURL=server.js.map