zazz-ui 0.3.1 → 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 +10 -0
- package/README.md +2 -2
- package/dist/{add-Bm5kc6TG.js → add-20ac-qTJ.js} +8 -6
- package/dist/cli.js +6 -7
- package/dist/{diff-B38wvndQ.js → diff-BAlklyPv.js} +4 -5
- package/dist/{errors-DC2U2USS.js → errors--aALbpFB.js} +1 -2
- package/dist/init-CKJXvUpN.js +3 -0
- package/dist/{init-CXljM6FO.js → init-CnDb64uK.js} +5 -5
- package/dist/{update-BAfhUb3N.js → update-BJYS4fvC.js} +6 -9
- package/dist/{update-CTuqOys3.js → update-IzwW3BFA.js} +1 -1
- package/dist/{wiring-C77bl5LR.js → wiring-BVwEMqB1.js} +37 -28
- package/package.json +7 -8
- package/dist/init-OVodXfKt.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
|
|
10
|
+
## 0.3.2 (2026-10-26)
|
|
11
|
+
|
|
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`.
|
|
13
|
+
- The CSP fallback check in the generated `index.js`/`index.ts` reads `style` only after narrowing to `HTMLElement`, so a TypeScript entry (or `checkJs`) no longer flags `el.style` on an `Element`.
|
|
14
|
+
|
|
5
15
|
## 0.3.1 (2026-10-13)
|
|
6
16
|
|
|
7
17
|
- `init` vendors the kit's runtime fallbacks (`CORE_FALLBACKS`, from core 0.6.3: the Content Security Policy fallback `base/csp.js` and the `style` parser it imports) and writes their document check into `index.js`, the way the kit's own entry does. A fallback with a gate this CLI does not know is skipped, so a newer kit still vendors.
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ pnpm dlx zazz-ui add button combobox
|
|
|
13
13
|
|
|
14
14
|
`init` vendors the base platform into `zazz/` (or `--dir <path>`): the css layers (tokens, reset, typography, generated utilities), the core runtime scripts (plus the scroll-state polyfill, which `index.js` loads only in browsers without container scroll-state queries), an `index.css` and `index.js` entry pair, and a `head.html` snippet to paste into your `<head>` (fonts, import map, polyfills, theme persistence). It also writes `zazz.json`, which records the kit version and a hash of every vendored file's original bytes.
|
|
15
15
|
|
|
16
|
-
Flags: `--dir <path>`, `--ts` (vendor TypeScript sources instead of compiled js), `--legacy <path>` (wire an existing stylesheet into the `legacy.imports` cascade sublayer), `--no-fonts`, `--no-theme-script`. Re-running `init` repairs the tree: missing files come back, files you edited are left alone.
|
|
16
|
+
Flags: `--dir <path>`, `--ts` (vendor TypeScript sources instead of compiled js, plus the kit's ambient `globals.d.ts`), `--legacy <path>` (wire an existing stylesheet into the `legacy.imports` cascade sublayer), `--no-fonts`, `--no-theme-script`. Re-running `init` repairs the tree: missing files come back, files you edited are left alone.
|
|
17
17
|
|
|
18
18
|
## What add does
|
|
19
19
|
|
|
@@ -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.
|
|
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
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
|
@@ -45,14 +45,17 @@ async function runAdd(names, flags, global) {
|
|
|
45
45
|
for (const name of fresh) {
|
|
46
46
|
const entry = kit.manifest.primitives[name];
|
|
47
47
|
if (!entry) continue;
|
|
48
|
-
const
|
|
48
|
+
const files = primitiveFiles(entry, config.language, { examples: flags.examples === true && names.includes(name) });
|
|
49
|
+
const { writes, hashes } = await vendorFiles(kit, files, destRoot);
|
|
49
50
|
vendorWrites.push(...writes);
|
|
50
51
|
config.primitives[name] = {
|
|
51
52
|
version: kit.version,
|
|
52
53
|
files: hashes
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
const
|
|
56
|
+
const freshEntries = fresh.flatMap((name) => kit.manifest.primitives[name] ?? []);
|
|
57
|
+
const neededBase = baseScriptFiles(freshEntries, config.language).filter((file) => !(file in config.base.files));
|
|
58
|
+
const base = await vendorFiles(kit, neededBase, destRoot);
|
|
56
59
|
vendorWrites.push(...base.writes);
|
|
57
60
|
Object.assign(config.base.files, base.hashes);
|
|
58
61
|
const { kept, skipped } = await filterCollisions(vendorWrites, {
|
|
@@ -125,5 +128,4 @@ async function wiringWrites(kit, config, destRoot, fresh) {
|
|
|
125
128
|
return writes;
|
|
126
129
|
}
|
|
127
130
|
|
|
128
|
-
//#endregion
|
|
129
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
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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-
|
|
3
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
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
|
-
|
|
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,
|
|
@@ -142,7 +142,8 @@ async function repair(config, root, context) {
|
|
|
142
142
|
});
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
const onDisk = await readFile(dest);
|
|
146
|
+
if (sha256(onDisk) === recordedHash) intact += 1;
|
|
146
147
|
else if (context.force) writes.push({
|
|
147
148
|
dest,
|
|
148
149
|
content,
|
|
@@ -189,5 +190,4 @@ async function pristineContent(kit, config, file) {
|
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
|
|
192
|
-
//#endregion
|
|
193
193
|
export { runInit as n, parseVersionArg as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as parseVersionArg } from "./init-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { i as offlineMiss, n as kitTooNew, r as kitTooOld, t as ZazzError } from "./errors
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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",
|
|
@@ -395,13 +401,21 @@ function scriptVariants(jsPath, language) {
|
|
|
395
401
|
if (language === "ts") return [jsPath.replace(/\.js$/, ".ts")];
|
|
396
402
|
return [jsPath, jsPath.replace(/\.js$/, ".d.ts")];
|
|
397
403
|
}
|
|
398
|
-
/**
|
|
404
|
+
/**
|
|
405
|
+
* Everything `init` vendors: base css + core runtime, its polyfills, and its
|
|
406
|
+
* fallbacks, per language. TypeScript also gets the ambient `globals.d.ts`
|
|
407
|
+
* the sources type-check against (the emitted `.d.ts` files don't need it).
|
|
408
|
+
*/
|
|
399
409
|
function baseFiles(manifest, language) {
|
|
400
|
-
return [
|
|
401
|
-
...
|
|
402
|
-
...
|
|
403
|
-
...
|
|
404
|
-
|
|
410
|
+
return [
|
|
411
|
+
...language === "ts" ? ["globals.d.ts"] : [],
|
|
412
|
+
...baseCss(manifest),
|
|
413
|
+
...[
|
|
414
|
+
...coreRuntime(manifest),
|
|
415
|
+
...corePolyfills(manifest).map((polyfill) => polyfill.file),
|
|
416
|
+
...coreFallbacks(manifest).flatMap((fallback) => [fallback.file, ...fallback.requires])
|
|
417
|
+
].flatMap((jsPath) => scriptVariants(jsPath, language))
|
|
418
|
+
];
|
|
405
419
|
}
|
|
406
420
|
/** Everything `add` vendors for one primitive (dependencies resolved by the caller). */
|
|
407
421
|
function primitiveFiles(entry, language, options) {
|
|
@@ -423,8 +437,7 @@ function baseScriptFiles(entries, language) {
|
|
|
423
437
|
return files;
|
|
424
438
|
}
|
|
425
439
|
|
|
426
|
-
|
|
427
|
-
//#region src/transaction.ts
|
|
440
|
+
// src/transaction.ts
|
|
428
441
|
/**
|
|
429
442
|
* @fileoverview Staged, near-atomic application of a command's write plan.
|
|
430
443
|
* @description Every prompt is answered and every merge resolved before a
|
|
@@ -466,8 +479,7 @@ async function apply(tx) {
|
|
|
466
479
|
await saveConfig(tx.root, tx.config);
|
|
467
480
|
}
|
|
468
481
|
|
|
469
|
-
|
|
470
|
-
//#region src/ui.ts
|
|
482
|
+
// src/ui.ts
|
|
471
483
|
/**
|
|
472
484
|
* @fileoverview The CLI's voice: clack prompts and spinners behind one
|
|
473
485
|
* injectable interface.
|
|
@@ -551,8 +563,7 @@ function createUi(options) {
|
|
|
551
563
|
};
|
|
552
564
|
}
|
|
553
565
|
|
|
554
|
-
|
|
555
|
-
//#region src/vendor.ts
|
|
566
|
+
// src/vendor.ts
|
|
556
567
|
/**
|
|
557
568
|
* @fileoverview Vendoring: pristine tarball bytes → write entries + hashes.
|
|
558
569
|
* @description Reads each planned file's exact published bytes from the
|
|
@@ -590,8 +601,7 @@ async function vendorFiles(kit, files, destRoot) {
|
|
|
590
601
|
};
|
|
591
602
|
}
|
|
592
603
|
|
|
593
|
-
|
|
594
|
-
//#region src/wiring.ts
|
|
604
|
+
// src/wiring.ts
|
|
595
605
|
/** The insertion anchor `add` looks for in an untouched index.css. */
|
|
596
606
|
const PRIMITIVES_MARKER = "/* Zazz primitives — zazz-ui add inserts imports here in cascade order. */";
|
|
597
607
|
const LEGACY_SLOT_COMMENT = "/* Legacy layer — import your legacy stylesheets into layer(legacy.imports) here: */\n/* @import \"./your-legacy.css\" layer(legacy.imports); */";
|
|
@@ -645,7 +655,7 @@ const FALLBACK_SNIPPETS = { "blocked-inline-styles": (specifier) => `// A Conten
|
|
|
645
655
|
function blockedInlineStyles() {
|
|
646
656
|
for (const el of document.querySelectorAll("[style]")) {
|
|
647
657
|
const text = el.getAttribute("style");
|
|
648
|
-
if (text && text.includes(":") && el.style.length === 0) return true;
|
|
658
|
+
if (text && text.includes(":") && el instanceof HTMLElement && el.style.length === 0) return true;
|
|
649
659
|
}
|
|
650
660
|
return false;
|
|
651
661
|
}
|
|
@@ -719,5 +729,4 @@ function renderHead(kit, config) {
|
|
|
719
729
|
})}\n`;
|
|
720
730
|
}
|
|
721
731
|
|
|
722
|
-
//#endregion
|
|
723
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.
|
|
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",
|
|
@@ -32,22 +32,21 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@clack/prompts": "^1.
|
|
36
|
-
"@npmcli/config": "^11.0
|
|
37
|
-
"chalk": "^6.0.
|
|
35
|
+
"@clack/prompts": "^1.8.1",
|
|
36
|
+
"@npmcli/config": "^11.2.0",
|
|
37
|
+
"chalk": "^6.0.1",
|
|
38
38
|
"commander": "^15.0.0",
|
|
39
39
|
"diff": "^9.0.0",
|
|
40
40
|
"node-diff3": "^3.2.1",
|
|
41
41
|
"pacote": "^22.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/node": "^26.
|
|
44
|
+
"@types/node": "^26.6.5",
|
|
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@
|
|
49
|
-
"vite-plus": "
|
|
50
|
-
"vitest": "4.1.10"
|
|
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"
|
package/dist/init-OVodXfKt.js
DELETED