@pagesmith/core 0.1.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 (85) hide show
  1. package/README.md +481 -0
  2. package/assets/fonts/OFL.txt +7 -0
  3. package/assets/fonts/jetbrains-mono-variable.woff2 +0 -0
  4. package/assets/fonts/open-sans-variable.woff2 +0 -0
  5. package/assets/fonts.css +17 -0
  6. package/dist/ai/index.d.mts +41 -0
  7. package/dist/ai/index.d.mts.map +1 -0
  8. package/dist/ai/index.mjs +414 -0
  9. package/dist/ai/index.mjs.map +1 -0
  10. package/dist/assets/index.d.mts +31 -0
  11. package/dist/assets/index.d.mts.map +1 -0
  12. package/dist/assets/index.mjs +2 -0
  13. package/dist/assets-bX08zEJm.mjs +155 -0
  14. package/dist/assets-bX08zEJm.mjs.map +1 -0
  15. package/dist/content-config-fHPaFZ7i.d.mts +1128 -0
  16. package/dist/content-config-fHPaFZ7i.d.mts.map +1 -0
  17. package/dist/content-layer-B7fQ3im4.mjs +590 -0
  18. package/dist/content-layer-B7fQ3im4.mjs.map +1 -0
  19. package/dist/convert-DnuB6SVV.mjs +52 -0
  20. package/dist/convert-DnuB6SVV.mjs.map +1 -0
  21. package/dist/create/index.d.mts +20 -0
  22. package/dist/create/index.d.mts.map +1 -0
  23. package/dist/create/index.mjs +215 -0
  24. package/dist/create/index.mjs.map +1 -0
  25. package/dist/css/index.d.mts +2 -0
  26. package/dist/css/index.mjs +2 -0
  27. package/dist/css-ekIt2Fdb.mjs +19 -0
  28. package/dist/css-ekIt2Fdb.mjs.map +1 -0
  29. package/dist/heading-Dhvzlay-.d.mts +27 -0
  30. package/dist/heading-Dhvzlay-.d.mts.map +1 -0
  31. package/dist/index-BQ6B1-qG.d.mts +41 -0
  32. package/dist/index-BQ6B1-qG.d.mts.map +1 -0
  33. package/dist/index-CeNDTM-y.d.mts +7 -0
  34. package/dist/index-CeNDTM-y.d.mts.map +1 -0
  35. package/dist/index-DpRBzO8Q.d.mts +15 -0
  36. package/dist/index-DpRBzO8Q.d.mts.map +1 -0
  37. package/dist/index-sFCx17CD.d.mts +59 -0
  38. package/dist/index-sFCx17CD.d.mts.map +1 -0
  39. package/dist/index.d.mts +131 -0
  40. package/dist/index.d.mts.map +1 -0
  41. package/dist/index.mjs +56 -0
  42. package/dist/index.mjs.map +1 -0
  43. package/dist/jsx-runtime/index.d.mts +24 -0
  44. package/dist/jsx-runtime/index.d.mts.map +1 -0
  45. package/dist/jsx-runtime/index.mjs +88 -0
  46. package/dist/jsx-runtime/index.mjs.map +1 -0
  47. package/dist/loaders/index.d.mts +3 -0
  48. package/dist/loaders/index.mjs +2 -0
  49. package/dist/loaders-DyABmDrE.mjs +179 -0
  50. package/dist/loaders-DyABmDrE.mjs.map +1 -0
  51. package/dist/markdown/index.d.mts +3 -0
  52. package/dist/markdown/index.mjs +2 -0
  53. package/dist/markdown-Cj5X26FL.mjs +95 -0
  54. package/dist/markdown-Cj5X26FL.mjs.map +1 -0
  55. package/dist/runtime/index.d.mts +28 -0
  56. package/dist/runtime/index.d.mts.map +1 -0
  57. package/dist/runtime/index.mjs +90 -0
  58. package/dist/runtime/index.mjs.map +1 -0
  59. package/dist/schemas/index.d.mts +4 -0
  60. package/dist/schemas/index.mjs +2 -0
  61. package/dist/schemas-DJS7wOzd.mjs +47 -0
  62. package/dist/schemas-DJS7wOzd.mjs.map +1 -0
  63. package/dist/types-DUsjRE7Y.d.mts +28 -0
  64. package/dist/types-DUsjRE7Y.d.mts.map +1 -0
  65. package/dist/vite/index.d.mts +9878 -0
  66. package/dist/vite/index.d.mts.map +1 -0
  67. package/dist/vite/index.mjs +549 -0
  68. package/dist/vite/index.mjs.map +1 -0
  69. package/package.json +136 -0
  70. package/src/styles/code/inline.css +26 -0
  71. package/src/styles/content/alerts.css +87 -0
  72. package/src/styles/content/prose.css +225 -0
  73. package/src/styles/content/toc.css +87 -0
  74. package/src/styles/content.css +22 -0
  75. package/src/styles/foundations/reset.css +49 -0
  76. package/src/styles/foundations/tokens.css +66 -0
  77. package/src/styles/layout/grid.css +179 -0
  78. package/src/styles/layout/sidebar.css +18 -0
  79. package/src/styles/standalone.css +18 -0
  80. package/src/styles/viewport.css +20 -0
  81. package/templates/docs/content/README.md +18 -0
  82. package/templates/docs/content/guide/README.md +11 -0
  83. package/templates/docs/content/guide/getting-started/README.md +9 -0
  84. package/templates/docs/content/reference/README.md +11 -0
  85. package/templates/docs/pagesmith.config.json5 +15 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-config-fHPaFZ7i.d.mts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","AlignType","ReferenceType","Alternative","alt","Association","identifier","label","Reference","referenceType","Resource","url","title","BlockContent","BlockContentMap","Blockquote","Code","Heading","Html","List","Paragraph","Table","ThematicBreak","blockquote","code","heading","html","list","paragraph","table","thematicBreak","DefinitionContent","DefinitionContentMap","Definition","FootnoteDefinition","definition","footnoteDefinition","FrontmatterContent","FrontmatterContentMap","Yaml","yaml","ListContent","ListContentMap","ListItem","listItem","PhrasingContent","PhrasingContentMap","Break","Delete","Emphasis","FootnoteReference","Image","ImageReference","InlineCode","Link","LinkReference","Strong","Text","break","delete","emphasis","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text","RootContent","RootContentMap","TableCell","TableRow","tableCell","tableRow","RowContent","RowContentMap","TableContent","TableContentMap","Content","Literals","Nodes","Extract","Root","Parents","TopLevelContent","value","data","children","Array","BlockquoteData","type","BreakData","CodeData","lang","meta","DefinitionData","DeleteData","EmphasisData","FootnoteDefinitionData","FootnoteReferenceData","HeadingData","depth","HtmlData","HTML","ImageData","ImageReferenceData","InlineCodeData","LinkData","LinkReferenceData","ListData","ordered","start","spread","ListItemData","checked","ParagraphData","RootData","StrongData","TableData","align","TableRowData","TableCellData","TextData","ThematicBreakData","YamlData","YAML"],"sources":["../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../src/validation/schema-validator.ts","../src/validation/types.ts","../src/schemas/collection.ts","../src/schemas/content-config.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;AAqBA;;;;;AAKA;;;;;;;;;AAqBA;;UA1BiBA,MAAAA;;;;UAKAC,KAAAA;EA8BH;;AA6Bd;EAvDIC,IAAAA;EAwEmB;;;EAnEnBC,MAAAA;EAmEAU;;;EA/DAT,MAAAA;AAAAA;;AClBJ;;;;UD0BiBC,QAAAA;ECfLoB;;;EDmBRnB,KAAAA,EAAOL,KAAAA;ECZMyB;;;EDiBbnB,GAAAA,EAAKN,KAAAA;AAAAA;;;ACyET;;;;;AAWA;;;UDvDiBQ,MAAAA;ECuD+C;AAmBhE;;EDtEIE,IAAAA;ECwEM4B;;;EDnEN3B,IAAAA,GAAOZ,MAAAA;ECwEA4C;;;;;;EDhEP/B,QAAAA,GAAWR,QAAAA;AAAAA;;;;;AAjFf;;;;;AAKA;;;;;;;;;AAqBA;;KC1BYmB,SAAAA;;;;;;;ADgEZ;;;KCrDYC,aAAAA;AAAAA;;;;UAOKC,WAAAA;;;;AAlBjB;EAuBIC,GAAAA;AAAAA;;AAZJ;;;;;AAOA;;;UAiBiBC,WAAAA;EAZV;AAYP;;;;;AA+BA;;;;;;;EAjBIC,UAAAA;EA2BaI;;;;;AAgCjB;;;;EAhDIH,KAAAA;AAAAA;;;;UAMaC,SAAAA,SAAkBH,WAAAA;EAwEH;;;EApE5BI,aAAAA,EAAeP,aAAAA;AAAAA;;;;UAMFQ,QAAAA;EAsEe;;;EAlE5BC,GAAAA;EA4DAa;;;;EAvDAZ,KAAAA;AAAAA;AAAAA;;;;;;;;AAuEJ;;;;;AAkBA;;;;;;UAlEiBnB,IAAAA,SAAaC,MAAAA;AAAAA;AA4G9B;;;;;AAkBA;;AAlBA,KAjGYmB,YAAAA,GAAeC,eAAAA,OAAsBA,eAAAA;;AA8HjD;;;;;AAmBA;;;;;;;;;;;UA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 import { n as resolveLoader, t as defaultIncludePatterns } from "./loaders-DyABmDrE.mjs";
3
+ import { dirname, extname, relative, resolve } from "path";
4
+ import remarkParse from "remark-parse";
5
+ import { unified } from "unified";
6
+ import { existsSync } from "fs";
7
+ import fg from "fast-glob";
8
+ //#region src/utils/read-time.ts
9
+ /**
10
+ * Read time estimation.
11
+ *
12
+ * Computes estimated reading time from markdown source (~200 words per minute).
13
+ */
14
+ /** Compute read time in minutes from raw markdown. */
15
+ function computeReadTime(rawMarkdown) {
16
+ const wordCount = rawMarkdown.replace(/```[\s\S]*?```/g, " ").replace(/^( {4}|\t).+$/gm, " ").replace(/^---[\s\S]*?---/m, " ").replace(/<[^>]+>/g, " ").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[#*_~`>]/g, " ").replace(/\s+/g, " ").trim().split(" ").filter(Boolean).length;
17
+ return Math.max(1, Math.ceil(wordCount / 200));
18
+ }
19
+ //#endregion
20
+ //#region src/entry.ts
21
+ var ContentEntry = class {
22
+ /** URL-friendly identifier */
23
+ slug;
24
+ /** Collection this entry belongs to */
25
+ collection;
26
+ /** Absolute path to source file */
27
+ filePath;
28
+ /** Validated data (frontmatter or parsed data) */
29
+ data;
30
+ /** Raw body content (markdown only) */
31
+ rawContent;
32
+ /** Cached render result */
33
+ _rendered;
34
+ /** Markdown config for rendering */
35
+ _markdownConfig;
36
+ constructor(slug, collection, filePath, data, rawContent, markdownConfig) {
37
+ this.slug = slug;
38
+ this.collection = collection;
39
+ this.filePath = filePath;
40
+ this.data = data;
41
+ this.rawContent = rawContent;
42
+ this._markdownConfig = markdownConfig;
43
+ }
44
+ /** Render the entry content to HTML. Cached after first call. */
45
+ async render(options) {
46
+ if (this._rendered && !options?.force) return this._rendered;
47
+ if (!this.rawContent) {
48
+ this._rendered = {
49
+ html: "",
50
+ headings: [],
51
+ readTime: 0
52
+ };
53
+ return this._rendered;
54
+ }
55
+ const result = await processMarkdown(this.rawContent, this._markdownConfig, {
56
+ content: this.rawContent,
57
+ frontmatter: this.data
58
+ });
59
+ const readTime = computeReadTime(this.rawContent);
60
+ this._rendered = {
61
+ html: result.html,
62
+ headings: result.headings,
63
+ readTime
64
+ };
65
+ return this._rendered;
66
+ }
67
+ /** Clear cached render result. */
68
+ clearRenderCache() {
69
+ this._rendered = void 0;
70
+ }
71
+ };
72
+ //#endregion
73
+ //#region src/plugins/index.ts
74
+ /** Collect all remark plugins from content plugins. */
75
+ function collectRemarkPlugins(plugins) {
76
+ return plugins.filter((p) => p.remarkPlugin).map((p) => p.remarkPlugin);
77
+ }
78
+ /** Collect all rehype plugins from content plugins. */
79
+ function collectRehypePlugins(plugins) {
80
+ return plugins.filter((p) => p.rehypePlugin).map((p) => p.rehypePlugin);
81
+ }
82
+ /** Run all plugin validators against an entry. */
83
+ function runPluginValidators(plugins, entry) {
84
+ const issues = [];
85
+ for (const plugin of plugins) if (plugin.validate) issues.push(...plugin.validate(entry));
86
+ return issues;
87
+ }
88
+ //#endregion
89
+ //#region src/utils/glob.ts
90
+ /**
91
+ * File discovery via glob patterns.
92
+ */
93
+ /** Discover files matching glob patterns in a directory. */
94
+ function discoverFiles(options) {
95
+ const { directory, include, exclude = [] } = options;
96
+ return fg.sync(include, {
97
+ cwd: directory,
98
+ absolute: true,
99
+ ignore: [
100
+ "**/node_modules/**",
101
+ "**/dist/**",
102
+ "**/dev/**",
103
+ ...exclude
104
+ ]
105
+ }).map((p) => resolve(p));
106
+ }
107
+ //#endregion
108
+ //#region src/utils/slug.ts
109
+ /**
110
+ * Path-to-slug conversion.
111
+ *
112
+ * Generalized from packages/core/src/content/collector.ts.
113
+ */
114
+ /**
115
+ * Convert a content file path to a URL-friendly slug.
116
+ *
117
+ * Examples:
118
+ * content/posts/hello-world/README.md -> 'hello-world'
119
+ * content/posts/hello-world/index.md -> 'hello-world'
120
+ * content/posts/hello-world.md -> 'hello-world'
121
+ * content/authors/john.json -> 'john'
122
+ * content/posts/nested/deep/post.md -> 'nested/deep/post'
123
+ */
124
+ function toSlug(filePath, directory) {
125
+ const ext = extname(filePath);
126
+ let slug = relative(directory, filePath).replace(/\\/g, "/");
127
+ if (ext) slug = slug.slice(0, -ext.length);
128
+ if (slug === "README" || slug === "index") return "/";
129
+ if (slug.endsWith("/README")) slug = slug.slice(0, -7);
130
+ if (slug.endsWith("/index")) slug = slug.slice(0, -6);
131
+ return slug;
132
+ }
133
+ //#endregion
134
+ //#region src/validation/schema-validator.ts
135
+ /** Format a Zod error path into a human-readable field path. */
136
+ function formatPath(path) {
137
+ return path.map((segment, i) => {
138
+ if (typeof segment === "number") return `[${segment}]`;
139
+ if (typeof segment === "symbol") return `[${String(segment)}]`;
140
+ if (i === 0) return segment;
141
+ return `.${segment}`;
142
+ }).join("");
143
+ }
144
+ /** Validate data against a Zod schema and return structured issues. */
145
+ function validateSchema(data, schema) {
146
+ const result = schema.safeParse(data);
147
+ if (result.success) return {
148
+ issues: [],
149
+ validatedData: result.data
150
+ };
151
+ return {
152
+ issues: result.error.issues.map((issue) => ({
153
+ field: issue.path.length > 0 ? formatPath(issue.path) : void 0,
154
+ message: issue.message,
155
+ severity: "error"
156
+ })),
157
+ validatedData: data
158
+ };
159
+ }
160
+ //#endregion
161
+ //#region src/validation/code-block-validator.ts
162
+ /** Known meta properties accepted by Expressive Code and its plugins. */
163
+ const KNOWN_META_PROPS = new Set([
164
+ "title",
165
+ "showLineNumbers",
166
+ "startLineNumber",
167
+ "wrap",
168
+ "frame",
169
+ "collapse",
170
+ "mark",
171
+ "ins",
172
+ "del"
173
+ ]);
174
+ /** Extract the property name portion of a meta token (before `=` or `{`). */
175
+ function extractMetaPropNames(meta) {
176
+ const props = [];
177
+ const tokenRegex = /(\w+)(?:=(?:\{[^}]*\}|"[^"]*"|'[^']*'|\S+))?/g;
178
+ let match;
179
+ while ((match = tokenRegex.exec(meta)) !== null) props.push(match[1]);
180
+ return props;
181
+ }
182
+ /** Collect all `code` nodes from MDAST. */
183
+ function collectCodeBlocks(node) {
184
+ const blocks = [];
185
+ if (node.type === "code") blocks.push(node);
186
+ if (node.children) for (const child of node.children) blocks.push(...collectCodeBlocks(child));
187
+ return blocks;
188
+ }
189
+ const codeBlockValidator = {
190
+ name: "code-blocks",
191
+ validate(ctx) {
192
+ if (!ctx.rawContent || !ctx.mdast) return [];
193
+ const issues = [];
194
+ const tree = ctx.mdast;
195
+ const codeBlocks = collectCodeBlocks(tree);
196
+ for (const block of codeBlocks) {
197
+ const line = block.position?.start.line;
198
+ const lineInfo = line ? ` (line ${line})` : "";
199
+ const meta = block.meta ?? "";
200
+ const hasMeta = meta.trim().length > 0;
201
+ if (hasMeta && !block.lang) issues.push({
202
+ field: `code-block${lineInfo}`,
203
+ message: "Code block has meta properties but no language identifier",
204
+ severity: "warn"
205
+ });
206
+ if (!hasMeta) continue;
207
+ const propNames = extractMetaPropNames(meta);
208
+ for (const prop of propNames) if (!KNOWN_META_PROPS.has(prop)) issues.push({
209
+ field: `code-block${lineInfo}`,
210
+ message: `Unknown code block meta property: "${prop}"`,
211
+ severity: "warn"
212
+ });
213
+ }
214
+ return issues;
215
+ }
216
+ };
217
+ //#endregion
218
+ //#region src/validation/heading-validator.ts
219
+ /** Extract plain text from a heading node's children. */
220
+ function getTextContent(node) {
221
+ if (node.type === "text") return node.value ?? "";
222
+ if (node.children) return node.children.map(getTextContent).join("");
223
+ return "";
224
+ }
225
+ /** Collect all heading nodes from MDAST. */
226
+ function collectHeadings(node) {
227
+ const headings = [];
228
+ if (node.type === "heading" && node.depth) headings.push({
229
+ depth: node.depth,
230
+ text: getTextContent(node),
231
+ line: node.position?.start.line
232
+ });
233
+ if (node.children) for (const child of node.children) headings.push(...collectHeadings(child));
234
+ return headings;
235
+ }
236
+ const headingValidator = {
237
+ name: "headings",
238
+ validate(ctx) {
239
+ if (!ctx.rawContent || !ctx.mdast) return [];
240
+ const issues = [];
241
+ const tree = ctx.mdast;
242
+ const headings = collectHeadings(tree);
243
+ if (headings.length === 0) {
244
+ if (ctx.rawContent.trim().length > 0) issues.push({
245
+ message: "Document has content but no headings",
246
+ severity: "warn"
247
+ });
248
+ return issues;
249
+ }
250
+ const h1s = headings.filter((h) => h.depth === 1);
251
+ if (h1s.length > 1) for (const h of h1s.slice(1)) {
252
+ const lineInfo = h.line ? ` (line ${h.line})` : "";
253
+ issues.push({
254
+ field: `headings${lineInfo}`,
255
+ message: `Multiple h1 headings found: "${h.text}"`,
256
+ severity: "warn"
257
+ });
258
+ }
259
+ for (let i = 1; i < headings.length; i++) {
260
+ const prev = headings[i - 1];
261
+ const curr = headings[i];
262
+ if (curr.depth > prev.depth + 1) {
263
+ const lineInfo = curr.line ? ` (line ${curr.line})` : "";
264
+ issues.push({
265
+ field: `headings${lineInfo}`,
266
+ message: `Heading level skip: h${prev.depth} -> h${curr.depth} ("${curr.text}")`,
267
+ severity: "warn"
268
+ });
269
+ }
270
+ }
271
+ return issues;
272
+ }
273
+ };
274
+ //#endregion
275
+ //#region src/validation/link-validator.ts
276
+ /**
277
+ * Link validator — checks links in markdown content.
278
+ *
279
+ * Walks the shared MDAST for link/image nodes. Internal links are checked for file existence;
280
+ * external links are checked for well-formed URL format.
281
+ */
282
+ /** Walk MDAST tree, collecting link and image nodes. */
283
+ function collectLinks(node) {
284
+ const links = [];
285
+ if ((node.type === "link" || node.type === "image") && node.url) links.push({
286
+ url: node.url,
287
+ line: node.position?.start.line
288
+ });
289
+ if (node.children) for (const child of node.children) links.push(...collectLinks(child));
290
+ return links;
291
+ }
292
+ function isInternalLink(url) {
293
+ if (url.startsWith("#")) return false;
294
+ if (url.startsWith("http://") || url.startsWith("https://")) return false;
295
+ if (url.startsWith("//")) return false;
296
+ if (url.startsWith("mailto:")) return false;
297
+ if (url.startsWith("tel:")) return false;
298
+ return true;
299
+ }
300
+ function isWellFormedUrl(url) {
301
+ try {
302
+ new URL(url);
303
+ return true;
304
+ } catch {
305
+ return false;
306
+ }
307
+ }
308
+ const linkValidator = {
309
+ name: "links",
310
+ validate(ctx) {
311
+ if (!ctx.rawContent || !ctx.mdast) return [];
312
+ const issues = [];
313
+ const tree = ctx.mdast;
314
+ const links = collectLinks(tree);
315
+ const fileDir = dirname(ctx.filePath);
316
+ for (const link of links) {
317
+ const lineInfo = link.line ? ` (line ${link.line})` : "";
318
+ if (link.url.startsWith("http://") || link.url.startsWith("https://")) {
319
+ if (!isWellFormedUrl(link.url)) issues.push({
320
+ field: `links${lineInfo}`,
321
+ message: `Malformed external URL: ${link.url}`,
322
+ severity: "warn"
323
+ });
324
+ continue;
325
+ }
326
+ if (isInternalLink(link.url)) {
327
+ const urlPath = link.url.split("#")[0].split("?")[0];
328
+ if (!urlPath) continue;
329
+ if (!existsSync(resolve(fileDir, urlPath))) issues.push({
330
+ field: `links${lineInfo}`,
331
+ message: `Broken internal link: ${link.url}`,
332
+ severity: "error"
333
+ });
334
+ }
335
+ }
336
+ return issues;
337
+ }
338
+ };
339
+ //#endregion
340
+ //#region src/validation/runner.ts
341
+ /**
342
+ * Validation runner — executes a list of content validators on an entry.
343
+ *
344
+ * Validators that throw are caught and converted to error-severity issues
345
+ * so one failing validator does not block the rest.
346
+ */
347
+ /** The built-in validators for markdown content. */
348
+ const builtinMarkdownValidators = [
349
+ linkValidator,
350
+ codeBlockValidator,
351
+ headingValidator
352
+ ];
353
+ /** Run all validators on a single content entry. */
354
+ async function runValidators(ctx, validators) {
355
+ if (ctx.rawContent && !ctx.mdast) ctx.mdast = unified().use(remarkParse).parse(ctx.rawContent);
356
+ const issues = [];
357
+ for (const validator of validators) try {
358
+ const result = await validator.validate(ctx);
359
+ issues.push(...result);
360
+ } catch (err) {
361
+ const message = err instanceof Error ? err.message : String(err);
362
+ issues.push({
363
+ message: `Validator "${validator.name}" threw: ${message}`,
364
+ severity: "error"
365
+ });
366
+ }
367
+ return issues;
368
+ }
369
+ //#endregion
370
+ //#region src/store.ts
371
+ /**
372
+ * ContentStore — in-memory cache for loaded collections.
373
+ *
374
+ * Handles file discovery, loading, validation, and caching.
375
+ * Not exported directly — used internally by ContentLayer.
376
+ */
377
+ var ContentStore = class {
378
+ cache = /* @__PURE__ */ new Map();
379
+ loaded = /* @__PURE__ */ new Set();
380
+ config;
381
+ rootDir;
382
+ markdownConfig;
383
+ constructor(config) {
384
+ this.config = config;
385
+ this.rootDir = config.root ? resolve(config.root) : process.cwd();
386
+ this.markdownConfig = this.createMarkdownConfig();
387
+ }
388
+ /** Load a collection (if not already loaded) and return entries. */
389
+ async loadCollection(name, def) {
390
+ if (this.loaded.has(name)) {
391
+ const cached = this.cache.get(name);
392
+ return cached ? Array.from(cached.values()).map((c) => c.entry) : [];
393
+ }
394
+ const loader = resolveLoader(def.loader);
395
+ const directory = resolve(this.rootDir, def.directory);
396
+ const files = discoverFiles({
397
+ directory,
398
+ include: def.include ?? defaultIncludePatterns(loader),
399
+ exclude: def.exclude
400
+ });
401
+ const entries = /* @__PURE__ */ new Map();
402
+ const results = await Promise.all(files.map(async (filePath) => {
403
+ try {
404
+ return await this.loadEntry(name, filePath, directory, loader, def);
405
+ } catch (err) {
406
+ const message = err instanceof Error ? err.message : String(err);
407
+ return {
408
+ entry: new ContentEntry(def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory), name, filePath, {}, void 0, this.markdownConfig),
409
+ issues: [{
410
+ message: `Failed to load: ${message}`,
411
+ severity: "error"
412
+ }]
413
+ };
414
+ }
415
+ }));
416
+ for (const result of results) if (result) entries.set(result.entry.slug, result);
417
+ this.cache.set(name, entries);
418
+ this.loaded.add(name);
419
+ return Array.from(entries.values()).map((c) => c.entry);
420
+ }
421
+ /** Load a single entry from a file. */
422
+ async loadEntry(collectionName, filePath, directory, loader, def) {
423
+ const loaded = await loader.load(filePath);
424
+ const slug = def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory);
425
+ let raw = {
426
+ data: loaded.data,
427
+ content: loaded.content,
428
+ filePath,
429
+ slug
430
+ };
431
+ if (def.transform) raw = await def.transform(raw);
432
+ if (def.computed) for (const [key, fn] of Object.entries(def.computed)) raw.data[key] = fn(raw);
433
+ if (def.filter && !def.filter(raw)) return null;
434
+ const { issues, validatedData } = validateSchema(raw.data, def.schema);
435
+ if (def.validate) {
436
+ const customError = def.validate(raw);
437
+ if (customError) issues.push({
438
+ message: customError,
439
+ severity: "error"
440
+ });
441
+ }
442
+ if (raw.content !== void 0) {
443
+ const validators = this.resolveValidators(def);
444
+ if (validators.length > 0) {
445
+ const contentIssues = await runValidators({
446
+ filePath,
447
+ slug,
448
+ collection: collectionName,
449
+ rawContent: raw.content,
450
+ data: raw.data
451
+ }, validators);
452
+ issues.push(...contentIssues);
453
+ }
454
+ }
455
+ if (this.config.plugins?.length) {
456
+ const pluginIssues = runPluginValidators(this.config.plugins, {
457
+ data: raw.data,
458
+ content: raw.content
459
+ });
460
+ for (const message of pluginIssues) issues.push({
461
+ message,
462
+ severity: "error"
463
+ });
464
+ }
465
+ return {
466
+ entry: new ContentEntry(slug, collectionName, filePath, validatedData, raw.content, this.markdownConfig),
467
+ issues
468
+ };
469
+ }
470
+ /** Get a single entry by slug. */
471
+ getEntry(collection, slug) {
472
+ return this.cache.get(collection)?.get(slug)?.entry;
473
+ }
474
+ /** Get validation issues for a collection. */
475
+ getIssues(collection) {
476
+ const result = /* @__PURE__ */ new Map();
477
+ const entries = this.cache.get(collection);
478
+ if (!entries) return result;
479
+ for (const [slug, cached] of entries) if (cached.issues.length > 0) result.set(slug, cached.issues);
480
+ return result;
481
+ }
482
+ /** Invalidate a single entry (forces full collection reload on next access). */
483
+ invalidate(collection, slug) {
484
+ this.cache.get(collection)?.delete(slug);
485
+ this.loaded.delete(collection);
486
+ }
487
+ /** Invalidate an entire collection. */
488
+ invalidateCollection(collection) {
489
+ this.cache.delete(collection);
490
+ this.loaded.delete(collection);
491
+ }
492
+ /** Invalidate all collections. */
493
+ invalidateAll() {
494
+ this.cache.clear();
495
+ this.loaded.clear();
496
+ }
497
+ /** Resolve the list of content validators for a collection. */
498
+ resolveValidators(def) {
499
+ const builtin = def.disableBuiltinValidators ? [] : builtinMarkdownValidators;
500
+ const custom = def.validators ?? [];
501
+ return [...builtin, ...custom];
502
+ }
503
+ createMarkdownConfig() {
504
+ const base = this.config.markdown ?? {};
505
+ const remarkPlugins = [...base.remarkPlugins ?? []];
506
+ const rehypePlugins = [...base.rehypePlugins ?? []];
507
+ const plugins = this.config.plugins ?? [];
508
+ if (plugins.length > 0) {
509
+ remarkPlugins.push(...collectRemarkPlugins(plugins));
510
+ rehypePlugins.push(...collectRehypePlugins(plugins));
511
+ }
512
+ return {
513
+ ...base,
514
+ ...remarkPlugins.length > 0 ? { remarkPlugins } : {},
515
+ ...rehypePlugins.length > 0 ? { rehypePlugins } : {}
516
+ };
517
+ }
518
+ };
519
+ //#endregion
520
+ //#region src/content-layer.ts
521
+ var ContentLayerImpl = class {
522
+ store;
523
+ config;
524
+ constructor(config) {
525
+ this.config = config;
526
+ this.store = new ContentStore(config);
527
+ }
528
+ async getCollection(name) {
529
+ const def = this.config.collections[name];
530
+ if (!def) throw new Error(`Collection "${name}" not found. Available: ${Object.keys(this.config.collections).join(", ")}`);
531
+ return this.store.loadCollection(name, def);
532
+ }
533
+ async getEntry(collection, slug) {
534
+ await this.getCollection(collection);
535
+ return this.store.getEntry(collection, slug);
536
+ }
537
+ async convert(markdown, options) {
538
+ const { convert: coreConvert } = await import("./convert-DnuB6SVV.mjs").then((n) => n.n);
539
+ return coreConvert(markdown, { markdown: options?.markdown ?? this.config.markdown });
540
+ }
541
+ invalidate(collection, slug) {
542
+ this.store.invalidate(collection, slug);
543
+ }
544
+ invalidateCollection(collection) {
545
+ this.store.invalidateCollection(collection);
546
+ }
547
+ invalidateAll() {
548
+ this.store.invalidateAll();
549
+ }
550
+ async validate(collection) {
551
+ const names = collection ? [collection] : Object.keys(this.config.collections);
552
+ const results = [];
553
+ for (const name of names) {
554
+ await this.getCollection(name);
555
+ const issues = this.store.getIssues(name);
556
+ const entries = Array.from(issues.entries()).map(([slug, entryIssues]) => {
557
+ return {
558
+ slug,
559
+ filePath: this.store.getEntry(name, slug)?.filePath ?? "",
560
+ issues: entryIssues
561
+ };
562
+ });
563
+ let errors = 0;
564
+ let warnings = 0;
565
+ for (const entry of entries) for (const issue of entry.issues) if (issue.severity === "error") errors++;
566
+ else warnings++;
567
+ results.push({
568
+ collection: name,
569
+ entries,
570
+ errors,
571
+ warnings
572
+ });
573
+ }
574
+ return results;
575
+ }
576
+ getCollectionNames() {
577
+ return Object.keys(this.config.collections);
578
+ }
579
+ getCollectionDef(name) {
580
+ return this.config.collections[name];
581
+ }
582
+ };
583
+ /** Create a new content layer from a configuration. */
584
+ function createContentLayer(config) {
585
+ return new ContentLayerImpl(config);
586
+ }
587
+ //#endregion
588
+ export { headingValidator as a, ContentEntry as c, linkValidator as i, builtinMarkdownValidators as n, codeBlockValidator as o, runValidators as r, toSlug as s, createContentLayer as t };
589
+
590
+ //# sourceMappingURL=content-layer-B7fQ3im4.mjs.map