feat: add DeprecatedFontsOnSettingsData check for config/settings_data.json#1174
Open
SinhSinhAn wants to merge 1 commit intoShopify:mainfrom
Open
feat: add DeprecatedFontsOnSettingsData check for config/settings_data.json#1174SinhSinhAn wants to merge 1 commit intoShopify:mainfrom
SinhSinhAn wants to merge 1 commit intoShopify:mainfrom
Conversation
Add a new theme check that warns when `config/settings_data.json` contains deprecated font handles. This complements the existing `DeprecatedFontsOnSectionsAndBlocks` and `DeprecatedFontsOnSettingsSchema` checks by covering the saved preset values in settings_data.json, which was the remaining unchecked surface for deprecated fonts. The check walks all string literal values in the JSON and flags any that match the shared DEPRECATED_FONT_HANDLES set. Closes Shopify#1008
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
DeprecatedFontsOnSettingsDataJSON check that warns on deprecated font handles inconfig/settings_data.jsonThis complements the existing
DeprecatedFontsOnSectionsAndBlocks(sections/blocks{% schema %}tags) andDeprecatedFontsOnSettingsSchema(config/settings_schema.json) checks by covering the remaining unchecked surface: saved preset values insettings_data.json.How it works
The check walks all string literal
Propertyvalues inconfig/settings_data.jsonand flags any that match the sharedDEPRECATED_FONT_HANDLESset. This covers:currentsettings (live theme values)presets(theme demo presets)Implementation details
DEPRECATED_FONT_HANDLESset fromdeprecated-fonts-data.tsDeprecatedFontsOnSettingsSchemaallCheckswithrecommended: trueTests
6 test cases covering:
config/settings_data.json)All existing tests continue to pass (21 tests across the other two deprecated font checks).
Closes #1008