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

Allowing the build command to try to auto-skip #697

Open
wotta opened this issue Sep 26, 2024 · 2 comments
Open

Allowing the build command to try to auto-skip #697

wotta opened this issue Sep 26, 2024 · 2 comments
Labels
community enhancement New feature or request

Comments

@wotta
Copy link

wotta commented Sep 26, 2024

Synopsis:

At this moment when we run the build command we do have an option to pass a list of file classes, but this somewhat unnatural to me. When I am adding models and other stuff as POC real quick I usually forget to delete the old stuff.

Imagine I generated a draft.yaml with the following content:

models:
  Timesheet:
    postal_from: string:6
    house_number_from: string:4
    city_from: string
    postal_to: string:6
    house_number_to: string:4
    city_to: string

seeders: Timesheet

Now when quickly used filament and api platform to generate my resources for both the admin and api and I want to add an additional model I usually add it below the existing information. Like below.

models:
  Timesheet:
    postal_from: string:6
    house_number_from: string:4
    city_from: string
    postal_to: string:6
    house_number_to: string:4
    city_to: string
  Setting: // This is new
    name: string
    value: text
    model: string
    softDeletes

seeders: Timesheet

Proposed Syntax:

Nothing changes here.

Expected Behavior:

It would be amazing if I could run for example php artisan blueprint:build --auto-skip which would use the .blueprint file to automatically add the files generated to the skip option to achieve this behavior.

Let me know if you don't mind this being an additional option to use. I'm also open to hop on a call to talk about this if needed 🙂

@wotta wotta added enhancement New feature or request pending This issue is pending review labels Sep 26, 2024
@jasonmccreary
Copy link
Collaborator

Blueprint is a passive code generator. So the draft files are meant to be "scratch pads" and throw away. Not cumulative representations of the entire system.

With that said, I understand what you are trying to do. I wonder if a --force option provides more optionality - where any other component which exists in the draft file gets overwritten.

I guess it's all perspective, as --skip would do the opposite. Anyway, not something I will add. But I am open to a PR.

@wotta
Copy link
Author

wotta commented Sep 26, 2024

Cool thanks for at least taking the time reading over this. I will try to make an example tonight, and then it is still up to you of course to see if you want to add it at all.
For my use-case it seems helpful because I am only building an x amounts of cruds in the end, so for those instances it would be nice to have something which I can extend instead of throwing away. Mainly for future references, but that might just be my weird thing😂

Thanks either way and I wish you an amazing day!

@jasonmccreary jasonmccreary added community and removed pending This issue is pending review labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants