Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: makeSource args type not updated with new config options for 0.2.5 release #243

Closed
Saeris opened this issue Jun 1, 2022 · 4 comments
Milestone

Comments

@Saeris
Copy link

Saeris commented Jun 1, 2022

In the 0.2.5 release notes, for MDX, it's recommended to use a new mdxOptions property, but the PartialArgs type that makeSource expects hasn't been updated for this as far as I can tell. Whereas with the markdown field, it was correctly updated to optionally support a builder callback function. Here's a link the relevant code:

export type PartialArgs = {
markdown?: MarkdownOptions | MarkdownUnifiedBuilderCallback | undefined
mdx?: MarkdownOptions | undefined
date?: DateOptions | undefined
fieldOptions?: Partial<FieldOptions>
extensions?: PluginExtensions
disableImportAliasWarning?: boolean
}

And the release notes where there is a mismatch: https://github.com/contentlayerdev/contentlayer/releases/tag/v0.2.5

Additionally, I'm unsure how this solves the problem I was aiming to resolve with #192

@Saeris
Copy link
Author

Saeris commented Jun 1, 2022

Ah, as for #192 I see that in fact the rawDocumentData was added to the VFile data object, which was undocumented in the release notes. So that does solve for my problem. Thanks!

Clarity may still be needed for this issue though on the makeSource arg types.

@seancdavis
Copy link
Collaborator

@Saeris There are two issues on the website repo for better documenting markdown behavior:

Do you suspect properly completing those issues would solve this topic here?

@Saeris
Copy link
Author

Saeris commented Jun 4, 2022

This topic is specifically about the types the library is shipping need to be updated. Currently you cannot use mdxOptions as documented because it raises a type error. So no, it's not a documentation issue, it's missing code. Either that or the release notes were inaccurate.

Read the section on MDX Processing in the page I linked above. You cannot use the code snippet there because it raises a type error.

@schickling
Copy link
Collaborator

This should be addressed with the 0.2.6 release. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants