@stacksjs/stx 0.2.26 → 0.2.28

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.
@@ -0,0 +1,18 @@
1
+ import type { BuildOptions, SiteConfig } from './types';
2
+ /**
3
+ * Build a static stx site end-to-end:
4
+ * 1. Bundle all pages with bun-plugin-stx
5
+ * 2. Inject Crosswind CSS into each HTML file
6
+ * 3. Replace stx default SEO tags with site-specific ones
7
+ * 4. Drop the empty bundle chunks bun-plugin-stx leaves behind
8
+ * 5. Copy public/ assets verbatim
9
+ * 6. Synthesize 404.html (uses pages/404.stx if present, else clones index)
10
+ * 7. Generate sitemap.xml and robots.txt
11
+ */
12
+ export declare function buildStaticSite(options: BuildOptions): Promise<BuildResult>;
13
+ export declare function defineSiteConfig<T extends SiteConfig>(config: T): T;
14
+ export declare interface BuildResult {
15
+ outDir: string
16
+ pages: string[]
17
+ durationMs: number
18
+ }
@@ -0,0 +1,11 @@
1
+ export type {
2
+ BuildOptions,
3
+ PageMeta,
4
+ SiteConfig,
5
+ SiteSeo,
6
+ SiteSocial,
7
+ } from './types';
8
+ export { buildStaticSite, defineSiteConfig, type BuildResult } from './build';
9
+ export { injectSeo } from './seo';
10
+ export { generateSitemap, type SitemapEntry } from './sitemap';
11
+ export { generateRobots } from './robots';
@@ -0,0 +1,2 @@
1
+ import type { SiteConfig } from './types';
2
+ export declare function generateRobots(site: SiteConfig): string | null;
@@ -0,0 +1,8 @@
1
+ import type { PageMeta, SiteConfig } from './types';
2
+ /**
3
+ * Replace stx's auto-injected default SEO block (which says "stx Project")
4
+ * with site-specific tags. Looks for the marker comment stx inserts and
5
+ * swaps the wrapped meta tags. If the block isn't found, prepends the
6
+ * tags after <head>.
7
+ */
8
+ export declare function injectSeo(html: string, site: SiteConfig, page?: PageMeta, pagePath?: string): string;
@@ -0,0 +1,10 @@
1
+ import type { PageMeta, SiteConfig } from './types';
2
+ /**
3
+ * Generate sitemap.xml content from a list of built pages.
4
+ * Pages with `sitemap: false` in their config are excluded.
5
+ */
6
+ export declare function generateSitemap(site: SiteConfig, entries: SitemapEntry[]): string;
7
+ export declare interface SitemapEntry {
8
+ path: string
9
+ page?: PageMeta
10
+ }
@@ -0,0 +1,42 @@
1
+ export declare interface SiteSeo {
2
+ title?: string
3
+ description?: string
4
+ siteName?: string
5
+ image?: string
6
+ twitter?: string
7
+ locale?: string
8
+ type?: string
9
+ favicon?: string
10
+ }
11
+ export declare interface SiteSocial {
12
+ twitter?: string
13
+ instagram?: string
14
+ youtube?: string
15
+ github?: string
16
+ linkedin?: string
17
+ [k: string]: string | undefined
18
+ }
19
+ export declare interface SiteConfig {
20
+ name: string
21
+ url: string
22
+ description?: string
23
+ social?: SiteSocial
24
+ seo?: SiteSeo
25
+ pagesDir?: string
26
+ publicDir?: string
27
+ outDir?: string
28
+ sitemap?: boolean
29
+ robots?: boolean | 'allow' | 'disallow' | string
30
+ pages?: Record<string, PageMeta>
31
+ }
32
+ export declare interface PageMeta {
33
+ title?: string
34
+ description?: string
35
+ image?: string
36
+ sitemap?: boolean
37
+ priority?: number
38
+ changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'
39
+ }
40
+ export declare interface BuildOptions extends SiteConfig {
41
+ noClean?: boolean
42
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.26",
4
+ "version": "0.2.28",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -116,12 +116,12 @@
116
116
  "dependencies": {
117
117
  "@cwcss/crosswind": "^0.2.0",
118
118
  "@stacksjs/clapp": "^0.2.0",
119
- "@stacksjs/desktop": "0.2.26",
120
- "@stacksjs/sanitizer": "0.2.26",
119
+ "@stacksjs/desktop": "0.2.27",
120
+ "@stacksjs/sanitizer": "0.2.27",
121
121
  "@stacksjs/ts-craft": "^0.0.2",
122
- "bun-plugin-stx": "0.2.26",
122
+ "bun-plugin-stx": "0.2.27",
123
123
  "bunfig": "^0.15.6",
124
- "stx-router": "0.2.26",
124
+ "stx-router": "0.2.27",
125
125
  "ts-broadcasting": "^0.0.4",
126
126
  "ts-syntax-highlighter": "^0.2.1"
127
127
  }