Shopify / themekit

Shopify theme development command line tool.
https://shopify.dev/tools/theme-kit
MIT License
1.19k stars 374 forks source link

"theme validate" command #628

Open mattgenious opened 5 years ago

mattgenious commented 5 years ago

When building themes for shopify I always upload them on a git repository. On other projects I use CI solutions such as Jenkins and would like to do that with my shopify themes.

Right now I don't see a way to validate the theme without uploading it. I suggest a command such as "theme validate" to validate whether or not the theme is valid for upload.

An example of existing functionality is the error messages given related to specific files when trying to deploy or watching a file with an error in it.

This would in turn allow me to use that command in my CI when developing new themes and let Jenkins report to me whether or not a "build" is valid.

tanema commented 5 years ago

Hey, @mattgenious thanks for the suggestion. Are you suggesting that I validate things like missing critical files or something more specific like invalid liquid or missing section definitions?

I could do very simple validation like missing critical files however I think that sort of validation is a bit useless because unless you just created the theme, you should know that these files are missing.

As for further validation, I am afraid I cannot support them because it would tie themekit very strictly to the elements of Shopify themes and a lot of overhead and binary bloat to do so. For instance, if this was done in the past when theme sections were released, themekit would have broken for everyone.

cameroncowden commented 5 years ago

Chiming in here, I definitely can see why it doesn't make sense to try to process liquid etc, but I think processing scss and other server-side build steps could be nice to able to perform locally.

For example, if I'm running theme watch and working on a scss stylesheet, if I make a mistake that breaks the scss build, I don't know until the new file has been uploaded, the build failed, and then a blank file with a general build failure message sent to my browser. Also debugging is somewhat difficult as the messages don't contain any info about the message, and I'll sometimes have to go manually try to compile to get more detailed output.

On Fri, Apr 5, 2019 at 2:40 PM Tim Anema notifications@github.com wrote:

Hey, @mattgenious https://github.com/mattgenious thanks for the suggestion. Are you suggesting that I validate things like missing critical files or something more specific like invalid liquid or missing section definitions?

I could do very simple validation like missing critical files however I think that sort of validation is a bit useless because unless you just created the theme, you should know that these files are missing.

As for further validation, I am afraid I cannot support them because it would tie themekit very strictly to the elements of Shopify themes and a lot of overhead and binary bloat to do so. For instance, if this was done in the past when theme sections were released, themekit would have broken for everyone.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Shopify/themekit/issues/628#issuecomment-480398534, or mute the thread https://github.com/notifications/unsubscribe-auth/ADTjS2AnuN3T5JNhxFHdPUph04Y9m8-Gks5vd6angaJpZM4ceWT4 .

tanema commented 5 years ago

I would recommend other tooling then. It seems silly to build scss validation into themekit as there are other tools that can do this.

mattgenious commented 5 years ago

What I was looking for was more like validating the json structure in the schemes and making sure the data is valid. I’ve had trouble with filenames and strings in the json that were invalid but I have not been able to find documentation stating the definition of validity. Whether or not a variable exists in the liquid environment (aka Shopify server) is not something I would expect to validate.