-
Notifications
You must be signed in to change notification settings - Fork 0
Shopify Integration
Living notes for Shopify CLI dev-server support.
Treat Shopify local development servers as first-class Dev Servers rows while preserving the extension's OS-driven detection model.
The dashboard should catch Shopify servers started from any terminal, package script, or tool. Start/restart support lives in the shared spawn path so the generic Node/Bun path stays boring.
- Detect global Shopify CLI dev processes that are not launched from
node_modules. - Recognize these commands:
shopify theme devshopify app devshopify hydrogen dev
- Show dedicated tool tags:
-
shopify-theme-> Shopify Theme -
shopify-app-> Shopify App -
shopify-hydrogen-> Hydrogen
-
- Keep the existing runtime tag behavior. Shopify CLI currently runs under Node, so the runtime remains
node. - Start and restart pure theme roots via
shopify theme dev. A theme root islayout/theme.liquidorshopify.theme.toml; nopackage.jsonis required. - Start and restart app roots via package scripts when present, or
shopify app devwhenshopify.app.tomlexists and no dev script is usable. - Detect Hydrogen before the
shopify.app.tomlmarker. Hydrogen projects can also carry app markers, but@shopify/hydrogenis the more specific signal.
Implementation:
-
src/servers.ts:detectShopifyTool(command)classifies Shopify CLI dev commands. -
src/servers.ts:isCandidateaccepts Shopify CLI dev commands in addition tonode_modulesand bare Bun candidates. -
src/tool-display.ts: labels and colors for Shopify tags. -
src/start.tsx:guessFramework(cwd)uses theme markers first, then the Hydrogen dependency, then the app marker. -
src/servers.ts:findProjectRootaccepts theme/app roots, andplanSpawnfalls back to Shopify CLI commands when scripts do not cover the project.
Detection is intentionally command-line based, matching the existing dashboard model.
Positive examples:
node /Users/me/.nvm/versions/node/v24/bin/shopify theme dev
shopify app dev --use-localhost
/opt/homebrew/bin/shopify hydrogen dev
Negative examples:
shopify theme check
shopify theme language-server
/path/to/shopify-plugin
/path/to/shopify.theme-check-vscode/server.js
The detector should stay strict. A process merely containing the word shopify is not enough; it must be a Shopify CLI dev command.
Package scripts still win. Scaffolded Shopify apps, Hydrogen storefronts, and themes that wrap shopify theme dev in concurrently should keep their project-owned script as the launch surface.
The Shopify CLI fallbacks are only for roots the generic script path cannot start: pure themes and app roots without a usable dev script. First-run auth/store selection stays a log-surfaced caveat, because the CLI prompts for login and store choice and a detached spawn cannot answer.
shopify theme dev has no next-free-port fallback and dies with EADDRINUSE when 9292 is taken (Shopify/cli#5554). Before starting a theme, the extension probes the default bind and exports SHOPIFY_FLAG_PORT with the next free port when needed.
An environment variable was chosen instead of adding --port to argv because it reaches every wrapping shape: bare theme roots and dev scripts that nest the CLI under another tool. A user-written --port still wins because Shopify CLI gives explicit flags precedence over env.
Parallel starts reserve picked ports for the same 15s window as the spawn watchdog. The probe socket closes before Shopify binds, so the reservation prevents two selected theme worktrees from being handed the same apparently-free fallback port.
Use Shopify CLI output when the extension started the process.
- Parse and store the local preview URL when it differs from
localhost:PORT. - Parse the theme editor URL for
shopify theme dev. - Parse the shareable preview link for
shopify theme dev. - Add row actions such as Open Theme Editor and Copy Preview Link when the URLs are known.
Handle multi-port Shopify sessions more deliberately.
-
shopify app dev --use-localhostuses a localhost proxy port by default and can be overridden with--localhost-port. -
shopify app devcan also involve app and extension child servers. If the dashboard gets noisy, group or prioritize Shopify-owned listeners. - Hydrogen dev mirrors Oxygen/workerd behavior and may expose static assets on another localhost origin. Prefer the primary CLI dev URL when discoverable.
- Should pure Shopify theme starts prompt for
--storeif no previous store is configured, or should the spawn log remain the first-run setup surface? - Should the extension ever run
shopify theme info --json, or should it avoid extra CLI calls during polling? - Should Shopify App and Hydrogen eventually get separate display colors, or is a shared Shopify green enough?