Shopify / theme-tools

Everything developer experience for Shopify themes
https://shopify.dev/docs/themes
MIT License
48 stars 14 forks source link

Extension should look for templates relatively or by setting. #392

Open IngoVals opened 2 years ago

IngoVals commented 2 years ago

I'm using Webpack to build my theme so I have the liquid files inside a /src/static directory. I keep these static files in the same directory structure as they will be built as.

{% comment %} Inside theme.liquid {% endcomment %}
{% section 'header' %}

So theme-check extension checks my code automatically and gives me a MissingTemplate.

Since this file is located at src/static/layout I would like theme check to look in src/static/sections/header.liquid

If that is not possible maybe a base url setting for the extension for which theme check will be ran in.

adrianocr commented 2 years ago

I have the same issue.

It seems that the extension is built to only be compatible with flat theme structures.

IngoVals commented 2 years ago

I guess we could add a .theme-check.yml and set the root to either the '/dist' folder or '/src/static'

This is enabled by the theme check CLI tool that this extension uses under the hood

charlespwd commented 2 years ago

Yep the way to do this is with .theme-check.yml as you said. What steps did you take to get the extension running? Do you have suggestions on how we could improve our docs (or their discoverability)?

teknolog2000 commented 1 year ago

This seems broken when editing a theme from within a VSCode Workspace with many directories. I have my root: . in theme-check.yml but the root it goes to is seemingly the first directory in the workspace. If I open just the theme directory in a new VSCode window it works.