Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metafield completion #502

Open
2 of 5 tasks
charlespwd opened this issue Sep 25, 2024 · 0 comments
Open
2 of 5 tasks

Metafield completion #502

charlespwd opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@charlespwd
Copy link
Contributor

charlespwd commented Sep 25, 2024

Is your feature request related to a problem? Please describe.
Accessing metafield values in a theme is kind of complicated.. There's probably something smart we can do that would make it super easy to have code completion for those in a shop-aware scenario.

Describe the solution you'd like

  • Use dependency injection of some kind of data structure so that the browser and node environments have access to a shop's metafield config
  • Wire the metafield definitions into the type system so that code completion works as though they were normal types.
  • It should be opt-in
  • It should be as easy as logging in to get the stuff we need. (think get approval and we do the graphql call for you)
  • Maybe a CLI command. Maybe reuse CLI auth. Maybe dump to file (so that it's usable in CI).

Describe alternatives you've considered

  • Using dependency injection so that the core does the graphql calls to get the stuff. I don't like that because it creates a network dependency and error handling can get weird. I'd like to be able to keep running theme-check in CI without making API calls. Probably something like dumping the definitions to a file and providing those. In web, we could probably do the graphql query to get them.

Tasks

  • Allow VScode to parse and auto-complete metafield definitions
  • Allow OSE to parse and auto-complete metafield definitions
  • Create CLI command to fetch metafield definitions and store it in the themes directory
  • Ensure themes directory does not commit and push the file into the repo
  • Fetch the metafield definitions on VScode startup

Questions

  • How do we want to handle when the CLI isn't logged into an shop?
    • Should we try to use Theme Access app if they have store + password defined in their environment file?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants