Skip to content

fix: update section type in config/settings_data.json on section rename#1193

Open
reza6ix wants to merge 1 commit intoShopify:mainfrom
reza6ix:fix/settings-data-section-rename
Open

fix: update section type in config/settings_data.json on section rename#1193
reza6ix wants to merge 1 commit intoShopify:mainfrom
reza6ix:fix/settings-data-section-rename

Conversation

@reza6ix
Copy link
Copy Markdown

@reza6ix reza6ix commented Apr 23, 2026

Problem

Fixes #713. When a section file is renamed in a Shopify theme, the type attribute
inside config/settings_data.json presets was not updated, leaving the file pointing
at the old section name
Template files, section groups, and {% section %} tags were already handled by
SectionRenameHandler; settings_data.json was the only missing location.

Changes

  • src/utils/uri.ts — adds isSettingsData URI predicate
  • src/renamed/handlers/utils.ts — adds SettingsData interfaces and isValidSettingsData type guard
  • src/renamed/handlers/SectionRenameHandler.ts — adds getSettingsDataChanges method
  • src/renamed/handlers/SectionRenameHandler.spec.ts — 4 new tests

Only the type attribute value is updated; section keys and all other fields are untouched.

Test plan

  • yarn test in packages/theme-check-common — 946 tests pass
  • yarn test in packages/theme-language-server-common — 437 tests pass

@reza6ix reza6ix requested a review from a team as a code owner April 23, 2026 19:28
@reza6ix
Copy link
Copy Markdown
Author

reza6ix commented Apr 23, 2026

I signed the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Section rename handling in config/settings_data.json

1 participant