@cloudflare/kumo 1.0.0 → 1.1.0
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 +20 -24
- package/ai/schemas.ts +7 -2
- package/bin/kumo.js +32 -0
- package/dist/.build-complete +1 -0
- package/dist/catalog.js +1 -1
- package/dist/schemas-Cbid4MwW.js +3539 -0
- package/dist/schemas-Cbid4MwW.js.map +1 -0
- package/package.json +8 -11
- package/scripts/component-registry/schema-generator.ts +7 -2
- package/LICENSE +0 -21
- package/dist/schemas-BSdA0fz-.js +0 -3210
- package/dist/schemas-BSdA0fz-.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/kumo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Kumo - Cloudflare's component library for building modern web applications",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"url": "https://github.com/cloudflare/kumo.git",
|
|
10
10
|
"directory": "packages/kumo"
|
|
11
11
|
},
|
|
12
|
-
"homepage": "https://kumo-ui.com",
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/cloudflare/kumo/issues"
|
|
15
|
-
},
|
|
16
12
|
"license": "MIT",
|
|
17
13
|
"keywords": [
|
|
18
14
|
"react",
|
|
@@ -25,7 +21,7 @@
|
|
|
25
21
|
"module": "./dist/index.js",
|
|
26
22
|
"types": "./dist/src/index.d.ts",
|
|
27
23
|
"bin": {
|
|
28
|
-
"kumo": "./
|
|
24
|
+
"kumo": "./bin/kumo.js"
|
|
29
25
|
},
|
|
30
26
|
"exports": {
|
|
31
27
|
".": {
|
|
@@ -354,6 +350,7 @@
|
|
|
354
350
|
},
|
|
355
351
|
"files": [
|
|
356
352
|
"dist",
|
|
353
|
+
"bin",
|
|
357
354
|
"ai",
|
|
358
355
|
"templates",
|
|
359
356
|
"scripts",
|
|
@@ -381,7 +378,7 @@
|
|
|
381
378
|
"codegen:primitives": "tsx scripts/generate-primitives.ts",
|
|
382
379
|
"codegen:registry": "pnpm --filter @cloudflare/kumo-docs-astro codegen:demos && tsx scripts/component-registry/index.ts",
|
|
383
380
|
"lint": "pnpm run lint:oxlint && pnpm run lint:eslint",
|
|
384
|
-
"lint:oxlint": "oxlint src/** --type-aware",
|
|
381
|
+
"lint:oxlint": "oxlint --config .oxlintrc.json src/** --type-aware",
|
|
385
382
|
"lint:eslint": "eslint src/",
|
|
386
383
|
"test": "CI=true vitest run --project=unit",
|
|
387
384
|
"test:ui": "vitest --ui",
|
|
@@ -397,7 +394,7 @@
|
|
|
397
394
|
"@phosphor-icons/react": "^2.1.10",
|
|
398
395
|
"react": "^18.0.0 || ^19.0.0",
|
|
399
396
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
400
|
-
"zod": "^
|
|
397
|
+
"zod": "^4.0.0"
|
|
401
398
|
},
|
|
402
399
|
"peerDependenciesMeta": {
|
|
403
400
|
"zod": {
|
|
@@ -425,8 +422,8 @@
|
|
|
425
422
|
"eslint-plugin-jsx-a11y": "catalog:",
|
|
426
423
|
"glob": "13.0.0",
|
|
427
424
|
"happy-dom": "catalog:",
|
|
428
|
-
"oxlint": "
|
|
429
|
-
"oxlint-tsgolint": "
|
|
425
|
+
"oxlint": "catalog:",
|
|
426
|
+
"oxlint-tsgolint": "catalog:",
|
|
430
427
|
"playwright": "catalog:",
|
|
431
428
|
"plop": "4.0.4",
|
|
432
429
|
"rollup-plugin-preserve-directives": "0.4.0",
|
|
@@ -439,6 +436,6 @@
|
|
|
439
436
|
"vite-plugin-dts": "catalog:",
|
|
440
437
|
"vitest": "catalog:",
|
|
441
438
|
"wrangler": "catalog:",
|
|
442
|
-
"zod": "^
|
|
439
|
+
"zod": "^4.0.0"
|
|
443
440
|
}
|
|
444
441
|
}
|
|
@@ -102,6 +102,11 @@ export function generateSchemasFile(registry: ComponentRegistry): string {
|
|
|
102
102
|
"",
|
|
103
103
|
'import { z } from "zod";',
|
|
104
104
|
"",
|
|
105
|
+
"// SafeParseReturnType was removed in Zod v4, but we still want stable typing.",
|
|
106
|
+
"export type SafeParseResult<T> =",
|
|
107
|
+
" | { success: true; data: T; error?: never }",
|
|
108
|
+
" | { success: false; error: z.ZodError<any>; data?: never };",
|
|
109
|
+
"",
|
|
105
110
|
"// =============================================================================",
|
|
106
111
|
"// Dynamic Value Schema (for data binding)",
|
|
107
112
|
"// =============================================================================",
|
|
@@ -290,7 +295,7 @@ export function generateSchemasFile(registry: ComponentRegistry): string {
|
|
|
290
295
|
lines.push(" * Validate an element's props against its component schema");
|
|
291
296
|
lines.push(" */");
|
|
292
297
|
lines.push(
|
|
293
|
-
"export function validateElementProps(element: UIElement):
|
|
298
|
+
"export function validateElementProps(element: UIElement): SafeParseResult<unknown> {",
|
|
294
299
|
);
|
|
295
300
|
lines.push(
|
|
296
301
|
" const schema = ComponentPropsSchemas[element.type as keyof typeof ComponentPropsSchemas];",
|
|
@@ -307,7 +312,7 @@ export function generateSchemasFile(registry: ComponentRegistry): string {
|
|
|
307
312
|
lines.push(" * Validate a complete UI tree");
|
|
308
313
|
lines.push(" */");
|
|
309
314
|
lines.push(
|
|
310
|
-
"export function validateUITree(tree: unknown):
|
|
315
|
+
"export function validateUITree(tree: unknown): SafeParseResult<UITree> {",
|
|
311
316
|
);
|
|
312
317
|
lines.push(" return UITreeSchema.safeParse(tree);");
|
|
313
318
|
lines.push("}");
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Cloudflare, Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|