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

Filter that blindly executes a command #344

Open
berarma opened this issue Feb 6, 2020 · 4 comments
Open

Filter that blindly executes a command #344

berarma opened this issue Feb 6, 2020 · 4 comments

Comments

@berarma
Copy link
Contributor

berarma commented Feb 6, 2020

Hi @markstory.

I want to use an automatic CSS prefixer but I don't see any filter for this task. Creating filter is easy but repetitive work.

Most or all filters are available as commands. It would be very convenient having a type of filter that I can provide a command line to and the filter just executes the command feeding the assets in the input and collecting the output. I think such filter doesn't exist, does it?

I'd prefer implementing such filter than implementing a filter for every new command that I want to add to the filter chain. Any downsides? Would you accept PRs to do so?

@markstory
Copy link
Owner

Most or all filters are available as commands. It would be very convenient having a type of filter that I can provide a command line to and the filter just executes the command feeding the assets in the input and collecting the output. I think such filter doesn't exist, does it?

Are you looking for a generic filter that pipes the current asset state through a provided command? If so you are correct that such a thing doesn't currently exist, but it could be helpful to have and could help simplify a few integrations.

@berarma
Copy link
Contributor Author

berarma commented Feb 6, 2020

Are you looking for a generic filter that pipes the current asset state through a provided command? If so you are correct that such a thing doesn't currently exist, but it could be helpful to have and could help simplify a few integrations.

Yes, exactly. Are you going to implement it or should I try to lend a hand?

@markstory
Copy link
Owner

Are you going to implement it or should I try to lend a hand?

It would be great if you could get this started 🙇

@berarma
Copy link
Contributor Author

berarma commented May 9, 2020

I'm working on this and it seems pretty straight-forward for the output filter.

Input filters seem a bit trickier. There should be a way to get the dependencies for the file being processed or maybe ignore them and always execute the filter. We can use the CSS dependency analyzer for some cases but it has to be optional. The only issue is that any assets using this filter without dependency analysis will have to be rebuilt every time.

I'll do a tentative implementation in a PR.

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

2 participants