@marktiderman/genesis-sites 0.4.0 → 0.5.0

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.
Files changed (67) hide show
  1. package/README.md +155 -18
  2. package/SKILL.md +46 -0
  3. package/dist/assets/fonts/LICENSES.txt +1469 -0
  4. package/dist/assets/form-island.c521219f1b.js +51 -0
  5. package/dist/assets/{islands.a521d323d9.js → islands.f275dc88cb.js} +1 -1
  6. package/dist/assets/sites-forms.490d10e01b.css +10 -0
  7. package/dist/assets/sites-forms.css +1 -1
  8. package/dist/assets/sites.1a40b828a5.css +2 -0
  9. package/dist/assets/sites.css +1 -1
  10. package/dist/assets.generated-P7NPIZHO.js +3 -0
  11. package/dist/{assets.generated-WCOFU56J.js.map → assets.generated-P7NPIZHO.js.map} +1 -1
  12. package/dist/{chunk-P5MR34QQ.js → chunk-3XCKSU4Z.js} +143 -85
  13. package/dist/chunk-3XCKSU4Z.js.map +1 -0
  14. package/dist/chunk-BJ6NXVZI.js +19 -0
  15. package/dist/chunk-BJ6NXVZI.js.map +1 -0
  16. package/dist/{chunk-3VKTBE7S.js → chunk-MU2Z2C4F.js} +2 -2
  17. package/dist/{chunk-3VKTBE7S.js.map → chunk-MU2Z2C4F.js.map} +1 -1
  18. package/dist/chunk-OFJISW3T.js +3 -0
  19. package/dist/chunk-OFJISW3T.js.map +1 -0
  20. package/dist/{chunk-FBQF2L7O.js → chunk-VLY75P7W.js} +190 -40
  21. package/dist/chunk-VLY75P7W.js.map +1 -0
  22. package/dist/{chunk-KGB6XHPS.js → chunk-VMJ67LCW.js} +97 -28
  23. package/dist/chunk-VMJ67LCW.js.map +1 -0
  24. package/dist/{chunk-KPOX7D4S.js → chunk-XOM334IK.js} +5 -5
  25. package/dist/chunk-XOM334IK.js.map +1 -0
  26. package/dist/{chunk-ZGWGQGT2.js → chunk-YAASBQTJ.js} +35 -22
  27. package/dist/chunk-YAASBQTJ.js.map +1 -0
  28. package/dist/editor.d.ts +5 -3
  29. package/dist/editor.js +14 -10
  30. package/dist/editor.js.map +1 -1
  31. package/dist/fonts.generated-HTXRHNVY.js +4 -0
  32. package/dist/handler-ESFMOYYF.js +10 -0
  33. package/dist/{handler-G35AUOTG.js.map → handler-ESFMOYYF.js.map} +1 -1
  34. package/dist/import.d.ts +26 -62
  35. package/dist/import.js +11 -258
  36. package/dist/import.js.map +1 -1
  37. package/dist/index.d.ts +10 -95
  38. package/dist/index.js +5 -4
  39. package/dist/{registry-HBn1X60x.d.ts → registry-CeSBSfU8.d.ts} +187 -13
  40. package/dist/sections.d.ts +153 -30
  41. package/dist/sections.js +3 -3
  42. package/dist/{store-BXiZeZzH.d.ts → store-CUsfzNmK.d.ts} +42 -119
  43. package/dist/supabase.d.ts +5 -3
  44. package/dist/supabase.js +15 -6
  45. package/dist/supabase.js.map +1 -1
  46. package/dist/templates-DALVa71A.d.ts +92 -0
  47. package/dist/templates.d.ts +78 -0
  48. package/dist/templates.js +146 -0
  49. package/dist/templates.js.map +1 -0
  50. package/dist/theme-B3Vh_b-P.d.ts +136 -0
  51. package/dist/web.d.ts +72 -13
  52. package/dist/web.js +7 -6
  53. package/migrations/tests/0001_genesis_sites.test.sql +4 -4
  54. package/migrations/tests/0002_genesis_sites_posts.test.sql +2 -2
  55. package/package.json +67 -15
  56. package/dist/assets/form-island.ad67ee00c0.js +0 -51
  57. package/dist/assets/sites-forms.e506c7dda2.css +0 -10
  58. package/dist/assets/sites.716b4ac1a5.css +0 -2
  59. package/dist/assets.generated-WCOFU56J.js +0 -3
  60. package/dist/chunk-FBQF2L7O.js.map +0 -1
  61. package/dist/chunk-IZQCYZ3R.js +0 -18
  62. package/dist/chunk-IZQCYZ3R.js.map +0 -1
  63. package/dist/chunk-KGB6XHPS.js.map +0 -1
  64. package/dist/chunk-KPOX7D4S.js.map +0 -1
  65. package/dist/chunk-P5MR34QQ.js.map +0 -1
  66. package/dist/chunk-ZGWGQGT2.js.map +0 -1
  67. package/dist/handler-G35AUOTG.js +0 -9
