@absolutejs/absolute 0.19.0-beta.953 → 0.19.0-beta.954

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.
@@ -4,7 +4,6 @@ export { ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER, buildAbsoluteHttpTransferCach
4
4
  export { createDeterministicRandom, DETERMINISTIC_NOW, DETERMINISTIC_RANDOM, DETERMINISTIC_SEED, provideDeterministicEnv } from './deterministicEnv';
5
5
  export { handleAngularPageRequest } from './pageHandler';
6
6
  export { defineAngularPage } from './page';
7
- export { __abs_provideRouter } from './internal/captureProvideRouter';
8
7
  export { preserveAcrossHmr } from './preserveAcrossHmr';
9
8
  export { withPendingTask } from './pendingTask';
10
9
  export { createTypedIsland } from './createIsland';
@@ -0,0 +1,26 @@
1
+ export type AngularSpaRoute = {
2
+ /** Path segment as declared in the Angular `Routes` config — already
3
+ * stripped of any leading/trailing slashes. */
4
+ path: string;
5
+ /** True when the segment contains `:param`, `*`, or `**`. */
6
+ dynamic: boolean;
7
+ /** True when the route is a `redirectTo` — sitemap should skip. */
8
+ redirected: boolean;
9
+ /** True when the route has `data: { sitemap: 'exclude' }`. */
10
+ sitemapExcluded: boolean;
11
+ };
12
+ export type AngularSpaPage = {
13
+ /** Absolute path of the source file the routes were read from. */
14
+ sourceFile: string;
15
+ /** `APP_BASE_HREF` useValue — the mount path the page expects to be
16
+ * served at (e.g. `'/portal/'`). */
17
+ baseHref: string;
18
+ /** Leaf routes extracted from the page's `Routes` array. */
19
+ routes: AngularSpaRoute[];
20
+ };
21
+ /** Statically scan an Angular page-source directory for SPA hosts —
22
+ * files that both import `APP_BASE_HREF`/`provideRouter` and declare
23
+ * an `APP_BASE_HREF` provider plus a literal `Routes` array. Returns
24
+ * one entry per host with the mount path and leaf routes. Does not
25
+ * load or execute user code. */
26
+ export declare const analyzeAngularSpaRoutes: (angularDirectory: string) => Promise<AngularSpaPage[]>;
@@ -4,9 +4,8 @@ type AppRoute = {
4
4
  path: string;
5
5
  handler?: unknown;
6
6
  };
7
- type AppLike = {
8
- routes: AppRoute[];
9
- handle: (request: Request) => Promise<Response>;
7
+ export type SitemapPipelineConfig = {
8
+ angularDirectory?: string;
10
9
  };
11
- export declare const generateSitemap: (app: AppLike, serverUrl: string, outDir: string, config?: SitemapConfig) => Promise<void>;
10
+ export declare const generateSitemap: (routes: AppRoute[], serverUrl: string, outDir: string, config?: SitemapConfig, pipelineConfig?: SitemapPipelineConfig) => Promise<void>;
12
11
  export {};
package/package.json CHANGED
@@ -401,5 +401,5 @@
401
401
  ]
402
402
  }
403
403
  },
404
- "version": "0.19.0-beta.953"
404
+ "version": "0.19.0-beta.954"
405
405
  }
@@ -1,6 +0,0 @@
1
- import type { SpaRouteEntry } from '../utils/spaRouteEnumeration';
2
- /** Reads the `Routes` arrays captured for any `provideRouter(...)` call
3
- * in `pageModule.providers` (compile-time rewrite records them) and
4
- * walks them, eagerly resolving `loadChildren`. Returns one entry per
5
- * leaf, with paths relative to the page's mount point. */
6
- export declare const enumerateAngularSpaRoutes: (pageModule: unknown) => Promise<SpaRouteEntry[]>;
@@ -1,11 +0,0 @@
1
- import { provideRouter, type Routes } from '@angular/router';
2
- /** Runtime shim installed by AbsoluteJS's compile-time rewrite. User
3
- * code in Angular pages calls `provideRouter(routes, ...features)`
4
- * as usual; the compile pipeline rewrites those call sites to call
5
- * this wrapper instead, which delegates to the real `provideRouter`
6
- * and records the route table for sitemap enumeration. */
7
- export declare const __abs_provideRouter: (routes: Routes, ...features: Parameters<typeof provideRouter> extends [Routes, ...infer F] ? F : unknown[]) => unknown;
8
- /** Look up the `Routes` array captured for a given `EnvironmentProviders`
9
- * entry from `provideRouter`. Returns `undefined` for any other provider
10
- * shape. */
11
- export declare const getRoutesForProviders: (providers: unknown) => Routes | undefined;
@@ -1,5 +0,0 @@
1
- /** Returns the source with `provideRouter(...)` calls rewritten to use
2
- * AbsoluteJS's capturing shim. Idempotent: returns the source unchanged
3
- * when no `@angular/router` import is present or when the shim has
4
- * already been injected. */
5
- export declare const rewriteAngularProvideRouter: (source: string) => string;
@@ -1,23 +0,0 @@
1
- export type SpaRouteSitemap = 'exclude' | 'include' | {
2
- priority?: number;
3
- changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
4
- lastmod?: string;
5
- };
6
- export type SpaRouteEntry = {
7
- /** Path relative to the page's mount point (no leading slash needed). */
8
- path: string;
9
- /** True when any segment is `:param`, `*`, or `**`. */
10
- dynamic?: boolean;
11
- /** Optional sitemap metadata read off `Route.data.sitemap`. */
12
- sitemap?: SpaRouteSitemap;
13
- };
14
- /** True when the current async context is collecting SPA routes. Framework
15
- * page handlers should short-circuit their SSR pipeline when this is set
16
- * and instead call `recordSpaRoutes` with the page's enumerated routes. */
17
- export declare const isCollectingSpaRoutes: () => boolean;
18
- /** Push enumerated routes into the active collection. No-op when called
19
- * outside a `collectSpaRoutes` scope. */
20
- export declare const recordSpaRoutes: (entries: SpaRouteEntry[]) => void;
21
- /** Run `task` with an active SPA-route collection scope and return whatever
22
- * routes were recorded inside it. */
23
- export declare const collectSpaRoutes: (task: () => Promise<unknown>) => Promise<SpaRouteEntry[]>;