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

Dynamically generate types from compile and traverse #21

Open
ignatiusmb opened this issue May 29, 2021 · 1 comment
Open

Dynamically generate types from compile and traverse #21

ignatiusmb opened this issue May 29, 2021 · 1 comment

Comments

@ignatiusmb
Copy link
Owner

Only fixed set of types are exposed but it doesn't really describe the actual file's front matter. Ideally, these front matter properties are available to use after compilation. Right now, they need to be manually typed by the user so any changes or updates to the front matter needs to be updated to the type as well, which is nice strictly speaking, but not ideal as this should generally be dynamic.

The general idea is to

  1. Generate .d.ts from JSON object, straight from the return value of compile and traverse, which means a separate function. Or even inside of them, passed as an option.
  2. Place generated *.d.ts in a locally cached folder (needs to be gitignored), or inside node_modules (if it's possible) and somehow make TypeScript aware of it and correctly captures the types in relation to the directory path, or just make them globally available to be imported
@ignatiusmb ignatiusmb added the enhancement Pull requests that adds a new feature label May 29, 2021
@ignatiusmb ignatiusmb added this to the v0.4.0 milestone May 29, 2021
@ignatiusmb
Copy link
Owner Author

This could probably be added as a patch or enhancement.

@ignatiusmb ignatiusmb removed this from the v0.4.0 milestone Dec 21, 2022
@ignatiusmb ignatiusmb removed the enhancement Pull requests that adds a new feature label Jun 1, 2023
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

1 participant