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

feat: support passing except/only args to ziggy command #805

Conversation

joshmanders
Copy link
Contributor

This PR adds the ability to pass --except and --only args to the artisan command.

The reason for this is I have developed a vite plugin for auto generating of your ziggy routes and types when any changes happen to routes/ files and it would be nice to be able to just composer require tightenco/ziggy then npm i -D vite-plugin-ziggy and add the plugin to your vite config and it just works.

I have this setup to respect config as usual, but if you pass one of the args to the command that takes precidence over the same key in the config.

Only supports except/only, the rest should delegate to the config if you want to get that deep, in which case if you don't pass an except or only key to my plugin, it won't pass down to the command allowing ziggy to work as always.

@joshmanders joshmanders marked this pull request as ready for review January 19, 2025 20:36
@bakerkretzmar bakerkretzmar merged commit ee0c18c into tighten:2.x Jan 22, 2025
22 checks passed
@bakerkretzmar
Copy link
Collaborator

Thanks! The Vite plugin looks cool, is storing generated files in node_modules a common practice for JS packages? I'd be worried about that breaking or causing other obscure issues but it sure is clean.

@joshmanders joshmanders deleted the feature/support-passing-except-only-args-to-ziggy-command branch January 23, 2025 00:38
@joshmanders
Copy link
Contributor Author

Thanks! The Vite plugin looks cool, is storing generated files in node_modules a common practice for JS packages? I'd be worried about that breaking or causing other obscure issues but it sure is clean.

@bakerkretzmar yeah a few other projects do it, you could even store them in node_modules/.cache as that's what it's intended for, instead of dumping things into project roots. The largest project I know of that does this and where I got it from is Prisma ORM.

joshmanders added a commit to aniftyco/vite-plugin-ziggy that referenced this pull request Jan 23, 2025
This adds support for configuring ziggy under the hood directly from the
Vite plugin.

Depends on tighten/ziggy#805 being merged and
published.
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

Successfully merging this pull request may close these issues.

2 participants