@zvndev/darkmown 2.10.0 → 2.11.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 (45) hide show
  1. package/AGENTS.md +8 -6
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +37 -3
  4. package/SECURITY.md +1 -0
  5. package/docs/cli.md +20 -1
  6. package/docs/errors.md +255 -0
  7. package/docs/spec-alignment.md +14 -1
  8. package/package.json +3 -2
  9. package/site/pages/benchmarks/index.wd +1 -1
  10. package/site/pages/docs/index.wd +6 -1
  11. package/site/pages/index.wd +1 -0
  12. package/site/pages/playground/index.js +59 -54
  13. package/src/api-runner.js +80 -8
  14. package/src/builder.js +122 -13
  15. package/src/catalog.js +6 -0
  16. package/src/cli.js +48 -5
  17. package/src/compiler/page.js +16 -4
  18. package/src/compiler/state.js +75 -0
  19. package/src/compiler.js +1 -1
  20. package/src/errors.js +50 -3
  21. package/src/font-subset.js +25 -7
  22. package/src/image-variant-resize.js +4 -1
  23. package/src/image-variants.js +9 -4
  24. package/src/mcp-tools.js +354 -0
  25. package/src/mcp.js +287 -0
  26. package/src/router.js +16 -0
  27. package/src/skin.js +111 -45
  28. package/src/statics.js +1 -0
  29. package/src/templates/dashboard/README.md +3 -1
  30. package/src/templates/landing/site/pages/index.skin +7 -0
  31. package/src/templates/landing/site/pages/index.wd +10 -3
  32. package/src/templates/store/README.md +5 -2
  33. package/src/templates/store/site/_/card.wd +19 -0
  34. package/src/templates/store/site/_/products.json +6 -6
  35. package/src/templates/store/site/pages/index.skin +17 -2
  36. package/src/templates/store/site/pages/index.wd +3 -12
  37. package/types/api-runner.d.ts +20 -4
  38. package/types/builder.d.ts +5 -0
  39. package/types/compiler/page.d.ts +12 -3
  40. package/types/compiler.d.ts +4 -1
  41. package/types/errors.d.ts +6 -4
  42. package/types/font-subset.d.ts +7 -3
  43. package/types/image-variants.d.ts +7 -3
  44. package/types/router.d.ts +5 -0
  45. package/types/skin.d.ts +9 -4
@@ -102,7 +102,7 @@ Measured on the same machine, 67 routes on both sides:
102
102
 
103
103
  Both of these were real losses on measured bytes, not hypotheticals, and both shaped what shipped next.
104
104
 
105
- - **Fonts, badly.** The rebuild served three raw variable TTFs: 1.07 MB on the homepage, against `next/font`'s 158 KB of subset woff2. Fonts were the single largest byte category on every rebuilt page. The 2.8 documentation now ships a font recipe (convert to woff2, subset to the glyphs used, `font-display swap`, preload the critical face), and build-time subsetting is on the roadmap.
105
+ - **Fonts, badly.** The rebuild served three raw variable TTFs: 1.07 MB on the homepage, against `next/font`'s 158 KB of subset woff2. Fonts were the single largest byte category on every rebuilt page. The 2.8 documentation shipped a font recipe (convert to woff2, subset to the glyphs used, `font-display swap`, preload the critical face), and 2.10 closes the gap outright: with the optional toolchain installed, the build subsets project-local fonts to the site's charset automatically. Measured on these same demo fonts, the 1.07 MB of TTFs became 288 KB of woff2.
106
106
  - **Photos.** The doctors page shipped 1,045 KB of headshots against the live site's 147 KB of CDN width variants. Darkmown 2.8 added the `@width` convention (drop in `photo@640.jpg` and the build wires the `srcset`), and 2.9 generates those variants at build time when sharp is installed. Run the same rebuild today and this category flips.
107
107
  - **A shared cost neither side avoids:** both sites load the same ~594 KB hero video on the homepage. No edge for anyone there.
108
108
 
