Skip to content

feat(cli): detect Lynx (rspeedy) projects in rozenite init - #504

Merged
V3RON merged 1 commit into
mainfrom
claude/intelligent-feynman-tzytpz
Sep 15, 2026
Merged

V3RON merged 1 commit into
mainfrom
claude/intelligent-feynman-tzytpz

Conversation

@V3RON

@V3RON V3RON commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

rozenite init now detects rspeedy/Rsbuild (Lynx) projects, installs @rozenite/lynx, and wires it into lynx.config.ts — the same experience it already gives Metro and Re.Pack projects, instead of the previous "Could not determine bundler type" dead end.

  • getAvailableBundlerTypes (@rozenite/tools) gains a lynx member, detected via lynx.config.ts/lynx.config.js or an @lynx-js/rspeedy dependency in package.json.
  • rozenite init's project-detection gate no longer rejects Lynx projects: it previously required "react-native" to appear in package.json, which a pure Lynx project never has.
  • A new Lynx branch in wrapConfigFile adds import { rozeniteLynxPlugin } from '@rozenite/lynx/rspeedy'; and inserts rozeniteLynxPlugin() into the plugins array of lynx.config.ts, matching the same import-style/quote-style detection Metro and Re.Pack use.
  • After configuring Lynx, init prints a reminder to turn on Lynx DevTool, since it's off by default and nothing is discoverable without it.
  • The "Could not determine bundler type" error now also mentions lynx.config.ts.
  • Dropped the "rozenite init doesn't cover rspeedy yet" caveat from the getting-started docs.

Related Issue

Closes #493

Context

Metro/Re.Pack configs are wrapped by wrapping the whole config export (withRozenite(config)), but rspeedy's lynx.config.ts declares plugins as a list (plugins: [pluginReactLynx(), ...]) rather than composing around the exported object — see the Rozenite for Lynx manual-install docs. So the Lynx path inserts rozeniteLynxPlugin() as the last entry of that plugins array instead of reusing the export-wrapping regexes, using a small bracket-matching helper (skipping over strings/comments) to find the array's end reliably even when a plugin call itself contains braces, template literals, or comments — which create-rspeedy's scaffolded config does.

Testing

Automated:

  • pnpm checks:affected (typecheck, lint, format) — passing
  • pnpm test:affected — passing, including new tests:
    • packages/tools/src/__tests__/project-type.test.ts — Lynx detection via config file / package.json dependency, and mixed-bundler workspaces
    • packages/cli/src/__tests__/is-project.test.ts — the project gate now accepts Lynx projects
    • packages/cli/src/__tests__/config-wrapper.test.ts — new lynx describe block covering a basic config, an empty plugins: [], an already-configured config (no-op), a missing config file, a missing plugins array, and a real-world config (mirroring create-rspeedy's react template, with nested braces/template literals/comments inside a plugin call) to make sure the bracket matcher doesn't get confused

Manual verification:

  • Scaffolded a real Lynx project with npx create-rspeedy@0.16.4 . --template react.
  • Ran the built CLI's init command against it end-to-end: it installed @rozenite/lynx, rewrote lynx.config.ts to add the plugin, and printed the Lynx DevTool reminder.
  • Confirmed the rewritten lynx.config.ts typechecks (tsc --noEmit) and that npx rspeedy dev boots against it, logging [Rozenite] No plugins found. — proof the plugin is wired in and running.

🤖 Generated with Claude Code

https://claude.ai/code/session_018XyA3ckZz2ZFvmH659mBAT


Generated by Claude Code

`rozenite init` now recognizes an rspeedy/Rsbuild project (via
lynx.config.ts/js, or @lynx-js/rspeedy in package.json), installs
@rozenite/lynx, and adds rozeniteLynxPlugin() to the plugins array in
lynx.config.ts, mirroring Metro/Re.Pack support. It also prints a
reminder to turn on Lynx DevTool, and the project-detection gate no
longer rejects Lynx projects for lacking a react-native dependency.

Closes #493

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018XyA3ckZz2ZFvmH659mBAT
@V3RON
V3RON merged commit 66098f4 into main Sep 15, 2026
4 checks passed
@V3RON
V3RON deleted the claude/intelligent-feynman-tzytpz branch September 15, 2026 08:55
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.

rozenite init does not detect Lynx (rspeedy) projects

2 participants