Skip to content

refactor(genui): add @lynx-js/genui#2712

Merged
gaoachao merged 8 commits into
mainfrom
refactor/add-genui-pkg
May 27, 2026
Merged

refactor(genui): add @lynx-js/genui#2712
gaoachao merged 8 commits into
mainfrom
refactor/add-genui-pkg

Conversation

@gaoachao
Copy link
Copy Markdown
Collaborator

@gaoachao gaoachao commented May 25, 2026

Summary by CodeRabbit

  • New Features

    • Introduces a unified GenUI package and new genui CLI with namespace commands (e.g., genui a2ui generate catalog / genui a2ui generate prompt).
  • Documentation

    • Extensive README and guide updates across packages (installation, unified entrypoints, A2UI/OpenUI examples, catalog/prompt generation, CLI usage), including Chinese docs and CLI compatibility notes.
  • Chores

    • Package identities, manifests, build configs, exports, workspace layout, and theme/style import targets updated; dist outputs ignored.

Review Change Stack

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

⚠️ No Changeset found

Latest commit: ddcb5b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Consolidates multiple a2ui/openui packages into a new root @lynx-js/genui with subpath exports, introduces a namespace-first genui CLI (delegating to a2ui/openui subcommands), renames packages to genui-* variants, migrates imports to compiled .js targets, and updates build/config/docs/playground to the new layout.

Changes

GenUI Package Consolidation

Layer / File(s) Summary
Root package + build configs
packages/genui/package.json, packages/genui/tsconfig.build.json, packages/genui/turbo.json, packages/genui/.gitignore, pnpm-workspace.yaml
Adds @lynx-js/genui manifest, build/tsconfig/turbo configs, ignores /dist/, and registers packages/genui in the workspace.
CLI restructuring
packages/genui/cli/bin/cli.js, packages/genui/cli/package.json, packages/genui/cli/README.md, packages/genui/cli/AGENTS.md
New @lynx-js/genui-cli package and bin rewrites routing to genui <namespace> ..., dynamic delegation to a2ui/openui, and backward-compatible a2ui-cli alias.
A2UI core rename & JSX→JS migration
packages/genui/a2ui/package.json, packages/genui/a2ui/src/**, packages/genui/a2ui/tsconfig.build.json
Renames package to @lynx-js/genui-a2ui, updates build:catalog script/devDep, and switches many internal imports/exports from .jsx to .js and sets JSX compile option.
Catalog extractor & prompt packages
packages/genui/a2ui-catalog-extractor/package.json, packages/genui/a2ui-catalog-extractor/tsconfig.build.json, packages/genui/a2ui-prompt/package.json, packages/genui/a2ui-prompt/src/index.ts
Renames packages to genui-scoped names, updates build config and error messages, and switches build tooling commands.
OpenUI rename & renderer CSS removal
packages/genui/openui/package.json, packages/genui/openui/src/core/renderer.tsx, packages/genui/openui/README.md
Renames to @lynx-js/genui-openui, marks private, updates README imports, and removes side-effect CSS import.
Root API aggregation (entrypoint)
packages/genui/index.ts
New primary entrypoint re-exporting A2UI React APIs, store helpers, OpenUI exports, prompt builders, and catalog-extractor functions/types.
Playground, examples & styles
packages/genui/a2ui-playground/**, website/package.json
Updates playground imports/manifests to @lynx-js/genui or local ../../../a2ui/dist/catalog/*, updates theme import, and adjusts website devDependencies.
Documentation and AGENTS updates
packages/genui/**/README.md, AGENTS.md, localized READMEs
Updates all docs, README examples, CLI usage and Chinese translations to the new genui namespace and command patterns.
Lint/TS/workspace & minor fixes
eslint.config.js, pnpm-workspace.yaml, packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js, packages/genui/ui-judge/tests/helpers/playground-preview-server.ts, packages/genui/tsconfig.json
Adds ESLint overrides for the new index, includes package in pnpm workspace, removes an ESLint suppression comment, updates an error message, and clears TS project references.

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers:

  • HuJean
  • PupilTong
  • Sherry-hue
  • fzx2666-fz

"A rabbit hops with a tiny drum,
New names to shout, the packages come.
I nibbled docs, I brushed the bin —
Now genui calls, let builds begin! 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(genui): add @lynx-js/genui' directly and clearly describes the main change—adding a new GenUI package that consolidates previous separate A2UI and OpenUI packages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/add-genui-pkg

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/cli/bin/cli.js`:
- Around line 135-137: Replace the hard-coded relative dist imports in the CLI
bootstrap with package entrypoint imports: instead of importing
'../../a2ui-catalog-extractor/dist/cli.js' and
'../../a2ui-prompt/dist/index.js', import from the package names (e.g. import {
runCli as runCatalogExtractorCli } from 'a2ui-catalog-extractor' or from the
package's published subpath like 'a2ui-catalog-extractor/cli' depending on that
package's exports) so the CLI delegates via package exports; update the two
dynamic imports in packages/genui/cli/bin/cli.js that create
runCatalogExtractorCli and the prompt runner to use the appropriate package
entrypoint identifiers (runCli or exported names) instead of sibling dist paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9638494e-4667-4841-9145-c4fd760b4e68

📥 Commits

Reviewing files that changed from the base of the PR and between ab3c742 and b9e54c0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • packages/genui/.gitignore
  • packages/genui/README.md
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/tsconfig.build.json
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-playground/AGENTS.md
  • packages/genui/a2ui-playground/examples/README.md
  • packages/genui/a2ui-playground/examples/io-mock/mockAgent.ts
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/openui/App.tsx
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/catalog/a2ui.ts
  • packages/genui/a2ui-playground/src/components/UsageSection.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui/AGENTS.md
  • packages/genui/a2ui/README.md
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Modal/index.tsx
  • packages/genui/a2ui/src/catalog/README.md
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Tabs/index.tsx
  • packages/genui/a2ui/src/catalog/defineCatalog.ts
  • packages/genui/a2ui/src/catalog/index.ts
  • packages/genui/a2ui/src/index.ts
  • packages/genui/a2ui/src/react/A2UI.tsx
  • packages/genui/a2ui/src/react/index.ts
  • packages/genui/a2ui/src/react/useA2UIContext.ts
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/cli/AGENTS.md
  • packages/genui/cli/README.md
  • packages/genui/cli/bin/cli.js
  • packages/genui/cli/package.json
  • packages/genui/index.ts
  • packages/genui/openui/README.md
  • packages/genui/openui/package.json
  • packages/genui/openui/src/core/renderer.tsx
  • packages/genui/package.json
  • packages/genui/tsconfig.build.json
  • packages/genui/tsconfig.json
  • packages/genui/turbo.json
  • packages/genui/ui-judge/tests/helpers/playground-preview-server.ts
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (3)
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/package.json
  • packages/genui/openui/src/core/renderer.tsx

Comment thread packages/genui/cli/bin/cli.js
@gaoachao gaoachao force-pushed the refactor/add-genui-pkg branch from fe6b209 to ceceafd Compare May 26, 2026 07:37
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/genui/cli/bin/cli.js (1)

135-137: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use package entrypoint delegation instead of sibling dist imports.

These imports bypass the delegated package entrypoints and couple CLI behavior to local folder layout/build artifacts. Switch to package exports (@lynx-js/genui/a2ui-catalog-extractor/cli and @lynx-js/genui/a2ui-prompt).

Proposed fix
-    const { runCli: runCatalogExtractorCli } = await import(
-      '../../a2ui-catalog-extractor/dist/cli.js'
-    );
+    const { runCli: runCatalogExtractorCli } = await import(
+      '`@lynx-js/genui/a2ui-catalog-extractor/cli`'
+    );
@@
-  } = await import('../../a2ui-prompt/dist/index.js');
+  } = await import('`@lynx-js/genui/a2ui-prompt`');
#!/bin/bash
set -euo pipefail

echo "== Current CLI dynamic imports =="
rg -n "a2ui-catalog-extractor|a2ui-prompt|await import\\(" packages/genui/cli/bin/cli.js -n -C2

echo
echo "== Validate exported entrypoints in packages/genui/package.json =="
sed -n '1,220p' packages/genui/package.json | rg -n "\"\\./a2ui-catalog-extractor/cli\"|\"\\./a2ui-prompt\"|\"exports\"" -n -C2

As per coding guidelines: packages/genui/cli/bin/cli.js: genui a2ui generate catalog should delegate to @lynx-js/genui/a2ui-catalog-extractor and genui a2ui generate prompt should delegate to @lynx-js/genui/a2ui-prompt.

Also applies to: 175-180

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/cli/bin/cli.js` around lines 135 - 137, Replace sibling dist
imports with package entrypoint exports: change dynamic imports that currently
reference '../../a2ui-catalog-extractor/dist/cli.js' (where runCli is imported
as runCatalogExtractorCli) and the similar a2ui-prompt dist import to their
exported package paths (e.g. import from
'`@lynx-js/genui/a2ui-catalog-extractor/cli`' and from
'`@lynx-js/genui/a2ui-prompt`' respectively), updating the await import(...) calls
and any renamed imports (runCatalogExtractorCli, the prompt CLI import) so the
CLI delegates to package entrypoints rather than local dist artifacts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/tsconfig.json`:
- Line 10: The package tsconfig.json currently has "compilerOptions.composite":
true but empty "references": [] and "include": [], making this config a no-op
for tsc --build; restore the intended project references or add input files so
GenUI is part of the build graph: update the tsconfig.json to populate
"references" with the other GenUI project refs (or alternatively add appropriate
"include" or "files" entries) so the composite build will typecheck and emit for
GenUI; edit the tsconfig.json keys "references", "include", or "files"
accordingly.

---

Duplicate comments:
In `@packages/genui/cli/bin/cli.js`:
- Around line 135-137: Replace sibling dist imports with package entrypoint
exports: change dynamic imports that currently reference
'../../a2ui-catalog-extractor/dist/cli.js' (where runCli is imported as
runCatalogExtractorCli) and the similar a2ui-prompt dist import to their
exported package paths (e.g. import from
'`@lynx-js/genui/a2ui-catalog-extractor/cli`' and from
'`@lynx-js/genui/a2ui-prompt`' respectively), updating the await import(...) calls
and any renamed imports (runCatalogExtractorCli, the prompt CLI import) so the
CLI delegates to package entrypoints rather than local dist artifacts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4538df1e-c3ad-4070-a642-4e441d676b11

📥 Commits

Reviewing files that changed from the base of the PR and between fe6b209 and ceceafd.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (57)
  • eslint.config.js
  • packages/genui/.gitignore
  • packages/genui/README.md
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/tsconfig.build.json
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-playground/AGENTS.md
  • packages/genui/a2ui-playground/examples/README.md
  • packages/genui/a2ui-playground/examples/io-mock/mockAgent.ts
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/openui/App.tsx
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui-playground/src/catalog/a2ui.ts
  • packages/genui/a2ui-playground/src/components/UsageSection.tsx
  • packages/genui/a2ui-playground/src/styles.css
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui/AGENTS.md
  • packages/genui/a2ui/README.md
  • packages/genui/a2ui/README_zh.md
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Modal/index.tsx
  • packages/genui/a2ui/src/catalog/README.md
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Tabs/index.tsx
  • packages/genui/a2ui/src/catalog/defineCatalog.ts
  • packages/genui/a2ui/src/catalog/index.ts
  • packages/genui/a2ui/src/index.ts
  • packages/genui/a2ui/src/react/A2UI.tsx
  • packages/genui/a2ui/src/react/index.ts
  • packages/genui/a2ui/src/react/useA2UIContext.ts
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/cli/AGENTS.md
  • packages/genui/cli/README.md
  • packages/genui/cli/bin/cli.js
  • packages/genui/cli/package.json
  • packages/genui/index.ts
  • packages/genui/openui/README.md
  • packages/genui/openui/package.json
  • packages/genui/openui/src/core/renderer.tsx
  • packages/genui/package.json
  • packages/genui/tsconfig.build.json
  • packages/genui/tsconfig.json
  • packages/genui/turbo.json
  • packages/genui/ui-judge/tests/helpers/playground-preview-server.ts
  • pnpm-workspace.yaml
  • website/package.json
💤 Files with no reviewable changes (4)
  • packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/package.json
  • packages/genui/openui/src/core/renderer.tsx
✅ Files skipped from review due to trivial changes (25)
  • packages/genui/.gitignore
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Tabs/index.tsx
  • packages/genui/a2ui-playground/examples/README.md
  • packages/genui/a2ui/src/react/index.ts
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/Modal/index.tsx
  • packages/genui/a2ui/src/react/useA2UIContext.ts
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/cli/README.md
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui/src/catalog/README.md
  • packages/genui/a2ui/src/react/A2UI.tsx
  • packages/genui/tsconfig.build.json
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/openui/package.json
  • pnpm-workspace.yaml
  • packages/genui/a2ui-playground/AGENTS.md
  • packages/genui/README.md
  • packages/genui/a2ui-playground/src/components/UsageSection.tsx
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/turbo.json
  • packages/genui/openui/README.md

Comment thread packages/genui/tsconfig.json
@gaoachao gaoachao force-pushed the refactor/add-genui-pkg branch 2 times, most recently from 713d069 to 9bcdd87 Compare May 26, 2026 08:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/a2ui-playground/package.json`:
- Line 10: The dev script currently runs "build:lynx" before starting the dev
server which reintroduces a blocking prebuild; update the "dev" npm script in
package.json to stop pre-building Lynx (remove "build:lynx") and instead launch
Lynx in its dev/watch mode concurrently with the standard dev server (i.e., run
Lynx's dev command in parallel with "rsbuild dev"); ensure you reference the
existing "dev" script and the "build:lynx" script name when making the change so
the new script runs Lynx in dev/watch mode rather than invoking the build step.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43828a02-186d-4bfd-9a10-f4dde4b7c136

📥 Commits

Reviewing files that changed from the base of the PR and between 713d069 and 9bcdd87.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • eslint.config.js
  • packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui/README.md
  • packages/genui/a2ui/README_zh.md
  • packages/genui/tsconfig.json
  • website/package.json
💤 Files with no reviewable changes (1)
  • packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
✅ Files skipped from review due to trivial changes (2)
  • packages/genui/a2ui/README.md
  • packages/genui/a2ui/README_zh.md

Comment thread packages/genui/a2ui-playground/package.json
@gaoachao gaoachao force-pushed the refactor/add-genui-pkg branch 3 times, most recently from ffa7b6a to ba71668 Compare May 27, 2026 08:05
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 27, 2026

Merging this PR will not alter performance

✅ 81 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing refactor/add-genui-pkg (ddcb5b3) with main (0578c8d)2

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (7672f0c) during the generation of this report, so 0578c8d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

The turbo cache key was only namespaced by the Rust transform sources
(packages/**/src/**/*.rs) and github.sha, with restore-keys that fell
back to any cache for the same OS. Turbo's per-task hash does not fully
capture the compiled ReactLynx snapshot output, so a PR that only changes
the dependency graph (e.g. adding a package) without touching *.rs would
inherit a base-branch .turbo and replay stale compiled snapshots. The
main-thread snapshot registrations and background-thread references then
came from different transform states, producing widespread
'BackgroundSnapshot not found: __snapshot_*' failures in the Vitest jobs.

- Add hashFiles('pnpm-lock.yaml') to the cache key so caches are scoped
  by dependency graph as well.
- Drop the over-broad restore-keys fallbacks (the *.rs-only and OS-only
  lines) that allowed inheriting a cache from an unrelated graph.
- Align the glob in consumer workflows to packages/**/src/**/*.rs so the
  key stays byte-for-byte identical to workflow-build.yml (required by
  fail-on-cache-miss).
- Bump turbo-v4 -> turbo-v5 to discard currently-poisoned caches.

Change-Id: I5fe87bae2346ff379340410aad4cc25be8001d85
@gaoachao gaoachao force-pushed the refactor/add-genui-pkg branch from ba71668 to 0b948da Compare May 27, 2026 09:18
gaoachao and others added 2 commits May 27, 2026 17:35
Root cause of the 'BackgroundSnapshot not found' failures (51 test files):
packages/genui/a2ui depends on published @lynx-js/lynx-ui-*@3.133.0, which
peer-depend on @lynx-js/react@^0.121.0. pnpm pulled a published
@lynx-js/react@0.121.0 alongside the workspace copy (0.121.1), so the
ReactLynx runtime singleton 'snapshotManager' existed twice. Snapshots
registered in one copy were not found when looked up via the other, breaking
ReactLynx snapshot rendering across the whole monorepo (incl. unrelated tests
like lynx/gesture-runtime).

Verified locally with a clean, cache-free build: before -> 51 failed (197
'BackgroundSnapshot not found'); after the override -> 0 such failures on both
node 22 and node 24. (Remaining webpack/react and rspeedy/react failures are
pre-existing macOS-only rspack issues that also fail on main and pass in CI.)

- pnpm-workspace.yaml: add override "@lynx-js/react": "workspace:*" so the
  published lynx-ui peer resolves to the single workspace copy.
- Revert the turbo cache-key change (turbo-v5 + pnpm-lock hash) across the
  5 workflows: the failure was never a turbo cache staleness issue (a clean
  cache-free build reproduces it), so that change is unnecessary.
@github-actions
Copy link
Copy Markdown
Contributor

UI Judge

GEQI weighted score: 9.4 / 100 across 8 examples.
Average visual-correctness score: 0.9 / 5.

Dimension Weight Average Results Status
Usability & Interaction 30% 0.5 / 5 8 OK
Visual & Aesthetics 25% 0.4 / 5 8 OK
Consistency & Standards 15% 0.5 / 5 8 OK
Architecture & UX Writing 15% 0.5 / 5 8 OK
Accessibility & Performance 15% 0.5 / 5 8 OK
# Example Visual Correctness Usability & Interaction (30%) Visual & Aesthetics (25%) Consistency & Standards (15%) Architecture & UX Writing (15%) Accessibility & Performance (15%) GEQI Page Status
1 recs 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 40 / 100 preview OK
2 cast-grid 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
3 citywalk-list 1 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
4 fridge-search 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
5 trip-planner 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
6 weather-current 2 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
7 product-card 2 / 5 2 / 5 1 / 5 2 / 5 2 / 5 2 / 5 35 / 100 preview OK
8 workout-plan 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 5 0 / 100 preview OK
Details

Result 1

  • Example: recs
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show date-night dining recommendations for Moonlight Terrace, Pinewood Bistro, and Sea Breeze Kitchen.

Result 2

  • Example: cast-grid
  • Dimension: visual-correctness
  • Visual correctness: 0 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show a cast grid for the short film Night Notes, including Lin Xia and Zhou Ning cast cards.

Result 3

  • Example: citywalk-list
  • Dimension: visual-correctness
  • Visual correctness: 1 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show weekend citywalk coffee picks with Rooftop Brew Room, Corner Canvas Lab, and Late Sun Roastery.

Result 4

  • Example: fridge-search
  • Dimension: visual-correctness
  • Visual correctness: 0 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show refrigerator search results with Siemens, Hualing, Haier, and Midea product cards.

Result 5

  • Example: trip-planner
  • Dimension: visual-correctness
  • Visual correctness: 0 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show a Kyoto 48-hour trip planner with Day 1 and Day 2 itinerary sections, including Monkey Park Viewpoint.

Result 6

  • Example: weather-current
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show the current weather for Austin, TX, including clear skies with light breeze.

Result 7

  • Example: product-card
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 1 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a Wireless Headphones Pro product card with a visible Add to Cart action.

Result 8

  • Example: workout-plan
  • Dimension: visual-correctness
  • Visual correctness: 0 / 5
  • GEQI dimensions:
    • Usability & Interaction: 0 / 5 (30%)
    • Visual & Aesthetics: 0 / 5 (25%)
    • Consistency & Standards: 0 / 5 (15%)
    • Architecture & UX Writing: 0 / 5 (15%)
    • Accessibility & Performance: 0 / 5 (15%)
  • Task: The A2UI playground preview should show a weekly workout plan with five days from Monday Ramp-Up through Friday Conditioning.

Workflow run

@gaoachao gaoachao enabled auto-merge (squash) May 27, 2026 17:29
@gaoachao gaoachao merged commit f38e285 into main May 27, 2026
44 checks passed
@gaoachao gaoachao deleted the refactor/add-genui-pkg branch May 27, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants