garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.66k stars 602 forks source link

Use any config files: backstop.json, backstop.js - Version 2 #1566

Closed klodoma closed 1 month ago

klodoma commented 2 months ago

Use any config files: backstop.json, backstop.js whichever is found first.

Discussion here: https://github.com/garris/BackstopJS/issues/1482

Changes:

klodoma commented 2 months ago

I am not inclined to add another file format generation to init -- I don't think this moves the objectives forward.

@garris

Imo I think this project should switch from .json to .js config file. We'll keep the "backward" compatibility through the require feature.

So, my proposal would be:

solomonhawk commented 2 months ago

Any consideration for using https://github.com/cosmiconfig/cosmiconfig? It might be nice to offload the work to a separate well-tested, fully-featured library and allow backdrop to give end-users the flexibility that they might expect coming from other ecosystem packages that use cosmiconfig.

maxfenton commented 1 month ago

@garris @klodoma Just wondering if any version of this solution can be merged.

garris commented 1 month ago

@maxfenton I would be willing to merge a PR for just this change. It opens up possibilities with the lightest touch.

image
klodoma commented 1 month ago

@garris That would be the second PR.

I didn't hat time anymore I'll have a second look and let you know.

garris commented 1 month ago

I just made the change. Hope this is helpful. Will go out in next release. https://github.com/garris/BackstopJS/commit/944884bcd785a3cd0715a90371eb39a62855ec58