@@ -0,0 +1,136 @@
1
+ import { DesignSystemChoice, CanonicalBrand, FontInfo, DesignSystem } from '@marktiderman/genesis-design-system';
2
+ import { n as FontChoice, k as BodyFontChoice, g as SiteDoc } from './registry-CeSBSfU8.js';
3
+
4
+ /**
5
+ * A site's theme, from its brand: one `<style>` of CSS variables per site.
6
+ *
7
+ * The brand comes from the host (`BrandSource`) at render time, never copied
8
+ * into the site. A publish checks the brand's colours and records its hash;
9
+ * a page rendered with a different brand (edited since) is served with a
10
+ * short cache and a warning until the site is published again, which checks
11
+ * the new colours and purges the old pages. It
12
+ * may be a full `CanonicalBrand` or the minimal shape a brand screen collects
13
+ * (`SiteBrand`: a name, a primary colour for light and dark, a heading and a
14
+ * body font from a fixed list, a logo, and a design system).
15
+ *
16
+ * The variables are design-system `themeFromBrand(brand).variables` (the
17
+ * brand's scales, `--color-*`, and its design system's `--ds-*` tokens) plus
18
+ * the genesis-ui roles the sections are styled with (`--primary`,
19
+ * `--background`, `--font-display`, ...), so the one shared stylesheet serves
20
+ * every brand and every design system. Swapping the design system changes
21
+ * only these variables, never the HTML.
22
+ *
23
+ * - **With a colour design system** (one with `surfaces`, such as `crisp@1`),
24
+ * the roles come from the OKLCH colour engine, which solves every text
25
+ * pair to pass.
26
+ * - **With `classic@1`** (the default), the roles are today's: the brand's
27
+ * neutrals and surface, with foregrounds picked for contrast (the text on
28
+ * a primary button is whichever of the brand's light or dark text reads
29
+ * better, and the focus ring falls back to the text colour when the
30
+ * primary is too faint on the page).
31
+ */
32
+
33
+ /** The minimal brand: what a brand screen collects. */
34
+ interface SiteBrand {
35
+ name: string;
36
+ colors: {
37
+ /** The primary colour in light mode, as #rrggbb. */
38
+ primary: string;
39
+ /** The primary in dark mode. Default: the light primary, lightened. */
40
+ primaryDark?: string;
41
+ /** One optional supporting colour, as #rrggbb: chips, tags and illustrations, never a band. Used by a colour design system. */
42
+ secondary?: string;
43
+ };
44
+ fonts?: {
45
+ heading?: FontChoice;
46
+ body?: BodyFontChoice;
47
+ };
48
+ /** The logo, shown in the header and footer and named in JSON-LD. */
49
+ logo?: {
50
+ src: string;
51
+ alt?: string;
52
+ };
53
+ /**
54
+ * The design system (`{ id: "crisp@1" }`) and up to three choices: density,
55
+ * corners and motion. Unset: `classic@1`, today's look. An id must be
56
+ * built in or registered (`registerDesignSystem` from genesis-design-system).
57
+ */
58
+ designSystem?: DesignSystemChoice;
59
+ }
60
+ /** What a `BrandSource` may return: the minimal brand, or a full design-system brand (with an optional logo). */
61
+ type BrandInput = SiteBrand | (CanonicalBrand & {
62
+ logo?: {
63
+ src: string;
64
+ alt?: string;
65
+ };
66
+ displayName?: string;
67
+ });
68
+ /** The host's brand, read at render time. */
69
+ interface BrandSource {
70
+ getBrand(siteId: string): Promise<BrandInput | null> | BrandInput | null;
71
+ }
72
+ /** `#abc` / `#aabbcc` → [r, g, b] (0–255). Throws on anything else. */
73
+ declare function parseHex(hex: string): [number, number, number];
74
+ /** WCAG relative luminance. */
75
+ declare function luminance(hex: string): number;
76
+ /** WCAG contrast ratio (1–21) of two colours. */
77
+ declare function contrastRatio(a: string, b: string): number;
78
+ /** Mix a colour toward white (`amount` > 0) or black (< 0), 0–1. */
79
+ declare function mix(hex: string, amount: number): string;
80
+ /** `#4f46e5` → `243 75% 59%`: the HSL triplet genesis-ui's variables hold. */
81
+ declare function hexToHslTriplet(hex: string): string;
82
+ declare function isSiteBrand(brand: BrandInput): brand is SiteBrand;
83
+ /** The minimal brand as a design-system brand (Genesis's neutrals and status colours, the brand's primary and fonts). */
84
+ declare function toCanonicalBrand(brand: BrandInput): CanonicalBrand;
85
+ /** The brand's display name: the minimal brand's `name`, a canonical brand's `displayName` or `name`. */
86
+ declare function brandDisplayName(brand: BrandInput): string;
87
+ interface ThemePair {
88
+ /** What the pair is, for an accessibility issue: "body text on the page". */
89
+ name: string;
90
+ mode: "light" | "dark";
91
+ foreground: string;
92
+ background: string;
93
+ /** The ratio it must reach: 4.5 for text, 3 for the focus ring and other non-text marks. */
94
+ minimum: number;
95
+ /**
96
+ * `error` (default) blocks the publish; `warning` is shown but doesn't. A
97
+ * mark that never carries meaning alone (each one also has text or a shape)
98
+ * warns, so a light brand colour can still publish.
99
+ */
100
+ severity?: "error" | "warning";
101
+ }
102
+ interface SiteTheme {
103
+ light: Record<string, string>;
104
+ dark: Record<string, string>;
105
+ colorScheme: "light" | "dark" | "auto";
106
+ /** The fonts the site uses, to load. */
107
+ fonts: FontInfo[];
108
+ /** The headings' font, when it is one of `FONT_CHOICES`: the page preloads it. */
109
+ headingFont?: FontInfo;
110
+ /** The colour pairs the sections draw, for the contrast check. */
111
+ pairs: ThemePair[];
112
+ /** Hash of the brand and overrides it was made from (recorded on a release). */
113
+ brandHash: string;
114
+ /** The design system it was made with (`classic@1` when the brand names none, or names one that isn't available). */
115
+ designSystem: string;
116
+ }
117
+ /** FNV-1a, 32 bits twice: a short, stable hash for cache keys and release records (not for security). */
118
+ declare function stableHash(value: unknown): string;
119
+ interface SiteThemeOptions {
120
+ /**
121
+ * The design system to use instead of the brand's (a preview of a swap,
122
+ * say). Default: the brand's `designSystem.id`, else `classic@1`.
123
+ */
124
+ designSystem?: DesignSystem | string;
125
+ }
126
+ /**
127
+ * The site's theme: variables for light and dark, the fonts to load, the
128
+ * pairs the contrast check reads, and a hash of what it was made from.
129
+ *
130
+ * @stability Beta
131
+ */
132
+ declare function siteTheme(brand: BrandInput, theme?: Partial<SiteDoc["theme"]>, options?: SiteThemeOptions): SiteTheme;
133
+ /** The site's `<style>` body: the light variables on `:root`, the dark ones by scheme. */
134
+ declare function themeCss(theme: SiteTheme): string;
135
+
136
+ export { type BrandInput as B, type SiteBrand as S, type ThemePair as T, type BrandSource as a, type SiteTheme as b, type SiteThemeOptions as c, brandDisplayName as d, contrastRatio as e, stableHash as f, toCanonicalBrand as g, hexToHslTriplet as h, isSiteBrand as i, luminance as l, mix as m, parseHex as p, siteTheme as s, themeCss as t };
package/dist/web.d.ts CHANGED
@@ -1,9 +1,29 @@
1
- import { F as FormsResolver, U as ReleaseSnapshot, h as ReleasePage, d as ResolvedForm, O as PostsContext } from './registry-HBn1X60x.js';
2
- import { S as SiteStore, f as BrandSource, R as ReservedPaths, g as FontInfo, r as SiteTheme } from './store-BXiZeZzH.js';
1
+ import { ImageUrlBuilder } from '@marktiderman/genesis-media';
2
+ import { F as FormsResolver, U as ReleaseSnapshot, h as ReleasePage, d as ResolvedForm, O as PostsContext } from './registry-CeSBSfU8.js';
3
+ import { S as SiteStore, R as ReservedPaths } from './store-CUsfzNmK.js';
4
+ import { a as BrandSource, b as SiteTheme } from './theme-B3Vh_b-P.js';
3
5
  import * as React from 'react';
4
6
  import 'zod';
5
7
  import '@marktiderman/genesis-design-system';
6
8
 
9
+ /**
10
+ * handleSiteRequest: serve a site from a `Request`, as a `Response`, or say
11
+ * "not mine" (null) so the host app answers instead.
12
+ *
13
+ * A site shares its hostname with the host app. The host resolves the
14
+ * request's Host to a site id itself (this package keeps no hostname table
15
+ * and reads no Host header) and calls this before its own routes:
16
+ *
17
+ * const res = await handleSiteRequest(request, { store, brand, siteId, origin: "https://riverside.example" });
18
+ * if (res) return res;
19
+ * return app(request);
20
+ *
21
+ * Order: reserved paths (null), this package's assets, robots.txt and
22
+ * sitemap.xml, redirects, the trailing-slash redirect, then the page. An
23
+ * unknown path is null (or the site's 404 page, with `unknownPath:
24
+ * "not-found"`). Pages render to HTML with no hydration.
25
+ */
26
+
7
27
  /** Where this package serves its own files, under the site's base path. Reserved for pages. */
8
28
  declare const ASSETS_PREFIX = "/_gs";
9
29
  interface SiteRequestOptions {
@@ -12,7 +32,7 @@ interface SiteRequestOptions {
12
32
  * `getLivePost`); preview needs the draft reads too (`listPosts` and
13
33
  * `getPost` for posts).
14
34
  */
15
- store: Pick<SiteStore, "getLive"> & Partial<Pick<SiteStore, "getDraft" | "listPages" | "getPageDraft" | "listLivePosts" | "getLivePost" | "listPosts" | "getPost">>;
35
+ store: Pick<SiteStore, "getLive"> & Partial<Pick<SiteStore, "getDraft" | "listPages" | "getPageDraft" | "listLivePosts" | "getLivePost" | "listPosts" | "getPost" | "assetOrigin">>;
16
36
  brand: BrandSource;
17
37
  /** The site this request is for, resolved by the host from the Host header (or a path). */
18
38
  siteId: string;
@@ -52,10 +72,27 @@ interface SiteRequestOptions {
52
72
  }) => void;
