@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 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 merge requests and include the commit hash for identification.
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 merge requests through the CI pipeline configured in the root `.gitlab-ci.yml`:
319
+ Beta releases are automatically triggered for pull requests through GitHub Actions (`.github/workflows/preview.yml`):
320
320
 
321
- **CI Job Configuration:**
321
+ **Workflow Configuration:**
322
322
 
323
- - **Job Name**: `version-and-publish-beta`
324
- - **Stage**: `beta-release` (runs after build, checks, and tests)
325
- - **Triggers**: Automatically on merge requests with changes to `packages/kumo/**/*`
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` (executes `./ci/versioning/version-beta.sh`)
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 run build` in `packages/kumo`
337
- 4. **Publish**: Runs `pnpm run release:beta` to publish with `beta` tag
338
- 5. **Verify**: Waits 45s for npm propagation and verifies publication
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
- - `GITLAB_API_TOKEN`: For posting MR comments
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 MR will include a comment with installation instructions:
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 MR**: Submit your changes with a changeset
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 MR comment
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 MR for production release
370
+ 5. **Merge**: Once tested, merge the PR for production release
375
371
 
376
372
  ### Changeset Validation
377
373
 
378
- All merge requests with changes to `packages/kumo/` must include a changeset:
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 MR with changes and changeset
420
- 4. **Beta Test**: Test the beta version published to the MR
421
- 5. **Merge**: Merge MR to main branch
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 GitLab CI logs for specific error messages
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): z.SafeParseReturnType<unknown, unknown> {
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): z.SafeParseReturnType<unknown, UITree> {
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
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  let c = null, h = null;
3
3
  async function y() {
4
- return c || h || (h = import("./schemas-BSdA0fz-.js").then((t) => (c = t, c)), h);
4
+ return c || h || (h = import("./schemas-Cbid4MwW.js").then((t) => (c = t, c)), h);
5
5
  }
6
6
  function l() {
7
7
  if (!c)