@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @cloudflare/kumo
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 001f9e7: fixes to figma plugin init + zod v4 in kumo
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 6dc9a73: Fix `kumo` CLI bin resolution in repo checkouts so `pnpm install` doesn't warn when `dist/` hasn't been built yet.
|
|
12
|
+
|
|
3
13
|
## 1.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -312,36 +312,32 @@ pnpm test:coverage
|
|
|
312
312
|
|
|
313
313
|
## Beta Releases
|
|
314
314
|
|
|
315
|
-
Beta releases allow you to test changes before publishing to production. Beta versions are automatically created for
|
|
315
|
+
Beta releases allow you to test changes before publishing to production. Beta versions are automatically created for pull requests and include the commit hash for identification.
|
|
316
316
|
|
|
317
317
|
### Automated Beta Releases
|
|
318
318
|
|
|
319
|
-
Beta releases are automatically triggered for
|
|
319
|
+
Beta releases are automatically triggered for pull requests through GitHub Actions (`.github/workflows/preview.yml`):
|
|
320
320
|
|
|
321
|
-
**
|
|
321
|
+
**Workflow Configuration:**
|
|
322
322
|
|
|
323
|
-
- **
|
|
324
|
-
- **
|
|
325
|
-
- **
|
|
326
|
-
- **Dependencies**: Requires `validate-changeset-run` job to pass
|
|
327
|
-
- **Environment**: Node.js container with pnpm, jq, and git configured
|
|
328
|
-
- **Authentication**: Uses Vault secrets for npm and GitLab API tokens
|
|
323
|
+
- **Workflow**: `preview.yml`
|
|
324
|
+
- **Triggers**: Pull requests with changes to `packages/kumo/**` or `.changeset/**`
|
|
325
|
+
- **Dependencies**: Requires changeset to exist for `@cloudflare/kumo`
|
|
329
326
|
|
|
330
327
|
**Process Flow:**
|
|
331
328
|
|
|
332
329
|
1. **Validate**: Ensures changeset exists for `@cloudflare/kumo`
|
|
333
|
-
2. **Version**: Runs `pnpm run version:beta`
|
|
330
|
+
2. **Version**: Runs `pnpm run version:beta`
|
|
334
331
|
- Consumes pending changesets
|
|
335
332
|
- Appends `-beta.{commit-hash}` to version number
|
|
336
|
-
3. **Build**: Runs `pnpm
|
|
337
|
-
4. **Publish**:
|
|
338
|
-
5. **
|
|
339
|
-
6. **Notify**: Posts MR comment with installation instructions
|
|
333
|
+
3. **Build**: Runs `pnpm --filter @cloudflare/kumo build`
|
|
334
|
+
4. **Publish**: Publishes to npm with `beta` tag
|
|
335
|
+
5. **Notify**: Posts PR comment with installation instructions
|
|
340
336
|
|
|
341
337
|
**Secrets Required:**
|
|
342
338
|
|
|
343
339
|
- `NPM_TOKEN`: Authentication for npm registry
|
|
344
|
-
- `
|
|
340
|
+
- `GITHUB_TOKEN`: For posting PR comments (built-in)
|
|
345
341
|
|
|
346
342
|
### Beta Version Format
|
|
347
343
|
|
|
@@ -355,7 +351,7 @@ For example: `0.1.0-beta.a1b2c3d`
|
|
|
355
351
|
|
|
356
352
|
### Installing Beta Versions
|
|
357
353
|
|
|
358
|
-
When a beta is published, the
|
|
354
|
+
When a beta is published, the PR will include a comment with installation instructions:
|
|
359
355
|
|
|
360
356
|
```bash
|
|
361
357
|
# Install the specific beta version
|
|
@@ -367,15 +363,15 @@ pnpm add @cloudflare/kumo@0.1.0-beta.a1b2c3d
|
|
|
367
363
|
|
|
368
364
|
### Testing Beta Releases
|
|
369
365
|
|
|
370
|
-
1. **Create
|
|
366
|
+
1. **Create PR**: Submit your changes with a changeset
|
|
371
367
|
2. **Wait for Beta**: The beta job runs automatically after changeset validation passes
|
|
372
|
-
3. **Install Beta**: Use the version from the
|
|
368
|
+
3. **Install Beta**: Use the version from the PR comment
|
|
373
369
|
4. **Test Changes**: Verify functionality in your project
|
|
374
|
-
5. **Merge**: Once tested, merge the
|
|
370
|
+
5. **Merge**: Once tested, merge the PR for production release
|
|
375
371
|
|
|
376
372
|
### Changeset Validation
|
|
377
373
|
|
|
378
|
-
All
|
|
374
|
+
All pull requests with changes to `packages/kumo/` must include a changeset:
|
|
379
375
|
|
|
380
376
|
```bash
|
|
381
377
|
# Create a changeset
|
|
@@ -416,9 +412,9 @@ This package uses [Changesets](https://github.com/changesets/changesets) for ver
|
|
|
416
412
|
|
|
417
413
|
1. **Development**: Make changes to components or blocks
|
|
418
414
|
2. **Changeset**: Create changeset describing the changes
|
|
419
|
-
3. **Review**: Submit
|
|
420
|
-
4. **Beta Test**: Test the beta version published to the
|
|
421
|
-
5. **Merge**: Merge
|
|
415
|
+
3. **Review**: Submit PR with changes and changeset
|
|
416
|
+
4. **Beta Test**: Test the beta version published to the PR
|
|
417
|
+
5. **Merge**: Merge PR to main branch
|
|
422
418
|
6. **Release**: Run the production release process
|
|
423
419
|
|
|
424
420
|
### Production Release Process
|
|
@@ -509,7 +505,7 @@ If the beta release job fails:
|
|
|
509
505
|
1. **Check build**: Ensure `pnpm build` succeeds locally
|
|
510
506
|
2. **Check npm token**: Verify npm authentication is configured in CI
|
|
511
507
|
3. **Check version format**: Ensure version follows semver format
|
|
512
|
-
4. **Review CI logs**: Check
|
|
508
|
+
4. **Review CI logs**: Check GitHub Actions logs for specific error messages
|
|
513
509
|
|
|
514
510
|
**Import Errors After Release**
|
|
515
511
|
|
package/ai/schemas.ts
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
|
+
// SafeParseReturnType was removed in Zod v4, but we still want stable typing.
|
|
11
|
+
export type SafeParseResult<T> =
|
|
12
|
+
| { success: true; data: T; error?: never }
|
|
13
|
+
| { success: false; error: z.ZodError<any>; data?: never };
|
|
14
|
+
|
|
10
15
|
// =============================================================================
|
|
11
16
|
// Dynamic Value Schema (for data binding)
|
|
12
17
|
// =============================================================================
|
|
@@ -573,7 +578,7 @@ export type UITree = z.infer<typeof UITreeSchema>;
|
|
|
573
578
|
/**
|
|
574
579
|
* Validate an element's props against its component schema
|
|
575
580
|
*/
|
|
576
|
-
export function validateElementProps(element: UIElement):
|
|
581
|
+
export function validateElementProps(element: UIElement): SafeParseResult<unknown> {
|
|
577
582
|
const schema = ComponentPropsSchemas[element.type as keyof typeof ComponentPropsSchemas];
|
|
578
583
|
if (!schema) {
|
|
579
584
|
return { success: false, error: new z.ZodError([{ code: 'custom', message: `Unknown component type: ${element.type}`, path: ['type'] }]) };
|
|
@@ -584,7 +589,7 @@ export function validateElementProps(element: UIElement): z.SafeParseReturnType<
|
|
|
584
589
|
/**
|
|
585
590
|
* Validate a complete UI tree
|
|
586
591
|
*/
|
|
587
|
-
export function validateUITree(tree: unknown):
|
|
592
|
+
export function validateUITree(tree: unknown): SafeParseResult<UITree> {
|
|
588
593
|
return UITreeSchema.safeParse(tree);
|
|
589
594
|
}
|
|
590
595
|
|
package/bin/kumo.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const distCliPath = path.resolve(__dirname, "../dist/command-line/cli.js");
|
|
11
|
+
if (existsSync(distCliPath)) {
|
|
12
|
+
await import(pathToFileURL(distCliPath).href);
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// In a repo checkout, the CLI may not be built yet. If `tsx` is available,
|
|
17
|
+
// run the TypeScript entrypoint directly.
|
|
18
|
+
const srcCliPath = path.resolve(__dirname, "../src/command-line/cli.ts");
|
|
19
|
+
if (existsSync(srcCliPath)) {
|
|
20
|
+
const result = spawnSync(
|
|
21
|
+
process.execPath,
|
|
22
|
+
["--import", "tsx", srcCliPath, ...process.argv.slice(2)],
|
|
23
|
+
{ stdio: "inherit" },
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
process.exit(result.status ?? 1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.error(
|
|
30
|
+
"Kumo CLI entrypoint not found. If you're in the repo, run: pnpm --filter @cloudflare/kumo build",
|
|
31
|
+
);
|
|
32
|
+
process.exit(1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1770420370035
|
package/dist/catalog.js
CHANGED