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

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,7 @@
1
+ import type { SpaHost } from '../utils/spaRouteTypes';
2
+ /** Statically scan an Angular page-source directory for SPA hosts —
3
+ * files that both import `APP_BASE_HREF`/`provideRouter` and declare
4
+ * an `APP_BASE_HREF` provider plus a literal `Routes` array. Returns
5
+ * one entry per host with the mount path and leaf routes. Does not
6
+ * load or execute user code. */
7
+ export declare const analyzeAngularSpaRoutes: (angularDirectory: string) => Promise<SpaHost[]>;
@@ -0,0 +1,7 @@
1
+ import type { SpaHost } from '../utils/spaRouteTypes';
2
+ /** Statically scan a React page-source directory for SPA hosts —
3
+ * files that call `createBrowserRouter(routes, { basename })` from
4
+ * `react-router-dom`. The first argument supplies the routes (inline
5
+ * array or identifier reference), the second arg's `basename`
6
+ * supplies the mount path. */
7
+ export declare const analyzeReactSpaRoutes: (reactDirectory: string) => Promise<SpaHost[]>;
@@ -0,0 +1,7 @@
1
+ import type { SpaHost } from '../utils/spaRouteTypes';
2
+ /** Statically scan a Svelte page-source directory for SPA hosts —
3
+ * `.svelte` files that contain a `<Router basepath="...">` block from
4
+ * AbsoluteJS's Svelte router with one or more `<Route path="...">`
5
+ * children. Regex-based since `.svelte` files aren't directly TS-AST
6
+ * parseable; covers the common case where the markup is literal. */
7
+ export declare const analyzeSvelteSpaRoutes: (svelteDirectory: string) => Promise<SpaHost[]>;
@@ -4,9 +4,11 @@ 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;
9
+ reactDirectory?: string;
10
+ svelteDirectory?: string;
11
+ vueDirectory?: string;
10
12
  };
11
- export declare const generateSitemap: (app: AppLike, serverUrl: string, outDir: string, config?: SitemapConfig) => Promise<void>;
13
+ export declare const generateSitemap: (routes: AppRoute[], serverUrl: string, outDir: string, config?: SitemapConfig, pipelineConfig?: SitemapPipelineConfig) => Promise<void>;
12
14
  export {};
@@ -0,0 +1,25 @@
1
+ export type SpaRoute = {
2
+ /** Full joined path within the SPA (no mount-path prefix). */
3
+ path: string;
4
+ /** `true` when any segment is `:param`, `*`, or `**`. */
5
+ dynamic: boolean;
6
+ /** `true` when this route is purely a `redirectTo` — sitemap skips. */
7
+ redirected: boolean;
8
+ /** `true` when an explicit opt-out marker was found
9
+ * (`Route.data.sitemap === 'exclude'` in Angular, etc.). */
10
+ sitemapExcluded: boolean;
11
+ };
12
+ export type SpaHost = {
13
+ /** Absolute path of the source file the routes were read from. */
14
+ sourceFile: string;
15
+ /** Mount path the page expects to be served at — e.g. `'/portal/'`,
16
+ * `'/admin/'`. Frameworks express this differently:
17
+ * - Angular: `{ provide: APP_BASE_HREF, useValue: '...' }`
18
+ * - React: `<BrowserRouter basename="...">` or
19
+ * `createBrowserRouter(routes, { basename: '...' })`
20
+ * - Vue: `createRouter({ history: createWebHistory('...') })`
21
+ * - Svelte: `<Router basepath="...">` */
22
+ baseHref: string;
23
+ /** Leaf routes extracted from the page's router config. */
24
+ routes: SpaRoute[];
25
+ };
@@ -0,0 +1,7 @@
1
+ import type { SpaHost } from '../utils/spaRouteTypes';
2
+ /** Statically scan a Vue page-source directory for SPA hosts — files
3
+ * that call `createRouter({ history: createWebHistory('/...'), routes })`
4
+ * from `vue-router`. The `createWebHistory` argument supplies the mount
5
+ * path; the `routes` option supplies the route table (inline array or
6
+ * identifier reference). Scans `.vue` SFC script blocks too. */
7
+ export declare const analyzeVueSpaRoutes: (vueDirectory: string) => Promise<SpaHost[]>;
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.955"
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[]>;