altair823
5497c6e7b5
feat(dogfood): route .mts/.cts to typescript + .mdx to markdown
Dogfood (PR #142 1B + multi-root: kebab-docs + httpx + zod + lodash)
showed 28 files skipped by extension that are routable to existing
extractors:
- .mts (ESM TypeScript) / .cts (CommonJS TypeScript) — same grammar as
.ts in tree-sitter-typescript 0.23 (LANGUAGE_TYPESCRIPT covers JSX-
agnostic variants; LANGUAGE_TSX stays for .tsx only)
- .mdx (Markdown + JSX) — routed as MediaType::Markdown; the md parser
folds JSX islands through as raw passthrough
Changes:
- crates/kebab-source-fs/src/media.rs: 'mts'|'cts' → Code(typescript),
'mdx' → Markdown. +2 unit tests.
- crates/kebab-parse-code/src/lang.rs: code_lang_for_path matches mts/cts;
module_path_for_tsjs strips .mts/.cts as well. Test cases extended.
- crates/kebab-parse-code/src/typescript.rs: doc comment on select_grammar
refreshed to mention .mts/.cts.
- crates/kebab-parse-code/tests/lang.rs: 2 new assertions.
verify: kebab-source-fs 44 / kebab-parse-code lib 20 + lang 4 all pass; clippy clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 06:24:21 +00:00
..
2026-05-20 06:24:21 +00:00
2026-05-20 05:15:04 +00:00
2026-05-20 05:15:04 +00:00