Skip to content

fix(cli): generate plugins on the current Rozenite 2.x packages - #571

Open
lukewalczak wants to merge 1 commit into
callstackincubator:mainfrom
lukewalczak:fix/cli-template-rozenite
Open

lukewalczak wants to merge 1 commit into
callstackincubator:mainfrom
lukewalczak:fix/cli-template-rozenite

Conversation

@lukewalczak

Copy link
Copy Markdown

Description

rozenite generate scaffolds new plugins on the 1.x line, so every plugin created since 2.0.0 shipped starts on outdated packages. This bumps the template to the current 2.x line:

 // packages/cli/template/package.json
-"@rozenite/plugin-bridge": "^1.2.0"
+"@rozenite/plugin-bridge": "^2.5.0"
-"@rozenite/vite-plugin": "^1.2.0",
+"@rozenite/vite-plugin": "^2.5.0",
-"rozenite": "^1.2.0",
+"rozenite": "^2.5.0",

It also adds a test that fails when the template's Rozenite dependencies fall off the CLI's major version.

Related Issue

Closes

Context

The template was last bumped in #171, before 2.0.0. Nothing in the release flow updates it, since the template is not a published package, so ^1.2.0 stayed while the packages moved to 2.x. Because a caret range never crosses a major, new plugins resolve to 1.13.0.

The template already uses 2.x features: #456 added integrations to its rozenite.config.ts, but the 1.x build ignores the option and leaves it out of the manifest. Official plugins on npm already depend on @rozenite/plugin-bridge 2.5.0.

Rozenite packages are released in lockstep, so the test reads the CLI's own version and checks that rozenite, @rozenite/vite-plugin and @rozenite/plugin-bridge in template/package.json use ^ with the same major. On the next major the test fails until someone bumps the template.

Testing

Automated:

  • pnpm checks:affected && pnpm test:affected pass.
  • The new test fails on the old template and passes on the new one:
    • Before: @rozenite/plugin-bridge: expected '^1.2.0' to match /^\^2\./
    • After: ✓ plugin template > depends on the Rozenite major line the CLI belongs to

Manual verification, using a plugin generated with the local CLI build (rozenite generate):

  • Before: dependencies resolved to 1.13.0, and dist/rozenite.json had no integrations.
  • After: dependencies resolved to 2.5.0. tsc and rozenite build pass, and dist/rozenite.json includes integrations.
  • An unknown id in integrations fails the build: Invalid integration "reakt-native" in rozenite.config.ts.
  • rozenite dev serves the dev host on localhost:8888, and the "Hello world!" panel renders.
  • In the playground on the iPhone 17 Pro simulator, I linked the plugin and ran Metro with ROZENITE_DEV_MODE. "Hello world!" appears in the Rozenite tab of React Native DevTools, and its panel loads from localhost:8888.

This branch has not been deployed

No deployments
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