zappie 0.1.2 → 0.1.4

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,17 @@
1
1
  # zappie
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - edfc401: Audit storefront dependencies and widen secret scanning to tracked files, Worker output, server bundles and optional Git history.
8
+
9
+ ## 0.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - b74e9a9: Verify can run on a build worker. `zappie verify` takes `--only` with check IDs or the `quick` set (V01 to V07, V09, V10 and V13), `--no-build` to serve the existing build, `--port` for the local preview, `--artifacts` for screenshots and the trace, and `--runner` for the report. `@zappie/verify` launches the Chromium named by `browserExecutablePath` or `ZAPPIE_VERIFY_CHROMIUM` instead of Playwright's own, exports `CHECK_SETS`, and refuses an `only` entry that names no check.
14
+
3
15
  ## 0.1.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -11,18 +11,18 @@ npx zappie add cart-drawer
11
11
 
12
12
  ## Commands
13
13
 
14
- | Command | What it does |
15
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
16
- | `zappie add <name...>` | Add components from the registry. `--dry-run` shows the plan, `--overwrite` replaces files you've changed, and `--no-install` skips npm installs. |
17
- | `zappie list` | Show the components in the registry. `--installed` shows the ones in your project. |
18
- | `zappie diff [name]` | Compare your components with the registry. `--apply` merges updates into files you've changed. |
19
- | `zappie doctor` | Check your project, its `zappie.json` and its installed components. |
20
- | `zappie check [dir]` | Run the storefront checks from `@zappie/check` in your project. |
21
- | `zappie verify [url]` | Test a storefront through customer journeys with `@zappie/verify`. |
14
+ | Command | What it does |
15
+ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | `zappie add <name...>` | Add components from the registry. `--dry-run` shows the plan, `--overwrite` replaces files you've changed, and `--no-install` skips npm installs. |
17
+ | `zappie list` | Show the components in the registry. `--installed` shows the ones in your project. |
18
+ | `zappie diff [name]` | Compare your components with the registry. `--apply` merges updates into files you've changed. |
19
+ | `zappie doctor` | Check your project, its `zappie.json` and its installed components. |
20
+ | `zappie check [dir]` | Run the storefront checks from `@zappie/check` in your project. |
21
+ | `zappie verify [url]` | Test a storefront through customer journeys with `@zappie/verify`. `--only quick` runs the quick set, and `--no-build` verifies the existing build. |
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.
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.
26
26
 
27
27
  Run `zappie --help` for every option.
28
28
 
package/dist/cli.js CHANGED
@@ -67,6 +67,37 @@ function registrySource(flag, configured) {
67
67
 
68
68
  // src/args.ts
69
69
  var registryFlag = "--registry <url|dir>";
70
+ var verifyRunners = ["cli", "ci", "build-worker", "sandbox"];
71
+ var verifyCheckSets = {
72
+ quick: ["V01", "V02", "V03", "V04", "V05", "V06", "V07", "V09", "V10", "V13"]
73
+ };
74
+ function parseOnly(value) {
75
+ const entries = value.split(",").map((entry) => entry.trim()).filter(Boolean);
76
+ if (entries.length === 0) {
77
+ throw new CliError("Name at least one check or check set for --only.");
78
+ }
79
+ const ids = /* @__PURE__ */ new Set();
80
+ for (const entry of entries) {
81
+ const set = verifyCheckSets[entry.toLowerCase()];
82
+ if (set) {
83
+ set.forEach((id) => ids.add(id));
84
+ } else if (/^[VE]\d{2}$/i.test(entry)) {
85
+ ids.add(entry.toUpperCase());
86
+ } else {
87
+ throw new CliError(
88
+ `"${entry}" is not a check ID or set for --only. Pass IDs such as V01,V02 or one of: ${Object.keys(verifyCheckSets).join(", ")}.`
89
+ );
90
+ }
91
+ }
92
+ return [...ids];
93
+ }
94
+ function parsePort(value) {
95
+ const port = Number(value);
96
+ if (!/^\d+$/.test(value) || port < 1 || port > 65535) {
97
+ throw new CliError("Pass a port between 1 and 65535 for --port.");
98
+ }
99
+ return port;
100
+ }
70
101
  var usage = `Usage: zappie <command>
71
102
 
72
103
  Commands:
@@ -84,8 +115,15 @@ Options:
84
115
  ${registryFlag} Use a registry URL or folder. Default: zappie.json, then ${DEFAULT_REGISTRY}
85
116
  --json Print machine-readable output for init, add, list, diff, doctor, check or verify
86
117
  --all Keep running check after a step fails
118
+ --audit <mode> Turn dependency auditing off, report findings, or enforce critical findings
119
+ --history Include Git history in the secret scan
87
120
  --suite <name> Run the standard or extended verify suite
121
+ --only <checks> Run only these verify checks, such as V01,V04 or quick
88
122
  --report <file> Save your verification report to a file
123
+ --no-build Verify the project's existing build without building it again
124
+ --port <number> Serve verify's local preview on this port. Default: a free port
125
+ --artifacts <dir> Save verify screenshots and the trace here. Default: verify-artifacts
126
+ --runner <name> Record cli, ci, build-worker or sandbox as the report's runner
89
127
  --key <pk_test_...> Use this test publishable key for init or verify
90
128
  --store <slug> Choose your store for init or verify
91
129
  --overwrite Replace files you changed locally during add
@@ -117,10 +155,17 @@ function parseCommand(argv) {
117
155
  installed: { type: "boolean" },
118
156
  apply: { type: "boolean" },
119
157
  all: { type: "boolean" },
158
+ audit: { type: "string" },
159
+ history: { type: "boolean" },
120
160
  suite: { type: "string" },
121
161
  report: { type: "string" },
122
162
  key: { type: "string" },
123
163
  store: { type: "string" },
164
+ only: { type: "string" },
165
+ "no-build": { type: "boolean" },
166
+ port: { type: "string" },
167
+ artifacts: { type: "string" },
168
+ runner: { type: "string" },
124
169
  help: { type: "boolean", short: "h" }
125
170
  },
126
171
  allowPositionals: true,
@@ -199,10 +244,16 @@ ${usage}`);
199
244
 
200
245
  ${usage}`);
201
246
  }
247
+ const audit = values.audit ?? "report";
248
+ if (audit !== "off" && audit !== "report" && audit !== "enforce") {
249
+ throw new CliError("Choose off, report or enforce for --audit.");
250
+ }
202
251
  return {
203
252
  name: name2,
204
253
  directory: rest[0],
205
254
  all: values.all === true,
255
+ audit,
256
+ history: values.history === true,
206
257
  json: json4
207
258
  };
208
259
  }
@@ -214,7 +265,20 @@ ${usage}`);
214
265
  }
215
266
  const suite = values.suite ?? "standard";
216
267
  if (suite !== "standard" && suite !== "extended") {
217
- throw new CliError("Choose standard or extended for --suite.");
268
+ throw new CliError(
269
+ "Choose standard or extended for --suite. To run the quick checks, pass --only quick."
270
+ );
271
+ }
272
+ const runner = values.runner;
273
+ if (typeof runner === "string" && !verifyRunners.includes(runner)) {
274
+ throw new CliError(`Choose ${verifyRunners.join(", ")} for --runner.`);
275
+ }
276
+ const build = values["no-build"] !== true;
277
+ const port = typeof values.port === "string" ? parsePort(values.port) : void 0;
278
+ if (rest[0] && (!build || port !== void 0)) {
279
+ throw new CliError(
280
+ "--no-build and --port apply to the local preview. Drop them, or drop the URL."
281
+ );
218
282
  }
219
283
  return {
220
284
  name: name2,
@@ -223,6 +287,11 @@ ${usage}`);
223
287
  report: typeof values.report === "string" ? values.report : void 0,
224
288
  key: typeof values.key === "string" ? values.key : void 0,
225
289
  store: typeof values.store === "string" ? values.store : void 0,
290
+ only: typeof values.only === "string" ? parseOnly(values.only) : void 0,
291
+ build,
292
+ port,
293
+ artifacts: typeof values.artifacts === "string" ? values.artifacts : void 0,
294
+ runner,
226
295
  json: json4
227
296
  };
228
297
  }
@@ -269,6 +338,8 @@ async function runProjectCheck(options) {
269
338
  const result = await loaded.runCheck({
270
339
  cwd: options.cwd,
271
340
  all: options.all,
341
+ audit: options.audit ?? "report",
342
+ history: options.history ?? false,
272
343
  packageManager: options.packageManager,
273
344
  ...options.signal ? { signal: options.signal } : {}
274
345
  });
@@ -1719,6 +1790,11 @@ async function runProjectVerify(options) {
1719
1790
  packageManager: options.packageManager,
1720
1791
  ...options.url ? { url: options.url } : {},
1721
1792
  ...options.store ? { store: options.store } : {},
1793
+ ...options.only ? { only: options.only } : {},
1794
+ ...options.build === false ? { build: false } : {},
1795
+ ...options.port ? { port: options.port } : {},
1796
+ ...options.artifacts ? { artifactsDir: path15.resolve(options.cwd, options.artifacts) } : {},
1797
+ ...options.runner ? { runner: options.runner } : {},
1722
1798
  ...options.signal ? { signal: options.signal } : {}
1723
1799
  });
1724
1800
  if (options.report) {
@@ -1829,6 +1905,8 @@ async function main(argv) {
1829
1905
  const result = await runProjectCheck({
1830
1906
  cwd: directory,
1831
1907
  all: command.all,
1908
+ audit: command.audit,
1909
+ history: command.history,
1832
1910
  json: command.json,
1833
1911
  packageManager: detectPackageManager(directory),
1834
1912
  signal: controller.signal
@@ -1851,6 +1929,11 @@ async function main(argv) {
1851
1929
  ...command.report ? { report: command.report } : {},
1852
1930
  ...command.key ? { key: command.key } : {},
1853
1931
  ...command.store ? { store: command.store } : {},
1932
+ ...command.only ? { only: command.only } : {},
1933
+ ...command.build ? {} : { build: false },
1934
+ ...command.port ? { port: command.port } : {},
1935
+ ...command.artifacts ? { artifacts: command.artifacts } : {},
1936
+ ...command.runner ? { runner: command.runner } : {},
1854
1937
  packageManager: detectPackageManager(cwd),
1855
1938
  signal: controller.signal
1856
1939
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zappie",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Install Zappie kit components and check storefront projects.",
5
5
  "type": "module",
6
6
  "bin": {