Skip to content

fix: catalog outputs should copy style css#2541

Open
Sherry-hue wants to merge 1 commit intolynx-family:mainfrom
Sherry-hue:fix/catalog-style
Open

fix: catalog outputs should copy style css#2541
Sherry-hue wants to merge 1 commit intolynx-family:mainfrom
Sherry-hue:fix/catalog-style

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented Apr 29, 2026

Summary by CodeRabbit

  • New Features

    • Exposes a RadioGroup component for consumption.
  • Bug Fixes

    • CLI entry now correctly forwards and returns process exit statuses.
  • Chores

    • Consolidated Lynx build into primary build and dev workflows.
    • Ensures CSS assets are copied into build outputs and adds a package-level entrypoint.
    • Stores incremental TypeScript build info inside the package build output.

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 Apr 29, 2026

🦋 Changeset detected

Latest commit: 4ec287b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

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

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

Repository-wide build and packaging changes: new empty changeset added; a2ui package gains an index entry and copy-css script plus exports changes; a2ui-playground build/dev scripts now run Lynx build; catalog extractor CLI entrypoint changed to await and propagate exit codes; TS buildinfo path added.

Changes

Cohort / File(s) Summary
Changeset
\.changeset/fruity-bats-divide.md
Adds a new changeset Markdown file containing only YAML delimiters (---) with no metadata.
a2ui package surface & build
packages/genui/a2ui/package.json, packages/genui/a2ui/src/index.ts, packages/genui/a2ui/tsconfig.json, packages/genui/a2ui/scripts/copy-css.mjs
Adds src entrypoint exporting core and chat; adds copy-css.mjs to copy .css from src to dist; updates tsconfig to set tsBuildInfoFile; modifies package.json exports (removes several ./catalog/* entries, adds ./catalog/RadioGroup) and expands build script to run tsc, copy CSS, then catalog extractor.
a2ui-playground scripts
packages/genui/a2ui-playground/package.json
Changes build and dev to run pnpm run build:lynx before rsbuild commands; removes Lynx-only dev/preview scripts.
Catalog extractor CLI
packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
Reworks bin to call and await named runCli from ../dist/cli.js, forward process.argv.slice(2), and set process.exitCode on non-zero exit codes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • HuJean
  • PupilTong
  • gaoachao
  • fzx2666-fz

Poem

🐰 I hopped through builds and shuffled files,
I copied CSS across the aisles,
I bound the Lynx into the run,
Awaited CLI, then set exit none —
A tiny rabbit, changes done. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly summarizes the main change: adding CSS copying functionality to the catalog build output process.
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

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

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.

🧹 Nitpick comments (1)
packages/genui/a2ui-playground/package.json (1)

9-9: Consider adding a watch mode for Lynx rebuilds in the dev flow.

Line 9 runs a one-time build:lynx before rsbuild dev. Changes to lynx-src/ files during development won't be reflected until the dev server restarts. Add a parallel rspeedy build --watch task to enable incremental rebuilds alongside the web dev server.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/genui/a2ui-playground/package.json` at line 9, The dev script
currently runs the one-time "build:lynx" before "rsbuild dev", so changes under
lynx-src/ aren't rebuilt live; update the "dev" NPM script to run a watch build
for Lynx in parallel with the web dev server by invoking "rspeedy build --watch"
alongside "rsbuild dev" (keep the existing "build:lynx" for initial build or
replace it with the watch invocation), using a parallel runner (e.g.,
concurrently or npm-run-all) so the "dev" script runs both "rspeedy build
--watch" and "rsbuild dev" concurrently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/genui/a2ui-playground/package.json`:
- Line 9: The dev script currently runs the one-time "build:lynx" before
"rsbuild dev", so changes under lynx-src/ aren't rebuilt live; update the "dev"
NPM script to run a watch build for Lynx in parallel with the web dev server by
invoking "rspeedy build --watch" alongside "rsbuild dev" (keep the existing
"build:lynx" for initial build or replace it with the watch invocation), using a
parallel runner (e.g., concurrently or npm-run-all) so the "dev" script runs
both "rspeedy build --watch" and "rsbuild dev" concurrently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb21795c-1d8e-4b98-85fe-fe46d3eeef5d

📥 Commits

Reviewing files that changed from the base of the PR and between e4ace87 and f269809.

📒 Files selected for processing (3)
  • .changeset/fruity-bats-divide.md
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui/tools/catalog_generator.ts

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 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 the current code and only fix it if needed.

Inline comments:
In `@packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js`:
- Around line 8-11: Add integration tests that execute the bin entry point and
assert propagation of runCli's return to process exit code: spawn a Node process
to run the built a2ui-catalog-extractor.js entry script and assert exit code 0
when runCli resolves 0 and a non-zero exit code when runCli resolves non-zero;
if unit-testing inside the same runtime, stub/mocking the exported runCli
function (used in the entry module) to return 0 and a non-zero value and require
the entry module in a fresh subprocess or via a module reset to exercise its
top-level await path that sets process.exitCode; include two focused test cases
(zero and non-zero), ensure you restore any stubs and isolate environment
variables so tests are deterministic, and assert process exit code rather than
only runCli behavior.
🪄 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: 1231d2b2-2d01-4bb8-9878-066dcf03f98d

📥 Commits

Reviewing files that changed from the base of the PR and between 2d86848 and 4ec287b.

📒 Files selected for processing (7)
  • .changeset/fruity-bats-divide.md
  • packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js
  • packages/genui/a2ui-playground/package.json
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/scripts/copy-css.mjs
  • packages/genui/a2ui/src/index.ts
  • packages/genui/a2ui/tsconfig.json
✅ Files skipped from review due to trivial changes (3)
  • packages/genui/a2ui/tsconfig.json
  • .changeset/fruity-bats-divide.md
  • packages/genui/a2ui/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/genui/a2ui-playground/package.json

Comment on lines +8 to +11
const exitCode = await runCli(process.argv.slice(2));
if (exitCode !== 0) {
process.exitCode = exitCode;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether CLI entrypoint behavior is already covered by tests.
# Expected: at least one test asserting entrypoint/exit-code behavior.

rg -n -C3 --iglob '**/*.test.{js,ts,jsx,tsx}' \
  'runCli|process\.exitCode|a2ui-catalog-extractor' \
  packages/genui/a2ui-catalog-extractor

Repository: lynx-family/lynx-stack

Length of output: 1306


🏁 Script executed:

# First, let's look at the test that uses runCli to understand what it validates
sed -n '160,200p' packages/genui/a2ui-catalog-extractor/test/extractor.test.ts

Repository: lynx-family/lynx-stack

Length of output: 1332


🏁 Script executed:

# Also check if there are any tests specifically for the bin file
rg -n 'a2ui-catalog-extractor\.js|bin.*exit' packages/genui/a2ui-catalog-extractor/test/ -A 3

Repository: lynx-family/lynx-stack

Length of output: 48


🏁 Script executed:

# Check the full test file structure to see all tests for runCli
grep -n "runCli" packages/genui/a2ui-catalog-extractor/test/extractor.test.ts

Repository: lynx-family/lynx-stack

Length of output: 139


🏁 Script executed:

# Check for any integration tests or bin-level test coverage
find packages/genui/a2ui-catalog-extractor -name '*.test.*' -o -name '*.spec.*' | head -20

Repository: lynx-family/lynx-stack

Length of output: 127


🏁 Script executed:

# Check if there are any tests that execute the bin file directly
rg -n 'spawn|execFile|execSync|bin/a2ui' packages/genui/a2ui-catalog-extractor/test/ -A 2

Repository: lynx-family/lynx-stack

Length of output: 48


🏁 Script executed:

# Check the actual bin file to confirm the change
cat -n packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js

Repository: lynx-family/lynx-stack

Length of output: 588


Add test coverage for bin entry point exit-code behavior.

The CLI flow changed at lines 8–11 (now uses top-level await and explicit process.exitCode mapping). Add a test to verify both zero and non-zero exit codes from runCli are properly propagated through the bin entry point.

Currently, tests only validate the runCli function directly; the bin entry point's contract is not covered. Consider adding a focused test case or integration test that executes the CLI and asserts exit code behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/genui/a2ui-catalog-extractor/bin/a2ui-catalog-extractor.js` around
lines 8 - 11, Add integration tests that execute the bin entry point and assert
propagation of runCli's return to process exit code: spawn a Node process to run
the built a2ui-catalog-extractor.js entry script and assert exit code 0 when
runCli resolves 0 and a non-zero exit code when runCli resolves non-zero; if
unit-testing inside the same runtime, stub/mocking the exported runCli function
(used in the entry module) to return 0 and a non-zero value and require the
entry module in a fresh subprocess or via a module reset to exercise its
top-level await path that sets process.exitCode; include two focused test cases
(zero and non-zero), ensure you restore any stubs and isolate environment
variables so tests are deterministic, and assert process exit code rather than
only runCli behavior.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 29, 2026

Merging this PR will improve performance by 17.27%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 79 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
002-hello-reactLynx-destroyBackground 893.7 µs 819.7 µs +9.03%
transform 1000 view elements 46.9 ms 40 ms +17.27%

Comparing Sherry-hue:fix/catalog-style (4ec287b) with main (e4ace87)

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.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React External

#813 Bundle Size — 680.27KiB (0%).

4ec287b(current) vs e4ace87 main#801(baseline)

Bundle metrics  no changes
                 Current
#813
     Baseline
#801
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#813
     Baseline
#801
No change  Other 680.27KiB 680.27KiB

Bundle analysis reportBranch Sherry-hue:fix/catalog-styleProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React Example

#7697 Bundle Size — 225.38KiB (0%).

4ec287b(current) vs e4ace87 main#7685(baseline)

Bundle metrics  no changes
                 Current
#7697
     Baseline
#7685
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 179 179
No change  Duplicate Modules 69 69
No change  Duplicate Code 44.57% 44.57%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7697
     Baseline
#7685
No change  IMG 145.76KiB 145.76KiB
No change  Other 79.63KiB 79.63KiB

Bundle analysis reportBranch Sherry-hue:fix/catalog-styleProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React MTF Example

#829 Bundle Size — 196.54KiB (0%).

4ec287b(current) vs e4ace87 main#817(baseline)

Bundle metrics  no changes
                 Current
#829
     Baseline
#817
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 173 173
No change  Duplicate Modules 66 66
No change  Duplicate Code 44.08% 44.08%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#829
     Baseline
#817
No change  IMG 111.23KiB 111.23KiB
No change  Other 85.31KiB 85.31KiB

Bundle analysis reportBranch Sherry-hue:fix/catalog-styleProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

Web Explorer

#9270 Bundle Size — 900.02KiB (0%).

4ec287b(current) vs e4ace87 main#9258(baseline)

Bundle metrics  Change 2 changes
                 Current
#9270
     Baseline
#9258
No change  Initial JS 44.46KiB 44.46KiB
No change  Initial CSS 2.22KiB 2.22KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 9 9
No change  Assets 11 11
Change  Modules 229(+0.44%) 228
No change  Duplicate Modules 11 11
Change  Duplicate Code 27.28%(-0.04%) 27.29%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#9270
     Baseline
#9258
No change  JS 495.88KiB 495.88KiB
No change  Other 401.92KiB 401.92KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch Sherry-hue:fix/catalog-styleProject dashboard


Generated by RelativeCIDocumentationReport issue

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.

1 participant