@pagesmith/core 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/REFERENCE.md +163 -94
- package/dist/ai/index.d.mts +5 -3
- package/dist/ai/index.d.mts.map +1 -1
- package/dist/ai/index.mjs +300 -206
- package/dist/ai/index.mjs.map +1 -1
- package/dist/assets/index.d.mts +10 -1
- package/dist/assets/index.d.mts.map +1 -1
- package/dist/assets/index.mjs +2 -2
- package/dist/{assets-DXiWF_KI.mjs → assets-CAPOqQ_P.mjs} +42 -5
- package/dist/assets-CAPOqQ_P.mjs.map +1 -0
- package/dist/{content-config-Bfe4W9us.d.mts → content-config-Bu2HH0Yx.d.mts} +49 -17
- package/dist/{content-config-Bfe4W9us.d.mts.map → content-config-Bu2HH0Yx.d.mts.map} +1 -1
- package/dist/{content-layer-DPK1EmfY.mjs → content-layer-CJRrNpZ_.mjs} +192 -36
- package/dist/content-layer-CJRrNpZ_.mjs.map +1 -0
- package/dist/content-layer-Ckt08g2i.d.mts +122 -0
- package/dist/content-layer-Ckt08g2i.d.mts.map +1 -0
- package/dist/create/index.d.mts.map +1 -1
- package/dist/create/index.mjs +31 -30
- package/dist/create/index.mjs.map +1 -1
- package/dist/css/index.d.mts +1 -1
- package/dist/css/index.mjs +1 -1
- package/dist/css-CO3CBqxx.mjs +24 -0
- package/dist/css-CO3CBqxx.mjs.map +1 -0
- package/dist/heading-D4X2L4vd.d.mts +12 -0
- package/dist/heading-D4X2L4vd.d.mts.map +1 -0
- package/dist/{index-BBYkDxwI.d.mts → index-B4YZRIzb.d.mts} +1 -1
- package/dist/{index-BBYkDxwI.d.mts.map → index-B4YZRIzb.d.mts.map} +1 -1
- package/dist/{index-Bg9srb5U.d.mts → index-B7NRZAxd.d.mts} +1 -1
- package/dist/{index-Bg9srb5U.d.mts.map → index-B7NRZAxd.d.mts.map} +1 -1
- package/dist/{index-YXQxMV6J.d.mts → index-CryArLlX.d.mts} +2 -2
- package/dist/{index-YXQxMV6J.d.mts.map → index-CryArLlX.d.mts.map} +1 -1
- package/dist/{index-CbOKbkjJ.d.mts → index-D44syBt-.d.mts} +3 -2
- package/dist/index-D44syBt-.d.mts.map +1 -0
- package/dist/index.d.mts +16 -99
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/dist/loaders/index.d.mts +2 -2
- package/dist/loaders/index.mjs +1 -1
- package/dist/{loaders-Cf-BXf2L.mjs → loaders-DnyWfANR.mjs} +3 -3
- package/dist/loaders-DnyWfANR.mjs.map +1 -0
- package/dist/markdown/index.d.mts +2 -2
- package/dist/markdown/index.mjs +1 -1
- package/dist/{markdown-CyrHoDhP.mjs → markdown-DMHd400a.mjs} +29 -2
- package/dist/markdown-DMHd400a.mjs.map +1 -0
- package/dist/{heading-BpDXnl-7.d.mts → markdown-config-CDvh5aJ-.d.mts} +2 -10
- package/dist/markdown-config-CDvh5aJ-.d.mts.map +1 -0
- package/dist/mcp/index.d.mts +23 -0
- package/dist/mcp/index.d.mts.map +1 -0
- package/dist/mcp/index.mjs +2 -0
- package/dist/mcp/server.d.mts +13 -0
- package/dist/mcp/server.d.mts.map +1 -0
- package/dist/mcp/server.mjs +2 -0
- package/dist/runtime/index.d.mts.map +1 -1
- package/dist/runtime/index.mjs +4 -9
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/schemas/index.d.mts +4 -3
- package/dist/server-BZA_iSen.mjs +203 -0
- package/dist/server-BZA_iSen.mjs.map +1 -0
- package/dist/ssg-utils/index.d.mts +51 -0
- package/dist/ssg-utils/index.d.mts.map +1 -0
- package/dist/ssg-utils/index.mjs +119 -0
- package/dist/ssg-utils/index.mjs.map +1 -0
- package/dist/{types-Cn52sdoq.d.mts → types-B-V5qemH.d.mts} +1 -1
- package/dist/{types-Cn52sdoq.d.mts.map → types-B-V5qemH.d.mts.map} +1 -1
- package/dist/vite/index.d.mts +69 -34
- package/dist/vite/index.d.mts.map +1 -1
- package/dist/vite/index.mjs +296 -228
- package/dist/vite/index.mjs.map +1 -1
- package/docs/agents/AGENTS.md.template +29 -0
- package/docs/agents/changelog-notes.md +15 -0
- package/docs/agents/errors.md +150 -0
- package/docs/agents/migration.md +25 -0
- package/docs/agents/recipes.md +50 -0
- package/docs/agents/usage.md +119 -0
- package/docs/llms-full.txt +111 -0
- package/docs/llms.txt +68 -0
- package/package.json +57 -4
- package/dist/assets-DXiWF_KI.mjs.map +0 -1
- package/dist/content-layer-DPK1EmfY.mjs.map +0 -1
- package/dist/css-BneO430t.mjs +0 -20
- package/dist/css-BneO430t.mjs.map +0 -1
- package/dist/heading-BpDXnl-7.d.mts.map +0 -1
- package/dist/index-CbOKbkjJ.d.mts.map +0 -1
- package/dist/loaders-Cf-BXf2L.mjs.map +0 -1
- package/dist/markdown-CyrHoDhP.mjs.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# @pagesmith/core Full AI Reference
|
|
2
|
+
|
|
3
|
+
This file is the package-shipped source of truth for AI assistants using `@pagesmith/core`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm add @pagesmith/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Priority order
|
|
12
|
+
|
|
13
|
+
1. `node_modules/@pagesmith/core/REFERENCE.md` for the complete API reference (content layer, collections, loaders, markdown, JSX, CSS, Vite plugins).
|
|
14
|
+
2. `node_modules/@pagesmith/core/docs/agents/usage.md` for package rules, integration contract, and copy-paste agent prompts.
|
|
15
|
+
3. `node_modules/@pagesmith/core/docs/agents/recipes.md` for step-by-step implementation patterns.
|
|
16
|
+
|
|
17
|
+
## Key rules
|
|
18
|
+
|
|
19
|
+
- Use `@pagesmith/core` for custom-site scenarios; do not force docs conventions from `@pagesmith/docs`.
|
|
20
|
+
- Prefer `defineCollection`, **`defineCollections`** (batch collection map), `defineConfig`, and `createContentLayer`.
|
|
21
|
+
- Prefer folder-based markdown entries when pages reference sibling assets.
|
|
22
|
+
- Keep content validation in collection schemas and validators, not scattered in app code.
|
|
23
|
+
- Treat Expressive Code as the source for code-block UI; do not add separate copy-button scripts.
|
|
24
|
+
|
|
25
|
+
## Runtime requirements
|
|
26
|
+
|
|
27
|
+
- **Node.js 24+** (see `engines` in `@pagesmith/core` package.json).
|
|
28
|
+
|
|
29
|
+
## ContentLayerConfig
|
|
30
|
+
|
|
31
|
+
Fields: `collections`, optional `root`, `markdown`, `assets`, `plugins`, optional **`strict`** (fail fast on loader errors). There is no `cache` or `eager` field on `ContentLayerConfig`.
|
|
32
|
+
|
|
33
|
+
## ContentLayer methods
|
|
34
|
+
|
|
35
|
+
| Method | Purpose |
|
|
36
|
+
|--------|---------|
|
|
37
|
+
| `getCollection(name)` | Load all entries in a collection |
|
|
38
|
+
| `getEntry(collection, slug)` | Single entry by slug |
|
|
39
|
+
| `convert(markdown, options?)` | Markdown to HTML outside collections |
|
|
40
|
+
| `invalidate` / `invalidateCollection` / `invalidateAll` | Cache invalidation |
|
|
41
|
+
| `validate(collection?)` | Run validators |
|
|
42
|
+
| `getCollectionNames()` | List configured collection names |
|
|
43
|
+
| `getCollectionDef(name)` | Lookup `CollectionDef` |
|
|
44
|
+
| `getCollections()` | All collection definitions |
|
|
45
|
+
| `invalidateWhere(collection, predicate)` | Invalidate matching entries |
|
|
46
|
+
| `watch(callback)` | FS watch on collection dirs |
|
|
47
|
+
| `getCacheStats()` | Cache size stats |
|
|
48
|
+
|
|
49
|
+
## CLI
|
|
50
|
+
|
|
51
|
+
The **`pagesmith`** CLI lives in **`@pagesmith/docs`**. `@pagesmith/core` does not ship that binary.
|
|
52
|
+
|
|
53
|
+
## Package files
|
|
54
|
+
|
|
55
|
+
All paths below are under `node_modules/@pagesmith/core/`:
|
|
56
|
+
|
|
57
|
+
| File | Purpose |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `node_modules/@pagesmith/core/REFERENCE.md` | Complete API: content layer, collections, loaders, markdown pipeline, JSX, CSS, Vite plugins |
|
|
60
|
+
| `node_modules/@pagesmith/core/README.md` | User-facing quick start, Vite integration, and API overview |
|
|
61
|
+
| `node_modules/@pagesmith/core/docs/agents/usage.md` | Agent rules, integration shape, copy-paste prompts for common workflows |
|
|
62
|
+
| `node_modules/@pagesmith/core/docs/agents/recipes.md` | Step-by-step recipes (collections, Vite, markdown, AI pointers) |
|
|
63
|
+
| `node_modules/@pagesmith/core/docs/agents/errors.md` | Error catalog with patterns and fixes |
|
|
64
|
+
| `node_modules/@pagesmith/core/docs/agents/migration.md` | Pre-1.0 upgrade notes |
|
|
65
|
+
| `node_modules/@pagesmith/core/docs/agents/changelog-notes.md` | Version highlights |
|
|
66
|
+
| `node_modules/@pagesmith/core/docs/agents/AGENTS.md.template` | Template for project AGENTS.md with task-specific file pointers |
|
|
67
|
+
| `node_modules/@pagesmith/core/docs/llms.txt` | Compact AI context index |
|
|
68
|
+
| `node_modules/@pagesmith/core/docs/llms-full.txt` | This file — full AI context |
|
|
69
|
+
|
|
70
|
+
## Agent prompts by use case
|
|
71
|
+
|
|
72
|
+
The `node_modules/@pagesmith/core/docs/agents/usage.md` file contains copy-paste prompts for these workflows:
|
|
73
|
+
|
|
74
|
+
1. **Initial setup with Vite** → reads `node_modules/@pagesmith/core/REFERENCE.md`, `node_modules/@pagesmith/core/docs/agents/recipes.md`
|
|
75
|
+
2. **Define content collections** → reads `node_modules/@pagesmith/core/REFERENCE.md`
|
|
76
|
+
3. **Write markdown content** (frontmatter, code blocks, mermaid) → reads `node_modules/@pagesmith/core/REFERENCE.md`
|
|
77
|
+
4. **Troubleshooting validation errors** → reads `node_modules/@pagesmith/core/docs/agents/errors.md`
|
|
78
|
+
|
|
79
|
+
## Pointer snippet for consuming projects
|
|
80
|
+
|
|
81
|
+
Add to project-level `CLAUDE.md` or `AGENTS.md`:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
For @pagesmith/core usage and prompts, read node_modules/@pagesmith/core/docs/agents/usage.md
|
|
85
|
+
For the full @pagesmith/core API reference, see node_modules/@pagesmith/core/REFERENCE.md
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Related docs package
|
|
89
|
+
|
|
90
|
+
- Docs reference: `node_modules/@pagesmith/docs/REFERENCE.md`
|
|
91
|
+
- Docs usage: `node_modules/@pagesmith/docs/docs/agents/usage.md`
|
|
92
|
+
- Docs README: `node_modules/@pagesmith/docs/README.md`
|
|
93
|
+
|
|
94
|
+
## Validation
|
|
95
|
+
|
|
96
|
+
`ValidationIssue` includes an optional `source` field (`'schema' | 'content' | 'plugin' | 'custom'`) that identifies which validation phase produced the issue. Use this to categorize and prioritize fixes.
|
|
97
|
+
|
|
98
|
+
## MCP tools
|
|
99
|
+
|
|
100
|
+
The core MCP server (`@pagesmith/core/mcp`) exposes:
|
|
101
|
+
|
|
102
|
+
- `core_list_collections` — list all collections with loader type, directory, and schema fields
|
|
103
|
+
- `core_list_entries` — list entries in a collection (paginated, limit/offset)
|
|
104
|
+
- `core_get_entry` — load a single entry with rendered HTML, headings, and read time
|
|
105
|
+
- `core_validate` — run validation on one or all collections
|
|
106
|
+
- `core_search_entries` — search entries by title, description, tags, slug (case-insensitive, max 20)
|
|
107
|
+
|
|
108
|
+
Shared utilities exported from `@pagesmith/core/mcp`:
|
|
109
|
+
- `getPackageVersion(moduleDir)` — read version from package.json
|
|
110
|
+
- `resolvePackageDocPath(moduleDir, relativePath)` — resolve doc file path
|
|
111
|
+
- `asTextResource(uri, path)` — load file as MCP text resource
|
package/docs/llms.txt
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @pagesmith/core
|
|
2
|
+
|
|
3
|
+
Version-matched AI context for the installed `@pagesmith/core` package.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm add @pagesmith/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use this package when
|
|
12
|
+
|
|
13
|
+
- You need a custom content architecture, custom layouts, or framework-specific rendering.
|
|
14
|
+
- You want typed content collections with explicit schemas and runtime control.
|
|
15
|
+
|
|
16
|
+
## Start here
|
|
17
|
+
|
|
18
|
+
- **Full API reference:** `node_modules/@pagesmith/core/REFERENCE.md`
|
|
19
|
+
- **Agent rules + prompts:** `node_modules/@pagesmith/core/docs/agents/usage.md`
|
|
20
|
+
- **Step-by-step recipes:** `node_modules/@pagesmith/core/docs/agents/recipes.md`
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
- **Node.js 24+** (`engines.node` in package.json).
|
|
25
|
+
|
|
26
|
+
## Content layer snapshot
|
|
27
|
+
|
|
28
|
+
- **`ContentLayerConfig`** (via `defineConfig`): `collections`, optional `root`, `markdown`, `assets`, `plugins`, and optional **`strict`** (throw on load errors). There is no top-level `cache` or `eager` field on this config.
|
|
29
|
+
- **`defineCollections({ ... })`** — helper to build the `collections` map in one call (same as registering multiple `defineCollection` defs).
|
|
30
|
+
- **`ContentLayer`** methods include: `getCollection`, `getEntry`, `convert`, `invalidate` / `invalidateCollection` / `invalidateAll`, `validate`, `getCollectionNames`, `getCollectionDef`, `getCollections`, `invalidateWhere`, `watch`, `getCacheStats`.
|
|
31
|
+
|
|
32
|
+
## CLI
|
|
33
|
+
|
|
34
|
+
The **`pagesmith`** CLI (init, dev, build, preview, mcp, etc.) ships with **`@pagesmith/docs`**, not `@pagesmith/core`.
|
|
35
|
+
|
|
36
|
+
## All guidance files
|
|
37
|
+
|
|
38
|
+
| File | Purpose |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `node_modules/@pagesmith/core/REFERENCE.md` | Complete API: content layer, collections, loaders, markdown, JSX, CSS, Vite plugins |
|
|
41
|
+
| `node_modules/@pagesmith/core/README.md` | User-facing quick start and API overview |
|
|
42
|
+
| `node_modules/@pagesmith/core/docs/agents/usage.md` | Agent rules, integration shape, copy-paste prompts |
|
|
43
|
+
| `node_modules/@pagesmith/core/docs/agents/recipes.md` | Task-specific step-by-step recipes |
|
|
44
|
+
| `node_modules/@pagesmith/core/docs/agents/errors.md` | Error catalog with patterns and fixes |
|
|
45
|
+
| `node_modules/@pagesmith/core/docs/agents/migration.md` | Pre-1.0 upgrade notes |
|
|
46
|
+
| `node_modules/@pagesmith/core/docs/agents/changelog-notes.md` | Version highlights |
|
|
47
|
+
| `node_modules/@pagesmith/core/docs/agents/AGENTS.md.template` | Template for project-level AGENTS.md |
|
|
48
|
+
|
|
49
|
+
## Project memory pointer
|
|
50
|
+
|
|
51
|
+
In the consuming project, add this to `CLAUDE.md` or `AGENTS.md`:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
For @pagesmith/core usage and prompts, read node_modules/@pagesmith/core/docs/agents/usage.md
|
|
55
|
+
For the full @pagesmith/core API reference, see node_modules/@pagesmith/core/REFERENCE.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Related package
|
|
59
|
+
|
|
60
|
+
- Docs reference: `node_modules/@pagesmith/docs/REFERENCE.md`
|
|
61
|
+
- Docs usage: `node_modules/@pagesmith/docs/docs/agents/usage.md`
|
|
62
|
+
|
|
63
|
+
## Recent changes
|
|
64
|
+
|
|
65
|
+
- `ValidationIssue` now includes an optional `source` field (`'schema' | 'content' | 'plugin' | 'custom'`) to identify which validation phase produced the issue.
|
|
66
|
+
- New `core_search_entries` MCP tool: search entries across collections by title, description, tags, and slug (case-insensitive, max 20 results).
|
|
67
|
+
- `@pagesmith/core/mcp` now exports shared MCP utilities (`getPackageVersion`, `resolvePackageDocPath`, `asTextResource`) alongside the server factory.
|
|
68
|
+
- Error catalog added at `agents/errors.md` with machine-readable patterns and fixes for schema, content, plugin, load, and MCP errors.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagesmith/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "File-based CMS — schema-validated collections, lazy markdown rendering, and runtime CSS/JS exports",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"url": "https://github.com/sujeet-pro/pagesmith/issues"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
+
"author": "Sujeet <hello@sujeet.pro> (https://sujeet.pro)",
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
20
21
|
"url": "https://github.com/sujeet-pro/pagesmith.git",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"src/styles/",
|
|
26
27
|
"assets/",
|
|
27
28
|
"templates/",
|
|
29
|
+
"docs/",
|
|
28
30
|
"REFERENCE.md"
|
|
29
31
|
],
|
|
30
32
|
"type": "module",
|
|
@@ -89,10 +91,26 @@
|
|
|
89
91
|
"types": "./dist/vite/index.d.mts",
|
|
90
92
|
"import": "./dist/vite/index.mjs"
|
|
91
93
|
},
|
|
94
|
+
"./ssg-utils": {
|
|
95
|
+
"types": "./dist/ssg-utils/index.d.mts",
|
|
96
|
+
"import": "./dist/ssg-utils/index.mjs"
|
|
97
|
+
},
|
|
92
98
|
"./create": {
|
|
93
99
|
"types": "./dist/create/index.d.mts",
|
|
94
100
|
"import": "./dist/create/index.mjs"
|
|
95
101
|
},
|
|
102
|
+
"./mcp": {
|
|
103
|
+
"types": "./dist/mcp/index.d.mts",
|
|
104
|
+
"import": "./dist/mcp/index.mjs"
|
|
105
|
+
},
|
|
106
|
+
"./llms": "./docs/llms.txt",
|
|
107
|
+
"./llms-full": "./docs/llms-full.txt",
|
|
108
|
+
"./agents/usage": "./docs/agents/usage.md",
|
|
109
|
+
"./agents/recipes": "./docs/agents/recipes.md",
|
|
110
|
+
"./agents/changelog-notes": "./docs/agents/changelog-notes.md",
|
|
111
|
+
"./agents/errors": "./docs/agents/errors.md",
|
|
112
|
+
"./agents/migration": "./docs/agents/migration.md",
|
|
113
|
+
"./agents/template": "./docs/agents/AGENTS.md.template",
|
|
96
114
|
"./package.json": "./package.json"
|
|
97
115
|
},
|
|
98
116
|
"scripts": {
|
|
@@ -100,6 +118,7 @@
|
|
|
100
118
|
"test": "vp test run"
|
|
101
119
|
},
|
|
102
120
|
"dependencies": {
|
|
121
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
103
122
|
"devalue": "^5.1.1",
|
|
104
123
|
"fast-glob": "^3.3.0",
|
|
105
124
|
"gray-matter": "^4.0.3",
|
|
@@ -119,14 +138,48 @@
|
|
|
119
138
|
"remark-parse": "^11.0.0",
|
|
120
139
|
"remark-rehype": "^11.1.1",
|
|
121
140
|
"remark-smartypants": "^3.0.2",
|
|
122
|
-
"smol-toml": "^1.
|
|
141
|
+
"smol-toml": "^1.6.1",
|
|
123
142
|
"unified": "^11.0.5",
|
|
124
143
|
"yaml": "^2.7.0",
|
|
125
144
|
"zod": "^4.3.6"
|
|
126
145
|
},
|
|
127
146
|
"devDependencies": {
|
|
128
|
-
"@types/node": "^25.5.
|
|
129
|
-
"typescript": "^
|
|
147
|
+
"@types/node": "^25.5.2",
|
|
148
|
+
"typescript": "^6.0.2",
|
|
130
149
|
"vite-plus": "^0.1.13"
|
|
150
|
+
},
|
|
151
|
+
"bundleDependencies": [
|
|
152
|
+
"@modelcontextprotocol/sdk",
|
|
153
|
+
"devalue",
|
|
154
|
+
"fast-glob",
|
|
155
|
+
"gray-matter",
|
|
156
|
+
"json5",
|
|
157
|
+
"lightningcss",
|
|
158
|
+
"rehype-accessible-emojis",
|
|
159
|
+
"rehype-autolink-headings",
|
|
160
|
+
"rehype-expressive-code",
|
|
161
|
+
"rehype-external-links",
|
|
162
|
+
"rehype-mathjax",
|
|
163
|
+
"rehype-slug",
|
|
164
|
+
"rehype-stringify",
|
|
165
|
+
"remark-frontmatter",
|
|
166
|
+
"remark-gfm",
|
|
167
|
+
"remark-github-alerts",
|
|
168
|
+
"remark-math",
|
|
169
|
+
"remark-parse",
|
|
170
|
+
"remark-rehype",
|
|
171
|
+
"remark-smartypants",
|
|
172
|
+
"smol-toml",
|
|
173
|
+
"unified",
|
|
174
|
+
"yaml",
|
|
175
|
+
"zod"
|
|
176
|
+
],
|
|
177
|
+
"engines": {
|
|
178
|
+
"node": ">=24"
|
|
179
|
+
},
|
|
180
|
+
"ai": {
|
|
181
|
+
"context": "./docs/llms.txt",
|
|
182
|
+
"fullContext": "./docs/llms-full.txt",
|
|
183
|
+
"agentsDir": "./docs/agents"
|
|
131
184
|
}
|
|
132
185
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assets-DXiWF_KI.mjs","names":[],"sources":["../src/assets/copier.ts","../src/assets/hasher.ts"],"sourcesContent":["import { copyFileSync, existsSync, mkdirSync, readdirSync } from 'fs'\nimport { dirname, join, relative } from 'path'\n\n/**\n * Copy public directory to output, preserving structure (no hashing).\n * Skips `fonts/` since those are copied to dist/assets/ and hashed.\n */\nexport function copyPublicFiles(publicDir: string, outDir: string): void {\n if (!existsSync(publicDir)) return\n function walk(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n // Skip fonts/ — they are copied to dist/assets/ and hashed\n if (entry.isDirectory() && entry.name === 'fonts' && dir === publicDir) continue\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const rel = relative(publicDir, full)\n const dest = join(outDir, rel)\n mkdirSync(dirname(dest), { recursive: true })\n copyFileSync(full, dest)\n }\n }\n walk(publicDir)\n}\n","/**\n * Demand-driven asset pipeline.\n *\n * Instead of blindly copying all content assets to dist, this:\n * 1. Hashes pre-existing dist/assets/ files (CSS, JS, fonts — already there from bundling)\n * 2. Scans generated HTML for /assets/* references\n * 3. For each referenced content asset not yet in dist, finds the source\n * file in the content directory, copies it with a content hash\n * 4. Rewrites all HTML references to hashed paths\n *\n * Content assets are only copied if actually referenced in the output HTML.\n * Public assets (favicons, robots.txt) are handled separately by copyPublicFiles.\n */\n\nimport { createHash } from 'crypto'\nimport { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'fs'\nimport { basename, dirname, extname, join, relative } from 'path'\n\nconst HASHABLE_EXTS = new Set([\n '.css',\n '.js',\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.woff',\n '.woff2',\n '.ttf',\n '.eot',\n])\n\nconst CONTENT_ASSET_EXTS = new Set([\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n])\n\n/** Build a basename → source path lookup for content assets. */\nfunction buildContentAssetMap(contentDir: string): Map<string, string> {\n const map = new Map<string, string>()\n function walk(dir: string) {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const ext = extname(entry.name)\n if (!CONTENT_ASSET_EXTS.has(ext)) continue\n if (entry.name.endsWith('.inline.svg')) continue\n map.set(entry.name, full)\n }\n }\n walk(contentDir)\n return map\n}\n\nfunction computeHash(content: Buffer): string {\n return createHash('sha256').update(content).digest('hex').slice(0, 8)\n}\n\n/**\n * Hash assets and rewrite HTML references.\n *\n * @param outDir - The dist output directory\n * @param contentDir - The content source directory (for finding referenced assets)\n */\nexport function hashAssets(outDir: string, contentDir: string): void {\n const assetsDir = join(outDir, 'assets')\n mkdirSync(assetsDir, { recursive: true })\n\n const renames = new Map<string, string>()\n const contentAssets = buildContentAssetMap(contentDir)\n\n // Phase 1: Collect and hash pre-existing files in dist/assets/ (CSS, JS, fonts)\n const existing: Array<{ full: string; ext: string; name: string }> = []\n if (existsSync(assetsDir)) {\n for (const entry of readdirSync(assetsDir, { withFileTypes: true })) {\n if (entry.isDirectory()) continue\n const ext = extname(entry.name)\n if (!HASHABLE_EXTS.has(ext)) continue\n existing.push({ full: join(assetsDir, entry.name), ext, name: basename(entry.name, ext) })\n }\n }\n for (const file of existing) {\n const content = readFileSync(file.full)\n const hash = computeHash(content)\n const hashedPath = join(assetsDir, `${file.name}.${hash}${file.ext}`)\n renameSync(file.full, hashedPath)\n renames.set(file.full, hashedPath)\n }\n\n // Phase 2: Scan HTML — resolve content assets on demand, rewrite all references\n function processHtml(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n processHtml(full)\n continue\n }\n if (!entry.name.endsWith('.html')) continue\n\n let html = readFileSync(full, 'utf-8')\n\n html = html.replace(/(src|href|srcset)=\"([^\"]+)\"/g, (match, attr: string, ref: string) => {\n if (\n ref.startsWith('http:') ||\n ref.startsWith('https:') ||\n ref.startsWith('//') ||\n ref.startsWith('#') ||\n ref.startsWith('data:') ||\n ref.startsWith('mailto:')\n ) {\n return match\n }\n\n // Normalize relative refs (shouldn't exist after rehype, but just in case)\n let assetRef = ref\n if (ref.startsWith('./') && /\\.(svg|png|jpg|jpeg|gif|webp|avif|ico)$/i.test(ref)) {\n assetRef = '/assets/' + basename(ref)\n }\n\n // Non-asset paths (e.g. page links, anchors)\n if (!assetRef.startsWith('/assets/')) return match\n\n const fileName = assetRef.slice('/assets/'.length)\n const distPath = join(assetsDir, fileName)\n\n // Already hashed in phase 1 (CSS, JS, fonts) or a prior HTML file\n const already = renames.get(distPath)\n if (already) {\n return `${attr}=\"/${relative(outDir, already)}\"`\n }\n\n // Content asset — find source, copy + hash on demand\n const sourcePath = contentAssets.get(fileName)\n if (!sourcePath) {\n return `${attr}=\"${assetRef}\"`\n }\n\n const content = readFileSync(sourcePath)\n const hash = computeHash(content)\n const ext = extname(fileName)\n const name = basename(fileName, ext)\n const hashedName = `${name}.${hash}${ext}`\n const hashedDest = join(assetsDir, hashedName)\n\n writeFileSync(hashedDest, content)\n renames.set(distPath, hashedDest)\n\n return `${attr}=\"/assets/${hashedName}\"`\n })\n\n writeFileSync(full, html)\n }\n }\n processHtml(outDir)\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,gBAAgB,WAAmB,QAAsB;AACvE,KAAI,CAAC,WAAW,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EzB,QAAO;IAIT,IAAI,WAAW;AACf,QAAI,IAAI,WAAW,KAAK,IAAI,2CAA2C,KAAK,IAAI,CAC9E,YAAW,aAAa,SAAS,IAAI;AAIvC,QAAI,CAAC,SAAS,WAAW,WAAW,CAAE,QAAO;IAE7C,MAAM,WAAW,SAAS,MAAM,EAAkB;IAClD,MAAM,WAAW,KAAK,WAAW,SAAS;IAG1C,MAAM,UAAU,QAAQ,IAAI,SAAS;AACrC,QAAI,QACF,QAAO,GAAG,KAAK,KAAK,SAAS,QAAQ,QAAQ,CAAC;IAIhD,MAAM,aAAa,cAAc,IAAI,SAAS;AAC9C,QAAI,CAAC,WACH,QAAO,GAAG,KAAK,IAAI,SAAS;IAG9B,MAAM,UAAU,aAAa,WAAW;IACxC,MAAM,OAAO,YAAY,QAAQ;IACjC,MAAM,MAAM,QAAQ,SAAS;IAE7B,MAAM,aAAa,GADN,SAAS,UAAU,IAAI,CACT,GAAG,OAAO;IACrC,MAAM,aAAa,KAAK,WAAW,WAAW;AAE9C,kBAAc,YAAY,QAAQ;AAClC,YAAQ,IAAI,UAAU,WAAW;AAEjC,WAAO,GAAG,KAAK,YAAY,WAAW;KACtC;AAEF,iBAAc,MAAM,KAAK;;;AAG7B,aAAY,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-layer-DPK1EmfY.mjs","names":["coreConvert"],"sources":["../src/convert.ts","../src/utils/read-time.ts","../src/entry.ts","../src/plugins/index.ts","../src/utils/glob.ts","../src/utils/slug.ts","../src/validation/schema-validator.ts","../src/validation/code-block-validator.ts","../src/validation/heading-validator.ts","../src/validation/link-validator.ts","../src/validation/runner.ts","../src/store.ts","../src/content-layer.ts"],"sourcesContent":["import { processMarkdown } from './markdown'\nimport type { Heading } from './schemas/heading'\nimport type { MarkdownConfig } from './schemas/markdown-config'\n\nexport type ConvertOptions = {\n markdown?: MarkdownConfig\n}\n\nexport type ConvertResult = {\n html: string\n toc: Heading[]\n frontmatter: Record<string, unknown>\n}\n\nexport async function convert(input: string, options: ConvertOptions = {}): Promise<ConvertResult> {\n const result = await processMarkdown(input, options.markdown || {})\n return { html: result.html, toc: result.headings, frontmatter: result.frontmatter }\n}\n","/**\n * Read time estimation.\n *\n * Computes estimated reading time from markdown source (~200 words per minute).\n */\n\n/** Compute read time in minutes from raw markdown. */\nexport function computeReadTime(rawMarkdown: string): number {\n const plainText = rawMarkdown\n .replace(/```[\\s\\S]*?```/g, ' ')\n .replace(/^( {4}|\\t).+$/gm, ' ')\n .replace(/^---[\\s\\S]*?---/m, ' ')\n .replace(/<[^>]+>/g, ' ')\n .replace(/!?\\[([^\\]]*)\\]\\([^)]*\\)/g, '$1')\n .replace(/[#*_~`>]/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim()\n const wordCount = plainText.split(' ').filter(Boolean).length\n return Math.max(1, Math.ceil(wordCount / 200))\n}\n","/**\n * ContentEntry — represents a single content entry in a collection.\n *\n * Supports lazy rendering: data is available immediately after loading,\n * but HTML rendering is deferred until render() is called.\n */\n\nimport type { Heading } from './schemas/heading'\nimport type { MarkdownConfig } from './schemas/markdown-config'\nimport { processMarkdown } from './markdown'\nimport { computeReadTime } from './utils/read-time'\n\nexport type RenderedContent = {\n /** Processed HTML */\n html: string\n /** Extracted headings for TOC */\n headings: Heading[]\n /** Estimated read time in minutes */\n readTime: number\n}\n\nexport class ContentEntry<T = Record<string, any>> {\n /** URL-friendly identifier */\n readonly slug: string\n /** Collection this entry belongs to */\n readonly collection: string\n /** Absolute path to source file */\n readonly filePath: string\n /** Validated data (frontmatter or parsed data) */\n readonly data: T\n /** Raw body content (markdown only) */\n readonly rawContent?: string\n\n /** Cached render result */\n private _rendered?: RenderedContent\n /** Markdown config for rendering */\n private _markdownConfig: MarkdownConfig\n\n constructor(\n slug: string,\n collection: string,\n filePath: string,\n data: T,\n rawContent: string | undefined,\n markdownConfig: MarkdownConfig,\n ) {\n this.slug = slug\n this.collection = collection\n this.filePath = filePath\n this.data = data\n this.rawContent = rawContent\n this._markdownConfig = markdownConfig\n }\n\n /** Render the entry content to HTML. Cached after first call. */\n async render(options?: { force?: boolean }): Promise<RenderedContent> {\n if (this._rendered && !options?.force) {\n return this._rendered\n }\n\n if (!this.rawContent) {\n // Non-markdown entries have no renderable content\n this._rendered = { html: '', headings: [], readTime: 0 }\n return this._rendered\n }\n\n const result = await processMarkdown(this.rawContent, this._markdownConfig, {\n content: this.rawContent,\n frontmatter: this.data as Record<string, unknown>,\n })\n const readTime = computeReadTime(this.rawContent)\n\n this._rendered = {\n html: result.html,\n headings: result.headings,\n readTime,\n }\n\n return this._rendered\n }\n\n /** Clear cached render result. */\n clearRenderCache(): void {\n this._rendered = undefined\n }\n}\n","/**\n * Plugin registration and execution.\n */\n\nimport type { ContentPlugin } from '../schemas/content-config'\n\n/** Collect all remark plugins from content plugins. */\nexport function collectRemarkPlugins(plugins: ContentPlugin[]): any[] {\n return plugins.filter((p) => p.remarkPlugin).map((p) => p.remarkPlugin!)\n}\n\n/** Collect all rehype plugins from content plugins. */\nexport function collectRehypePlugins(plugins: ContentPlugin[]): any[] {\n return plugins.filter((p) => p.rehypePlugin).map((p) => p.rehypePlugin!)\n}\n\n/** Run all plugin validators against an entry. */\nexport function runPluginValidators(\n plugins: ContentPlugin[],\n entry: { data: Record<string, any>; content?: string },\n): string[] {\n const issues: string[] = []\n for (const plugin of plugins) {\n if (plugin.validate) {\n issues.push(...plugin.validate(entry))\n }\n }\n return issues\n}\n\nexport type { ContentPlugin } from '../schemas/content-config'\n","/**\n * File discovery via glob patterns.\n */\n\nimport fg from 'fast-glob'\nimport { resolve } from 'path'\n\nexport interface DiscoverOptions {\n /** Directory to search in (absolute path) */\n directory: string\n /** Glob patterns to include */\n include: string[]\n /** Glob patterns to exclude */\n exclude?: string[]\n}\n\n/** Discover files matching glob patterns in a directory. */\nexport async function discoverFiles(options: DiscoverOptions): Promise<string[]> {\n const { directory, include, exclude = [] } = options\n\n const files = await fg(include, {\n cwd: directory,\n absolute: true,\n ignore: ['**/node_modules/**', '**/dist/**', '**/dev/**', ...exclude],\n })\n\n return files.map((p) => resolve(p))\n}\n","/**\n * Path-to-slug conversion.\n *\n * Generalized from packages/core/src/content/collector.ts.\n */\n\nimport { extname, relative } from 'path'\n\n/**\n * Convert a content file path to a URL-friendly slug.\n *\n * Examples:\n * content/posts/hello-world/README.md -> 'hello-world'\n * content/posts/hello-world/index.md -> 'hello-world'\n * content/posts/hello-world.md -> 'hello-world'\n * content/authors/john.json -> 'john'\n * content/posts/nested/deep/post.md -> 'nested/deep/post'\n */\nexport function toSlug(filePath: string, directory: string): string {\n const ext = extname(filePath)\n let slug = relative(directory, filePath).replace(/\\\\/g, '/')\n\n // Remove file extension\n if (ext) {\n slug = slug.slice(0, -ext.length)\n }\n\n // Strip README / index suffixes\n if (slug === 'README' || slug === 'index') return '/'\n if (slug.endsWith('/README')) slug = slug.slice(0, -7)\n if (slug.endsWith('/index')) slug = slug.slice(0, -6)\n\n return slug\n}\n","/**\n * Schema validation with rich error reporting.\n *\n * Wraps Zod's safeParse to produce human-readable validation issues.\n */\n\nimport type { ZodError, ZodType } from 'zod'\n\nexport type ValidationIssue = {\n /** Field path (e.g. 'tags[0]') */\n field?: string\n /** Human-readable error message */\n message: string\n /** Error severity */\n severity: 'error' | 'warn'\n}\n\nexport type ValidationEntryResult = {\n slug: string\n filePath: string\n issues: ValidationIssue[]\n}\n\nexport type ValidationResult = {\n collection: string\n entries: ValidationEntryResult[]\n errors: number\n warnings: number\n}\n\n/** Format a Zod error path into a human-readable field path. */\nexport function formatPath(path: PropertyKey[]): string {\n return path\n .map((segment, i) => {\n if (typeof segment === 'number') return `[${segment}]`\n if (typeof segment === 'symbol') return `[${String(segment)}]`\n if (i === 0) return segment\n return `.${segment}`\n })\n .join('')\n}\n\n/** Validate data against a Zod schema and return structured issues. */\nexport function validateSchema(\n data: Record<string, any>,\n schema: ZodType,\n): {\n issues: ValidationIssue[]\n validatedData: any\n} {\n const result = schema.safeParse(data)\n if (result.success) {\n return {\n issues: [],\n validatedData: result.data,\n }\n }\n\n const issues = (result.error as ZodError).issues.map((issue) => ({\n field: issue.path.length > 0 ? formatPath(issue.path) : undefined,\n message: issue.message,\n severity: 'error' as const,\n }))\n\n return {\n issues,\n validatedData: data,\n }\n}\n","/**\n * Code block validator — checks fenced code block meta syntax.\n *\n * Walks the shared MDAST for `code` nodes. Validates known meta properties\n * and language identifiers. Meta syntax follows Expressive Code conventions.\n */\n\nimport type { ValidationIssue } from './schema-validator'\nimport type { ContentValidator, MdastNode, ValidatorContext } from './types'\n\n/** Known meta properties accepted by Expressive Code and its plugins. */\nconst KNOWN_META_PROPS = new Set([\n 'title',\n 'showLineNumbers',\n 'startLineNumber',\n 'wrap',\n 'frame',\n 'collapse',\n 'mark',\n 'ins',\n 'del',\n])\n\n/** Extract the property name portion of a meta token (before `=` or `{`). */\nfunction extractMetaPropNames(meta: string): string[] {\n const props: string[] = []\n\n // Match key=value, key={...}, or bare flags\n const tokenRegex = /(\\w+)(?:=(?:\\{[^}]*\\}|\"[^\"]*\"|'[^']*'|\\S+))?/g\n let match: RegExpExecArray | null\n while ((match = tokenRegex.exec(meta)) !== null) {\n props.push(match[1]!)\n }\n\n return props\n}\n\n/** Collect all `code` nodes from MDAST. */\nfunction collectCodeBlocks(node: MdastNode): MdastNode[] {\n const blocks: MdastNode[] = []\n\n if (node.type === 'code') {\n blocks.push(node)\n }\n\n if (node.children) {\n for (const child of node.children) {\n blocks.push(...collectCodeBlocks(child))\n }\n }\n\n return blocks\n}\n\nexport const codeBlockValidator: ContentValidator = {\n name: 'code-blocks',\n\n validate(ctx: ValidatorContext): ValidationIssue[] {\n if (!ctx.rawContent || !ctx.mdast) return []\n\n const issues: ValidationIssue[] = []\n const tree = ctx.mdast as MdastNode\n\n const codeBlocks = collectCodeBlocks(tree)\n\n for (const block of codeBlocks) {\n const line = block.position?.start.line\n const lineInfo = line ? ` (line ${line})` : ''\n const meta = block.meta ?? ''\n const hasMeta = meta.trim().length > 0\n\n // Language required when using syntax features\n if (hasMeta && !block.lang) {\n issues.push({\n field: `code-block${lineInfo}`,\n message: 'Code block has meta properties but no language identifier',\n severity: 'warn',\n })\n }\n\n if (!hasMeta) continue\n\n // Check for unknown meta properties\n const propNames = extractMetaPropNames(meta)\n for (const prop of propNames) {\n if (!KNOWN_META_PROPS.has(prop)) {\n issues.push({\n field: `code-block${lineInfo}`,\n message: `Unknown code block meta property: \"${prop}\"`,\n severity: 'warn',\n })\n }\n }\n }\n\n return issues\n },\n}\n","/**\n * Heading validator — checks heading structure in markdown.\n *\n * Walks the shared MDAST for heading nodes. Validates level ordering and h1 uniqueness.\n */\n\nimport type { ValidationIssue } from './schema-validator'\nimport type { ContentValidator, MdastNode, ValidatorContext } from './types'\n\n/** Extract plain text from a heading node's children. */\nfunction getTextContent(node: MdastNode): string {\n if (node.type === 'text') return node.value ?? ''\n if (node.children) return node.children.map(getTextContent).join('')\n return ''\n}\n\n/** Collect all heading nodes from MDAST. */\nfunction collectHeadings(node: MdastNode): Array<{ depth: number; text: string; line?: number }> {\n const headings: Array<{ depth: number; text: string; line?: number }> = []\n\n if (node.type === 'heading' && node.depth) {\n headings.push({\n depth: node.depth,\n text: getTextContent(node),\n line: node.position?.start.line,\n })\n }\n\n if (node.children) {\n for (const child of node.children) {\n headings.push(...collectHeadings(child))\n }\n }\n\n return headings\n}\n\nexport const headingValidator: ContentValidator = {\n name: 'headings',\n\n validate(ctx: ValidatorContext): ValidationIssue[] {\n if (!ctx.rawContent || !ctx.mdast) return []\n\n const issues: ValidationIssue[] = []\n const tree = ctx.mdast as MdastNode\n\n const headings = collectHeadings(tree)\n\n // No headings in a document with content is worth noting\n if (headings.length === 0) {\n const hasContent = ctx.rawContent.trim().length > 0\n if (hasContent) {\n issues.push({\n message: 'Document has content but no headings',\n severity: 'warn',\n })\n }\n return issues\n }\n\n // At most one h1\n const h1s = headings.filter((h) => h.depth === 1)\n if (h1s.length > 1) {\n for (const h of h1s.slice(1)) {\n const lineInfo = h.line ? ` (line ${h.line})` : ''\n issues.push({\n field: `headings${lineInfo}`,\n message: `Multiple h1 headings found: \"${h.text}\"`,\n severity: 'warn',\n })\n }\n }\n\n // No skipped levels (only flag when going deeper)\n for (let i = 1; i < headings.length; i++) {\n const prev = headings[i - 1]!\n const curr = headings[i]!\n if (curr.depth > prev.depth + 1) {\n const lineInfo = curr.line ? ` (line ${curr.line})` : ''\n issues.push({\n field: `headings${lineInfo}`,\n message: `Heading level skip: h${prev.depth} -> h${curr.depth} (\"${curr.text}\")`,\n severity: 'warn',\n })\n }\n }\n\n return issues\n },\n}\n","/**\n * Link validator — checks links in markdown content.\n *\n * Walks the shared MDAST for link/image nodes. Internal links are checked for file existence;\n * external links are checked for well-formed URL format.\n */\n\nimport { existsSync } from 'fs'\nimport { dirname, resolve } from 'path'\nimport type { ValidationIssue } from './schema-validator'\nimport type { ContentValidator, MdastNode, ValidatorContext } from './types'\n\n/** Walk MDAST tree, collecting link and image nodes. */\nfunction collectLinks(node: MdastNode): Array<{ url: string; line?: number }> {\n const links: Array<{ url: string; line?: number }> = []\n\n if ((node.type === 'link' || node.type === 'image') && node.url) {\n links.push({\n url: node.url,\n line: node.position?.start.line,\n })\n }\n\n if (node.children) {\n for (const child of node.children) {\n links.push(...collectLinks(child))\n }\n }\n\n return links\n}\n\nfunction isInternalLink(url: string): boolean {\n if (url.startsWith('#')) return false\n if (url.startsWith('http://') || url.startsWith('https://')) return false\n if (url.startsWith('//')) return false\n if (url.startsWith('mailto:')) return false\n if (url.startsWith('tel:')) return false\n return true\n}\n\nfunction isWellFormedUrl(url: string): boolean {\n try {\n new URL(url)\n return true\n } catch {\n return false\n }\n}\n\nexport type LinkValidatorOptions = {\n /** Glob patterns for internal links to skip file-existence checks on. */\n skipPatterns?: string[]\n}\n\nexport function createLinkValidator(options?: LinkValidatorOptions): ContentValidator {\n const skipPatterns = options?.skipPatterns ?? []\n\n function shouldSkip(url: string): boolean {\n return skipPatterns.some((pattern) => {\n if (pattern.includes('*')) {\n const regex = new RegExp('^' + pattern.replace(/\\*/g, '.*') + '$')\n return regex.test(url)\n }\n return url.startsWith(pattern)\n })\n }\n\n return {\n name: 'links',\n\n validate(ctx: ValidatorContext): ValidationIssue[] {\n if (!ctx.rawContent || !ctx.mdast) return []\n\n const issues: ValidationIssue[] = []\n const tree = ctx.mdast as MdastNode\n\n const links = collectLinks(tree)\n const fileDir = dirname(ctx.filePath)\n\n for (const link of links) {\n const lineInfo = link.line ? ` (line ${link.line})` : ''\n\n // External links — check URL format\n if (link.url.startsWith('http://') || link.url.startsWith('https://')) {\n if (!isWellFormedUrl(link.url)) {\n issues.push({\n field: `links${lineInfo}`,\n message: `Malformed external URL: ${link.url}`,\n severity: 'warn',\n })\n }\n continue\n }\n\n // Internal links — check file exists\n if (isInternalLink(link.url)) {\n if (shouldSkip(link.url)) continue\n\n // Strip fragment and query\n const urlPath = link.url.split('#')[0]!.split('?')[0]!\n if (!urlPath) continue // pure fragment link\n\n const resolved = resolve(fileDir, urlPath)\n if (!existsSync(resolved)) {\n issues.push({\n field: `links${lineInfo}`,\n message: `Broken internal link: ${link.url}`,\n severity: 'error',\n })\n }\n }\n }\n\n return issues\n },\n }\n}\n\nexport const linkValidator: ContentValidator = createLinkValidator()\n","/**\n * Validation runner — executes a list of content validators on an entry.\n *\n * Validators that throw are caught and converted to error-severity issues\n * so one failing validator does not block the rest.\n */\n\nimport remarkParse from 'remark-parse'\nimport { unified } from 'unified'\nimport type { ValidationIssue } from './schema-validator'\nimport type { ContentValidator, ValidatorContext } from './types'\n\nimport { codeBlockValidator } from './code-block-validator'\nimport { headingValidator } from './heading-validator'\nimport { linkValidator } from './link-validator'\n\n/** The built-in validators for markdown content. */\nexport const builtinMarkdownValidators: ContentValidator[] = [\n linkValidator,\n codeBlockValidator,\n headingValidator,\n]\n\n/** Run all validators on a single content entry. */\nexport async function runValidators(\n ctx: ValidatorContext,\n validators: ContentValidator[],\n): Promise<ValidationIssue[]> {\n if (ctx.rawContent && !ctx.mdast) {\n ctx.mdast = unified().use(remarkParse).parse(ctx.rawContent)\n }\n\n const issues: ValidationIssue[] = []\n\n for (const validator of validators) {\n try {\n const result = await validator.validate(ctx)\n issues.push(...result)\n } catch (err) {\n // Convert thrown errors into issues so one bad validator doesn't abort all\n const message = err instanceof Error ? err.message : String(err)\n issues.push({\n message: `Validator \"${validator.name}\" threw: ${message}`,\n severity: 'error',\n })\n }\n }\n\n return issues\n}\n","/**\n * ContentStore — in-memory cache for loaded collections.\n *\n * Handles file discovery, loading, validation, and caching.\n * Not exported directly — used internally by ContentLayer.\n */\n\nimport { resolve } from 'path'\nimport type { MarkdownConfig } from './schemas/markdown-config'\nimport type { ZodType } from 'zod'\nimport { ContentEntry } from './entry'\nimport { defaultIncludePatterns, resolveLoader } from './loaders'\nimport type { Loader } from './loaders/types'\nimport { collectRehypePlugins, collectRemarkPlugins, runPluginValidators } from './plugins'\nimport type { CollectionDef, RawEntry } from './schemas/collection'\nimport type { ContentLayerConfig } from './schemas/content-config'\nimport { discoverFiles } from './utils/glob'\nimport { toSlug } from './utils/slug'\nimport { validateSchema, type ValidationIssue } from './validation'\nimport { builtinMarkdownValidators, runValidators } from './validation/runner'\nimport type { ContentValidator } from './validation/types'\n\ntype CacheEntry = {\n entry: ContentEntry\n issues: ValidationIssue[]\n}\n\nexport class ContentStore {\n private cache = new Map<string, Map<string, CacheEntry>>()\n private loaded = new Set<string>()\n private config: ContentLayerConfig\n private rootDir: string\n private markdownConfig: MarkdownConfig\n\n constructor(config: ContentLayerConfig) {\n this.config = config\n this.rootDir = config.root ? resolve(config.root) : process.cwd()\n this.markdownConfig = this.createMarkdownConfig()\n }\n\n /** Load a collection (if not already loaded) and return entries. */\n async loadCollection<S extends ZodType>(\n name: string,\n def: CollectionDef<S>,\n ): Promise<ContentEntry[]> {\n if (this.loaded.has(name)) {\n const cached = this.cache.get(name)\n return cached ? Array.from(cached.values()).map((c) => c.entry) : []\n }\n\n const loader = resolveLoader(def.loader)\n const directory = resolve(this.rootDir, def.directory)\n const include = def.include ?? defaultIncludePatterns(loader)\n\n const files = await discoverFiles({\n directory,\n include,\n exclude: def.exclude,\n })\n\n const entries = new Map<string, CacheEntry>()\n const results = await Promise.all(\n files.map(async (filePath) => {\n try {\n return await this.loadEntry(name, filePath, directory, loader, def)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n const slug = def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory)\n const loadError = new Error(`Failed to load ${filePath}: ${message}`, {\n cause: err,\n })\n console.warn(loadError.message)\n return {\n entry: new ContentEntry(slug, name, filePath, {}, undefined, this.markdownConfig),\n issues: [{ message: loadError.message, severity: 'error' as const }],\n }\n }\n }),\n )\n\n for (const result of results) {\n if (result) {\n entries.set(result.entry.slug, result)\n }\n }\n\n this.cache.set(name, entries)\n this.loaded.add(name)\n\n return Array.from(entries.values()).map((c) => c.entry)\n }\n\n /** Load a single entry from a file. */\n private async loadEntry(\n collectionName: string,\n filePath: string,\n directory: string,\n loader: Loader,\n def: CollectionDef<any>,\n ): Promise<CacheEntry | null> {\n const loaded = await loader.load(filePath)\n const slug = def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory)\n\n let raw: RawEntry = {\n data: loaded.data,\n content: loaded.content,\n filePath,\n slug,\n }\n\n // Apply transform\n if (def.transform) {\n raw = await def.transform(raw)\n }\n\n // Apply computed fields\n if (def.computed) {\n for (const [key, fn] of Object.entries(def.computed) as Array<\n [string, (entry: RawEntry) => any]\n >) {\n raw.data[key] = fn(raw)\n }\n }\n\n // Apply filter\n if (def.filter && !def.filter(raw)) {\n return null\n }\n\n // Validate schema once to collect issues and transformed data.\n const { issues, validatedData } = validateSchema(raw.data, def.schema)\n\n // Custom validation\n if (def.validate) {\n const customError = def.validate(raw)\n if (customError) {\n issues.push({ message: customError, severity: 'error' })\n }\n }\n\n // Run content validators on markdown entries\n const isMarkdownEntry = raw.content !== undefined\n if (isMarkdownEntry) {\n const validators = this.resolveValidators(def)\n if (validators.length > 0) {\n const contentIssues = await runValidators(\n {\n filePath,\n slug,\n collection: collectionName,\n rawContent: raw.content,\n data: raw.data,\n },\n validators,\n )\n issues.push(...contentIssues)\n }\n }\n\n if (this.config.plugins?.length) {\n const pluginIssues = runPluginValidators(this.config.plugins, {\n data: raw.data,\n content: raw.content,\n })\n for (const message of pluginIssues) {\n issues.push({ message, severity: 'error' })\n }\n }\n\n const entry = new ContentEntry(\n slug,\n collectionName,\n filePath,\n validatedData,\n raw.content,\n this.markdownConfig,\n )\n\n return { entry, issues }\n }\n\n /** Get a single entry by slug. */\n getEntry(collection: string, slug: string): ContentEntry | undefined {\n return this.cache.get(collection)?.get(slug)?.entry\n }\n\n /** Get validation issues for a collection. */\n getIssues(collection: string): Map<string, ValidationIssue[]> {\n const result = new Map<string, ValidationIssue[]>()\n const entries = this.cache.get(collection)\n if (!entries) return result\n for (const [slug, cached] of entries) {\n if (cached.issues.length > 0) {\n result.set(slug, cached.issues)\n }\n }\n return result\n }\n\n /** Invalidate a single entry and reload it without reloading the entire collection. */\n async invalidate(collection: string, slug: string): Promise<void> {\n const def = this.config.collections[collection]\n if (!def) return\n\n const collectionCache = this.cache.get(collection)\n if (!collectionCache) return\n\n const existing = collectionCache.get(slug)\n if (!existing) return\n\n const loader = resolveLoader(def.loader)\n const directory = resolve(this.rootDir, def.directory)\n\n try {\n const result = await this.loadEntry(\n collection,\n existing.entry.filePath,\n directory,\n loader,\n def,\n )\n if (result) {\n collectionCache.set(slug, result)\n } else {\n // Entry was filtered out after reload\n collectionCache.delete(slug)\n }\n } catch {\n // File may have been deleted; remove from cache\n collectionCache.delete(slug)\n }\n }\n\n /** Invalidate an entire collection. */\n async invalidateCollection(collection: string): Promise<void> {\n this.cache.delete(collection)\n this.loaded.delete(collection)\n }\n\n /** Invalidate all collections. */\n invalidateAll(): void {\n this.cache.clear()\n this.loaded.clear()\n }\n\n /** Resolve the list of content validators for a collection. */\n private resolveValidators(def: CollectionDef<any>): ContentValidator[] {\n const builtin = def.disableBuiltinValidators ? [] : builtinMarkdownValidators\n const custom = def.validators ?? []\n return [...builtin, ...custom]\n }\n\n private createMarkdownConfig(): MarkdownConfig {\n const base = this.config.markdown ?? {}\n const remarkPlugins = [...(base.remarkPlugins ?? [])]\n const rehypePlugins = [...(base.rehypePlugins ?? [])]\n const plugins = this.config.plugins ?? []\n\n if (plugins.length > 0) {\n remarkPlugins.push(...collectRemarkPlugins(plugins))\n rehypePlugins.push(...collectRehypePlugins(plugins))\n }\n\n return {\n ...base,\n ...(remarkPlugins.length > 0 ? { remarkPlugins } : {}),\n ...(rehypePlugins.length > 0 ? { rehypePlugins } : {}),\n }\n }\n}\n","/**\n * ContentLayer — the main API for working with content collections.\n *\n * Created via createContentLayer(config). Provides methods to:\n * - Load and query collections (getCollection, getEntry)\n * - Convert markdown directly (convert)\n * - Invalidate cache (invalidate, invalidateCollection, invalidateAll)\n * - Validate all entries (validate)\n */\n\nimport { convert as coreConvert } from './convert'\nimport type { ConvertResult } from './convert'\nimport type { MarkdownConfig } from './schemas/markdown-config'\nimport type { ContentEntry } from './entry'\nimport type { CollectionDef } from './schemas/collection'\nimport type { ContentLayerConfig } from './schemas/content-config'\nimport { ContentStore } from './store'\nimport type { ValidationResult } from './validation'\n\nexport interface ContentLayer {\n /** Get all entries in a collection. */\n getCollection(name: string): Promise<ContentEntry[]>\n\n /** Get a single entry by collection name and slug. */\n getEntry(collection: string, slug: string): Promise<ContentEntry | undefined>\n\n /** Convert raw markdown to HTML (no collection, no validation). */\n convert(markdown: string, options?: LayerConvertOptions): Promise<ConvertResult>\n\n /** Invalidate a single entry's cache. */\n invalidate(collection: string, slug: string): Promise<void>\n\n /** Invalidate an entire collection's cache. */\n invalidateCollection(collection: string): Promise<void>\n\n /** Invalidate all cached data. */\n invalidateAll(): void\n\n /** Validate all entries in a collection (or all collections). */\n validate(collection?: string): Promise<ValidationResult[]>\n\n /** Get the names of all configured collections. */\n getCollectionNames(): string[]\n\n /** Get the definition of a collection. */\n getCollectionDef(name: string): CollectionDef | undefined\n\n /** Get all collection definitions. */\n getCollections(): Record<string, CollectionDef>\n}\n\nexport type LayerConvertOptions = {\n markdown?: MarkdownConfig\n}\n\nclass ContentLayerImpl implements ContentLayer {\n private store: ContentStore\n private config: ContentLayerConfig\n\n constructor(config: ContentLayerConfig) {\n this.config = config\n this.store = new ContentStore(config)\n }\n\n async getCollection(name: string): Promise<ContentEntry[]> {\n const def = this.config.collections[name]\n if (!def) {\n throw new Error(\n `Collection \"${name}\" not found. Available: ${Object.keys(this.config.collections).join(\n ', ',\n )}`,\n )\n }\n return this.store.loadCollection(name, def)\n }\n\n async getEntry(collection: string, slug: string): Promise<ContentEntry | undefined> {\n // The first getEntry call loads the full collection and then serves from cache.\n // Single-entry loading would skip collection-level transforms and validation context.\n await this.getCollection(collection)\n return this.store.getEntry(collection, slug)\n }\n\n async convert(markdown: string, options?: LayerConvertOptions): Promise<ConvertResult> {\n return coreConvert(markdown, {\n markdown: options?.markdown ?? this.config.markdown,\n })\n }\n\n async invalidate(collection: string, slug: string): Promise<void> {\n await this.store.invalidate(collection, slug)\n }\n\n async invalidateCollection(collection: string): Promise<void> {\n await this.store.invalidateCollection(collection)\n }\n\n invalidateAll(): void {\n this.store.invalidateAll()\n }\n\n async validate(collection?: string): Promise<ValidationResult[]> {\n const names = collection ? [collection] : Object.keys(this.config.collections)\n const results: ValidationResult[] = []\n\n for (const name of names) {\n // Ensure loaded\n await this.getCollection(name)\n\n const issues = this.store.getIssues(name)\n const entries = Array.from(issues.entries()).map(([slug, entryIssues]) => {\n const entry = this.store.getEntry(name, slug)\n return {\n slug,\n filePath: entry?.filePath ?? '',\n issues: entryIssues,\n }\n })\n\n let errors = 0\n let warnings = 0\n for (const entry of entries) {\n for (const issue of entry.issues) {\n if (issue.severity === 'error') errors++\n else warnings++\n }\n }\n\n results.push({ collection: name, entries, errors, warnings })\n }\n\n return results\n }\n\n getCollectionNames(): string[] {\n return Object.keys(this.config.collections)\n }\n\n getCollectionDef(name: string): CollectionDef | undefined {\n return this.config.collections[name]\n }\n\n getCollections(): Record<string, CollectionDef> {\n return { ...this.config.collections }\n }\n}\n\n/** Create a new content layer from a configuration. */\nexport function createContentLayer(config: ContentLayerConfig): ContentLayer {\n return new ContentLayerImpl(config)\n}\n"],"mappings":";;;;;;;;AAcA,eAAsB,QAAQ,OAAe,UAA0B,EAAE,EAA0B;CACjG,MAAM,SAAS,MAAM,gBAAgB,OAAO,QAAQ,YAAY,EAAE,CAAC;AACnE,QAAO;EAAE,MAAM,OAAO;EAAM,KAAK,OAAO;EAAU,aAAa,OAAO;EAAa;;;;;;;;;;ACTrF,SAAgB,gBAAgB,aAA6B;CAU3D,MAAM,YATY,YACf,QAAQ,mBAAmB,IAAI,CAC/B,QAAQ,mBAAmB,IAAI,CAC/B,QAAQ,oBAAoB,IAAI,CAChC,QAAQ,YAAY,IAAI,CACxB,QAAQ,4BAA4B,KAAK,CACzC,QAAQ,aAAa,IAAI,CACzB,QAAQ,QAAQ,IAAI,CACpB,MAAM,CACmB,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC;AACvD,QAAO,KAAK,IAAI,GAAG,KAAK,KAAK,YAAY,IAAI,CAAC;;;;ACGhD,IAAa,eAAb,MAAmD;;CAEjD;;CAEA;;CAEA;;CAEA;;CAEA;;CAGA;;CAEA;CAEA,YACE,MACA,YACA,UACA,MACA,YACA,gBACA;AACA,OAAK,OAAO;AACZ,OAAK,aAAa;AAClB,OAAK,WAAW;AAChB,OAAK,OAAO;AACZ,OAAK,aAAa;AAClB,OAAK,kBAAkB;;;CAIzB,MAAM,OAAO,SAAyD;AACpE,MAAI,KAAK,aAAa,CAAC,SAAS,MAC9B,QAAO,KAAK;AAGd,MAAI,CAAC,KAAK,YAAY;AAEpB,QAAK,YAAY;IAAE,MAAM;IAAI,UAAU,EAAE;IAAE,UAAU;IAAG;AACxD,UAAO,KAAK;;EAGd,MAAM,SAAS,MAAM,gBAAgB,KAAK,YAAY,KAAK,iBAAiB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AAIT,WAAQ,KAAK;IAAE,YAAY;IAAM;IAAS;IAAQ;IAAU,CAAC;;AAG/D,SAAO;;CAGT,qBAA+B;AAC7B,SAAO,OAAO,KAAK,KAAK,OAAO,YAAY;;CAG7C,iBAAiB,MAAyC;AACxD,SAAO,KAAK,OAAO,YAAY;;CAGjC,iBAAgD;AAC9C,SAAO,EAAE,GAAG,KAAK,OAAO,aAAa;;;;AAKzC,SAAgB,mBAAmB,QAA0C;AAC3E,QAAO,IAAI,iBAAiB,OAAO"}
|
package/dist/css-BneO430t.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { bundle } from "lightningcss";
|
|
3
|
-
//#region src/css/builder.ts
|
|
4
|
-
function buildCss(entryPath, config) {
|
|
5
|
-
const targets = config?.targets ?? {};
|
|
6
|
-
const { code } = bundle({
|
|
7
|
-
filename: resolve(entryPath),
|
|
8
|
-
minify: config?.minify ?? true,
|
|
9
|
-
targets: {
|
|
10
|
-
chrome: (targets.chrome ?? 123) << 16,
|
|
11
|
-
firefox: (targets.firefox ?? 120) << 16,
|
|
12
|
-
safari: (targets.safari ?? 18) << 16
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return new TextDecoder().decode(code);
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { buildCss as t };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=css-BneO430t.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-BneO430t.mjs","names":[],"sources":["../src/css/builder.ts"],"sourcesContent":["import { bundle } from 'lightningcss'\nimport { resolve } from 'path'\n\nexport type CssBuildOptions = {\n minify?: boolean\n targets?: {\n chrome?: number\n firefox?: number\n safari?: number\n }\n}\n\nexport function buildCss(entryPath: string, config?: CssBuildOptions): string {\n const targets = config?.targets ?? {}\n const { code } = bundle({\n filename: resolve(entryPath),\n minify: config?.minify ?? true,\n targets: {\n chrome: (targets.chrome ?? 123) << 16,\n firefox: (targets.firefox ?? 120) << 16,\n safari: (targets.safari ?? 18) << 16,\n },\n })\n return new TextDecoder().decode(code)\n}\n"],"mappings":";;;AAYA,SAAgB,SAAS,WAAmB,QAAkC;CAC5E,MAAM,UAAU,QAAQ,WAAW,EAAE;CACrC,MAAM,EAAE,SAAS,OAAO;EACtB,UAAU,QAAQ,UAAU;EAC5B,QAAQ,QAAQ,UAAU;EAC1B,SAAS;GACP,SAAS,QAAQ,UAAU,QAAQ;GACnC,UAAU,QAAQ,WAAW,QAAQ;GACrC,SAAS,QAAQ,UAAU,OAAO;GACnC;EACF,CAAC;AACF,QAAO,IAAI,aAAa,CAAC,OAAO,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"heading-BpDXnl-7.d.mts","names":[],"sources":["../src/schemas/markdown-config.ts","../src/schemas/heading.ts"],"mappings":";;;cAIa,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;KAerB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;;;cCf/B,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;KAMd,OAAA,GAAU,CAAA,CAAE,KAAA,QAAa,aAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CbOKbkjJ.d.mts","names":[],"sources":["../src/markdown/pipeline.ts"],"mappings":";;;KAuBY,cAAA;EACV,IAAA;EACA,QAAA,EAAU,OAAA;EACV,WAAA,EAAa,MAAA;AAAA;AAAA,iBA8HO,eAAA,CACpB,GAAA,UACA,MAAA,GAAS,cAAA,EACT,YAAA;EAAiB,OAAA;EAAiB,WAAA,EAAa,MAAA;AAAA,IAC9C,OAAA,CAAQ,cAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loaders-Cf-BXf2L.mjs","names":["parseYaml","parse"],"sources":["../src/loaders/errors.ts","../src/loaders/json.ts","../src/loaders/jsonc.ts","../src/loaders/markdown.ts","../src/loaders/toml.ts","../src/loaders/yaml.ts","../src/loaders/index.ts"],"sourcesContent":["export class LoaderError extends Error {\n readonly filePath: string\n readonly format: string\n readonly line?: number\n readonly column?: number\n\n constructor(message: string, filePath: string, format: string, line?: number, column?: number) {\n super(`${format} parse error in ${filePath}${line ? `:${line}` : ''}: ${message}`)\n this.name = 'LoaderError'\n this.filePath = filePath\n this.format = format\n this.line = line\n this.column = column\n }\n}\n","/**\n * JSON / JSON5 / JSONC loader.\n *\n * Detects format from file extension and parses accordingly.\n */\n\nimport { readFile } from 'fs/promises'\nimport JSON5 from 'json5'\nimport { LoaderError } from './errors'\nimport type { Loader, LoaderResult } from './types'\n\nexport class JsonLoader implements Loader {\n name = 'json'\n kind = 'data' as const\n extensions = ['.json', '.json5']\n\n async load(filePath: string): Promise<LoaderResult> {\n const raw = await readFile(filePath, 'utf-8')\n const isJson = filePath.endsWith('.json')\n\n try {\n const data = isJson ? JSON.parse(raw) : JSON5.parse(raw)\n return { data }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n throw new LoaderError(message, filePath, isJson ? 'JSON' : 'JSON5')\n }\n }\n}\n","/**\n * JSONC loader — JSON with Comments.\n *\n * Strips single-line (//) and multi-line comments before parsing.\n * Delegates to JSON.parse after stripping (no JSON5 superset features).\n */\n\nimport { readFile } from 'fs/promises'\nimport { LoaderError } from './errors'\nimport type { Loader, LoaderResult } from './types'\n\n/** Strip // and block comments, preserving strings. */\nfunction stripComments(raw: string): string {\n let result = ''\n let i = 0\n const len = raw.length\n\n while (i < len) {\n // String literal — copy verbatim to preserve contents\n if (raw[i] === '\"') {\n let end = i + 1\n while (end < len && raw[end] !== '\"') {\n if (raw[end] === '\\\\') end++ // skip escaped char\n end++\n }\n result += raw.slice(i, end + 1)\n i = end + 1\n continue\n }\n\n // Single-line comment\n if (raw[i] === '/' && raw[i + 1] === '/') {\n i += 2\n while (i < len && raw[i] !== '\\n') i++\n continue\n }\n\n // Block comment\n if (raw[i] === '/' && raw[i + 1] === '*') {\n i += 2\n while (i < len && !(raw[i] === '*' && raw[i + 1] === '/')) i++\n i += 2 // skip closing */\n continue\n }\n\n result += raw[i]\n i++\n }\n\n return result\n}\n\nexport class JsoncLoader implements Loader {\n name = 'jsonc'\n kind = 'data' as const\n extensions = ['.jsonc']\n\n async load(filePath: string): Promise<LoaderResult> {\n const raw = await readFile(filePath, 'utf-8')\n try {\n const stripped = stripComments(raw)\n const data = JSON.parse(stripped)\n return { data }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n throw new LoaderError(message, filePath, 'JSONC')\n }\n }\n}\n","/**\n * Markdown loader.\n *\n * Uses gray-matter to extract YAML frontmatter and body content.\n * Rendering is NOT done here — it's deferred to ContentEntry.render().\n */\n\nimport { readFile } from 'fs/promises'\nimport matter from 'gray-matter'\nimport { parse as parseYaml } from 'yaml'\nimport { LoaderError } from './errors'\nimport type { Loader, LoaderResult } from './types'\n\nexport class MarkdownLoader implements Loader {\n name = 'markdown'\n kind = 'markdown' as const\n extensions = ['.md']\n\n async load(filePath: string): Promise<LoaderResult> {\n const raw = await readFile(filePath, 'utf-8')\n try {\n const { data, content } = matter(raw, { engines: { yaml: parseYaml } })\n return { data, content }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n throw new LoaderError(message, filePath, 'Markdown')\n }\n }\n}\n","/**\n * TOML loader.\n */\n\nimport { readFile } from 'fs/promises'\nimport { parse } from 'smol-toml'\nimport { LoaderError } from './errors'\nimport type { Loader, LoaderResult } from './types'\n\nexport class TomlLoader implements Loader {\n name = 'toml'\n kind = 'data' as const\n extensions = ['.toml']\n\n async load(filePath: string): Promise<LoaderResult> {\n const raw = await readFile(filePath, 'utf-8')\n try {\n const data = parse(raw)\n return { data }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n throw new LoaderError(message, filePath, 'TOML')\n }\n }\n}\n","/**\n * YAML loader.\n */\n\nimport { readFile } from 'fs/promises'\nimport { parse } from 'yaml'\nimport { LoaderError } from './errors'\nimport type { Loader, LoaderResult } from './types'\n\nexport class YamlLoader implements Loader {\n name = 'yaml'\n kind = 'data' as const\n extensions = ['.yaml', '.yml']\n\n async load(filePath: string): Promise<LoaderResult> {\n const raw = await readFile(filePath, 'utf-8')\n try {\n const data = parse(raw) ?? {}\n return { data }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n const line =\n err != null && typeof err === 'object' && 'linePos' in err\n ? (err as any).linePos?.[0]?.line\n : undefined\n throw new LoaderError(message, filePath, 'YAML', line)\n }\n }\n}\n","/**\n * Loader registry — resolves loader type strings to Loader instances.\n */\n\nexport { JsonLoader } from './json'\nexport { JsoncLoader } from './jsonc'\nexport { LoaderError } from './errors'\nexport { MarkdownLoader } from './markdown'\nexport { TomlLoader } from './toml'\nexport type { Loader, LoaderResult, LoaderType } from './types'\nexport { YamlLoader } from './yaml'\n\nimport { JsonLoader } from './json'\nimport { JsoncLoader } from './jsonc'\nimport { MarkdownLoader } from './markdown'\nimport { TomlLoader } from './toml'\nimport type { Loader, LoaderType } from './types'\nimport { YamlLoader } from './yaml'\n\n/** Singleton loader instances (loaders are stateless). */\nconst markdownLoader = new MarkdownLoader()\nconst jsonLoader = new JsonLoader()\nconst jsoncLoader = new JsoncLoader()\nconst yamlLoader = new YamlLoader()\nconst tomlLoader = new TomlLoader()\n\n/** Custom loader registry for user-registered loaders. */\nconst customLoaders = new Map<string, Loader>()\n\n/** Register a custom loader by name. */\nexport function registerLoader(name: string, loader: Loader): void {\n customLoaders.set(name, loader)\n}\n\n/** Resolve a loader type string or custom Loader instance. */\nexport function resolveLoader(loaderOrType: LoaderType | Loader): Loader {\n if (typeof loaderOrType === 'object') return loaderOrType\n\n const custom = customLoaders.get(loaderOrType)\n if (custom) return custom\n\n switch (loaderOrType) {\n case 'markdown':\n return markdownLoader\n case 'json':\n case 'json5':\n return jsonLoader\n case 'jsonc':\n return jsoncLoader\n case 'yaml':\n return yamlLoader\n case 'toml':\n return tomlLoader\n default:\n throw new Error(`Unknown loader type: ${loaderOrType as string}`)\n }\n}\n\n/** Get default include glob patterns for a loader. */\nexport function defaultIncludePatterns(loader: Loader): string[] {\n return loader.extensions.map((ext) => `**/*${ext}`)\n}\n"],"mappings":";;;;;;AAAA,IAAa,cAAb,cAAiC,MAAM;CACrC;CACA;CACA;CACA;CAEA,YAAY,SAAiB,UAAkB,QAAgB,MAAe,QAAiB;AAC7F,QAAM,GAAG,OAAO,kBAAkB,WAAW,OAAO,IAAI,SAAS,GAAG,IAAI,UAAU;AAClF,OAAK,OAAO;AACZ,OAAK,WAAW;AAChB,OAAK,SAAS;AACd,OAAK,OAAO;AACZ,OAAK,SAAS;;;;;;;;;;ACDlB,IAAa,aAAb,MAA0C;CACxC,OAAO;CACP,OAAO;CACP,aAAa,CAAC,SAAS,SAAS;CAEhC,MAAM,KAAK,UAAyC;EAClD,MAAM,MAAM,MAAM,SAAS,UAAU,QAAQ;EAC7C,MAAM,SAAS,SAAS,SAAS,QAAQ;AAEzC,MAAI;AAEF,UAAO,EAAE,MADI,SAAS,KAAK,MAAM,IAAI,GAAG,MAAM,MAAM,IAAI,EACzC;WACR,KAAK;AAEZ,SAAM,IAAI,YADM,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI,EACjC,UAAU,SAAS,SAAS,QAAQ;;;;;;;;;;;;;ACbzE,SAAS,cAAc,KAAqB;CAC1C,IAAI,SAAS;CACb,IAAI,IAAI;CACR,MAAM,MAAM,IAAI;AAEhB,QAAO,IAAI,KAAK;AAEd,MAAI,IAAI,OAAO,MAAK;GAClB,IAAI,MAAM,IAAI;AACd,UAAO,MAAM,OAAO,IAAI,SAAS,MAAK;AACpC,QAAI,IAAI,SAAS,KAAM;AACvB;;AAEF,aAAU,IAAI,MAAM,GAAG,MAAM,EAAE;AAC/B,OAAI,MAAM;AACV;;AAIF,MAAI,IAAI,OAAO,OAAO,IAAI,IAAI,OAAO,KAAK;AACxC,QAAK;AACL,UAAO,IAAI,OAAO,IAAI,OAAO,KAAM;A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;CACxC,OAAO;CACP,OAAO;CACP,aAAa,CAAC,SAAS,OAAO;CAE9B,MAAM,KAAK,UAAyC;EAClD,MAAM,MAAM,MAAM,SAAS,UAAU,QAAQ;AAC7C,MAAI;AAEF,UAAO,EAAE,MADI,MAAM,IAAI,IAAI,EAAE,EACd;WACR,KAAK;AAMZ,SAAM,IAAI,YALM,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI,EAKjC,UAAU,QAHvC,OAAO,QAAQ,OAAO,QAAQ,YAAY,aAAa,MAClD,IAAY,UAAU,IAAI,OAC3B,KAAA,EACgD;;;;;;;ACL5D,MAAM,iBAAiB,IAAI,gBAAgB;AAC3C,MAAM,aAAa,IAAI,YAAY;AACnC,MAAM,cAAc,IAAI,aAAa;AACrC,MAAM,aAAa,IAAI,YAAY;AACnC,MAAM,aAAa,IAAI,YAAY;;AAGnC,MAAM,gCAAgB,IAAI,KAAqB;;AAG/C,SAAgB,eAAe,MAAc,QAAsB;AACjE,eAAc,IAAI,MAAM,OAAO;;;AAIjC,SAAgB,cAAc,cAA2C;AACvE,KAAI,OAAO,iBAAiB,SAAU,QAAO;CAE7C,MAAM,SAAS,cAAc,IAAI,aAAa;AAC9C,KAAI,OAAQ,QAAO;AAEnB,SAAQ,cAAR;EACE,KAAK,WACH,QAAO;EACT,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,QACE,OAAM,IAAI,MAAM,wBAAwB,eAAyB;;;;AAKvE,SAAgB,uBAAuB,QAA0B;AAC/D,QAAO,OAAO,WAAW,KAAK,QAAQ,OAAO,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-CyrHoDhP.mjs","names":["parseYaml"],"sources":["../src/markdown/pipeline.ts"],"sourcesContent":["import matter from 'gray-matter'\nimport { parse as parseYaml } from 'yaml'\nimport { rehypeAccessibleEmojis } from 'rehype-accessible-emojis'\nimport rehypeAutolinkHeadings from 'rehype-autolink-headings'\nimport rehypeExpressiveCode, {\n type BundledShikiTheme,\n type RehypeExpressiveCodeOptions,\n} from 'rehype-expressive-code'\nimport rehypeExternalLinks from 'rehype-external-links'\nimport rehypeMathjax from 'rehype-mathjax/svg'\nimport rehypeSlug from 'rehype-slug'\nimport rehypeStringify from 'rehype-stringify'\nimport remarkFrontmatter from 'remark-frontmatter'\nimport remarkGfm from 'remark-gfm'\nimport remarkGithubAlerts from 'remark-github-alerts'\nimport remarkMath from 'remark-math'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport remarkSmartypants from 'remark-smartypants'\nimport { unified } from 'unified'\nimport type { Heading } from '../schemas/heading'\nimport type { MarkdownConfig } from '../schemas/markdown-config'\n\nexport type MarkdownResult = {\n html: string\n headings: Heading[]\n frontmatter: Record<string, unknown>\n}\n\nexport type { MarkdownConfig }\n\nconst DEFAULT_MARKDOWN_CONFIG: MarkdownConfig = {}\n\n/** Default language aliases for fenced code blocks that Shiki doesn't recognize natively. */\nconst DEFAULT_LANG_ALIASES: Record<string, string> = {\n dot: 'text',\n mermaid: 'text',\n plantuml: 'text',\n excalidraw: 'json',\n drawio: 'xml',\n proto: 'protobuf',\n ejs: 'html',\n hbs: 'handlebars',\n}\n\nfunction getTextContent(node: any): string {\n if (node.type === 'text') return node.value || ''\n if (node.children) return node.children.map(getTextContent).join('')\n return ''\n}\n\nfunction extractHeadings(tree: any, headings: Heading[]): void {\n if (tree.type === 'element' && /^h[1-6]$/.test(tree.tagName)) {\n headings.push({\n depth: parseInt(tree.tagName[1]),\n text: getTextContent(tree),\n slug: tree.properties?.id || '',\n })\n }\n if (tree.children) {\n for (const child of tree.children) {\n extractHeadings(child, headings)\n }\n }\n}\n\nfunction createProcessor(config: MarkdownConfig) {\n const processor = unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkMath)\n .use(remarkFrontmatter, ['yaml'])\n // GitHub-flavored alerts: > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]\n .use(remarkGithubAlerts)\n // Smart typography: \"smart quotes\", em—dashes, el…lipses\n .use(remarkSmartypants)\n\n if (config.remarkPlugins) {\n for (const plugin of config.remarkPlugins) {\n if (Array.isArray(plugin)) processor.use(plugin[0], plugin[1])\n else processor.use(plugin)\n }\n }\n\n // Apply language aliases to fenced code blocks before Expressive Code processes them.\n // Merge defaults with user-provided aliases (user overrides take precedence).\n const langAlias = { ...DEFAULT_LANG_ALIASES, ...config.shiki?.langAlias }\n processor.use(() => (tree: any) => {\n const visit = (node: any): void => {\n if (node?.type === 'code' && typeof node.lang === 'string' && langAlias[node.lang]) {\n node.lang = langAlias[node.lang]\n }\n if (Array.isArray(node?.children)) {\n for (const child of node.children) visit(child)\n }\n }\n visit(tree)\n })\n\n processor.use(remarkRehype, { allowDangerousHtml: true })\n\n // MathJax must run before Expressive Code so that math elements (from remark-math)\n // are rendered to SVG before Expressive Code tries to highlight them as code blocks.\n processor.use(rehypeMathjax)\n\n // Expressive Code — syntax highlighting, code frames, tabs, copy button\n const lightTheme = (config.shiki?.themes?.light || 'github-light') as BundledShikiTheme\n const darkTheme = (config.shiki?.themes?.dark || 'github-dark') as BundledShikiTheme\n\n processor.use(rehypeExpressiveCode, {\n themes: [darkTheme, lightTheme],\n useDarkModeMediaQuery: true,\n styleOverrides: {\n uiFontFamily: 'var(--ps-font-sans, var(--font-family, system-ui, sans-serif))',\n codeFontFamily: 'var(--ps-font-mono, var(--font-mono, ui-monospace, monospace))',\n codeFontSize: 'var(--ps-font-size-sm, 0.875rem)',\n codeLineHeight: '1.7',\n borderRadius: 'var(--ps-radius-lg, 0.5rem)',\n borderColor: 'var(--ps-color-border-subtle, var(--color-border-subtle, #e5e7eb))',\n },\n } satisfies RehypeExpressiveCodeOptions)\n\n processor\n .use(rehypeSlug)\n .use(rehypeAutolinkHeadings, { behavior: 'wrap' })\n // External links: add target=\"_blank\" rel=\"noopener noreferrer\" to absolute URLs\n .use(rehypeExternalLinks, {\n target: '_blank',\n rel: ['noopener', 'noreferrer'],\n })\n // Accessible emojis: wrap emoji characters in <span role=\"img\" aria-label=\"...\">\n .use(rehypeAccessibleEmojis)\n\n processor.use(() => (tree: any, file: any) => {\n const headings: Heading[] = []\n extractHeadings(tree, headings)\n file.data.headings = headings\n })\n\n if (config.rehypePlugins) {\n for (const plugin of config.rehypePlugins) {\n if (Array.isArray(plugin)) processor.use(plugin[0], plugin[1])\n else processor.use(plugin)\n }\n }\n\n processor.use(rehypeStringify, { allowDangerousHtml: true })\n return processor\n}\n\nconst processorCache = new WeakMap<MarkdownConfig, ReturnType<typeof createProcessor>>()\n\nexport async function processMarkdown(\n raw: string,\n config?: MarkdownConfig,\n preExtracted?: { content: string; frontmatter: Record<string, unknown> },\n): Promise<MarkdownResult> {\n let frontmatter: Record<string, unknown>\n let content: string\n if (preExtracted) {\n frontmatter = preExtracted.frontmatter\n content = preExtracted.content\n } else {\n const parsed = matter(raw, { engines: { yaml: parseYaml } })\n frontmatter = parsed.data\n content = parsed.content\n }\n const resolvedConfig = config && Object.keys(config).length > 0 ? config : DEFAULT_MARKDOWN_CONFIG\n // Freeze to prevent mutation — the processor is cached by object reference.\n if (Object.isFrozen(resolvedConfig) === false) Object.freeze(resolvedConfig)\n let processor = processorCache.get(resolvedConfig)\n if (!processor) {\n processor = createProcessor(resolvedConfig)\n processorCache.set(resolvedConfig, processor)\n }\n try {\n const result = await processor.process(content)\n const headings = Array.isArray(result.data.headings) ? (result.data.headings as Heading[]) : []\n return { html: String(result), headings, frontmatter }\n } catch (err) {\n throw new Error(\n `Markdown processing failed: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err },\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,0BAA0C,EAAE;;AAGlD,MAAM,uBAA+C;CACnD,KAAK;CACL,SAAS;CACT,UAAU;CACV,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,KAAK;CACL,KAAK;CACN;AA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