zappie 0.1.8 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # zappie
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a2a0950: `zappie check` now says which step is running. `runCheck` takes an `onProgress` callback that gets a `started` and a `finished` event for each step, and a `finished` event carries the step's `result`, `durationMs` and `timedOut`. `zappie check`, with or without `--json`, writes them to stderr as lines like `check: types started` and `check: types passed in 3.1s`. Stdout is unchanged, so its last line is still the JSON result.
8
+
9
+ Each step also has a time limit. The defaults are in `DEFAULT_STEP_TIMEOUTS` (`build` 180 s, `lint`, `types`, `test` and `secrets` 120 s, `audit` and `css` 60 s, the rest 30 s), and `timeouts` sets your own in milliseconds. A step that runs past its limit fails with a `<step>/timeout` problem that names the limit, instead of holding the run open. An audit past its limit is `audit/unavailable` and follows the audit mode.
10
+
11
+ Each command a step runs now gets its own process group with stdin closed. When the step is stopped, by its limit or by the run's `signal`, and again when its command exits, the whole group gets SIGTERM and then SIGKILL after 2 seconds. A package manager, compiler, test runner or server it started can no longer outlive the step or keep its output open. Before this, a command whose child kept running after it exited held `zappie check` open forever. The CLI stops the same way on SIGINT, SIGTERM and SIGHUP.
12
+
13
+ The starter's dev-server test gives up on a request after 5 seconds, so a server that accepts a connection and never answers fails the test instead of hanging it.
14
+
15
+ ## 0.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 88f52b6: `zappie init` adds Zappie to an existing React Router, Next.js or Vite project. Run it in a folder with a `package.json` and it installs `@zappie/sdk`, `@zappie/foundations` and `@zappie/tokens` with your package manager, adds the `provider` component, writes `zappie.json`, and adds your store and test key to `.env.local` as `VITE_ZAPPIE_*` or, in Next.js, `NEXT_PUBLIC_ZAPPIE_*`. A value already set in `.env`, `.env.local` or `.env.development(.local)` stays, and init writes no key unless you pass `--key`. It prints the code that wraps your app in `ZappieProvider` and the file it goes in, and `--json` returns both as `wrap`. `--no-install` skips the install and prints the command instead. Init still creates a storefront from the starter in a new or empty folder.
20
+
3
21
  ## 0.1.8
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@ npx zappie add cart-drawer
22
22
 
23
23
  Add `--json` to any command for machine-readable output, including errors. Components come from `https://registry.zappie.ai/v1` unless you pass `--registry <url|dir>` or set `registry` in `zappie.json`.
24
24
 
25
- `zappie check` and `zappie verify` run `@zappie/check` and `@zappie/verify` from your project. Install whichever you use as a dev dependency. `@zappie/verify` also needs `@playwright/test` and its Chromium browser, or `ZAPPIE_VERIFY_CHROMIUM` set to another Chromium's executable.
25
+ `zappie check` writes a progress line to stderr as each step starts and finishes, so with `--json` the result is still the only thing on stdout. `zappie check` and `zappie verify` run `@zappie/check` and `@zappie/verify` from your project. Install whichever you use as a dev dependency. `@zappie/verify` also needs `@playwright/test` and its Chromium browser, or `ZAPPIE_VERIFY_CHROMIUM` set to another Chromium's executable.
26
26
 
27
27
  Run `zappie --help` for every option.
28
28
 
@@ -50,7 +50,7 @@ npm run dev
50
50
  npm run check
51
51
  ```
52
52
 
53
- Choose a new or empty folder. Existing-project init is not available yet.
53
+ Choose a new or empty folder for the starter.
54
54
  The React Router starter comes from `https://registry.zappie.ai/v1`.
55
55
  Use `--registry <url|dir>` to choose another registry, or `--json` for a
56
56
  machine-readable result. Init checks the archive hash before writing files.
@@ -58,4 +58,19 @@ machine-readable result. Init checks the archive hash before writing files.
58
58
  Without `--yes`, init asks for missing values in a terminal. Pass `--store`
59
59
  when using `--yes` or `--json`. If you leave out the key, set your test
60
60
  publishable key in `.dev.vars` before starting. Init refuses live and secret
61
- keys. It never installs dependencies for you.
61
+ keys. It doesn't install the starter's dependencies for you.
62
+
63
+ ## Add Zappie to a project
64
+
65
+ ```sh
66
+ cd my-app
67
+ npx zappie init --store my-store --key pk_test_YOUR_KEY --yes
68
+ ```
69
+
70
+ Run init in a React Router, Next.js or Vite project with a `package.json`, and it:
71
+
72
+ - installs `@zappie/sdk`, `@zappie/foundations` and `@zappie/tokens` with your package manager, unless you pass `--no-install`
73
+ - adds the `provider` component and records it in `zappie.json`
74
+ - adds your store and test key to `.env.local`, as `VITE_ZAPPIE_STORE` and `VITE_ZAPPIE_KEY`, or `NEXT_PUBLIC_ZAPPIE_STORE` and `NEXT_PUBLIC_ZAPPIE_KEY` in Next.js. A value already set in `.env`, `.env.local`, `.env.development` or `.env.development.local` stays, and init writes no key unless you pass `--key`.
75
+
76
+ It then prints the code that wraps your app in `ZappieProvider`, and the file to put it in. If your provider has local changes, init stops before installing anything.