@absolutejs/absolute 0.19.0-beta.1019 → 0.19.0-beta.1020

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/build.js CHANGED
@@ -14992,9 +14992,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
14992
14992
  const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
14993
14993
  const providersHashInput = providersInjection ? (() => {
14994
14994
  let providersSourceContent = "";
14995
- try {
14996
- providersSourceContent = readFileSync19(providersInjection.appProvidersSource, "utf-8");
14997
- } catch {}
14995
+ if (providersInjection.appProvidersSource) {
14996
+ try {
14997
+ providersSourceContent = readFileSync19(providersInjection.appProvidersSource, "utf-8");
14998
+ } catch {}
14999
+ }
14998
15000
  return JSON.stringify({
14999
15001
  basePath: pageInjectionForHash?.basePath ?? null,
15000
15002
  hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
@@ -15031,20 +15033,22 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
15031
15033
  const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
15032
15034
  rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
15033
15035
  if (providersInjection && pageInjection) {
15034
- const compiledAppProvidersPath = (() => {
15035
- const angularDirAbs = resolve21(outRoot);
15036
- const appSourceAbs = resolve21(providersInjection.appProvidersSource);
15037
- const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
15038
- return join28(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
15039
- })();
15040
- const appProvidersSpec = (() => {
15041
- const rel = relative11(dirname14(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
15042
- return rel.startsWith(".") ? rel : `./${rel}`;
15043
- })();
15044
- const importLines = [
15045
- `import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`
15046
- ];
15047
- const fragments = ["...__abs_globalProviders"];
15036
+ const importLines = [];
15037
+ const fragments = [];
15038
+ if (providersInjection.appProvidersSource) {
15039
+ const compiledAppProvidersPath = (() => {
15040
+ const angularDirAbs = resolve21(outRoot);
15041
+ const appSourceAbs = resolve21(providersInjection.appProvidersSource);
15042
+ const rel = relative11(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
15043
+ return join28(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
15044
+ })();
15045
+ const appProvidersSpec = (() => {
15046
+ const rel = relative11(dirname14(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
15047
+ return rel.startsWith(".") ? rel : `./${rel}`;
15048
+ })();
15049
+ importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
15050
+ fragments.push("...__abs_globalProviders");
15051
+ }
15048
15052
  if (pageInjection.hasRoutes) {
15049
15053
  importLines.push(`import { provideRouter as __abs_provideRouter, withComponentInputBinding as __abs_withComponentInputBinding, withViewTransitions as __abs_withViewTransitions } from "@angular/router";`);
15050
15054
  fragments.push("__abs_provideRouter(routes, __abs_withComponentInputBinding(), __abs_withViewTransitions())");
@@ -15053,13 +15057,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
15053
15057
  importLines.push(`import { APP_BASE_HREF as __abs_APP_BASE_HREF } from "@angular/common";`);
15054
15058
  fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
15055
15059
  }
15056
- rewritten += `
15060
+ if (fragments.length > 0) {
15061
+ rewritten += `
15057
15062
  /* __ABS_PROVIDERS_INJECTION_START */
15058
15063
  ${importLines.join(`
15059
15064
  `)}
15060
15065
  export const providers = [${fragments.join(", ")}];
15061
15066
  /* __ABS_PROVIDERS_INJECTION_END */
15062
15067
  `;
15068
+ }
15063
15069
  }
15064
15070
  await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
15065
15071
  const relativePath = relative11(indexesDir, rawServerFile).replace(/\\/g, "/");
@@ -20133,34 +20139,24 @@ ${content.slice(firstUseIdx)}`;
20133
20139
  const { parseAngularProvidersImport: parseAngularProvidersImport2 } = await Promise.resolve().then(() => (init_parseAngularConfigImports(), exports_parseAngularConfigImports));
20134
20140
  const scanResult = runAngularHandlerScan2(projectRoot, angularDir);
20135
20141
  const providersImport = parseAngularProvidersImport2(projectRoot);
20136
- if (providersImport) {
20137
- angularAppProvidersSource = providersImport.absolutePath;
20138
- const pagesByFile = new Map;
20139
- const basePathByKey = new Map;
20140
- for (const call of scanResult.calls) {
20141
- basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
20142
- }
20143
- for (const route of scanResult.pageRoutes) {
20144
- const basePath = basePathByKey.get(route.manifestKey) ?? null;
20145
- const normalizedBase = basePath === "/" ? null : basePath;
20146
- pagesByFile.set(route.pageFile, {
20147
- basePath: normalizedBase,
20148
- hasRoutes: route.hasRoutes
20149
- });
20150
- }
20151
- for (const route of scanResult.pageRoutes) {
20152
- if (pagesByFile.has(route.pageFile))
20153
- continue;
20154
- pagesByFile.set(route.pageFile, {
20155
- basePath: null,
20156
- hasRoutes: route.hasRoutes
20157
- });
20158
- }
20159
- angularProvidersInjection = {
20160
- appProvidersSource: providersImport.absolutePath,
20161
- pagesByFile
20162
- };
20142
+ angularAppProvidersSource = providersImport?.absolutePath;
20143
+ const pagesByFile = new Map;
20144
+ const basePathByKey = new Map;
20145
+ for (const call of scanResult.calls) {
20146
+ basePathByKey.set(call.manifestKey, call.mountPath?.endsWith("/*") ? call.mountPath.slice(0, -1) : null);
20147
+ }
20148
+ for (const route of scanResult.pageRoutes) {
20149
+ const basePath = basePathByKey.get(route.manifestKey) ?? null;
20150
+ const normalizedBase = basePath === "/" ? null : basePath;
20151
+ pagesByFile.set(route.pageFile, {
20152
+ basePath: normalizedBase,
20153
+ hasRoutes: route.hasRoutes
20154
+ });
20163
20155
  }
20156
+ angularProvidersInjection = {
20157
+ appProvidersSource: providersImport?.absolutePath ?? null,
20158
+ pagesByFile
20159
+ };
20164
20160
  });
20165
20161
  }
20166
20162
  const [
@@ -24967,7 +24963,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
24967
24963
  const projectRoot = process.cwd();
24968
24964
  const resolvedAngularDir = resolve40(angularDir);
24969
24965
  const providersImport = parseAngularProvidersImport2(projectRoot);
24970
- const providersInjection = providersImport ? (() => {
24966
+ const providersInjection = (() => {
24971
24967
  const scan = runAngularHandlerScan2(projectRoot, resolvedAngularDir);
24972
24968
  const basePathByKey = new Map;
24973
24969
  for (const call of scan.calls) {
@@ -24982,10 +24978,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
24982
24978
  });
24983
24979
  }
24984
24980
  return {
24985
- appProvidersSource: providersImport.absolutePath,
24981
+ appProvidersSource: providersImport?.absolutePath ?? null,
24986
24982
  pagesByFile
24987
24983
  };
24988
- })() : undefined;
24984
+ })();
24989
24985
  const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config), providersInjection);
24990
24986
  (async () => {
24991
24987
  try {
@@ -27162,5 +27158,5 @@ export {
27162
27158
  build
27163
27159
  };
27164
27160
 
27165
- //# debugId=2C1DEED81DF0B20B64756E2164756E21
27161
+ //# debugId=A8397E1AEC19B09664756E2164756E21
27166
27162
  //# sourceMappingURL=build.js.map