@glw907/cairn-cms 0.14.0 → 0.18.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 (96) hide show
  1. package/dist/auth/crypto.d.ts +8 -2
  2. package/dist/auth/crypto.d.ts.map +1 -1
  3. package/dist/auth/crypto.js +12 -2
  4. package/dist/auth/store.d.ts +2 -0
  5. package/dist/auth/store.d.ts.map +1 -1
  6. package/dist/auth/store.js +17 -5
  7. package/dist/components/EditPage.svelte +13 -8
  8. package/dist/components/EditPage.svelte.d.ts +3 -1
  9. package/dist/components/EditPage.svelte.d.ts.map +1 -1
  10. package/dist/content/compose.d.ts.map +1 -1
  11. package/dist/content/compose.js +1 -0
  12. package/dist/content/links.d.ts +14 -0
  13. package/dist/content/links.d.ts.map +1 -0
  14. package/dist/content/links.js +41 -0
  15. package/dist/content/manifest.d.ts +55 -0
  16. package/dist/content/manifest.d.ts.map +1 -0
  17. package/dist/content/manifest.js +98 -0
  18. package/dist/content/types.d.ts +10 -1
  19. package/dist/content/types.d.ts.map +1 -1
  20. package/dist/delivery/content-index.d.ts.map +1 -1
  21. package/dist/delivery/content-index.js +11 -9
  22. package/dist/delivery/feeds.d.ts +1 -1
  23. package/dist/delivery/feeds.d.ts.map +1 -1
  24. package/dist/delivery/feeds.js +31 -16
  25. package/dist/delivery/index.d.ts +1 -0
  26. package/dist/delivery/index.d.ts.map +1 -1
  27. package/dist/delivery/index.js +1 -0
  28. package/dist/delivery/manifest.d.ts +13 -0
  29. package/dist/delivery/manifest.d.ts.map +1 -0
  30. package/dist/delivery/manifest.js +31 -0
  31. package/dist/delivery/site-indexes.d.ts.map +1 -1
  32. package/dist/delivery/site-indexes.js +9 -1
  33. package/dist/env.d.ts.map +1 -1
  34. package/dist/env.js +14 -0
  35. package/dist/github/repo.d.ts +21 -0
  36. package/dist/github/repo.d.ts.map +1 -1
  37. package/dist/github/repo.js +79 -0
  38. package/dist/github/signing.d.ts +12 -0
  39. package/dist/github/signing.d.ts.map +1 -1
  40. package/dist/github/signing.js +22 -0
  41. package/dist/index.d.ts +4 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +5 -0
  44. package/dist/render/pipeline.d.ts +14 -1
  45. package/dist/render/pipeline.d.ts.map +1 -1
  46. package/dist/render/pipeline.js +22 -3
  47. package/dist/render/resolve-links.d.ts +8 -0
  48. package/dist/render/resolve-links.d.ts.map +1 -0
  49. package/dist/render/resolve-links.js +36 -0
  50. package/dist/render/sanitize-schema.d.ts +20 -0
  51. package/dist/render/sanitize-schema.d.ts.map +1 -0
  52. package/dist/render/sanitize-schema.js +57 -0
  53. package/dist/sveltekit/auth-routes.d.ts.map +1 -1
  54. package/dist/sveltekit/auth-routes.js +29 -11
  55. package/dist/sveltekit/content-routes.d.ts +3 -0
  56. package/dist/sveltekit/content-routes.d.ts.map +1 -1
  57. package/dist/sveltekit/content-routes.js +31 -4
  58. package/dist/sveltekit/guard.d.ts +1 -1
  59. package/dist/sveltekit/guard.d.ts.map +1 -1
  60. package/dist/sveltekit/guard.js +25 -10
  61. package/dist/sveltekit/nav-routes.js +2 -2
  62. package/dist/sveltekit/public-routes.d.ts +2 -0
  63. package/dist/sveltekit/public-routes.d.ts.map +1 -1
  64. package/dist/sveltekit/public-routes.js +3 -2
  65. package/dist/sveltekit/types.d.ts +6 -0
  66. package/dist/sveltekit/types.d.ts.map +1 -1
  67. package/package.json +3 -2
  68. package/src/lib/auth/crypto.ts +14 -2
  69. package/src/lib/auth/store.ts +18 -5
  70. package/src/lib/components/EditPage.svelte +13 -8
  71. package/src/lib/content/compose.ts +1 -0
  72. package/src/lib/content/links.ts +48 -0
  73. package/src/lib/content/manifest.ts +138 -0
  74. package/src/lib/content/types.ts +10 -3
  75. package/src/lib/delivery/content-index.ts +12 -9
  76. package/src/lib/delivery/feeds.ts +34 -19
  77. package/src/lib/delivery/index.ts +1 -0
  78. package/src/lib/delivery/manifest.ts +38 -0
  79. package/src/lib/delivery/site-indexes.ts +13 -1
  80. package/src/lib/env.ts +13 -0
  81. package/src/lib/github/repo.ts +103 -0
  82. package/src/lib/github/signing.ts +32 -0
  83. package/src/lib/index.ts +16 -0
  84. package/src/lib/render/pipeline.ts +33 -3
  85. package/src/lib/render/resolve-links.ts +42 -0
  86. package/src/lib/render/sanitize-schema.ts +66 -0
  87. package/src/lib/sveltekit/auth-routes.ts +30 -11
  88. package/src/lib/sveltekit/content-routes.ts +38 -6
  89. package/src/lib/sveltekit/guard.ts +25 -10
  90. package/src/lib/sveltekit/nav-routes.ts +2 -2
  91. package/src/lib/sveltekit/public-routes.ts +5 -3
  92. package/src/lib/sveltekit/types.ts +5 -1
  93. package/dist/render/sanitize.d.ts +0 -8
  94. package/dist/render/sanitize.d.ts.map +0 -1
  95. package/dist/render/sanitize.js +0 -26
  96. package/src/lib/render/sanitize.ts +0 -27
@@ -1,9 +1,15 @@
1
- /** The session cookie name. */
2
- export declare const COOKIE_NAME = "cairn_session";
1
+ /**
2
+ * The session cookie name. On https the cookie is Secure and takes the __Host- prefix, which
3
+ * binds it to the origin (the browser enforces Secure, Path=/, and no Domain). On local http
4
+ * dev the prefix is dropped, since __Host- requires Secure and the dev cookie cannot set it.
5
+ */
6
+ export declare function sessionCookieName(secure: boolean): string;
3
7
  /** Magic-link tokens live 10 minutes. */
4
8
  export declare const TOKEN_TTL_MS: number;
5
9
  /** Sessions live 30 days. */
6
10
  export declare const SESSION_TTL_MS: number;
11
+ /** A magic link is sent at most once per email per minute, to throttle inbox flooding. */
12
+ export declare const SEND_COOLDOWN_MS: number;
7
13
  /** A fresh 256-bit magic-link token, url-safe. */
8
14
  export declare function generateToken(): string;
9
15
  /** A fresh 256-bit session id, url-safe. */
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/lib/auth/crypto.ts"],"names":[],"mappings":"AAIA,+BAA+B;AAC/B,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,yCAAyC;AACzC,eAAO,MAAM,YAAY,QAAiB,CAAC;AAE3C,6BAA6B;AAC7B,eAAO,MAAM,cAAc,QAA2B,CAAC;AAUvD,kDAAkD;AAClD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,oEAAoE;AACpE,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI9D"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/lib/auth/crypto.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED,yCAAyC;AACzC,eAAO,MAAM,YAAY,QAAiB,CAAC;AAE3C,6BAA6B;AAC7B,eAAO,MAAM,cAAc,QAA2B,CAAC;AAEvD,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAU1C,kDAAkD;AAClD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,oEAAoE;AACpE,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI9D"}
@@ -1,12 +1,22 @@
1
1
  // Token and session-id generation plus SHA-256 token hashing, on Web Crypto so the
2
2
  // code runs unchanged in workerd. The store keeps only the hash of a token, never the
3
3
  // token itself (spec 7.1).
4
- /** The session cookie name. */
5
- export const COOKIE_NAME = 'cairn_session';
4
+ /** The base session cookie name, prefixed with __Host- when the cookie is Secure. */
5
+ const COOKIE_BASE = 'cairn_session';
6
+ /**
7
+ * The session cookie name. On https the cookie is Secure and takes the __Host- prefix, which
8
+ * binds it to the origin (the browser enforces Secure, Path=/, and no Domain). On local http
9
+ * dev the prefix is dropped, since __Host- requires Secure and the dev cookie cannot set it.
10
+ */
11
+ export function sessionCookieName(secure) {
12
+ return secure ? `__Host-${COOKIE_BASE}` : COOKIE_BASE;
13
+ }
6
14
  /** Magic-link tokens live 10 minutes. */
7
15
  export const TOKEN_TTL_MS = 10 * 60 * 1000;
8
16
  /** Sessions live 30 days. */
9
17
  export const SESSION_TTL_MS = 30 * 24 * 60 * 60 * 1000;
18
+ /** A magic link is sent at most once per email per minute, to throttle inbox flooding. */
19
+ export const SEND_COOLDOWN_MS = 60 * 1000;
10
20
  function randomBase64Url(byteLength = 32) {
11
21
  const bytes = new Uint8Array(byteLength);
12
22
  crypto.getRandomValues(bytes);
@@ -4,6 +4,8 @@ import type { Editor, Role } from './types.js';
4
4
  export declare function findEditor(db: D1Database, email: string): Promise<Editor | null>;
5
5
  /** Replace any prior token for this email with a fresh one, atomically. */
6
6
  export declare function issueToken(db: D1Database, email: string, tokenHash: string, expiresAt: number, now: number): Promise<void>;
7
+ /** True when a magic-link token for this email was issued at or after `since`, for the send cooldown. */
8
+ export declare function recentlyIssued(db: D1Database, email: string, since: number): Promise<boolean>;
7
9
  /**
8
10
  * Consume a token in one atomic statement. A returned email means the token was present and
9
11
  * unexpired and is now gone, so the link is single-use by construction on strongly-consistent D1.
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/lib/auth/store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQ/C,yCAAyC;AACzC,wBAAsB,UAAU,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMtF;AAED,2EAA2E;AAC3E,wBAAsB,UAAU,CAC9B,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV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wBAAsB,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUpG;AAED,iCAAiC;AACjC,wBAAsB,aAAa,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7E;AAED,2CAA2C;AAC3C,wBAAsB,WAAW,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKnE;AAED,sCAAsC;AACtC,wBAAsB,YAAY,CAChC,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,0FAA0F;AAC1F,wBAAsB,YAAY,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM/E;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAe1F;AAED,iFAAiF;AACjF,wBAAsB,aAAa,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAU1F"}
@@ -12,12 +12,21 @@ export async function findEditor(db, email) {
12
12
  /** Replace any prior token for this email with a fresh one, atomically. */
13
13
  export async function issueToken(db, email, tokenHash, expiresAt, now) {
14
14
  await db.batch([
15
- db.prepare('DELETE FROM magic_token WHERE email = ?').bind(email),
15
+ // Replace this email's prior token, and sweep any expired token while here (no cron needed).
16
+ db.prepare('DELETE FROM magic_token WHERE email = ? OR expires_at <= ?').bind(email, now),
16
17
  db
17
18
  .prepare('INSERT INTO magic_token (token_hash, email, expires_at, created_at) VALUES (?, ?, ?, ?)')
18
19
  .bind(tokenHash, email, expiresAt, now),
19
20
  ]);
20
21
  }
22
+ /** True when a magic-link token for this email was issued at or after `since`, for the send cooldown. */
23
+ export async function recentlyIssued(db, email, since) {
24
+ const row = await db
25
+ .prepare('SELECT 1 AS one FROM magic_token WHERE email = ? AND created_at >= ? LIMIT 1')
26
+ .bind(email, since)
27
+ .first();
28
+ return row != null;
29
+ }
21
30
  /**
22
31
  * Consume a token in one atomic statement. A returned email means the token was present and
23
32
  * unexpired and is now gone, so the link is single-use by construction on strongly-consistent D1.
@@ -31,10 +40,13 @@ export async function consumeToken(db, tokenHash, now) {
31
40
  }
32
41
  /** Create a session row. */
33
42
  export async function createSession(db, id, email, expiresAt, now) {
34
- await db
35
- .prepare('INSERT INTO session (id, email, expires_at, created_at) VALUES (?, ?, ?, ?)')
36
- .bind(id, email, expiresAt, now)
37
- .run();
43
+ await db.batch([
44
+ // Sweep expired sessions on login, so abandoned rows do not accumulate (no cron needed).
45
+ db.prepare('DELETE FROM session WHERE expires_at <= ?').bind(now),
46
+ db
47
+ .prepare('INSERT INTO session (id, email, expires_at, created_at) VALUES (?, ?, ?, ?)')
48
+ .bind(id, email, expiresAt, now),
49
+ ]);
38
50
  }
39
51
  /**
40
52
  * Resolve a session to its editor, joining `editor` so the role is read live. An expired
@@ -12,15 +12,16 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
12
12
  import type { IconSet } from '../render/glyph.js';
13
13
  import type { EditData } from '../sveltekit/content-routes.js';
14
14
  import type { TextareaField, TagsField, FreeTagsField } from '../content/types.js';
15
- import { sanitizePreviewHtml } from '../render/sanitize.js';
15
+ import type { LinkResolve } from '../content/links.js';
16
+ import { manifestLinkResolver } from '../content/manifest.js';
16
17
 
17
18
  interface Props {
18
19
  /** The edit load's data, plus the site name for the heading. */
19
20
  data: EditData & { siteName: string };
20
21
  /** The site's component registry, for the insert palette. */
21
22
  registry?: ComponentRegistry;
22
- /** The site's design-accurate render pipeline; the preview pane sanitizes its output. */
23
- render?: (md: string, opts?: { stagger?: boolean }) => string | Promise<string>;
23
+ /** The site's design-accurate render pipeline; the preview pane renders its output, which the floored pipeline already sanitized. */
24
+ render?: (md: string, opts?: { stagger?: boolean; resolve?: LinkResolve }) => string | Promise<string>;
24
25
  /** The site's icon set, for the guided form's icon fields. */
25
26
  icons?: IconSet;
26
27
  }
@@ -34,6 +35,10 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
34
35
  let previewHtml = $state('');
35
36
  let insert = $state.raw<(text: string) => void>(() => {});
36
37
 
38
+ // The manifest-backed resolver turns a cairn: link into its live permalink in the preview, and
39
+ // returns undefined for a missing target so the render step marks it cairn-broken-link.
40
+ const resolveLink = $derived(manifestLinkResolver(data.linkTargets));
41
+
37
42
  const PREVIEW_KEY = 'cairn-admin:preview';
38
43
 
39
44
  $effect(() => {
@@ -46,20 +51,20 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
46
51
  localStorage.setItem(PREVIEW_KEY, showPreview ? '1' : '0');
47
52
  }
48
53
 
49
- // Render the design-accurate preview as the body changes, debounced, and sanitize before the DOM.
50
- // The sanitize is the one barrier between editor-authored markdown and the page (the editor is unsanitized).
54
+ // Render the design-accurate preview as the body changes, debounced. The site's render is the
55
+ // floored engine pipeline, so its output is already sanitized; the preview mirrors the page.
51
56
  // previewRun is a plain counter (not reactive state) used as a latest-wins guard: if a slow earlier
52
57
  // async render call resolves after a newer one has started, the stale result is discarded.
53
58
  let previewRun = 0;
54
59
  $effect(() => {
55
60
  if (!showPreview || !render) return;
56
61
  const md = body;
62
+ const resolve = resolveLink; // tracked read in the effect body
57
63
  const run = ++previewRun;
58
64
  const handle = setTimeout(async () => {
59
65
  try {
60
- const html = await render(md);
61
- const safe = await sanitizePreviewHtml(html);
62
- if (run === previewRun) previewHtml = safe;
66
+ const html = await render(md, { resolve });
67
+ if (run === previewRun) previewHtml = html;
63
68
  } catch {
64
69
  if (run === previewRun) previewHtml = '';
65
70
  }
@@ -1,6 +1,7 @@
1
1
  import type { ComponentRegistry } from '../render/registry.js';
2
2
  import type { IconSet } from '../render/glyph.js';
3
3
  import type { EditData } from '../sveltekit/content-routes.js';
4
+ import type { LinkResolve } from '../content/links.js';
4
5
  interface Props {
5
6
  /** The edit load's data, plus the site name for the heading. */
6
7
  data: EditData & {
@@ -8,9 +9,10 @@ interface Props {
8
9
  };
9
10
  /** The site's component registry, for the insert palette. */
10
11
  registry?: ComponentRegistry;
11
- /** The site's design-accurate render pipeline; the preview pane sanitizes its output. */
12
+ /** The site's design-accurate render pipeline; the preview pane renders its output, which the floored pipeline already sanitized. */
12
13
  render?: (md: string, opts?: {
13
14
  stagger?: boolean;
15
+ resolve?: LinkResolve;
14
16
  }) => string | Promise<string>;
15
17
  /** The site's icon set, for the guided form's icon fields. */
16
18
  icons?: IconSet;
@@ -1 +1 @@
1
- {"version":3,"file":"EditPage.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/EditPage.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAK7D,UAAU,KAAK;IACb,gEAAgE;IAChE,IAAI,EAAE,QAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,yFAAyF;IACzF,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAsJH;;;;GAIG;AACH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"EditPage.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/EditPage.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIrD,UAAU,KAAK;IACb,gEAAgE;IAChE,IAAI,EAAE,QAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,qIAAqI;IACrI,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvG,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA2JH;;;;GAIG;AACH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/lib/content/compose.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,YAAY,EAAE,cAAc,EAAE,YAAY,EAAiB,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGxI;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAM,GAC3D,YAAY,CAwBd"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/lib/content/compose.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,YAAY,EAAE,cAAc,EAAE,YAAY,EAAiB,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGxI;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAM,GAC3D,YAAY,CAyBd"}
@@ -23,6 +23,7 @@ export function composeRuntime(adapter, extensions = [], urlPolicy = {}) {
23
23
  backend: adapter.backend,
24
24
  sender: adapter.sender,
25
25
  render: adapter.render,
26
+ manifestPath: adapter.manifestPath ?? 'src/content/.cairn/index.json',
26
27
  registry: adapter.registry,
27
28
  icons: adapter.icons,
28
29
  navMenu: adapter.navMenu,
@@ -0,0 +1,14 @@
1
+ /** A resolved reference to a content entry by its concept and permanent id. */
2
+ export interface CairnRef {
3
+ concept: string;
4
+ id: string;
5
+ }
6
+ /** Resolve a reference to its live permalink. Returns undefined when the target is missing (the
7
+ * preview marks it); the build resolver throws instead, so a dangling token fails the build. */
8
+ export type LinkResolve = (ref: CairnRef) => string | undefined;
9
+ /** Parse a `cairn:<concept>/<id>` href, or null for any other href or a malformed token. */
10
+ export declare function parseCairnToken(href: string): CairnRef | null;
11
+ /** The cairn links a markdown body points at, in first-occurrence order, deduped by concept/id.
12
+ * Parses the body as mdast, so a token inside a code span or fence is never matched. */
13
+ export declare function extractCairnLinks(body: string): CairnRef[];
14
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/lib/content/links.ts"],"names":[],"mappings":"AAUA,+EAA+E;AAC/E,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;iGACiG;AACjG,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,KAAK,MAAM,GAAG,SAAS,CAAC;AAEhE,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAS7D;AAED;yFACyF;AACzF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAa1D"}
@@ -0,0 +1,41 @@
1
+ // cairn-cms: the cairn: internal-link token. An internal link is a standard CommonMark link
2
+ // whose href is `cairn:<concept>/<id>`, keyed to the target's permanent filename stem so it
3
+ // survives a slug, date, or permalink change (content-graph design). This module owns the
4
+ // grammar; the render resolver (resolve-links.ts) reuses parseCairnToken.
5
+ import { unified } from 'unified';
6
+ import remarkParse from 'remark-parse';
7
+ import remarkGfm from 'remark-gfm';
8
+ import { visit } from 'unist-util-visit';
9
+ import { isValidId } from './ids.js';
10
+ /** Parse a `cairn:<concept>/<id>` href, or null for any other href or a malformed token. */
11
+ export function parseCairnToken(href) {
12
+ if (!href.startsWith('cairn:'))
13
+ return null;
14
+ const rest = href.slice('cairn:'.length);
15
+ const slash = rest.indexOf('/');
16
+ if (slash <= 0)
17
+ return null;
18
+ const concept = rest.slice(0, slash);
19
+ const id = rest.slice(slash + 1);
20
+ if (!concept || !isValidId(id))
21
+ return null;
22
+ return { concept, id };
23
+ }
24
+ /** The cairn links a markdown body points at, in first-occurrence order, deduped by concept/id.
25
+ * Parses the body as mdast, so a token inside a code span or fence is never matched. */
26
+ export function extractCairnLinks(body) {
27
+ const tree = unified().use(remarkParse).use(remarkGfm).parse(body);
28
+ const seen = new Set();
29
+ const refs = [];
30
+ visit(tree, 'link', (node) => {
31
+ const ref = node.url ? parseCairnToken(node.url) : null;
32
+ if (!ref)
33
+ return;
34
+ const key = `${ref.concept}/${ref.id}`;
35
+ if (seen.has(key))
36
+ return;
37
+ seen.add(key);
38
+ refs.push(ref);
39
+ });
40
+ return refs;
41
+ }
@@ -0,0 +1,55 @@
1
+ import { type CairnRef, type LinkResolve } from './links.js';
2
+ import type { ConceptDescriptor } from './types.js';
3
+ /** One entry's projection: its identity, routing, draft flag, and outbound cairn: edges. */
4
+ export interface ManifestEntry {
5
+ id: string;
6
+ concept: string;
7
+ title: string;
8
+ date?: string;
9
+ permalink: string;
10
+ draft: boolean;
11
+ links: CairnRef[];
12
+ }
13
+ /** The whole corpus as one committed file. `version` guards a future shape migration. */
14
+ export interface Manifest {
15
+ version: 1;
16
+ entries: ManifestEntry[];
17
+ }
18
+ /** The minimal entry view the preview resolver and (later) the picker read. */
19
+ export interface LinkTarget {
20
+ concept: string;
21
+ id: string;
22
+ permalink: string;
23
+ title: string;
24
+ date?: string;
25
+ draft: boolean;
26
+ }
27
+ /** Build one manifest entry from a content file. Drafts are included and flagged. */
28
+ export declare function manifestEntryFromFile(descriptor: ConceptDescriptor, file: {
29
+ path: string;
30
+ raw: string;
31
+ }): ManifestEntry;
32
+ /** An empty manifest, the starting point when no committed file exists yet. */
33
+ export declare function emptyManifest(): Manifest;
34
+ /** Serialize canonically: entries sorted by concept then id, links sorted and deduped, a fixed key
35
+ * order, two-space pretty, and a trailing newline, so the committed file diffs cleanly in a PR. */
36
+ export declare function serializeManifest(manifest: Manifest): string;
37
+ /** Parse a committed manifest. Throws on malformed JSON or the wrong shape. */
38
+ export declare function parseManifest(raw: string): Manifest;
39
+ /** Throw if the committed manifest drifts from what the corpus says. Both sides are compared in the
40
+ * canonical serialized form, so semantic equality never spuriously fails. The build calls this so a
41
+ * raw-git content edit, which leaves the committed manifest stale, fails the build loudly. */
42
+ export declare function verifyManifest(built: Manifest, committedRaw: string): void;
43
+ /** Replace the entry with the same concept and id, or add it. Order does not matter, since
44
+ * serializeManifest sorts. This is the save path's incremental patch. */
45
+ export declare function upsertEntry(manifest: Manifest, entry: ManifestEntry): Manifest;
46
+ /** Drop the entry with the given concept and id, if present. The delete path's patch. */
47
+ export declare function removeEntry(manifest: Manifest, concept: string, id: string): Manifest;
48
+ /** A resolver backed by manifest targets, for the admin preview. A miss returns undefined, so the
49
+ * render step marks the link broken rather than throwing. The build resolver throws instead. */
50
+ export declare function manifestLinkResolver(targets: {
51
+ concept: string;
52
+ id: string;
53
+ permalink: string;
54
+ }[]): LinkResolve;
55
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/lib/content/manifest.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqB,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,yFAAyF;AACzF,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAmBD,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,iBAAiB,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAiBvH;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,IAAI,QAAQ,CAExC;AAMD;oGACoG;AACpG,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAW5D;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAMnD;AAED;;+FAE+F;AAC/F,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAM1E;AAED;0EAC0E;AAC1E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,GAAG,QAAQ,CAI9E;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,CAErF;AAED;iGACiG;AACjG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,WAAW,CAG/G"}
@@ -0,0 +1,98 @@
1
+ // cairn-cms: the content manifest, a committed JSON projection of the corpus (content-graph
2
+ // design). The files in git stay the source of truth; the manifest exists so request-time admin
3
+ // code reads the content graph without an N+1 GitHub crawl. The build regenerates and verifies
4
+ // it; the save path patches one entry and commits it with the content in one commit. Each entry
5
+ // carries its identity and its outbound cairn: edges, so the manifest is the link graph.
6
+ import { idFromFilename, slugFromId } from './ids.js';
7
+ import { parseMarkdown } from './frontmatter.js';
8
+ import { permalink } from './permalink.js';
9
+ import { extractCairnLinks } from './links.js';
10
+ function basename(path) {
11
+ const slash = path.lastIndexOf('/');
12
+ return slash >= 0 ? path.slice(slash + 1) : path;
13
+ }
14
+ /** Mirror content-index's frontmatter coercion: a present non-empty string, else undefined. */
15
+ function asString(value) {
16
+ return typeof value === 'string' && value.trim() ? value : undefined;
17
+ }
18
+ /** Mirror content-index's date coercion: an unquoted YAML date is a JS Date, a string is sliced. */
19
+ function asDate(value) {
20
+ if (value instanceof Date)
21
+ return Number.isNaN(value.getTime()) ? undefined : value.toISOString().slice(0, 10);
22
+ if (typeof value === 'string')
23
+ return value.match(/^\d{4}-\d{2}-\d{2}/)?.[0];
24
+ return undefined;
25
+ }
26
+ /** Build one manifest entry from a content file. Drafts are included and flagged. */
27
+ export function manifestEntryFromFile(descriptor, file) {
28
+ const id = idFromFilename(basename(file.path));
29
+ // Use the same slug rule content-index uses, so the manifest's permalink for an entry always
30
+ // equals content-index's permalink for it. A cairn link must resolve to one URL whether the
31
+ // admin preview reads the manifest or the public build reads the content index.
32
+ const slug = slugFromId(id, descriptor.routing.dated ? descriptor.datePrefix : null);
33
+ const { frontmatter, body } = parseMarkdown(file.raw);
34
+ const date = asDate(frontmatter.date);
35
+ return {
36
+ id,
37
+ concept: descriptor.id,
38
+ title: asString(frontmatter.title) ?? id,
39
+ date,
40
+ permalink: permalink(descriptor, { id, slug, date }),
41
+ draft: frontmatter.draft === true,
42
+ links: extractCairnLinks(body),
43
+ };
44
+ }
45
+ /** An empty manifest, the starting point when no committed file exists yet. */
46
+ export function emptyManifest() {
47
+ return { version: 1, entries: [] };
48
+ }
49
+ function compareRef(a, b) {
50
+ return a.concept.localeCompare(b.concept) || a.id.localeCompare(b.id);
51
+ }
52
+ /** Serialize canonically: entries sorted by concept then id, links sorted and deduped, a fixed key
53
+ * order, two-space pretty, and a trailing newline, so the committed file diffs cleanly in a PR. */
54
+ export function serializeManifest(manifest) {
55
+ const entries = [...manifest.entries].sort(compareRef).map((e) => ({
56
+ id: e.id,
57
+ concept: e.concept,
58
+ title: e.title,
59
+ ...(e.date ? { date: e.date } : {}),
60
+ permalink: e.permalink,
61
+ draft: e.draft,
62
+ links: [...e.links].sort(compareRef).map((r) => ({ concept: r.concept, id: r.id })),
63
+ }));
64
+ return `${JSON.stringify({ version: 1, entries }, null, 2)}\n`;
65
+ }
66
+ /** Parse a committed manifest. Throws on malformed JSON or the wrong shape. */
67
+ export function parseManifest(raw) {
68
+ const data = JSON.parse(raw);
69
+ if (!data || typeof data !== 'object' || !Array.isArray(data.entries)) {
70
+ throw new Error('content manifest: malformed file, expected { version, entries: [] }');
71
+ }
72
+ return { version: 1, entries: data.entries };
73
+ }
74
+ /** Throw if the committed manifest drifts from what the corpus says. Both sides are compared in the
75
+ * canonical serialized form, so semantic equality never spuriously fails. The build calls this so a
76
+ * raw-git content edit, which leaves the committed manifest stale, fails the build loudly. */
77
+ export function verifyManifest(built, committedRaw) {
78
+ if (committedRaw !== serializeManifest(built)) {
79
+ throw new Error('content manifest is stale: the committed file does not match the corpus. Regenerate it (npm run cairn:manifest) and commit the result.');
80
+ }
81
+ }
82
+ /** Replace the entry with the same concept and id, or add it. Order does not matter, since
83
+ * serializeManifest sorts. This is the save path's incremental patch. */
84
+ export function upsertEntry(manifest, entry) {
85
+ const entries = manifest.entries.filter((e) => !(e.concept === entry.concept && e.id === entry.id));
86
+ entries.push(entry);
87
+ return { version: 1, entries };
88
+ }
89
+ /** Drop the entry with the given concept and id, if present. The delete path's patch. */
90
+ export function removeEntry(manifest, concept, id) {
91
+ return { version: 1, entries: manifest.entries.filter((e) => !(e.concept === concept && e.id === id)) };
92
+ }
93
+ /** A resolver backed by manifest targets, for the admin preview. A miss returns undefined, so the
94
+ * render step marks the link broken rather than throwing. The build resolver throws instead. */
95
+ export function manifestLinkResolver(targets) {
96
+ const byKey = new Map(targets.map((t) => [`${t.concept}/${t.id}`, t.permalink]));
97
+ return (ref) => byKey.get(`${ref.concept}/${ref.id}`);
98
+ }
@@ -2,6 +2,7 @@ import type { ComponentRegistry } from '../render/registry.js';
2
2
  import type { IconSet } from '../render/glyph.js';
3
3
  import type { DatePrefix } from './ids.js';
4
4
  import type { ConceptSchema } from './schema.js';
5
+ import type { LinkResolve } from './links.js';
5
6
  /** Common to every frontmatter field: the frontmatter key, the form label, and whether it is required. */
6
7
  interface FieldBase {
7
8
  /** Frontmatter key and form input name. */
@@ -149,10 +150,16 @@ export interface CairnAdapter {
149
150
  };
150
151
  backend: BackendConfig;
151
152
  sender: SenderConfig;
152
- /** The site's one renderer: the editor preview and every public page call it (design decision 4). */
153
+ /** The site's one renderer: the editor preview and every public page call it (design decision 4).
154
+ * `resolve` rewrites cairn: links to live permalinks; the build passes a site-index resolver, the
155
+ * preview a manifest one. */
153
156
  render(md: string, opts?: {
154
157
  stagger?: boolean;
158
+ resolve?: LinkResolve;
155
159
  }): string | Promise<string>;
160
+ /** Repo-relative path to the committed content manifest. Defaults to src/content/.cairn/index.json
161
+ * in composeRuntime. It sits outside any concept directory, so content enumeration never globs it. */
162
+ manifestPath?: string;
156
163
  /** Directive component registry; the renderer and the future palette derive from it (seam 3). */
157
164
  registry?: ComponentRegistry;
158
165
  /** The site's glyph name to SVG path-data map, for the admin icon picker and the renderer. */
@@ -243,7 +250,9 @@ export interface CairnRuntime {
243
250
  /** The site's one renderer: the editor preview and every public page call it (design decision 4). */
244
251
  render(md: string, opts?: {
245
252
  stagger?: boolean;
253
+ resolve?: LinkResolve;
246
254
  }): string | Promise<string>;
255
+ manifestPath: string;
247
256
  registry?: ComponentRegistry;
248
257
  /** The site's glyph name to SVG path-data map, for the admin icon picker and the renderer. */
249
258
  icons?: IconSet;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/content/types.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAA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B,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qGAAqG;IACrG,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,mGAAmG;IACnG,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"content-index.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/content-index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,yFAAyF;AACzF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;wEAEwE;AACxE,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,cAAc;IAC/E,WAAW,EAAE,CAAC,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY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C,EAAE,cAAc,CAAC;QAAC,KAAK,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC;IACzE,sFAAsF;IACtF,QAAQ,IAAI,cAAc,EAAE,CAAC;CAC9B;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE,CAElE;AAqBD,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5D,KAAK,EAAE,OAAO,EAAE,EAChB,UAAU,EAAE,iBAAiB,GAC5B,YAAY,CAAC,CAAC,CAAC,CAsEjB"}
@@ -30,19 +30,21 @@ function asTags(value) {
30
30
  /** Build a concept's index from its raw files and normalized descriptor. */
31
31
  export function createContentIndex(files, descriptor) {
32
32
  const problems = [];
33
- const entries = files.map((file) => {
33
+ const entries = [];
34
+ for (const file of files) {
34
35
  const id = idFromFilename(basename(file.path));
35
36
  const slug = slugFromId(id, descriptor.routing.dated ? descriptor.datePrefix : null);
36
37
  const { frontmatter: raw, body } = parseMarkdown(file.raw);
37
38
  const date = asDate(raw.date);
38
39
  const draft = raw.draft === true;
39
- // Validate once at build. The cheap summary stays raw-derived and robust; the typed detail
40
- // frontmatter carries the normalized data on success, the raw frontmatter on failure. A
41
- // failure is recorded, not thrown, so the query surface does not explode on construction.
40
+ // Validate once at build. A failure is recorded for the site gate and excluded from the typed
41
+ // read, so every readable entry's frontmatter is the validator's normalized output, never raw.
42
42
  const result = descriptor.validate(raw, body);
43
- if (!result.ok)
43
+ if (!result.ok) {
44
44
  problems.push({ id, draft, errors: result.errors });
45
- return {
45
+ continue;
46
+ }
47
+ entries.push({
46
48
  id,
47
49
  slug,
48
50
  permalink: permalink(descriptor, { id, slug, date }),
@@ -53,10 +55,10 @@ export function createContentIndex(files, descriptor) {
53
55
  excerpt: deriveExcerpt(body, { description: asString(raw.description) }),
54
56
  wordCount: wordCount(body),
55
57
  draft,
56
- frontmatter: (result.ok ? result.data : raw),
58
+ frontmatter: result.data,
57
59
  body,
58
- };
59
- });
60
+ });
61
+ }
60
62
  // Dated concepts sort newest-first; undated concepts (Pages) sort by title.
61
63
  const sorted = [...entries].sort((a, b) => descriptor.routing.dated ? (b.date ?? '').localeCompare(a.date ?? '') : a.title.localeCompare(b.title));
62
64
  const summarize = (entry) => {
@@ -14,7 +14,7 @@ export interface FeedChannel {
14
14
  export interface FeedItem {
15
15
  title: string;
16
16
  url: string;
17
- date: string;
17
+ date?: string;
18
18
  updated?: string;
19
19
  summary: string;
20
20
  contentHtml?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"feeds.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/feeds.ts"],"names":[],"mappings":"AAKA,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,uFAAuF;AACvF,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAyBD,iCAAiC;AACjC,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,CAkC5E;AAED,sCAAsC;AACtC,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAA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