Metafield theme-check
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
Follows up https://github.com/Shopify/theme-tools/issues/502
We need to verify if metafields being used in the code are valid. If the metafield does not exist, you should see a warning when running shopify theme check
Describe the solution you'd like
For themes:
- running
shopify theme checkshould verify if the metafield exists on your shop - If you don't have the metafield, you should get a warning message
For theme app extensions:
- TAEs might have their own metafield definitions that are specific to it (see https://shopify.dev/docs/apps/build/custom-data/metafields/use-app-data-metafields)
- running
shopify theme checkshould verify if the metafield exists on your shop OR if the metafield is defined for the app itself - If you don't have the metafield, you should get a warning message
Tasks
- Update theme-check in theme-tools to error out when metafield definitions dont exist
- Add lint ignore rules in Dawn + Horizon where we use metafields that don't exist in any shops by default
- Update CLI so there is a warning when running
theme checkand metafield isnt defined
NOTE: There are a few differences when you pull metafield definitions from CLI or from Theme Access App via CLI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked theme-tools issue #502 and the existing theme-check and CLI paths. Compare the requested metafield validation for themes with the app-specific definitions for theme app extensions, including the noted CLI and Theme Access differences. Done means theme-check and the CLI warn for missing definitions, with required lint ignores in Dawn and Horizon.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100