@absolutejs/absolute 0.19.0-beta.954 → 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.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/index.js +625 -46
- package/dist/index.js.map +9 -6
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +2 -21
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/utils/generateSitemap.d.ts +3 -0
- package/dist/src/utils/spaRouteTypes.d.ts +25 -0
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
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
|
-
};
|
|
1
|
+
import type { SpaHost } from '../utils/spaRouteTypes';
|
|
21
2
|
/** Statically scan an Angular page-source directory for SPA hosts —
|
|
22
3
|
* files that both import `APP_BASE_HREF`/`provideRouter` and declare
|
|
23
4
|
* an `APP_BASE_HREF` provider plus a literal `Routes` array. Returns
|
|
24
5
|
* one entry per host with the mount path and leaf routes. Does not
|
|
25
6
|
* load or execute user code. */
|
|
26
|
-
export declare const analyzeAngularSpaRoutes: (angularDirectory: string) => Promise<
|
|
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[]>;
|
|
@@ -6,6 +6,9 @@ type AppRoute = {
|
|
|
6
6
|
};
|
|
7
7
|
export type SitemapPipelineConfig = {
|
|
8
8
|
angularDirectory?: string;
|
|
9
|
+
reactDirectory?: string;
|
|
10
|
+
svelteDirectory?: string;
|
|
11
|
+
vueDirectory?: string;
|
|
9
12
|
};
|
|
10
13
|
export declare const generateSitemap: (routes: AppRoute[], serverUrl: string, outDir: string, config?: SitemapConfig, pipelineConfig?: SitemapPipelineConfig) => Promise<void>;
|
|
11
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