-
Notifications
You must be signed in to change notification settings - Fork 149
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
Support for creating files dynamically #316
Comments
Hey @buremba, that's a good idea really, and can inspire for more ideas around that. Unfortunately this is not planned in our roadmap due to limitations on SAO. We use SAO for compiling the templates in the files and moving etc and it does not support such dynamic structure. (I guess it won't be because its archived already by the owner of the project 😅) Still, I think we can do a workaround here, we already have We can add some field like Then, we should create those files inside the plugin file (already stored in a temporary directory after cloning). This way we can trick SAO to handle those files like the regular plugin files (compiling and moving to the target). As the result, we can create files dynamically. 🎉 🎉 While doing so, we might need to check and update our code for handling prompts, for dynamic files we might want to support wider range of prompt types 🤔 Currently, this is not planned but hypothetically it looks like something achievable 😅 If you want to give it a try, We'll be happy to help 🙏 |
Thanks for the quick answer @aliemir! I understand the limitation and I feel like this is not Refine/Superplate's focus and the solution that you suggested makes sense. What would you think about implementing something more generic such as a
Superplate can call this callback function/hook when the user selects a choice and the template files are generated automatically. That way, the |
Hey @buremba sorry for the late response 🙏 Thanks again for the issue, I'll definitely try to spare some time for this. This can provide a great flexibility to plugins 💪 |
I'm working on a Superplate plugin that will automatically generate the CRUD pages based on the value the user enters for a config defined in
prompt.js
. In order to be able to create the CRUD pages, I'm looking for a way to create Typescript files/directories in a dynamic way and I couldn't figure out how I can do that. Is it something on the roadmap?The text was updated successfully, but these errors were encountered: