From 08432d5b01a5cab1bd8d962c30f77ab3827bc5aa Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 3 Aug 2022 08:45:31 -0700 Subject: [PATCH] Allow globbed mdx files to have typed frontmatter (#4108) * Allow frontmatter typing for .mdx files from glob `Astro.glob("*.md")` is special cased to allow `T` to be a type for the frontmatter in the markdown. Since .mdx files also get frontmatter added to the globbed result, let's type it as such. * Add changeset Co-authored-by: Nate Moore Co-authored-by: Tony Sullivan --- .changeset/dirty-tables-report.md | 5 +++++ packages/astro/src/@types/astro.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/dirty-tables-report.md diff --git a/.changeset/dirty-tables-report.md b/.changeset/dirty-tables-report.md new file mode 100644 index 0000000000..09f6c069ea --- /dev/null +++ b/.changeset/dirty-tables-report.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Allow globbed mdx files to have typed frontmatter diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index cf966a839b..24f1fc8ee7 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -241,6 +241,7 @@ export interface AstroGlobalPartial { */ glob(globStr: `${any}.astro`): Promise; glob>(globStr: `${any}.md`): Promise[]>; + glob>(globStr: `${any}.mdx`): Promise[]>; glob>(globStr: string): Promise; /** * Returns a [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object built from the [site](https://docs.astro.build/en/reference/configuration-reference/#site) config option