59 Commits
Author SHA1 Message Date
Fuma Nama 3b07bec29a refactor(local-md): extract shared logic to local-content 2026-07-21 03:26:50 +08:00
Fuma Nama efc9d18402 chore(mdx): bake passthroughs into runtime module 2026-07-16 02:26:42 +08:00
Fuma Nama 368a92e3a2 feat(mdx): macro collection-level last modified time 2026-07-16 01:57:51 +08:00
Fuma Nama 13dfdbc224 feat(mdx): no longer require include for macros 2026-07-16 00:19:20 +08:00
Fuma Nama 1862822aa5 feat(mdx): redesign macro infrastructure 2026-07-15 23:05:15 +08:00
Fuma Nama 98a899ae4b feat(mdx): support macro API 2026-07-15 01:36:49 +08:00
Fuma Nama 3d80b8b242 fix(mdx): ensure satteri integration is optional 2026-07-06 21:25:13 +08:00
Fuma Nama 0ec19af868 feat(satteri): more tests & move remark-include 2026-07-06 16:30:40 +08:00
aded98924a Integrate Satteri (#3402)
* feat(satteri): add @fumadocs/satteri package and compiler discriminator

Introduce @fumadocs/satteri with Sätteri-native ports of Fumadocs MDX
plugins (remark-heading, structure, image, code-tab, npm, rehype-toc,
rehype-code, and others), plus applySatteriPreset and compileMdx.

In fumadocs-mdx, add compiler: 'satteri' on doc collections with
satteriOptions typing, getSatteriOptions(), and a buildSatteriMDX path
that uses mdxToJs instead of @mdx-js/mdx.

Co-authored-by: Fuma Nama <[email protected]>

* Port native rehype-code and isolate Satteri as optional peer

- Rewrite @fumadocs/satteri rehype-code as a Satteri hast plugin using
  fumadocs-core Shiki (no unified/vfile deps in the package)
- Unwrap Shiki root fragments before ctx.replaceNode
- Move getSatteriOptions to fumadocs-mdx/config/build-satteri and expose
  fumadocs-mdx/satteri and fumadocs-mdx/config/satteri entry points
- Make @fumadocs/satteri and satteri optional peerDependencies
- Dynamic-import the satteri build path only when compiler is satteri
- Add rehype-code and fumadocs-mdx satteri pipeline tests

Co-authored-by: Fuma Nama <[email protected]>

* Port official docs app to Satteri compiler

- Switch apps/docs docs and blog collections to compiler: satteri
- Replace mdxOptions/applyMdxPreset with applySatteriPreset and Satteri plugins
- Add @fumadocs/satteri plugins: rehypeKatex, remarkElementIds, remarkLlms
- Port remarkAutoTypeTableSatteri and remarkTypeScriptToJavaScriptSatteri
- Enhance remark-structure stringify and satteri postprocess pipeline
- Drop remark-math/rehype-katex/unified from docs deps (math via features.math)

Co-authored-by: Fuma Nama <[email protected]>

* Remove custom rehypeKatex; use Satteri features.math

Satteri natively parses inline ($...$) and display ($$...$$) math via
features.math. Drop the redundant KaTeX hast plugin, katex peer dependency,
and hast-util-from-html-isomorphic from @fumadocs/satteri.

Co-authored-by: Fuma Nama <[email protected]>

* Use structuredClone for Satteri node snapshots; fix build blockers

- Replace custom materialize() with structuredClone in remark-llms and
  remark-structure (snapshot nodes during visitor, stringify after pass)
- Add GFM/math stringifiers for structured data and LLM markdown export
- Fix remark-include cwd attribute, section extraction, and node replacement
- Fix remarkAutoTypeTableSatteri cwd resolution via collection _cwd
- Restore remark deps for apps/docs markdown.tsx

Co-authored-by: Fuma Nama <[email protected]>

* docs: add AGENTS.md with Cursor Cloud setup instructions

Co-authored-by: god63820869 <[email protected]>

* Fix Satteri plugin patterns per upstream API docs

Plugins were fighting Satteri's Rust-backed AST model:

- Export once at compile end via ctx.data, not queueDataExport per visit
  (rehype-toc, remark-llms, valueExportPlugin) — avoids 1600+ duplicate exports
- Use ctx.replaceNode / insertChildAt instead of splicing parent.children
  (remark-npm, remark-code-tab, remark-auto-type-table)
- Return { raw: string } for includes instead of inserting external mdast
- Skip Shiki on math code blocks; flatten toc titles for appendExports
- Sync remark-llms _markdown writes; guard get-llm-text processed fallback

Adds satteri-toc-count test. Docs build passes.

Co-authored-by: Fuma Nama <[email protected]>

* Use Satteri exported types instead of duplicating context shapes

Centralize ctx.data keys in @fumadocs/satteri/data-map via DataMap
augmentation. Plugins use MdastVisitorContext, HastVisitorContext, and
Data from satteri rather than inline { data: Record<...> } or
Parameters<typeof queueDataExport> hacks.

Re-export visitor context types from @fumadocs/satteri. MDX loader adds
_compiler to satteri DataMap separately.

Co-authored-by: Fuma Nama <[email protected]>

* Move remarkElementIds to docs; optimize Satteri plugin hot paths

- remarkElementIds is docs-only (apps/docs/lib) for lint link validation,
  removed from @fumadocs/satteri exports
- remark-llms: stringify once after all root children collected (was O(n²))
- remark-structure: attach structuredData once instead of every visit
- rehype-toc: store textContent title strings, not hast element refs
- preset: drop valueExportPlugin; compile.ts already handles _valueToExport

Co-authored-by: Fuma Nama <[email protected]>

* reduce deps

* Further Satteri plugin perf: defer clones, use textContent

- remark-llms: collect root indices during visit, structuredClone batch at end
- remark-structure: ctx.textContent instead of flattenNode when no custom stringify;
  single shared visitor per type; attach structuredData on first visit only
- remark-heading/postprocess: ctx.textContent for slug/title (no double tree walk)
- rehype-toc: assign export object once, mutate items array in place
- rehype-code: skip elements already highlighted by shiki
- Add remark-llms tests; vitest @ path alias

Co-authored-by: Fuma Nama <[email protected]>

* Move remark-ts2js Satteri plugin to @fumadocs/satteri

- Add remarkTs2js to @fumadocs/satteri (oxc-transform dep)
- doc-gen keeps unified remarkTypeScriptToJavaScript only; drop satteri peer
- Docs source.config imports remarkTs2js from @fumadocs/satteri
- Document Satteri usage tab in remark-ts2js docs page

Co-authored-by: Fuma Nama <[email protected]>

* Move remarkAutoTypeTable Satteri plugin to @fumadocs/satteri

Extract shared generation into fumadocs-typescript/auto-type-table-generate.
fumadocs-typescript keeps unified remarkAutoTypeTable only; no satteri dep.

Satteri remarkAutoTypeTable uses createAutoTypeTableGenerator from
fumadocs-typescript. Docs imports plugin from @fumadocs/satteri.

Co-authored-by: Fuma Nama <[email protected]>

* refactor(satteri): remove barrel export, use subpath imports

Drop src/index.ts and the package root export. Each plugin, preset,
compile, utils, and data-map module is now a separate subpath export.
Consumers import from paths like @fumadocs/satteri/preset and
@fumadocs/satteri/remark-ts2js. Satteri core APIs are imported
from the satteri package directly.

Co-authored-by: Fuma Nama <[email protected]>

* fix(satteri): keep auto-type-table logic local, use markdownToHast

Revert all fumadocs-typescript changes. Move auto-type-table generation
into @fumadocs/satteri with duplicated parse-tags helper. Render JSDoc
markdown via Satteri's markdownToHast (no remark/unified deps); sanitize
raw hast nodes for hast-util-to-estree compatibility.

Co-authored-by: Fuma Nama <[email protected]>

* refactor(satteri): consolidate remark-auto-type-table into one file

Merge auto-type-table-generate, markdown-renderer, and parse-tags into
remark-auto-type-table.ts. Drop factory/helpers; inline prop parsing and
table generation in the Satteri plugin visitor.

Co-authored-by: Fuma Nama <[email protected]>

* improve performance

* Merge branch 'pr-3398' into cursor/satteri-package-b279

---------

Co-authored-by: Fuma Nama <[email protected]>
2026-07-03 19:33:29 +08:00
Fuma Nama d35d0d6a43 fix(mdx): respect root in Vite config 2026-05-29 18:23:25 +08:00
Fuma Nama a744f9fae7 Core: Support frontmatter parsing at core-level 2026-04-16 19:38:40 +08:00
eliasfaltinandGitHub 31441492e7 fix(mdx): correct dynamic index generation for lazy entries (#3116)
* fix: correct mdx dynamic index generation

* fix: avoid unused dynamic path import
2026-03-16 21:21:34 +08:00
Fuma Nama 25f1f0c6ff Chore: migrate to oxfmt 2025-12-30 16:49:34 +08:00
8ce2c70fc5 feat(mdx): support VS Code-style #region extraction for <include /> (#2791)
* feat(include): support VS Code-style #region extraction for code files

* chore: add changeset for include code region support

* improve perf & fix bugs

* Docs: introduce region support

---------

Co-authored-by: Fuma Nama <[email protected]>
2025-12-20 18:06:57 +08:00
Fuma Nama d06eb7bf51 MDX: fix index file re-generation 2025-12-04 17:38:45 +08:00
Fuma Nama 31fd9d7058 MDX: add unit tests for workspace 2025-12-04 15:34:55 +08:00
Fuma Nama fc0e3dbb02 MDX: introduce official workspace API 2025-12-04 15:02:09 +08:00
Fuma Nama aa1a8378cf MDX: implement core for workspaces 2025-12-04 12:41:06 +08:00
Fuma Nama fb5a5967b1 MDX: prototype workspace feature 2025-12-04 10:16:30 +08:00
Fuma Nama 3de8981a90 MDX: add more tests for typegen 2025-11-18 19:27:10 +08:00
Fuma Nama 52dabc328b MDX: Support type-safe collection generation 2025-11-17 23:20:53 +08:00
Fuma Nama ce871c0bfb fix checks 2025-11-16 19:37:01 +08:00
Fuma Nama 323a4d2658 MDX: rename output files 2025-11-15 17:13:41 +08:00
Fuma Nama b9630213df MDX: make index-file a plugin and optimize re-generation 2025-11-13 22:35:58 +08:00
Fuma Nama 1bfc3c7ab3 MDX: prefer eager glob import 2025-11-13 14:21:05 +08:00
Fuma Nama 93a64f36f7 MDX: improve emit entry generation 2025-11-12 23:07:17 +08:00
Fuma Nama 61b90c8b61 MDX: Always transform meta files in collection 2025-10-31 23:24:44 +08:00
Fuma Nama 3caa5cd918 MDX: implement Plugins API 2025-10-21 21:42:06 +08:00
Fuma Nama eb73f23cd9 MDX: Improve unit tests 2025-10-07 22:25:18 +08:00
Fuma Nama 7ca3ab40f1 Replace with Negotiation API 2025-09-29 19:47:46 +08:00
4b9871dc1d MDX Async mode: read file content on load (#2394)
* MDX: read file content on load

* Use path.resolve in .source/index.ts

* Add absolutePath to force nft file tracing

* improve performance

---------

Co-authored-by: Fuma Nama <[email protected]>
2025-09-24 20:46:58 +08:00
Fuma Nama af50bc8e32 MDX: Support customising index file output path in Vite 2025-09-24 16:49:46 +08:00
Fuma Nama 5fc9ee4b9f MDX: Support remark-directive for Include API 2025-09-22 21:45:44 +08:00
Fuma Nama 8eae1cb736 update snapshots 2025-09-20 17:44:30 +08:00
Fuma Nama c8f49d891a MDX: Include frontmatter into page.data.content by default 2025-08-19 22:15:07 +08:00
Fuma Nama 3e45b3d9bb MDX: fix errors from last PR 2025-08-14 19:46:38 +08:00
Alex YangandGitHub b41ffc32bd fix: import js index file with file extension (#2206) 2025-08-14 09:33:32 +08:00
Fuma Nama 275cc9817b fix tests 2025-08-12 14:54:33 +08:00
Fuma Nama 57224f4f3e MDX: Support last modified time for Vite 2025-07-30 21:08:54 +08:00
Fuma Nama cbd97fe59e update test snapshots 2025-07-20 21:34:42 +08:00
Fuma Nama e5cfa27e5b MDX: Stabilize Vite plugin support 2025-07-19 19:18:46 +08:00
Fuma Nama 73e07a5178 MDX: bump zod to v4 2025-07-10 16:51:34 +08:00
Fuma Nama cd86f58c14 MDX: Hotfix Windows EOL being ignored 2025-06-16 22:04:56 +08:00
Fuma Nama ab5a5d166a MDX: add Vite transformer 2025-06-16 21:06:25 +08:00
Fuma Nama e9f2b7014a CLI: Allow code usage of create() 2025-04-09 20:01:50 +08:00
Fuma Nama b5ce255026 MDX: read full file contents on async mode 2025-04-09 19:41:19 +08:00
Fuma Nama fc5d7c0e46 MDX: Compile Meta files into inline JSON objects 2025-02-11 20:23:11 +08:00
Fuma Nama 33d47f7a30 MDX: generate with types 2025-02-05 19:15:18 +08:00
Fuma Nama 233a2d1080 Support Standard Schema for collection schema 2025-02-05 11:53:56 +08:00
Fuma Nama 421166a890 MDX: ready to release 2025-02-01 23:45:12 +08:00