@polyt/extractor-astro
v0.1.1
Published
Astro `.astro` file parser for `@polyt/extractor`. Handles frontmatter scripts and expression blocks inside Astro component templates.
Readme
@polyt/extractor-astro
Astro .astro file parser for @polyt/extractor. Handles frontmatter scripts and expression blocks inside Astro component templates.
Install
pnpm add -D @polyt/extractor-astroRequires astro ^5.0.0 as a peer dependency.
Usage
Install alongside @polyt/extractor. The extractor will detect and use this parser automatically via a dynamic import, no manual wiring required.
pnpm add -D @polyt/extractor @polyt/extractor-astroAPI
AstroParser
Extends gettext-extractor's Parser to walk the @astrojs/compiler AST. Handles:
- Frontmatter, the
---script block at the top of.astrofiles - Expression nodes,
{gettext("…")}template expressions
astroTypescriptExtractor(jsParser, callee, options)
Factory function that produces an IAstroExtractorFunction delegating to a JS parser for TypeScript expression content. Used internally by @polyt/extractor.
