npm scripts
Every script in package.json, what it runs, and when to use it.
npm scripts
Development
| Script | Runs | Notes |
|---|---|---|
npm run dev | run-pty ./run-pty.json | The four-process stack. The normal way to work |
npm run dev:vite | vite | Vite alone on https://localhost:5173 |
npm run dev:css | npm run build:css -- --watch | PostCSS watch, rebuilding the Tailwind output |
npm run dev:shopify | shopify theme dev --environment dev --port 9292 --reconciliation-strategy keep-local --theme-editor-sync | Shopify preview alone |
npm run dev:tunnel | node scripts/start-cloudflare-tunnel.mjs | Cloudflare tunnel alone |
Build
| Script | Runs | Notes |
|---|---|---|
npm run build | npm run build:css && vite build | Rewrites assets/ and snippets/vite-tag.liquid. Run before every commit |
npm run build:css | postcss src/assets/theme_in.css -o src/entrypoints/theme.styles.css --config . | Tailwind output only |
npm run typecheck | tsc --noEmit | Type checks src/. Writes nothing |
Quality
| Script | Runs | Notes |
|---|---|---|
npm run lint | shopify theme check | Shopify's Liquid linter. Configured in .theme-check.yml |
npm run lint:fix | shopify theme check -a | Applies safe auto-corrections |
npm run format | prettier --write . | Includes Liquid, through @shopify/prettier-plugin-liquid |
npm run format:check | prettier --check . | Reports without writing |
There is no test script. This repository has no test suite.
Shopify
| Script | Runs | Notes |
|---|---|---|
npm run pull | shopify theme pull | Downloads theme files from the store |
npm run push | npm run build && shopify theme push | Builds, then pushes to the configured theme |
npm run deploy | npm run build && node scripts/deploy.cjs | Duplicates the live theme and pushes to the copy |
npm run onboard | node scripts/onboard.cjs | Interactive first-time setup wizard |
npm run list | shopify theme list | Themes on the store with IDs and roles |
npm run open | shopify theme open -e dev | Opens the dev theme preview |
npm run console | shopify theme console -e dev | Liquid REPL against the dev environment |
npm run profile | shopify theme profile -e dev | Liquid render profiling for a page |
npm run push targets the theme selected by shopify.theme.toml, so read that file before running it. For a preview,
use the helper described in Deployment instead.
Deploy flags
npm run deploy -- --name "Beauty Affairs v6.8.0"
npm run deploy -- --force--name overrides the name built from themeNameTemplate and version in package.json. --force skips the
confirmation when a theme of that name already exists, and appends a timestamp so the names stay unique.
Hooks
| Hook | Runs |
|---|---|
prepare | simple-git-hooks, installing the hooks on npm install |
pre-commit | npx lint-staged && npm run build |
lint-staged runs Prettier over staged .liquid, .js, .css, .scss, .json and .md files.
The pre-commit build means every commit carries matching output in assets/. It also means commits are slow, and that a
commit can add files you did not stage. Run npm run build yourself first so you can review the output before it is
committed.
Configuration files
| File | Configures |
|---|---|
package.json | Scripts, dependencies, theme name template, version |
vite.config.js | Vite, the Shopify plugin, asset cleanup |
postcss.config.cjs | Tailwind, postcss-preset-env, cssnano |
tailwind.config.cjs | Tailwind, with the tw- prefix and the BA colour tokens |
tsconfig.json | TypeScript, target ES2022, strict, path aliases |
.theme-check.yml | Theme Check, extending theme-check:recommended |
.prettierrc | Prettier, with the Liquid plugin |
.prettierignore | Files Prettier skips, including vendor snippets |
.shopifyignore | Files excluded from theme pushes |
shopify.theme.toml | Store and environments |
run-pty.json | The four dev processes |
.nvmrc | Node 24.4.0 |