Skip to content

Build the theme graph without an assets folder - #1348

Merged
clauderic merged 1 commit into
mainfrom
web-components-without-assets
Oct 20, 2026
Merged

clauderic merged 1 commit into
mainfrom
web-components-without-assets

Conversation

@clauderic

@clauderic clauderic commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

What are you adding in this PR?

A theme without an assets folder never gets a theme graph in the language server.

  • getWebComponentMap reads assets/ without checking that it exists. For a theme without one, it rejects, and so does building the graph.
  • ThemeGraphManager caches the graph as a promise. Its rebuild on file changes awaits the cached promise before replacing it, so it rejects too and the graph is never rebuilt. Creating the folder doesn't help; only restarting the server does.
  • Until then, references and dependencies come back empty. OrphanedSnippet and ValidScopedCSSClass get the error when they ask the graph for references.

Now a missing assets folder means no web components. Other errors, like an assets folder that can't be read, still reject. The check uses theme-graph's existing exists helper, which is a stat.

What's next? Any followup issues?

Tophatting

  • npx vitest run packages/theme-graph/src/getWebComponentMap.spec.ts. Without the fix it fails with Directory not found: file:///assets.

Before you deploy

  • I included a patch bump changeset
  • My feature is backward compatible

🤖 Generated with Claude Code

getWebComponentMap read the assets folder without checking that it
exists, so it rejected for a theme without one, and so did building
its graph. The language server caches the graph as a promise, and its
rebuild awaits the cached one first, so that theme never got a graph,
even after the folder was created.

A missing assets folder now means no web components. Other errors,
like an assets folder that can't be read, still reject.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clauderic
clauderic requested a review from a team as a code owner October 20, 2026 12:42
@clauderic
clauderic added this pull request to stack #1353 October 20, 2026 13:15
@clauderic
clauderic merged commit 20f8edf into main Oct 20, 2026
8 checks passed
@clauderic
clauderic deleted the web-components-without-assets branch October 20, 2026 16:28
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.

3 participants