53
73
  /** An unknown path: `fall-through` (default) returns null; `not-found` serves the site's 404 page. */
54
74
  unknownPath?: "fall-through" | "not-found";
55
- /** Font stylesheets: Google Fonts by default, `false` for none, or a function returning a URL per font. */
56
- fonts?: false | ((font: FontInfo) => string | null);
75
+ /**
76
+ * The site's font files, served by this package under `/_gs/` (default
77
+ * true). `false` loads none: a visitor sees an installed font or the
78
+ * stack's fallback. Fonts never load from a third party.
79
+ */
80
+ fonts?: boolean;
57
81
  /** A Content-Security-Policy header (default true). */
58
82
  csp?: boolean;
83
+ /**
84
+ * Origins a site on `images: "own"` may load images from, besides itself
85
+ * and the store's `assetOrigin`. Pass the same origins as the publish's
86
+ * `assetOrigins`, so what the check allowed the page can load.
87
+ */
88
+ assetOrigins?: readonly string[];
89
+ /**
90
+ * Builds each image's `srcset`, such as genesis-media's
91
+ * `supabaseImageUrl({ url })` for images in Supabase Storage. Default
92
+ * pass-through: every image at its own URL, as before. On `images: "own"`,
93
+ * the URLs it builds must be on an asset origin, or the policy blocks them.
94
+ */
95
+ imageUrl?: ImageUrlBuilder;
59
96
  }
