Skip to content

Add Liquid docs bundle command#1240

Open
charlespwd wants to merge 1 commit into
mainfrom
fix/theme-liquid-docs-bundle-cli
Open

Add Liquid docs bundle command#1240
charlespwd wants to merge 1 commit into
mainfrom
fix/theme-liquid-docs-bundle-cli

Conversation

@charlespwd

@charlespwd charlespwd commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What are you adding in this PR?

Related issue: Shopify/developer-tools-team#783

Adds a stable Liquid docs bundle generator to @shopify/theme-check-docs-updater.

New package API:

import { buildThemeLiquidDocsBundle } from '@shopify/theme-check-docs-updater';

const bundle = await buildThemeLiquidDocsBundle();

New CLI command:

pnpm --dir packages/theme-check-docs-updater theme-docs bundle

The command writes a self-contained JSON bundle to stdout:

{
  "schemaVersion": 1,
  "revision": "40f966fc7793462726d9f8573c8d522f8ab44c54",
  "tags": [],
  "filters": [],
  "objects": [],
  "systemTranslations": {},
  "schemas": []
}

Logs from docs loading go to stderr so stdout can be redirected directly into a JSON artifact.

Why: browser-based hosts need a way to publish Liquid docs updates independently from theme-tools and extension releases. This PR only adds the generator; it does not change browser extension runtime behavior.

What's next? Any followup issues?

Follow-up PR: #1016 teaches the browser extension to fetch a published docs bundle at runtime and fall back to bundled docs if unavailable.

A separate host/CDN publisher can use this command after this package version is released, for example:

pnpm dlx @shopify/theme-check-docs-updater@<version> theme-docs bundle > liquid-docs-bundle.json

Tophatting

  • pnpm --dir packages/theme-check-docs-updater type-check
  • CI=1 pnpm vitest run packages/theme-check-docs-updater/src/themeLiquidDocsBundle.spec.ts packages/theme-check-docs-updater/src/themeLiquidDocsManager.spec.ts
  • pnpm --dir packages/theme-check-docs-updater build
  • pnpm --silent --dir packages/theme-check-docs-updater theme-docs bundle | jq '.revision, .schemaVersion'
  • pnpm format:check
  • git diff --check
  • Screenshots are not applicable; this is CLI/package API behavior.

Before you deploy

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

@charlespwd charlespwd marked this pull request as ready for review June 19, 2026 14:46
@charlespwd charlespwd requested a review from a team as a code owner June 19, 2026 14:46

@FKauwe FKauwe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tophatted and the commands compile, build, run on my machine and the unit tests test both happy and sad path. This seems like a helpful addition to have "fresh" docs available in between extension releases


Usage:
download <dir> \t\tDownloads all docsets and JSON Schemas to the specified directory.
bundle \t\t\tPrints a self-contained Liquid docs JSON bundle.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the first time I've seen the \t\t\t and asked Claude about it. Apparently it's a way to align the descriptions into columns. C mentioned that there are some libraries that exist that that handle alignment automatically. Just curious what the tradeoffs are between this syntax and a library-- maybe a whole library is just overkill and the current syntax is more lightweight for the purposes you need?

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.

2 participants