{"_id":"@anattadesign/liquid-quality-gate","_rev":"2-87acf1bb640d6d34561f7f067d24f719","name":"@anattadesign/liquid-quality-gate","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@anattadesign/liquid-quality-gate","version":"1.0.0","author":{"name":"Anatta Design"},"license":"ISC","_id":"@anattadesign/liquid-quality-gate@1.0.0","maintainers":[{"name":"daniel_nordby","email":"daniel@anattadesign.com"},{"name":"ui-anatta","email":"web@anattadesign.com"},{"name":"jamie.anatta","email":"jamie.smith@anattadesign.com"}],"bin":{"liquid-quality-gate":"bin/liquid-quality-gate.js"},"dist":{"shasum":"bbaa3e1014927ee5b16b19caccbe9b6c853b80c7","tarball":"https://registry.npmjs.org/@anattadesign/liquid-quality-gate/-/liquid-quality-gate-1.0.0.tgz","fileCount":7,"integrity":"sha512-A8Sabxolo7oChqpyjO5xDUFg/wce4KGzjYiqPGdLBKBBC+HYN+hNXDokpP2QIKGn98UVYWltUQITjFW00QQnRw==","signatures":[{"sig":"MEQCIFHF8BDycuUNoc5A6qyMWULy47qpr6WL9r4PczTdUKUGAiA/q6JZ0Ke+hakXJgXMyvDSuzykQH0yDiTxbr9mja3CbQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32639},"main":"dist/liquid-quality-gate.js","type":"module","types":"dist/liquid-quality-gate.d.ts","engines":{"node":">=18.17.0"},"gitHead":"af30fcea2e782582c04ec62cca674ac3067c75f1","scripts":{"gate":"npm run build && node bin/liquid-quality-gate.js","test":"echo \"Error: no test specified\" && exit 1","build":"tsc","postinstall":"node scripts/install-hook.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"daniel_nordby","email":"daniel@anattadesign.com"},"_npmVersion":"11.12.1","description":"Pre-push quality gate for Liquid theme repos — currently runs Lighthouse audits (performance, accessibility, best practices, SEO) against a live `shopify theme dev` server and blocks the push if any route falls below threshold.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"dotenv":"^17.4.2","lighthouse":"^12.2.1","chrome-launcher":"^1.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/liquid-quality-gate_1.0.0_1784572261613_0.18512576875589937","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@anattadesign/liquid-quality-gate","version":"1.0.1","description":"Pre-push quality gate for Liquid theme repos — currently runs Lighthouse audits (performance, accessibility, best practices, SEO) against a live `shopify theme dev` server and blocks the push if any route falls below threshold.","license":"ISC","author":{"name":"Anatta Design"},"type":"module","engines":{"node":">=18.17.0"},"main":"dist/liquid-quality-gate.js","types":"dist/liquid-quality-gate.d.ts","bin":{"liquid-quality-gate":"bin/liquid-quality-gate.js"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","prepublishOnly":"npm run build","postinstall":"node scripts/install-hook.js","gate":"npm run build && node bin/liquid-quality-gate.js","test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{"chrome-launcher":"^1.1.2","dotenv":"^17.4.2","lighthouse":"^12.2.1"},"devDependencies":{"@types/node":"^22.10.2","typescript":"^5.7.2"},"gitHead":"af30fcea2e782582c04ec62cca674ac3067c75f1","_id":"@anattadesign/liquid-quality-gate@1.0.1","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-UK2PYkPrJ6eGwAFLBDx2WE5lUhExxTy95xRp/M2Z8Utcky5NT7rVOiKrKxCOKkeKbWeQPjBg01L55wDkGgNpGQ==","shasum":"1c0c8d44aae680fc901d9fec96a8f10dfcba4eff","tarball":"https://registry.npmjs.org/@anattadesign/liquid-quality-gate/-/liquid-quality-gate-1.0.1.tgz","fileCount":7,"unpackedSize":33042,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGh9vc8MyBybiigbpSGEIU0CRbs/pPwrJyDCpBKAVAVzAiAyQ+64WKNPCEvU4WhCBUmDS7Eouujh6W/eJ1f1/o/t/w=="}]},"_npmUser":{"name":"daniel_nordby","email":"daniel@anattadesign.com"},"directories":{},"maintainers":[{"name":"daniel_nordby","email":"daniel@anattadesign.com"},{"name":"ui-anatta","email":"web@anattadesign.com"},{"name":"jamie.anatta","email":"jamie.smith@anattadesign.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/liquid-quality-gate_1.0.1_1784575415340_0.9733645910935493"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T18:31:01.345Z","modified":"2026-07-20T19:23:35.717Z","1.0.0":"2026-07-20T18:31:01.768Z","1.0.1":"2026-07-20T19:23:35.547Z"},"author":{"name":"Anatta Design"},"license":"ISC","description":"Pre-push quality gate for Liquid theme repos — currently runs Lighthouse audits (performance, accessibility, best practices, SEO) against a live `shopify theme dev` server and blocks the push if any route falls below threshold.","maintainers":[{"name":"daniel_nordby","email":"daniel@anattadesign.com"},{"name":"ui-anatta","email":"web@anattadesign.com"},{"name":"jamie.anatta","email":"jamie.smith@anattadesign.com"}],"readme":"# @anattadesign/liquid-quality-gate\n\nPre-push quality gate for Liquid theme repos. Currently runs a full Lighthouse audit (performance, accessibility, best practices, SEO) against a live `shopify theme dev` server, and blocks `git push` if any route falls below threshold in any category — Lighthouse is today's audit engine, not a fixed identity of this tool.\n\n## Installation\n\n```sh\nnpm install @anattadesign/liquid-quality-gate\n# or\nyarn add @anattadesign/liquid-quality-gate\n```\n\nOn install, this package automatically:\n\n1. Wires itself into your repo's `pre-push` git hook (plain `.git/hooks/pre-push`, or `.husky/pre-push` if the repo already uses Husky). If a `pre-push` hook already exists, the gate is appended to it rather than replacing it.\n2. Scaffolds a `.liquid-gaterc.json` config file in the repo root, if one doesn't already exist.\n\nNeither step overwrites anything you've already set up — re-running `npm install` is always safe.\n\n## Requirements\n\n- [Shopify CLI](https://shopify.dev/docs/api/shopify-cli) installed and authenticated locally, with a working `shopify theme dev`.\n- Chrome or Chromium installed locally (used headless, via `chrome-launcher`).\n\n## Configuration\n\nSettings are read in this order of precedence: **environment variables** → **`.liquid-gaterc.json`** → **built-in defaults**.\n\n### `.liquid-gaterc.json`\n\n```json\n{\n  \"productHandle\": [],\n  \"routes\": [\"/\", \"/collections/all\", \"/cart\"],\n  \"categories\": {\n    \"performance\": 90,\n    \"accessibility\": 90,\n    \"best-practices\": 90,\n    \"seo\": 90\n  },\n  \"shopifyFlags\": {\n    \"environment\": \"development\"\n  }\n}\n```\n\n| Field | Description |\n| --- | --- |\n| `productHandle` | **Required, non-empty.** Array of product handles in the store — `/products/<handle>` is audited for each one, so multiple product templates can be tested in the same run. |\n| `routes` | Array of additional route paths to audit, alongside the per-handle product pages. |\n| `categories` | Map of category id → minimum passing score (0–100). A category's presence in this map is what enables it — remove a key (e.g. delete `\"performance\"`) to skip auditing that category entirely. |\n| `shopifyFlags` | Flags passed to the spawned `shopify theme dev`, e.g. `{ \"store\": \"my-shop.myshopify.com\", \"environment\": \"development\" }`. Keys are translated to the Shopify CLI's own `SHOPIFY_FLAG_<NAME>` env var convention. |\n\nEverything you'd otherwise put in a `.env` file for this tool — product handle, category thresholds, and Shopify CLI flags like `store`/`environment` — belongs in this dotfile instead.\n\n### Environment variables\n\nEquivalent env vars (useful for CI-style overrides, or a one-off local override) — any of these take precedence over the dotfile:\n\n| Variable | Equivalent to |\n| --- | --- |\n| `SHOPIFY_PRODUCT_HANDLE` (single handle, or comma-separated for several) | `productHandle` |\n| `LIGHTHOUSE_THRESHOLD_<CATEGORY>` (e.g. `LIGHTHOUSE_THRESHOLD_PERFORMANCE`) | Overrides the threshold for a category already present in `categories`. Doesn't enable a category that's missing from the map. |\n| `SHOPIFY_FLAG_<NAME>` (e.g. `SHOPIFY_FLAG_STORE`) | `shopifyFlags.<name>` |\n\nBeyond `shopifyFlags`, store selection and authentication are left entirely to the Shopify CLI's own local session.\n\n## Usage\n\nOnce installed, the gate runs automatically on `git push`. To run it manually:\n\n```sh\nnpx liquid-quality-gate\n```\n\nIt starts `shopify theme dev`, waits for it to come up, audits every configured `routes` entry plus `/products/<handle>` for each configured `productHandle`, then prints a summary table:\n\n```\nSummary\n\n+-------------------------------+-------------+---------------+----------------+-----------+\n| Route                         | Performance | Accessibility | Best Practices | SEO       |\n+-------------------------------+-------------+---------------+----------------+-----------+\n| /                              | FAIL 41/100 | FAIL 77/100   | FAIL 57/100    | FAIL 69/100 |\n| /products/some-handle          | FAIL 31/100 | FAIL 80/100   | PASS 100/100   | FAIL 61/100 |\n| /collections/all               | FAIL 30/100 | PASS 90/100   | FAIL 79/100    | FAIL 85/100 |\n| /cart                          | FAIL 32/100 | PASS 90/100   | PASS 100/100   | FAIL 85/100 |\n+-------------------------------+-------------+---------------+----------------+-----------+\n```\n\nRoutes are audited one at a time — see the note in `src/liquid-quality-gate.ts` on why concurrent audits aren't safe in a single process.\n\n## Exit codes\n\n- `0` — every route passed every configured category.\n- `1` — a route fell below threshold in any category, no product handles were configured, `shopify theme dev` never became ready, or Chrome couldn't be launched.\n","readmeFilename":"README.md"}