-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
📎 Auto generate the configuration page configuration.mdx
#825
Comments
On this page https://biomejs.dev/reference/configuration , we need to update biome hosted schema version automatically. It's still 1.2.2 |
At the moment the page contains good examples, and there's a chance we won't be able to have those examples anymore. I see two solutions:
|
I would like to work on this issue, can you assign me? |
I assigned! |
@yossydev I suggest to take a look at We could do something similar with the JSON schema, and emit a markdown file instead. The JSON schema should retain the comments, although I don't know if it retains all of them, and if it's able to retain the markdown syntax too. |
@ematipico Right now I am trying to read However, the JSON schema defined seems to be different from the current configuration page. {
"$schema": ". /node_modules/@biomejs/biome/configuration_schema.json"
} does not seem to be defined. Presumably this is also required? Can I define it myself? Please check it out at your leisure: 🙇♂️ Translated with www.DeepL.com/Translator (free version) |
Hi @yossydev , apologies for not explaining a bit more about what the task is about. This is my fault. We don't want to read the file
Here's an example of how you can generate the schema: biome/crates/biome_service/src/workspace_types.rs Lines 421 to 433 in c3150e6
And this is a function that process the schema and starts generating types
This isn't a beginner task, that was a mistake of mine, apologies for that. 🙇 |
@ematipico If there is another issue that I can do, please let me deal with it! |
I'd like to work on this issue 🙇 |
Thank you @chansuke , let me know if you have any questions |
I have implemented the auto-generation of configuration.md using schemars. This involves generating a JSON schema from struct Configuration and parsing it into markdown format. This process requires programmatic parsing of JSON code blocks and lists, as our configuration is extensively described in JSON. For example:
However, there are some notable differences compared to our existing configuration.mdx:
How do you think about my approach 🙇 |
I don't mind the order of the items, as long as they don't change if we execute the codegen script multiple times
I think it's fine, and I think we shouldn't keep all the examples. I think small code snippets should be fine. I think we should move bigger code snippets like |
@ematipico
Yes, wen can execute the codegen muiltiple times with same result
Ok, I will move bigger code snippets from crates/biome_service/src/configuration/mod.rs to new file under |
@ematipico |
I'll look into it soon, thank you! |
I rebased my working branch onto the latest commit to finalize my pull request. However, after rebasing with the latest Configuration, I encountered the following error:
To progress, I implemented a temporary fix which allowed me to generate markdown locally again. However, this fix might not be ideal as it bypasses the schemars configuration and could potentially affect other crates. And now I'm facing the error to derive JsonSchema like below:
Could you provide some feedback on how to resolve these issues 🙏 |
@chansuke Thank you for reaching out for help. I pushed a fix in your PR Instead of using
|
@ematipico Thank you!!!! |
@ematipico Please kindly give me your advice 🙏 |
Description
The
configuration.mdx
is updated manually, and this is bothersome because we could actually generate automatically from the rust doc comments relatively easily.The text was updated successfully, but these errors were encountered: