@stacksjs/stx 0.2.28 → 0.2.30
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/cli.js +517 -514
- package/dist/index.d.ts +3 -0
- package/dist/index.js +505 -502
- package/dist/site-builder/index.d.ts +2 -0
- package/dist/site-builder/router.d.ts +10 -0
- package/dist/site-builder/types.d.ts +12 -0
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ export type {
|
|
|
2
2
|
BuildOptions,
|
|
3
3
|
PageMeta,
|
|
4
4
|
SiteConfig,
|
|
5
|
+
SiteRouterOptions,
|
|
5
6
|
SiteSeo,
|
|
6
7
|
SiteSocial,
|
|
7
8
|
} from './types';
|
|
@@ -9,3 +10,4 @@ export { buildStaticSite, defineSiteConfig, type BuildResult } from './build';
|
|
|
9
10
|
export { injectSeo } from './seo';
|
|
10
11
|
export { generateSitemap, type SitemapEntry } from './sitemap';
|
|
11
12
|
export { generateRobots } from './robots';
|
|
13
|
+
export { injectRouterScript, type RouterOptions } from './router';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SiteRouterOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Inject the stx SPA router into HTML. The script is appended just
|
|
4
|
+
* before `</body>` (or at the end of the document if there is no body
|
|
5
|
+
* close). Configuration from `options` is exposed as
|
|
6
|
+
* `window.__stxRouterConfig` ahead of the runtime so the runtime picks
|
|
7
|
+
* it up on init.
|
|
8
|
+
*/
|
|
9
|
+
export declare function injectRouterScript(html: string, options?: RouterOptions): Promise<string>;
|
|
10
|
+
export type RouterOptions = SiteRouterOptions;
|
|
@@ -28,6 +28,8 @@ export declare interface SiteConfig {
|
|
|
28
28
|
sitemap?: boolean
|
|
29
29
|
robots?: boolean | 'allow' | 'disallow' | string
|
|
30
30
|
pages?: Record<string, PageMeta>
|
|
31
|
+
spa?: boolean
|
|
32
|
+
router?: SiteRouterOptions
|
|
31
33
|
}
|
|
32
34
|
export declare interface PageMeta {
|
|
33
35
|
title?: string
|
|
@@ -40,3 +42,13 @@ export declare interface PageMeta {
|
|
|
40
42
|
export declare interface BuildOptions extends SiteConfig {
|
|
41
43
|
noClean?: boolean
|
|
42
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* SPA router options (subset — see RouterOptions in router.ts).
|
|
47
|
+
* Inlined to avoid a circular import in this types file.
|
|
48
|
+
*/
|
|
49
|
+
export declare interface SiteRouterOptions {
|
|
50
|
+
color?: string
|
|
51
|
+
progress?: boolean
|
|
52
|
+
prefetch?: boolean
|
|
53
|
+
cache?: boolean
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.30",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@stacksjs/desktop": "0.2.27",
|
|
120
120
|
"@stacksjs/sanitizer": "0.2.27",
|
|
121
121
|
"@stacksjs/ts-craft": "^0.0.2",
|
|
122
|
-
"bun-plugin-stx": "0.2.
|
|
122
|
+
"bun-plugin-stx": "0.2.29",
|
|
123
123
|
"bunfig": "^0.15.6",
|
|
124
124
|
"stx-router": "0.2.27",
|
|
125
125
|
"ts-broadcasting": "^0.0.4",
|