local-storefront
v0.1.14
Published
A local storefront for Shopify themes: lsf renders a theme from JSON fixtures, without the Shopify API, for fast end-to-end tests.
Maintainers
Readme
local-storefront
A local storefront for Shopify themes. Its command, lsf, serves a theme from your machine,
rendered from JSON fixtures instead of the Shopify API: no network, no rate limit, and each
test gets exactly the catalog, cart and customer it asks for.
npm install --save-dev local-storefrontnpx local-storefront serveWrite npx local-storefront, not npx lsf: an unrelated package named lsf exists on npm,
and npx lsf downloads and runs it wherever this package is not installed. Inside the
scripts of package.json, where only installed commands are looked up, lsf is fine.
With Playwright:
// playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: { baseURL: 'http://127.0.0.1:9292' },
webServer: {
command: 'npx local-storefront serve --port 9292 --static --quiet --strict',
url: 'http://127.0.0.1:9292/__lsf/status',
reuseExistingServer: !process.env.CI,
},
});This package only contains a launcher. The lsf binary comes from a platform package that
npm installs alongside it: macOS, Linux and Windows, on x64 and arm64.
Documentation: https://github.com/0xtlt/local-storefront
