fix: make dev up, dev server, and dev docs work - #956
Open
kdaviduik wants to merge 1 commit into
Open
Conversation
kdaviduik
force-pushed
the
kd-fix-dev-up-and-server
branch
2 times, most recently
from
August 22, 2026 03:37
7865823 to
6890ab8
Compare
dev up was broken: the node task used a pnpm: key that current dev rejects (requires package_manager:), and docs had no Ruby/Jekyll toolchain provisioned. dev server used the non-standard 'start' command name and failed to bind port 8080 due to a devns conflict. Changes to dev.yml: - Fix node task: pnpm: -> package_manager: + packages: [.] (the old pnpm: key was rejected by dev's validator) - Add ruby + bundler to up: provisions Jekyll for the docs preview - Rename 'start' command to 'server' (matches dev convention across Shopify repos; Ctrl-T during dev server opens 'app' link) - server now runs 'pnpm build && pnpm start' so a restart picks up source changes (the watch-based start script handles incremental recompiles, but build ensures dist/lib are current for test-manual) - Rename open: example -> open: app (Ctrl-T is hardcoded to look for a link named 'app') Changes to package.json: - serve script: http-server -> http-server -a 127.0.0.1 -p 8080 devns (dev's networking daemon) holds 0.0.0.0:8080 in a CLOSED socket state to proxy *.shop.dev traffic. http-server defaults to binding 0.0.0.0:8080, which conflicts (EADDRINUSE). Binding to 127.0.0.1 avoids the conflict. -p 8080 is needed because without it, http-server uses portfinder which checks 0.0.0.0 (still blocked by devns) and auto-increments to 8081+. See: https://github.com/http-party/http-server#readme (-a defaults to 0.0.0.0, -p defaults to 8080) - docs script: jekyll serve -> bundle exec jekyll serve Uses the Jekyll provisioned by dev up instead of relying on a system-installed jekyll New files: - .ruby-version: 3.3.6 (required by dev's ruby task; Jekyll 4.4 compatible) - Gemfile: gem 'jekyll', '~> 4.4' for the docs preview server - Gemfile.lock: generated by dev up, ensures reproducible installs Doc fixes: - docs/readme.md: was copy-pasted from js-buy-sdk repo (wrong title, wrong URL, referenced non-existent doc-build/doc-serve scripts). Rewritten to describe this repo's docs setup accurately. - readme.md: Documentation section no longer says to manually 'gem install jekyll' (dev up handles it). Corrected 'gh-pages from main' to 'Pages builds /docs from main' (no gh-pages branch). Added note about http-server binding to 127.0.0.1. Ignore files: - .gitignore: add .jekyll-cache (Jekyll 4 cache dir) - .npmignore: exclude /Gemfile, /Gemfile.lock, /.ruby-version so the Ruby tooling doesn't ship to npm consumers Co-authored-by: AI (Pi/GLM 5.2 Fast (Fireworks) [1m]) <noreply@pi.dev>
kdaviduik
force-pushed
the
kd-fix-dev-up-and-server
branch
from
August 22, 2026 03:39
6890ab8 to
eba4c2c
Compare
kdaviduik
marked this pull request as ready for review
August 22, 2026 03:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
dev upwas broken (thenodetask used apnpm:key that current dev rejects),dev serverfailed to bind port 8080 (devns conflict), anddev docshad no Ruby/Jekyll toolchain provisioned. This PR fixes all three so the standard dev workflow works out of the box — no manual setup steps.What
dev up— fixed node task + provisioned Jekylldev.ymlnodetask:pnpm: 10.16.1→package_manager: pnpm@10.16.1+packages: [.](the oldpnpm:key was rejected by dev's validator)ruby+bundlertoup:— provisions Ruby 3.3.6 and Jekyll 4.4.1 sodev docsworks without manually installing Jekyll.ruby-version(3.3.6),Gemfile(gem 'jekyll', '~> 4.4'),Gemfile.lock(generated bydev up)dev server— renamed command, fixed port binding, removed manual setupRenamed
start→serverindev.yml(matches the convention across Shopify repos)servernow runspnpm run build && pnpm run start— a restart picks up source changes cleanlyRenamed
open: example→open: app— Ctrl-T duringdev serveris hardcoded to look for a link namedappFixed
EADDRINUSEon port 8080: changedservescript fromhttp-servertohttp-server -a 127.0.0.1 -p 8080devns(dev's networking daemon) holds0.0.0.0:8080in a CLOSED socket state to proxy*.shop.devtraffic.http-serverdefaults to binding0.0.0.0:8080, which conflicts. Binding to127.0.0.1avoids the conflict.-p 8080is also needed — without it,http-serverusesportfinderwhich checks0.0.0.0(still blocked by devns) and auto-increments to 8081+.Evidence: http-server README documents that
-adefaults to0.0.0.0and-pdefaults to8080. You can reproduce the conflict by runningnode -e "require('http').createServer().listen(8080, '0.0.0.0')"— it throwsEADDRINUSE, whilelisten(8080, '127.0.0.1')succeeds.Why not
-p 0(auto-find open port)? The http-server docs suggest-p 0to letportfinderfind an open port starting at 8080. However,portfinderchecks availability on0.0.0.0(where devns holds the CLOSED socket), not on the-a 127.0.0.1address — so it sees 8080 as taken and skips to 8081, which breaksdev open app(hardcoded tohttp://localhost:8080/). Using an explicit-p 8080bypassesportfinderentirely and binds directly to127.0.0.1:8080.Renamed
index.example.html→index.htmland hardcoded the hydrogen-preview demo store credentials (same public credentials already used intest-manual/index.html). Removed/index.htmlfrom.gitignoreso it's committed. This eliminates the manualcp+ credential-filling step —dev serverjust works.Why this is safe:
index.htmlwas originally gitignored in 2016 because it contained a real Storefront API key. The example/template pattern was the 2016 solution to "don't commit API keys." This concern no longer applies: storefront access tokens are public-by-design (they're embedded in browser-side JS on merchant websites — that's literally what buy-button-js does), they only grant read access to products/collections, and the specific credentials used here are already committed intest-manual/index.htmlin this same repo.dev docs— fixed docs command + stale docsdocsscript:jekyll serve→bundle exec jekyll serve(uses the Jekyll provisioned bydev up)docs/readme.md: was copy-pasted from thejs-buy-sdkrepo (wrong title, wrong URL, referenced non-existentdoc-build/doc-servescripts) — rewritten to accurately describe this repo's docs setupreadme.md: Documentation section no longer says to manuallygem install jekyll(dev up handles it); corrected "gh-pages from main" to "Pages builds /docs from main" (no gh-pages branch); removed manualcp index.example.html index.htmlstepIgnore files
.gitignore: removed/index.html(now committed); added.jekyll-cache(Jekyll 4 cache dir).npmignore: excluded/Gemfile,/Gemfile.lock,/.ruby-versionso Ruby tooling doesn't ship to npm consumers (index.htmlwas already excluded)How to verify