local-storefront 0.1.18 → 0.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # local-storefront
2
2
 
3
- Run a Shopify theme on your machine, without Shopify. Its command, local-storefront, serves a
4
- theme rendered from JSON store data instead of the Shopify API: no network, no rate limit, and
5
- each test gets exactly the catalog, cart and customer it asks for.
3
+ Run Shopify themes and Shopify apps on your machine, without Shopify. From your theme, your app
4
+ and JSON store data, local-storefront serves the storefront, the checkout of your app and a local
5
+ GraphQL Admin API. There is no development store, no network and no rate limit, and each test
6
+ gets exactly the catalog, cart and customer it asks for.
6
7
 
7
8
  ```bash
8
9
  npm install --save-dev local-storefront
@@ -18,10 +19,12 @@ Inside the `scripts` of `package.json`, `local-storefront serve` is enough.
18
19
  | Command | What it does |
19
20
  |---|---|
20
21
  | `npx local-storefront serve` | Serves the theme at <http://127.0.0.1:9292>. |
21
- | `npx local-storefront validate` | Checks the store data. |
22
+ | `npx local-storefront validate` | Checks the store data and the checkout scenarios, with or without a theme. |
22
23
  | `npx local-storefront check --fix` | Fixes what Shopify's strict Liquid parser rejects. |
23
24
  | `npx local-storefront fmt` | Formats Liquid files as Prettier does. |
24
25
  | `npx local-storefront profile <path>` | Shows what makes a page slow. |
26
+ | `npx local-storefront app dev --app <dir>` | Serves a Shopify app: its checkout, where its Functions run and its UI extensions show, and the Admin API of its backend. |
27
+ | `npx local-storefront app check --app <dir>` | Runs the app's checkout scenarios and checks what each must look like, for CI. |
25
28
 
26
29
  With Playwright:
27
30
 
@@ -30,16 +33,18 @@ With Playwright:
30
33
  import { defineConfig } from '@playwright/test';
31
34
 
32
35
  export default defineConfig({
33
- use: { baseURL: 'http://127.0.0.1:9292' },
36
+ // A port of its own, so that a local run never reuses your dev server.
37
+ use: { baseURL: 'http://127.0.0.1:9393' },
34
38
  webServer: {
35
- command: 'npx local-storefront serve --port 9292 --static --quiet --strict',
36
- url: 'http://127.0.0.1:9292/__lsf/status',
39
+ command: 'npx local-storefront serve --port 9393 --static --quiet --strict',
40
+ url: 'http://127.0.0.1:9393/__lsf/status',
37
41
  reuseExistingServer: !process.env.CI,
38
42
  },
39
43
  });
40
44
  ```
41
45
 
42
- This package only contains a launcher. The local-storefront binary comes from a platform package
43
- that npm installs alongside it: macOS, Linux and Windows, on x64 and arm64.
46
+ This package holds a launcher and the docs. The local-storefront binary comes from a platform
47
+ package that npm installs alongside it: macOS, Linux and Windows, on x64 and arm64.
44
48
 
45
- Documentation: <https://github.com/0xtlt/local-storefront>
49
+ The docs of this version are in the package: `node_modules/local-storefront/docs/`, listed by
50
+ `node_modules/local-storefront/llms.txt`. Online: <https://github.com/0xtlt/local-storefront>
package/bin/lsf.js CHANGED
@@ -26,7 +26,10 @@ try {
26
26
  process.exit(1);
27
27
  }
28
28
 
29
- const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
29
+ // Installed with npm, the command is `npx local-storefront`, not `lsf`: the hints of the binary
30
+ // (`build it with \`lsf app build …\``) say what to type.
31
+ const env = { ...process.env, LSF_COMMAND: process.env.LSF_COMMAND || 'npx local-storefront' };
32
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit', env });
30
33
 
31
34
  // A runner that stops this process (Playwright's webServer, a CI step) must stop the server.
32
35
  const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
package/docs/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Documentation
2
+
3
+ local-storefront runs a Shopify theme, and the checkout and the Admin API of an app, on your
4
+ machine, without Shopify, from JSON store data.
5
+
6
+ ## Get started
7
+
8
+ In your theme folder:
9
+
10
+ ```bash
11
+ npm install --save-dev local-storefront
12
+ npx local-storefront serve # http://127.0.0.1:9292, with a demo store
13
+ npx local-storefront init # writes shopify-local/, the store data to edit
14
+ ```
15
+
16
+ Write `npx local-storefront`, not `npx lsf`: `lsf` is another package on npm. Other ways to
17
+ install (mise, a binary, from source):
18
+ [the project's README](https://github.com/0xtlt/local-storefront#other-ways-to-install).
19
+
20
+ ## Start here
21
+
22
+ One page each, from the first command to a test in CI.
23
+
24
+ | Quickstart | For |
25
+ |---|---|
26
+ | [A theme](quickstart-theme.md) | Serving a theme, writing store data, `validate`, `check`, a Playwright test. |
27
+ | [Functions](quickstart-functions.md) | Running an app's Functions and checkout UI extensions: scenarios, `expect`, `app check` in CI. |
28
+ | [An Admin API backend](quickstart-admin-api.md) | A backend against the local Admin API: the token, a first query, webhooks, resets, the clock. |
29
+ | [A public app](quickstart-app.md) | The React Router template end to end: the embedded admin, Events, billing, a theme app extension, the app proxy. |
30
+
31
+ ## Guides
32
+
33
+ One task each, from the first command to the details.
34
+
35
+ | Guide | For |
36
+ |---|---|
37
+ | [Data format](data-format.md) | Writing the store data: products, customers, menus, metafields. |
38
+ | [Testing](testing.md) | End-to-end tests: sessions, per-test data, slow networks, CI. |
39
+ | [Strict Liquid](strict-liquid.md) | Finding and fixing what Shopify's strict Liquid parser rejects. |
40
+ | [Formatting](formatting.md) | Formatting Liquid files as Prettier does. |
41
+ | [Performance](performance.md) | Profiling a page, in time or in what it would cost Shopify. |
42
+ | [Checkout](checkout.md) | Running the Functions and the checkout UI extensions of a Shopify app. |
43
+ | [Admin API](admin.md) | Pointing the backend of an app at the local Admin API, its OAuth and its webhooks; previewing its embedded pages in a local admin, with a local App Bridge. |
44
+ | [Storefront](storefront.md) | The storefront in a browser: accounts, password page, images, previews, the theme app extensions of an app. |
45
+ | [Agents](agents.md) | Driving local-storefront from an AI agent or a script. |
46
+
47
+ ## Reference
48
+
49
+ | Reference | For |
50
+ |---|---|
51
+ | [CLI](cli.md) | Every command, option, exit code and output format. |
52
+ | [Control API](control-api.md) | The `/__lsf` endpoints, sessions and response headers. |
53
+ | [Admin API reference](admin-reference.md) | What the local Admin API simulates, family by family: queries, mutations, webhooks, and what it leaves out. |
54
+ | [Fields](data-reference.md) | Every field of the store data, generated from its JSON Schema. |
55
+ | [Compatibility](compatibility.md) | What matches Shopify, how it is checked, and the known differences. |
56
+
57
+ ## Contributing
58
+
59
+ [Architecture](architecture.md): how the code is organised, how to develop and how to release.