jakearchibald / svgomg

Web GUI for SVGO
https://jakearchibald.github.io/svgomg/
MIT License
5.76k stars 476 forks source link

Add ability to download resulting config #383

Open epodivilov opened 2 years ago

epodivilov commented 2 years ago

Hi.

I and others (according to requests #11, #50 and #184), miss the possibility to apply SVGO configuration to multiple files. As I understood it, batch processing support is not expected, that's why I suggest an intermediate solution - a possibility to download the resulting config and then apply it using the cli interface of SVGO.

Unfortunately, the latest versions of SVGO don't support sending the config as text, that's why you'll have to create the config file as JS.

# Example of usage
npx svgo --config="./path/to/svgo.config.js" -f ./input -o ./output

Fixes #11

netlify[bot] commented 2 years ago

Deploy Preview for svgomg ready!

Name Link
Latest commit d11c8c2c2834e00310689ea99a13c279ce247133
Latest deploy log https://app.netlify.com/sites/svgomg/deploys/664b10d155d4410008168f19
Deploy Preview https://deploy-preview-383--svgomg.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

XhmikosR commented 1 year ago

hey, there. Thanks for continuing your work on this.

Can you please make sure there are no lint issues and the the export actually works?

XhmikosR commented 1 year ago

This doesn't seem to work, no lint errors, no console errors but the config is not downloaded, at lean of Firefox that I tried.

epodivilov commented 1 year ago

This doesn't seem to work, no lint errors, no console errors but the config is not downloaded, at lean of Firefox that I tried.

What version of Firefox do you have?

I have tested with the following versions on my system (MacOS Ventura)

I tested the export button on localhost and on the netlify build

XhmikosR commented 1 year ago

Something weird is happening... If I load the page and don't make any change, clicking on the export button does not trigger the download. If I change a setting, then it works.

XhmikosR commented 1 year ago

Maybe you are missing a click event?

epodivilov commented 1 year ago

Maybe you are missing a click event?

But it's a link, it doesn't need click event handler. Maybe you have an old variant with button cached?

UPDATE: I think I've found a case where the problem might arise

XhmikosR commented 1 year ago

Yup, that was it.

Now, the only issue I see is ripple not firing when clicking the button.

XhmikosR commented 1 year ago

This looks pretty good now! Waiting for @jakearchibald to review too.

KnifeFed commented 1 year ago

No progress on the review? I guess https://deploy-preview-383--svgomg.netlify.app works for now though 🙂

AdrianoCahete commented 4 months ago

JFYI: Using the preview build, I was able to export and use the config, but the property cleanupIDs returns an error:

Error: Unknown builtin plugin "cleanupIDs" specified.
    at resolvePluginConfig (...)

Mostly because cleanupIDs was renamed to cleanupIds in v3, as referenced in changelog.

Manually renaming on config file works.

epodivilov commented 3 months ago

cleanupIds

Thanks for the feedback. Checked, there is indeed a problem. It is true that for SVGOMG to support the new plugin name you need to update the svgo package.

I updated my PR and added the necessary edits