Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

[Bug] Theme check does not work inside a monorepo directory structure #141

Closed
AdiRishi opened this issue Jul 23, 2023 · 2 comments
Closed

Comments

@AdiRishi
Copy link

AdiRishi commented Jul 23, 2023

The problem

The theme check plugin is unable to handle themes not existing at a top level directory. A common example of this is in a monorepo setup (e.g when using turborepo).
I've made an example repository to demonstrate this - https://github.com/AdiRishi/shopify-theme-check-bug

When you open the repository at it's root, and navigate to let's say shopify/themes/bohemian-vibe-theme/snippets/article-card.liquid then you see a lot of errors like Undefined object media_aspect_ratio (just one example)
However, if you were to open just the bohemian-vibe-theme in vscode (aka this folder as root) then the errors don't show up.

From what I can tell, this is because the shopify theme check command is not being run at the template root, and the CLI command itself does not handle being run at a location that is not the template root.

Potential solution

I am fairly new to the shopify ecosystem, but here are some options

  • Only run the theme check command in folders which have a .theme-check.yml file
  • Allow users to configure which folders theme check is run on

Let me know if any more information is needed.

@AdiRishi
Copy link
Author

Okay, update on this. You can get around this problem by adding a .theme-check.yml file to the root of the monorepo and setting the root property to the directory location of your shopify theme. E.g.

root: shopify/themes/custom-theme

However, this wouldn't work if you had multiple themes in a single monorepo. So the issue is still valid.

@charlespwd
Copy link
Contributor

Acknowledged. Already fixed soon in future version of language server. Stay tuned for release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants