@absolutejs/absolute 0.19.0-beta.952 → 0.19.0-beta.953
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/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14258 -7348
- package/dist/angular/index.js.map +19 -9
- package/dist/angular/server.js +18357 -2511
- package/dist/angular/server.js.map +238 -5
- package/dist/build.js +26 -4
- package/dist/build.js.map +5 -4
- package/dist/index.js +129 -27
- package/dist/index.js.map +8 -6
- package/dist/src/angular/enumerateSpaRoutes.d.ts +6 -0
- package/dist/src/angular/index.d.ts +1 -0
- package/dist/src/angular/internal/captureProvideRouter.d.ts +11 -0
- package/dist/src/build/rewriteProvideRouter.d.ts +5 -0
- package/dist/src/utils/generateSitemap.d.ts +8 -2
- package/dist/src/utils/spaRouteEnumeration.d.ts +23 -0
- package/dist/types/angular.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
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[]>;
|
|
@@ -4,6 +4,7 @@ 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';
|
|
7
8
|
export { preserveAcrossHmr } from './preserveAcrossHmr';
|
|
8
9
|
export { withPendingTask } from './pendingTask';
|
|
9
10
|
export { createTypedIsland } from './createIsland';
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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,6 +1,12 @@
|
|
|
1
1
|
import type { SitemapConfig } from '../../types/sitemap';
|
|
2
|
-
|
|
2
|
+
type AppRoute = {
|
|
3
3
|
method: string;
|
|
4
4
|
path: string;
|
|
5
5
|
handler?: unknown;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
type AppLike = {
|
|
8
|
+
routes: AppRoute[];
|
|
9
|
+
handle: (request: Request) => Promise<Response>;
|
|
10
|
+
};
|
|
11
|
+
export declare const generateSitemap: (app: AppLike, serverUrl: string, outDir: string, config?: SitemapConfig) => Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
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[]>;
|
package/dist/types/angular.d.ts
CHANGED
|
@@ -18,6 +18,15 @@ export type AngularDeps = {
|
|
|
18
18
|
};
|
|
19
19
|
export type AngularPageDefinition<Props extends Record<string, unknown> = Record<never, never>> = {
|
|
20
20
|
component: import('@angular/core').Type<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Optional SPA route configuration for this page. When provided,
|
|
23
|
+
* the sitemap pipeline walks it (eagerly resolving `loadChildren`)
|
|
24
|
+
* and emits one entry per non-dynamic leaf, prefixed by the
|
|
25
|
+
* Elysia mount path. Pass the same `Routes` array given to
|
|
26
|
+
* `provideRouter(...)` so the single source of truth stays in
|
|
27
|
+
* user code.
|
|
28
|
+
*/
|
|
29
|
+
routes?: import('@angular/router').Routes;
|
|
21
30
|
/** Type-only marker used by handleAngularPageRequest to infer route props. */
|
|
22
31
|
__absoluteAngularPageProps?: Props;
|
|
23
32
|
};
|
package/package.json
CHANGED