You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I’m getting an “unknown object” warning for all references to section in section files because our section files are in a _sections directory, as we use a minimal custom build step to process them. We don’t have an src directory.
Describe the solution you'd like
An additional setting on the existing root setting to list directories where these types of files may be located.
root:
sections:
- sections
- _sections
This condition could then potentially check if any of the provided directories match:
Describe alternatives you've considered
We could move all of our theme files to an src directory but this would require changing our build step to copy all other directories and files. Ideally we would prefer to keep our build tooling minimal.
We could disable the UndefinedObject check but we’d like to leave it on to catch actual undefined objects.
Additional context
—
The text was updated successfully, but these errors were encountered:
Ish this one is a bit of a pickle. Normally the recommendation is to disable the ones you don't like in src/.theme-check.yml and enable them in the dist output to be sure. I can see how that doesn't map to your setup.
Thing is, this isn't only UndefinedObject. It's going to do the same thing for code completion and hover as well (those objects won't be "in scope").
The other thing is that supporting this would be a documentation complexity burden. The more options we have, the harder it is for someone new to make sense of it. It would also make the stuff more brittle internally.
And what we'd gain is the support for yet another different way to build themes.
But I do appreciate the desire to be build-less (or almost)... That's kind of what we're going for (with obvious gaps).
I wonder if we could tackle this a bit differently. Maybe a {% # global sections, predictive_search, recommendations %} comment at the top of the file as a low-key way of declaring variables in scope. Or maybe revisit the contract we wanted to do for snippet signatures and extending that to non-snippet files.
Thanks, I know it’s a bit of a unique issue, so I really appreciate you considering solutions! My ultimate goal is to not have any build process at all, but we’re not quite there yet. Theme blocks should get us much closer though.
Globals comments would definitely work. I’m not sure I’m familiar with the snippet signatures contract but sounds like that would also work (and would be useful for snippets too, of course).
Is your feature request related to a problem? Please describe.
I’m getting an “unknown object” warning for all references to
section
in section files because our section files are in a_sections
directory, as we use a minimal custom build step to process them. We don’t have ansrc
directory.Describe the solution you'd like
An additional setting on the existing
root
setting to list directories where these types of files may be located.This condition could then potentially check if any of the provided directories match:
https://github.com/Shopify/theme-tools/blob/main/packages/theme-check-common/src/checks/undefined-object/index.ts#L172
Describe alternatives you've considered
We could move all of our theme files to an
src
directory but this would require changing our build step to copy all other directories and files. Ideally we would prefer to keep our build tooling minimal.We could disable the
UndefinedObject
check but we’d like to leave it on to catch actual undefined objects.Additional context
—
The text was updated successfully, but these errors were encountered: