zazz-ui 0.3.2 → 0.3.3

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
@@ -2,6 +2,11 @@
2
2
 
3
3
  Notable changes to the `zazz-ui` CLI. The CLI versions independently of `@zazz-ui/core` (ADR-0010); the kit's own changelog is the one `update` and `diff` print.
4
4
 
5
+ ## 0.3.3 (2026-11-16)
6
+
7
+ - An exact version (`update @0.14.1`, `diff @0.14.1`, `init 0.14.1`) resolves right after it is published. The CLI reads an exact version from npm's cache, and when the cached version list predated the release, it reported "No matching version found" until something like `@latest` refreshed the list. A cache miss now asks the registry once. `--offline` still never goes online.
8
+ - The README lists `@zazz-ui/core` 0.1 through 0.14 as supported.
9
+
5
10
  ## 0.3.2 (2026-10-26)
6
11
 
7
12
  - `init --ts` vendors the kit's `globals.d.ts`, the ambient types the TypeScript sources check against (`window.Utils`, `Signals`, `Toaster`, `CommandEvent`). A full `update` adds it to an existing `--ts` project and keeps it current. If you copied the file in by hand, delete your copy after updating, or TypeScript reports a duplicate `EmblaCarouselType`.
package/README.md CHANGED
@@ -33,7 +33,7 @@ There is no runtime dependency on `@zazz-ui/core`. The files in `zazz/` are your
33
33
 
34
34
  ## Requirements
35
35
 
36
- Node 22.22+ (or 24.15+). Works with `@zazz-ui/core` 0.1 through 0.8 (manifest v1–v2); given a newer kit, the CLI tells you to upgrade it. Works offline once a kit version is cached; respects your `.npmrc` (registries, proxies, auth). `--registry`, `--offline`, and `--prefer-offline` are available on every command.
36
+ Node 22.22+ (or 24.15+). Works with `@zazz-ui/core` 0.1 through 0.14 (manifest v1–v2); given a newer kit, the CLI tells you to upgrade it. Works offline once a kit version is cached; respects your `.npmrc` (registries, proxies, auth). `--registry`, `--offline`, and `--prefer-offline` are available on every command.
37
37
 
38
38
  ## License
39
39
 
@@ -1,10 +1,10 @@
1
- import { t as ZazzError } from "./errors-DC2U2USS.js";
2
- import { _ as resolveKit, a as renderIndexJs, c as createUi, d as baseCssSplit, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, m as primitiveFiles, n as insertCssImports, o as sha256, p as baseScriptFiles, r as renderHead, s as vendorFiles, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-CWDMdCmo.js";
1
+ import { _ as resolveKit, a as renderIndexJs, c as createUi, d as baseCssSplit, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, m as primitiveFiles, n as insertCssImports, o as sha256, p as baseScriptFiles, r as renderHead, s as vendorFiles, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-BVwEMqB1.js";
2
+ import { t as ZazzError } from "./errors--aALbpFB.js";
3
3
  import { existsSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
 
7
- //#region src/commands/add.ts
7
+ // src/commands/add.ts
8
8
  /**
9
9
  * @fileoverview `zazz-ui add` — vendor primitives and their dependencies.
10
10
  * @description Resolves the requested primitives' dependency closure through
@@ -128,5 +128,4 @@ async function wiringWrites(kit, config, destRoot, fresh) {
128
128
  return writes;
129
129
  }
130
130
 
131
- //#endregion
132
131
  export { runAdd };
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { t as ZazzError } from "./errors-DC2U2USS.js";
2
+ import { t as ZazzError } from "./errors--aALbpFB.js";
3
3
  import { createRequire } from "node:module";
4
4
  import chalk from "chalk";
5
5
  import { Command, Option } from "commander";
6
6
 
7
- //#region src/cli.ts
7
+ // src/cli.ts
8
8
  /**
9
9
  * @fileoverview `zazz-ui` — vendor Zazz primitives into your project.
10
10
  * @description Thin commander program: parses flags, hands off to command
@@ -15,19 +15,19 @@ import { Command, Option } from "commander";
15
15
  const { version } = createRequire(import.meta.url)("../package.json");
16
16
  const program = new Command("zazz-ui").description("Vendor Zazz Design Framework primitives into your project").version(version).option("-c, --cwd <path>", "run as if started in <path>", process.cwd()).option("-y, --yes", "answer prompts with their defaults; never block").option("--silent", "no output except errors").option("--registry <url>", "npm registry override").option("--offline", "cache only; never touch the network").option("--prefer-offline", "use cached data without revalidating");
17
17
  program.command("init").description("vendor the Zazz base (tokens, reset, runtime) into this project").argument("[version]", "kit version, @-prefixed (e.g. @0.5.0); default latest").option("--dir <path>", "target directory for vendored files", "zazz").option("--ts", "vendor TypeScript sources instead of compiled .js").option("--legacy <path>", "wire an existing stylesheet into the legacy.imports cascade sublayer").option("--no-fonts", "omit the Geist fonts block from head.html").option("--no-theme-script", "omit the theme-persistence script from head.html").option("--force", "overwrite existing files without asking").option("--dry-run", "print the plan without writing").action(async (versionArg, options) => {
18
- const { runInit } = await import("./init-DqkIVXKV.js");
18
+ const { runInit } = await import("./init-CKJXvUpN.js");
19
19
  await runInit(versionArg, options, program.opts());
20
20
  });
21
21
  program.command("update").description("move vendored files to a new kit version with 3-way merges").argument("[args...]", "target version @-prefixed (default @latest) and/or primitive names to narrow to").addOption(new Option("--keep", "resolve every conflict by keeping your version").conflicts(["theirs", "markers"])).addOption(new Option("--theirs", "resolve every conflict by taking the new version").conflicts(["keep", "markers"])).addOption(new Option("--markers", "write diff3 conflict markers for every conflict").conflicts(["keep", "theirs"])).option("--force", "overwrite stray files without asking").option("--dry-run", "print the plan without writing").action(async (args, options) => {
22
- const { runUpdate } = await import("./update-BPtPsPr7.js");
22
+ const { runUpdate } = await import("./update-IzwW3BFA.js");
23
23
  await runUpdate(args, options, program.opts());
24
24
  });
25
25
  program.command("diff").description("preview what an update would change (read-only)").argument("[args...]", "target version @-prefixed (default @latest) and/or names to narrow to (base, button, …)").option("--upstream", "compare pristine recorded vs target instead of your files vs target").action(async (args, options) => {
26
- const { runDiff } = await import("./diff-BRTyzqhQ.js");
26
+ const { runDiff } = await import("./diff-BAlklyPv.js");
27
27
  await runDiff(args, options, program.opts());
28
28
  });
29
29
  program.command("add").description("vendor primitives (and their dependencies) at the project's kit version").argument("<primitive...>", "primitive names (e.g. button combobox)").option("--examples", "also copy the primitives' example html").option("--force", "overwrite existing files without asking").option("--dry-run", "print the closure and file plan without writing").action(async (names, options) => {
30
- const { runAdd } = await import("./add-Cvilkl7S.js");
30
+ const { runAdd } = await import("./add-20ac-qTJ.js");
31
31
  await runAdd(names, options, program.opts());
32
32
  });
33
33
  try {
@@ -40,5 +40,4 @@ try {
40
40
  } else throw error;
41
41
  }
42
42
 
43
- //#endregion
44
43
  export { };
@@ -1,13 +1,13 @@
1
- import { t as ZazzError } from "./errors-DC2U2USS.js";
2
- import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, m as primitiveFiles, o as sha256, r as renderHead, t as appendJsImports, v as loadConfig } from "./wiring-CWDMdCmo.js";
3
- import { a as compareVersions, i as isBinary, o as sliceChangelog, r as splitVersionArgs, t as readChangelog } from "./update-CaIG25mx.js";
1
+ import { a as compareVersions, i as isBinary, o as sliceChangelog, r as splitVersionArgs, t as readChangelog } from "./update-BJYS4fvC.js";
2
+ import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, m as primitiveFiles, o as sha256, r as renderHead, t as appendJsImports, v as loadConfig } from "./wiring-BVwEMqB1.js";
3
+ import { t as ZazzError } from "./errors--aALbpFB.js";
4
4
  import chalk from "chalk";
5
5
  import { existsSync } from "node:fs";
6
6
  import { readFile } from "node:fs/promises";
7
7
  import path from "node:path";
8
8
  import { structuredPatch } from "diff";
9
9
 
10
- //#region src/commands/diff.ts
10
+ // src/commands/diff.ts
11
11
  /**
12
12
  * @fileoverview `zazz-ui diff` — preview what an update would change.
13
13
  * @description Read-only, always exit 0. Default compares your on-disk files
@@ -193,5 +193,4 @@ function sortedByCascade(names, kit) {
193
193
  return [...names].sort((a, b) => (cascade.get(a) ?? Infinity) - (cascade.get(b) ?? Infinity));
194
194
  }
195
195
 
196
- //#endregion
197
196
  export { runDiff };
@@ -1,4 +1,4 @@
1
- //#region src/errors.ts
1
+ // src/errors.ts
2
2
  /**
3
3
  * @fileoverview The CLI's one error type and its canonical messages.
4
4
  * @description Commands and modules throw `ZazzError` for every expected
@@ -29,5 +29,4 @@ function kitTooOld(version, detail) {
29
29
  return new ZazzError(`@zazz-ui/core@${version} is older than this CLI supports (${detail})`, { hint: "target a newer kit version (e.g. @latest), or use an older zazz-ui" });
30
30
  }
31
31
 
32
- //#endregion
33
32
  export { offlineMiss as i, kitTooNew as n, kitTooOld as r, ZazzError as t };
@@ -0,0 +1,3 @@
1
+ import { n as runInit, t as parseVersionArg } from "./init-CnDb64uK.js";
2
+
3
+ export { runInit };
@@ -1,10 +1,10 @@
1
- import { t as ZazzError } from "./errors-DC2U2USS.js";
2
- import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, o as sha256, r as renderHead, s as vendorFiles, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-CWDMdCmo.js";
1
+ import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, o as sha256, r as renderHead, s as vendorFiles, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-BVwEMqB1.js";
2
+ import { t as ZazzError } from "./errors--aALbpFB.js";
3
3
  import { existsSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
 
7
- //#region src/commands/init.ts
7
+ // src/commands/init.ts
8
8
  /**
9
9
  * @fileoverview `zazz-ui init` — vendor the Zazz base platform.
10
10
  * @description Fresh projects get the base css layers, the core runtime,
@@ -190,5 +190,4 @@ async function pristineContent(kit, config, file) {
190
190
  }
191
191
  }
192
192
 
193
- //#endregion
194
193
  export { runInit as n, parseVersionArg as t };
@@ -1,13 +1,13 @@
1
- import { t as ZazzError } from "./errors-DC2U2USS.js";
2
- import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, m as primitiveFiles, o as sha256, p as baseScriptFiles, r as renderHead, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-CWDMdCmo.js";
3
- import { t as parseVersionArg } from "./init-m26gsqEa.js";
1
+ import { _ as resolveKit, a as renderIndexJs, c as createUi, f as baseFiles, g as kitSpec, h as loadFetchOptions, i as renderIndexCss, l as apply, m as primitiveFiles, o as sha256, p as baseScriptFiles, r as renderHead, t as appendJsImports, u as describe, v as loadConfig, y as filterCollisions } from "./wiring-BVwEMqB1.js";
2
+ import { t as ZazzError } from "./errors--aALbpFB.js";
3
+ import { t as parseVersionArg } from "./init-CnDb64uK.js";
4
4
  import chalk from "chalk";
5
5
  import { existsSync } from "node:fs";
6
6
  import { readFile } from "node:fs/promises";
7
7
  import path from "node:path";
8
8
  import { mergeDiff3 } from "node-diff3";
9
9
 
10
- //#region src/changelog.ts
10
+ // src/changelog.ts
11
11
  /**
12
12
  * @fileoverview Slices the kit's CHANGELOG.md down to what a project cares
13
13
  * about: versions in `(from, to]`, sections whose scope touches the vendored
@@ -99,8 +99,7 @@ function compareVersions(a, b) {
99
99
  return preA < preB ? -1 : 1;
100
100
  }
101
101
 
102
- //#endregion
103
- //#region src/merge.ts
102
+ // src/merge.ts
104
103
  /**
105
104
  * @fileoverview Per-file update classification and 3-way merging.
106
105
  * @description `classify` turns one file's three states — ours (on disk),
@@ -167,8 +166,7 @@ function bytesEqual(a, b) {
167
166
  return bufA.equals(bufB);
168
167
  }
169
168
 
170
- //#endregion
171
- //#region src/commands/update.ts
169
+ // src/commands/update.ts
172
170
  /**
173
171
  * @fileoverview `zazz-ui update` — move vendored files to a new kit version
174
172
  * with provenance-recorded 3-way merges.
@@ -666,5 +664,4 @@ async function readChangelog(kit) {
666
664
  }
667
665
  }
668
666
 
669
- //#endregion
670
667
  export { compareVersions as a, isBinary as i, runUpdate as n, sliceChangelog as o, splitVersionArgs as r, readChangelog as t };
@@ -1,3 +1,3 @@
1
- import { n as runUpdate, r as splitVersionArgs, t as readChangelog } from "./update-CaIG25mx.js";
1
+ import { n as runUpdate, r as splitVersionArgs, t as readChangelog } from "./update-BJYS4fvC.js";
2
2
 
3
3
  export { runUpdate };
@@ -1,4 +1,4 @@
1
- import { i as offlineMiss, n as kitTooNew, r as kitTooOld, t as ZazzError } from "./errors-DC2U2USS.js";
1
+ import { i as offlineMiss, n as kitTooNew, r as kitTooOld, t as ZazzError } from "./errors--aALbpFB.js";
2
2
  import chalk from "chalk";
3
3
  import { existsSync } from "node:fs";
4
4
  import { mkdir, mkdtemp, readFile, rename, rm, writeFile } from "node:fs/promises";
@@ -9,7 +9,7 @@ import os from "node:os";
9
9
  import * as clack from "@clack/prompts";
10
10
  import { createHash } from "node:crypto";
11
11
 
12
- //#region src/collisions.ts
12
+ // src/collisions.ts
13
13
  /**
14
14
  * @fileoverview The stray-file collision prompt, shared by every
15
15
  * command that writes files it has no provenance record for.
@@ -39,8 +39,7 @@ async function filterCollisions(writes, context) {
39
39
  };
40
40
  }
41
41
 
42
- //#endregion
43
- //#region src/config.ts
42
+ // src/config.ts
44
43
  /**
45
44
  * @fileoverview `zazz.json` — the project's vendoring provenance record.
46
45
  * @description One file at the project root records what was vendored, from
@@ -140,8 +139,7 @@ function isFileHashes(value) {
140
139
  return typeof value === "object" && value !== null && Object.values(value).every((hash) => typeof hash === "string");
141
140
  }
142
141
 
143
- //#endregion
144
- //#region src/kit.ts
142
+ // src/kit.ts
145
143
  /**
146
144
  * @fileoverview The kit engine: npm tarball → validated, importable kit.
147
145
  * @description Resolves a `@zazz-ui/core` spec through pacote (npm-identical
@@ -190,7 +188,7 @@ function isFileSpec(spec) {
190
188
  async function resolveKit(spec, fetch) {
191
189
  const fileSpec = isFileSpec(spec);
192
190
  const exact = !fileSpec && EXACT_VERSION.test(spec.slice(14));
193
- const options = {
191
+ let options = {
194
192
  ...fetch,
195
193
  preferOffline: exact || fetch.offline === true
196
194
  };
@@ -199,7 +197,17 @@ async function resolveKit(spec, fetch) {
199
197
  manifest = await pacote.manifest(spec, options);
200
198
  } catch (error) {
201
199
  if (fetch.offline || fetch.preferOffline) throw offlineMiss(spec);
202
- throw new ZazzError(`could not resolve ${spec}: ${error.message}`);
200
+ if (!exact) throw new ZazzError(`could not resolve ${spec}: ${error.message}`);
201
+ options = {
202
+ ...fetch,
203
+ preferOffline: false,
204
+ preferOnline: true
205
+ };
206
+ try {
207
+ manifest = await pacote.manifest(spec, options);
208
+ } catch (retry) {
209
+ throw new ZazzError(`could not resolve ${spec}: ${retry.message}`);
210
+ }
203
211
  }
204
212
  const version = manifest.version;
205
213
  const integrity = manifest.dist?.integrity ?? manifest._integrity ?? "";
@@ -301,8 +309,7 @@ function resolveWithin(root, relative) {
301
309
  return resolved;
302
310
  }
303
311
 
304
- //#endregion
305
- //#region src/npmrc.ts
312
+ // src/npmrc.ts
306
313
  /**
307
314
  * @fileoverview npm configuration → pacote options.
308
315
  * @description Loads the user's real npm config through `@npmcli/config`
@@ -350,8 +357,7 @@ async function loadFetchOptions(flags) {
350
357
  return options;
351
358
  }
352
359
 
353
- //#endregion
354
- //#region src/plan.ts
360
+ // src/plan.ts
355
361
  /** The v1 base stylesheet inventory (kit `src/index.css` cascade shell). */
356
362
  const V1_BASE_CSS_PRE = [
357
363
  "base/_layers.css",
@@ -431,8 +437,7 @@ function baseScriptFiles(entries, language) {
431
437
  return files;
432
438
  }
433
439
 
434
- //#endregion
435
- //#region src/transaction.ts
440
+ // src/transaction.ts
436
441
  /**
437
442
  * @fileoverview Staged, near-atomic application of a command's write plan.
438
443
  * @description Every prompt is answered and every merge resolved before a
@@ -474,8 +479,7 @@ async function apply(tx) {
474
479
  await saveConfig(tx.root, tx.config);
475
480
  }
476
481
 
477
- //#endregion
478
- //#region src/ui.ts
482
+ // src/ui.ts
479
483
  /**
480
484
  * @fileoverview The CLI's voice: clack prompts and spinners behind one
481
485
  * injectable interface.
@@ -559,8 +563,7 @@ function createUi(options) {
559
563
  };
560
564
  }
561
565
 
562
- //#endregion
563
- //#region src/vendor.ts
566
+ // src/vendor.ts
564
567
  /**
565
568
  * @fileoverview Vendoring: pristine tarball bytes → write entries + hashes.
566
569
  * @description Reads each planned file's exact published bytes from the
@@ -598,8 +601,7 @@ async function vendorFiles(kit, files, destRoot) {
598
601
  };
599
602
  }
600
603
 
601
- //#endregion
602
- //#region src/wiring.ts
604
+ // src/wiring.ts
603
605
  /** The insertion anchor `add` looks for in an untouched index.css. */
604
606
  const PRIMITIVES_MARKER = "/* Zazz primitives — zazz-ui add inserts imports here in cascade order. */";
605
607
  const LEGACY_SLOT_COMMENT = "/* Legacy layer — import your legacy stylesheets into layer(legacy.imports) here: */\n/* @import \"./your-legacy.css\" layer(legacy.imports); */";
@@ -727,5 +729,4 @@ function renderHead(kit, config) {
727
729
  })}\n`;
728
730
  }
729
731
 
730
- //#endregion
731
732
  export { resolveKit as _, renderIndexJs as a, createUi as c, baseCssSplit as d, baseFiles as f, kitSpec as g, loadFetchOptions as h, renderIndexCss as i, apply as l, primitiveFiles as m, insertCssImports as n, sha256 as o, baseScriptFiles as p, renderHead as r, vendorFiles as s, appendJsImports as t, describe as u, loadConfig as v, filterCollisions as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zazz-ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "CLI for the Zazz Design Framework — vendors primitives from @zazz-ui/core into your project, with provenance-tracked updates.",
5
5
  "keywords": [
6
6
  "cli",
@@ -45,9 +45,8 @@
45
45
  "@types/pacote": "^11.1.8",
46
46
  "tar": "^7.5.22",
47
47
  "typescript": "^7.0.2",
48
- "vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
49
- "vite-plus": "1.3.0",
50
- "vitest": "5.0.5"
48
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.5.1",
49
+ "vite-plus": "1.5.1"
51
50
  },
52
51
  "engines": {
53
52
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
@@ -1,3 +0,0 @@
1
- import { n as runInit, t as parseVersionArg } from "./init-m26gsqEa.js";
2
-
3
- export { runInit };