60
97
  /**
61
98
  * Serve a site request, or return null when the request isn't the site's.
@@ -88,6 +125,12 @@ interface SiteAssets {
88
125
  formsCss: string;
89
126
  /** The islands loader. */
90
127
  islands: string;
128
+ /**
129
+ * A font file's URL by its key (`inter-700`, see `fontFileKey`), or null
130
+ * when it isn't served. Without it the page names its fonts but loads no
131
+ * files, so a visitor sees an installed font or the stack's fallback.
132
+ */
133
+ font?: (key: string) => string | null;
91
134
  }
92
135
  interface SiteRendererProps {
93
136
  snapshot: ReleaseSnapshot;
@@ -107,16 +150,29 @@ interface SiteRendererProps {
107
150
  forms?: ReadonlyMap<string, ResolvedForm | null>;
108
151
  /** Asset URLs. */
109
152
  assets: SiteAssets;
110
- /** The stylesheet URL for a font, or null to rely on installed fonts. Default: Google Fonts. */
111
- fontHref?: ((font: FontInfo) => string | null) | false;
112
153
  /**
113
154
  * The blog, when the site has a post page: its path, the posts, the post
114
155
  * this page shows (`page` is then that post on the post page) and the
115
156
  * list's page number.
116
157
  */
117
158
  posts?: PostsContext;
159
+ /** Builds each image's `srcset` (genesis-media). Default pass-through: every image at its own URL. */
160
+ imageUrl?: ImageUrlBuilder;
118
161
  }
119
- declare const googleFontHref: (font: FontInfo) => string | null;
162
+ /**
163
+ * The `@font-face` rules for a theme's fonts, from files this package serves
164
+ * (`font-display: swap`, the latin subset), and the heading font's file to
165
+ * preload. A face with one weight is declared for every weight, so a bold
166
+ * heading draws it as it is instead of a faux bold.
167
+ *
168
+ * @stability Beta
169
+ */
170
+ declare function fontFaces(theme: Pick<SiteTheme, "fonts" | "headingFont">, fontUrl: ((key: string) => string | null) | undefined): {
171
+ css: string;
172
+ preload: string[];
173
+ };
174
+ /** The page's one inline `<style>`: its font faces, then the theme's variables. The Content-Security-Policy pins its hash. */
175
+ declare function pageStyleText(theme: SiteTheme, fontUrl: ((key: string) => string | null) | undefined): string;
120
176
  /** The form slugs a page uses, to resolve before rendering: well-formed slugs of visible form embeds in the page body. */
121
177
  declare function collectFormSlugs(_snapshot: ReleaseSnapshot, page: ReleasePage | null): string[];
122
178
  /**
@@ -124,13 +180,16 @@ declare function collectFormSlugs(_snapshot: ReleaseSnapshot, page: ReleasePage
124
180
  *
125
181
  * @stability Beta
126
182
  */
127
- declare function SiteRenderer({ snapshot, page, theme, origin, basePath, mode, logo, forms, assets, fontHref, posts }: SiteRendererProps): React.JSX.Element;
183
+ declare function SiteRenderer({ snapshot, page, theme, origin, basePath, mode, logo, forms, assets, posts, imageUrl }: SiteRendererProps): React.JSX.Element;
128
184
 
129
185
  declare const ASSET_SIZES: {
130
- readonly css: 39267;
131
- readonly formsCss: 76414;
186
+ readonly css: 43431;
187
+ readonly formsCss: 76796;
132
188
  readonly islands: 3010;
133
- readonly formIsland: 515645;
189
+ readonly formIsland: 521496;
190
+ readonly fonts: 861576;
134
191
  };
192
+ /** Each self-hosted font file's name under the assets prefix, by its key (`inter-700`). */
193
+ declare const FONT_FILES: Readonly<Record<string, string>>;
135
194
 
136
- export { ASSETS_PREFIX, ASSET_SIZES, type SiteAssets, SiteRenderer, type SiteRendererProps, type SiteRequestOptions, collectFormSlugs, googleFontHref, handleSiteRequest, renderSitePageToString };
195
+ export { ASSETS_PREFIX, ASSET_SIZES, FONT_FILES, type SiteAssets, SiteRenderer, type SiteRendererProps, type SiteRequestOptions, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString };
package/dist/web.js CHANGED
@@ -1,9 +1,10 @@
1
- export { ASSETS_PREFIX, SiteRenderer, collectFormSlugs, googleFontHref, handleSiteRequest, renderSitePageToString } from './chunk-KGB6XHPS.js';
2
- import './chunk-P5MR34QQ.js';
1
+ export { ASSETS_PREFIX, SiteRenderer, collectFormSlugs, fontFaces, handleSiteRequest, pageStyleText, renderSitePageToString } from './chunk-VMJ67LCW.js';
2
+ export { ASSET_SIZES, FONT_FILES } from './chunk-BJ6NXVZI.js';
3
+ import './chunk-OFJISW3T.js';
4
+ import './chunk-3XCKSU4Z.js';
3
5
  import './chunk-VZUDRPFG.js';
4
- import './chunk-FBQF2L7O.js';
5
- import './chunk-ZGWGQGT2.js';
6
- import './chunk-3VKTBE7S.js';
7
- export { ASSET_SIZES } from './chunk-IZQCYZ3R.js';
6
+ import './chunk-VLY75P7W.js';
7
+ import './chunk-YAASBQTJ.js';
8
+ import './chunk-MU2Z2C4F.js';
8
9
  //# sourceMappingURL=web.js.map
9
10
  //# sourceMappingURL=web.js.map
@@ -38,8 +38,8 @@ grant execute on function pg_temp.person(text), pg_temp.sign_in(text), pg_temp.a
38
38
  create temp table t (k text primary key, v uuid);
39
39
  grant select on t to anon, authenticated;
40
40
  grant insert on t to authenticated;
41
- insert into t select 'a', genesis_sites.create_site('Riverside Gym', 'riverside-test',
42
- '{"schemaVersion":1,"name":"Riverside Gym","redirects":[]}'::jsonb,
41
+ insert into t select 'a', genesis_sites.create_site('Riverside Works', 'riverside-test',
42
+ '{"schemaVersion":1,"name":"Riverside Works","redirects":[]}'::jsonb,
43
43
  jsonb_build_array(jsonb_build_object('path', '/', 'doc', pg_temp.page('Home')), jsonb_build_object('path', '/about', 'doc', pg_temp.page('About'))));
44
44
  insert into t select 'home', id from genesis_sites.site_pages where site_id = (select v from t where k = 'a') and path = '/';
45
45
  insert into t select 'about', id from genesis_sites.site_pages where site_id = (select v from t where k = 'a') and path = '/about';
@@ -291,7 +291,7 @@ reset role;
291
291
  -- Assets -----------------------------------------------------------------------------
292
292
  select pg_temp.sign_in('e1');
293
293
  select lives_ok(
294
- format('insert into genesis_sites.site_assets (site_id, path, mime, alt) values (%L, %L, %L, %L)', pg_temp.id('a'), 'sites/' || pg_temp.id('a') || '/hero.jpg', 'image/jpeg', 'The gym floor'),
294
+ format('insert into genesis_sites.site_assets (site_id, path, mime, alt) values (%L, %L, %L, %L)', pg_temp.id('a'), 'sites/' || pg_temp.id('a') || '/hero.jpg', 'image/jpeg', 'The studio floor'),
295
295
  'an editor records an upload under sites/<site_id>/'
296
296
  );
297
297
  select throws_ok(
@@ -320,7 +320,7 @@ reset role;
320
320
  select pg_temp.sign_in('e1');
321
321
  -- A redirect can't start on one of the app's paths: it would take over the app's own route.
322
322
  create function pg_temp.site_with_redirect(from_path text) returns jsonb language sql immutable as $$
323
- select jsonb_build_object('schemaVersion', 1, 'name', 'Riverside Gym', 'redirects', jsonb_build_array(jsonb_build_object('from', from_path, 'to', '/', 'status', 301)))
323
+ select jsonb_build_object('schemaVersion', 1, 'name', 'Riverside Works', 'redirects', jsonb_build_array(jsonb_build_object('from', from_path, 'to', '/', 'status', 301)))
324
324
  $$;
325
325
  grant execute on function pg_temp.site_with_redirect(text) to authenticated;
326
326
  select throws_like(
@@ -37,8 +37,8 @@ grant execute on function pg_temp.person(text), pg_temp.sign_in(text), pg_temp.a
37
37
 
38
38
  create temp table t (k text primary key, v uuid);
39
39
  grant select, insert on t to anon, authenticated;
40
- insert into t select 'a', genesis_sites.create_site('Hilltop Fitness', 'hilltop-posts-test',
41
- '{"schemaVersion":1,"name":"Hilltop Fitness","redirects":[]}'::jsonb,
40
+ insert into t select 'a', genesis_sites.create_site('Hilltop Collective', 'hilltop-posts-test',
41
+ '{"schemaVersion":1,"name":"Hilltop Collective","redirects":[]}'::jsonb,
42
42
  jsonb_build_array(jsonb_build_object('path', '/', 'doc', pg_temp.page('Home'))));
43
43
  create function pg_temp.id(k text) returns uuid language sql stable as $$ select v from t where t.k = id.k $$;
44
44
  grant execute on function pg_temp.id(text) to anon, authenticated;
package/package.json CHANGED
@@ -1,14 +1,31 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-sites",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": [
7
7
  "./dist/sections.js",
8
8
  "./dist/editor.js",
9
+ "./dist/chunk-*.js",
9
10
  "*.css"
10
11
  ],
11
12
  "description": "Sites and landing pages for Genesis apps: a section registry with zod 4 schemas, 20 server-rendered sections on Genesis UI (timetable, team, blog, map, timeline and downloads among them), a blog with drafts, published posts, RSS and Article JSON-LD, a guarded asset import (/import), a per-request renderer with no hydration, SEO (meta, sitemap, robots, JSON-LD, redirects), publish-time accessibility checks, one-click landing pages from a brand, a Supabase schema with draft, publish and rollback, and a visual editor on Puck (/editor) that published pages never load. Part of the Genesis framework.",
13
+ "keywords": [
14
+ "genesis",
15
+ "genesis-framework",
16
+ "website-builder",
17
+ "landing-pages",
18
+ "cms",
19
+ "site-builder",
20
+ "landing-page",
21
+ "website",
22
+ "seo",
23
+ "sitemap"
24
+ ],
25
+ "homepage": "https://github.com/marktiderman/genesis/tree/main/packages/sites#readme",
26
+ "bugs": {
27
+ "url": "https://github.com/marktiderman/genesis/issues"
28
+ },
12
29
  "repository": {
13
30
  "type": "git",
14
31
  "url": "git+https://github.com/marktiderman/genesis.git",
@@ -56,22 +73,28 @@
56
73
  "types": "./dist/import.d.ts",
57
74
  "import": "./dist/import.js"
58
75
  },
76
+ "./templates": {
77
+ "types": "./dist/templates.d.ts",
78
+ "import": "./dist/templates.js"
79
+ },
59
80
  "./sites.css": "./dist/assets/sites.css",
60
81
  "./sites-forms.css": "./dist/assets/sites-forms.css"
61
82
  },
62
83
  "files": [
63
84
  "dist",
64
85
  "migrations",
65
- "README.md"
86
+ "README.md",
87
+ "SKILL.md"
66
88
  ],
67
89
  "dependencies": {
68
- "@marktiderman/genesis-features": "^0.7.0"
90
+ "@marktiderman/genesis-features": "^0.8.0",
91
+ "@marktiderman/genesis-media": "^0.1.1"
69
92
  },
70
93
  "peerDependencies": {
71
- "@marktiderman/genesis-design-system": "^1.5.1",
94
+ "@marktiderman/genesis-design-system": "^1.6.0",
72
95
  "@marktiderman/genesis-forms": ">=0.6.0 <1.0.0",
73
96
  "@marktiderman/genesis-forms-web": ">=0.5.0 <1.0.0",
74
- "@marktiderman/genesis-ui": "^2.23.0",
97
+ "@marktiderman/genesis-ui": "^2.25.1",
75
98
  "@puckeditor/core": "^0.23.0",
76
99
  "@supabase/supabase-js": "^2.118.0",
77
100
  "lucide-react": "^1.0.0",
@@ -88,11 +111,26 @@
88
111
  }
89
112
  },
90
113
  "devDependencies": {
91
- "@marktiderman/genesis-design-system": "^1.5.1",
92
- "@marktiderman/genesis-forms": "^0.10.1",
93
- "@marktiderman/genesis-forms-react": "^0.3.2",
94
- "@marktiderman/genesis-forms-web": "^0.6.4",
95
- "@marktiderman/genesis-ui": "^2.23.0",
114
+ "@fontsource/barlow": "^5.3.0",
115
+ "@fontsource/barlow-condensed": "^5.3.0",
116
+ "@fontsource/bebas-neue": "^5.3.0",
117
+ "@fontsource/dm-sans": "^5.3.0",
118
+ "@fontsource/inter": "^5.3.0",
119
+ "@fontsource/lora": "^5.3.0",
120
+ "@fontsource/merriweather": "^5.3.0",
121
+ "@fontsource/montserrat": "^5.3.0",
122
+ "@fontsource/oswald": "^5.3.0",
123
+ "@fontsource/playfair-display": "^5.3.0",
124
+ "@fontsource/poppins": "^5.3.0",
125
+ "@fontsource/roboto-condensed": "^5.3.0",
126
+ "@fontsource/source-serif-4": "^5.3.1",
127
+ "@fontsource/space-grotesk": "^5.3.0",
128
+ "@fontsource/work-sans": "^5.3.0",
129
+ "@marktiderman/genesis-design-system": "^1.6.0",
130
+ "@marktiderman/genesis-forms": "^0.11.0",
131
+ "@marktiderman/genesis-forms-react": "^0.3.3",
132
+ "@marktiderman/genesis-forms-web": "^0.7.0",
133
+ "@marktiderman/genesis-ui": "^2.25.1",
96
134
  "@puckeditor/core": "^0.23.0",
97
135
  "@supabase/supabase-js": "^2.118.0",
98
136
  "@tailwindcss/cli": "4.3.3",
@@ -101,7 +139,7 @@
101
139
  "@types/react-dom": "^19.2.3",
102
140
  "axe-core": "^4.14.0",
103
141
  "esbuild": "^0.28.1",
104
- "happy-dom": "^20.9.0",
142
+ "happy-dom": "^21.0.4",
105
143
  "lucide-react": "^1.0.0",
106
144
  "radix-ui": "^1.6.7",
107
145
  "react": "^19.0.0",
@@ -109,10 +147,24 @@
109
147
  "tailwindcss": "4.3.3",
110
148
  "tsup": "^8.3.0",
111
149
  "typescript": "~6.0.3",
112
- "vitest": "^4.1.12",
113
- "zod": "^4.4.3"
150
+ "vitest": "^5.0.5",
151
+ "zod": "^4.6.6"
114
152
  },
115
153
  "genesis": {
154
+ "layer": "module",
155
+ "group": "modules",
156
+ "owner": "@marktiderman",
157
+ "module": {
158
+ "name": "Sites",
159
+ "summary": "Multi-page sites, landing pages and a blog, edited in the app and served as cached HTML.",
160
+ "blocks": [
161
+ "sites"
162
+ ],
163
+ "schema": "genesis_sites",
164
+ "install": "genesis add sites",
165
+ "docs": "https://github.com/marktiderman/genesis/blob/main/docs/SITES.md",
166
+ "skill": "SKILL.md"
167
+ },
116
168
  "blocks": {
117
169
  "sites": {
118
170
  "feature": {
@@ -169,8 +221,8 @@
169
221
  },
170
222
  "scripts": {
171
223
  "assets": "node scripts/build-assets.mjs",
172
- "build": "node scripts/build-assets.mjs && tsup && node ../../scripts/check-exports-resolve.mjs",
173
- "clean": "rm -rf dist src/web/assets.generated.ts",
224
+ "build": "node scripts/build-assets.mjs && tsup && node scripts/drop-fonts-sourcemap.mjs && node ../../scripts/check-exports-resolve.mjs",
225
+ "clean": "rm -rf dist src/web/assets.generated.ts src/web/fonts.generated.ts",
174
226
  "typecheck": "node scripts/build-assets.mjs --if-missing && tsc --noEmit",
175
227
  "test": "node scripts/build-assets.mjs --if-missing && vitest run"
176
228
  }