Skip to content

Add Shopify theme support: Liquid files and theme JSON templates #5552

Backlog

Description

@dalexhd

Problem

A Shopify theme builds a page from .liquid files that call each other (render, section, content_for) and from JSON files that place sections on a page. graphify sees almost none of it today:

  • .liquid is not in CODE_EXTENSIONS, so no extractor reads it.
  • templates/*.json and sections/*-group.json are skipped as data JSON (_is_config_json), and a template carrying $schema would be walked as a config file.
  • So "which pages break if I change this snippet?" has no answer. graphify affected snippets/card.liquid returns nothing.

Related, other platform: #2695 (Nuvemshop .tpl). Precedents for the approach: the Blade and EJS extractors.

Proposed behavior

Two small extractors, deterministic, no LLM, no new dependency:

  1. .liquid inside a theme root (an ancestor holding layout/theme.liquid; Jekyll and Eleventy also use .liquid, so elsewhere only the file node is emitted):
    • render / include / section / sections / content_for 'block' and {% schema %} block types -> imports edge to the target file.
    • 'x' | asset_url and 'a.b' | t -> references edge to the asset or the locale key.
  2. Theme JSON (templates, section groups, config/settings_schema.json), routed by path before the generic .json dispatch:
    • Each placed section -> imports edge to sections/<type>.liquid; nested blocks -> blocks/<type>.liquid when that file exists.
    • t: keys in schemas -> the key in locales/*.default.schema.json.

Why imports for composition and references for assets and keys: composition is what affected should follow when a file changes; an asset or a translation key is data the file points at.

Broken references

A static name whose file or locale key does not exist becomes an AMBIGUOUS edge (score 0.2) to a node flagged unresolved: true. Agents and CI can list them. Dynamic names (render some_var) get nothing, rather than a guess.

Out of scope

CSS and JS content of {% stylesheet %} / {% javascript %}, the {% block %} / {% partial %} preview tags, app blocks, config/settings_data.json, section-local blocks.

Plan

Two stacked PRs, one concern each: (1) Liquid extractor with unresolved references; (2) theme JSON extractor and schema t: keys. Happy to adjust relation names or split further.

AI disclosure: written with Claude Code, reviewed and run by me.

Activity

  1. github-actions commented on Nov 27, 2026

    @github-actions

    Thanks for opening this issue, @dalexhd. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. dalexhd commented on Nov 27, 2026

    @dalexhd
    ContributorAuthor

    Scope update after measuring three production themes, one of them Horizon 3.5.1:

    What stays out, because it cannot be resolved statically: app blocks, dynamic render names and non-literal translation keys.

  3. dalexhd commented on Nov 27, 2026

    @dalexhd
    ContributorAuthor

    Update on scope: a fourth PR, #5557 (stacked on #5555), extends the theme graph to the constructs the first three leave out: settings.x, custom elements (JS define to Liquid use), CSS classes (INFERRED), metafields, and .js.liquid/.css.liquid assets, and explain/affected now show every line of a repeated edge. It also adds a small grep-versus-graph gate script; on three real themes every category reaches 100 % coverage. It stays stacked until #5553 to #5555 are reviewed, so happy to rebase or split it however you prefer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions