Respect user .theme-check.yml in theme app extension builds#7391
Open
erikmay wants to merge 1 commit intoShopify:mainfrom
Open
Respect user .theme-check.yml in theme app extension builds#7391erikmay wants to merge 1 commit intoShopify:mainfrom
erikmay wants to merge 1 commit intoShopify:mainfrom
Conversation
`runThemeCheck` hardcoded `theme-check:theme-app-extension`, which bypassed theme-check-node's user-config discovery. Users who wanted to `ignore:` source directories had to fork the CLI or rely on the dot-prefix trick (hidden dirs are skipped by theme-check's glob). When `.theme-check.yml` exists in the extension root, pass `undefined` so theme-check-node auto-discovers the user config. When absent, keep the existing bundled `theme-app-extension` defaults.
8d0081f to
fce73a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runThemeCheckinpackages/app/src/cli/services/build/theme-check.tshardcodes the config identifier'theme-check:theme-app-extension', which bypasses theme-check-node's user-config discovery (findConfigPath). As a result, a.theme-check.ymlplaced in the theme app extension root is ignored duringshopify app devandshopify app deploy, even though the standaloneshopify theme checkcommand respects it.This PR makes
runThemeCheckcheck for.theme-check.ymlin the extension directory and passundefinedtocheck()when present, letting theme-check-node auto-discover the user config. When absent, the existing bundledtheme-check:theme-app-extensiondefaults are applied exactly as before — no behavior change for extensions without a user config.Motivation
Theme app extensions only allow a fixed set of top-level directories (
assets/,blocks/,snippets/,locales/,config/). Authors who want a separate source directory (e.g. uncompiled Liquid / TS / Tailwind that gets built intoblocks/+assets/) currently have two options:.src/) so theme-check's**/*.{liquid,json}glob skips it.Option 1 works but is surprising and fragile. Option 2 is heavy. With this change, a plain
src/source directory works as expected:Changes
packages/app/src/cli/services/build/theme-check.ts: check for.theme-check.ymland fall through to user-config discovery when present.@shopify/apppatch).Test plan
.theme-check.yml—shopify app devandshopify app deployproduce identical theme-check output to before (uses bundledtheme-app-extensiondefaults)..theme-check.ymlextendingtheme-check:theme-app-extensionand addingignore: ['src/**']—shopify app devskipssrc/**offenses..theme-check.ymlwith a custom check severity override —shopify app devreflects the override.