@@ -391,11 +391,12 @@ tags: [sales, revenue, "q1, q2"]
391
391
 
392
392
  `lang:` sets the document language on `<html lang>` per page (`lang: fr`, `lang: pt-BR`, …); it defaults to `en`. Every page also ships a visually-hidden-until-focused **skip-to-content link** targeting the main landmark — your own `<main>` is reused (an existing `id` wins as the target; an id-less one gets `id="main"`), and a page without one is wrapped in `<main id="main">`. Restyle it via `.wd-skip-link` in a skin. All compile-time — static pages stay zero-JS.
393
393
 
394
- Three more keys arrived in 2.8:
394
+ More head and publishing keys arrived in 2.8 and 2.11:
395
395
 
396
396
  - **`icon: /path`** sets the favicon verbatim (`<link rel="icon">`, with a `type` for `.svg`/`.png`/`.ico`). Without it, the first of `site/pages/icon.svg`, `icon.png`, or `favicon.ico` wins; without either, the built-in mark stays the fallback.
397
397
  - **`noindex: true`** builds the page but removes it from discovery: a robots `noindex,nofollow` meta, plus exclusion from `sitemap.xml`, `rss.xml`, and the generated `llms.txt`/`llms-full.txt`. On a collection entry with a `_schema.wd`, declare it as `noindex: boolean?`.
398
398
  - **`skins: [/base.skin]`** (an inline array) loads shared `.skin` files for that page only, resolved like `@include` paths; a missing file, a non-`.skin` file, or a path outside `site/pages`/`site/_` is `[WD017]`. A shared skin whose first line is `scoped` scopes to the whole page body, so keep to one scoped skin per page.
399
+ - **`md_source: true`** (home page only) publishes every page's byte-exact markdown source at `<route>.md` (`/docs/` also answers `/docs.md`, with a `<link rel="alternate" type="text/markdown">` head tag and a `text/markdown` content type). A page opts out with `md_source: false`; drafts never emit, and the sitemap and feeds never list the `.md` files. Off by default.
399
400
 
400
401
  **Cascade order changed in 2.8.** Stylesheet links emit the highlight sheet first (code pages), then include skins, then `skins:` entries in listed order, and **the page's own colocated `.skin` last**, so the page wins ties at equal specificity. Before 2.8 the page's skin came first; a page rule that unknowingly relied on losing to an include rule now wins.
401
402
 
@@ -1021,6 +1022,10 @@ session.call("apply", { edits: [{ op: "replace", symbol: "state:count", text: ":
1021
1022
  session.call("validate", {});
1022
1023
  ```
1023
1024
 
1025
+ ### MCP server
1026
+
1027
+ `darkmown mcp` runs a hand-rolled, zero-dependency MCP server on stdio (protocol 2024-11-05), so an MCP-capable agent gets the language as tools instead of shelling out: `catalog`, `grammar`, `validate` (compile-check `.wd` source in memory with coded errors), `error` (a WD code's cause, fix, and example), and `doc` (fuzzy section search over the shipped README/AGENTS.md), plus the shipped docs as `darkmown://docs/{readme,agents,changelog,errors,cli}` resources. stdout is protocol frames only. Point a client at it with `{ "mcpServers": { "darkmown": { "command": "npx", "args": ["-y", "@zvndev/darkmown", "mcp"] } } }`.
1028
+
1024
1029
  ## Compile error codes
1025
1030
 
1026
1031
  Every author-facing compile error opens with a stable `WDxxx` code, so it is searchable and matchable by tooling without parsing prose:
@@ -3,6 +3,7 @@ title: Darkmown: Markdown that runs
3
3
  description: A .md file is a page. Rename it to .wd and the same file gets loops, state, fetched data, and forms, with no components, no JSX, and no build step. Pages with no state ship zero framework JavaScript.
4
4
  image: https://darkmown.com/__wd/media/og.png
5
5
  site_url: https://darkmown.com
6
+ md_source: true
6
7
  transitions: true
7
8
  schema: WebSite
8
9
  ---