Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Prompt users for RN vs RNW on init #30635

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Feb 23, 2025

Closes N/A

What I did

Added a choice of @storybook/react-native vs @storybook/react-native-web-vite for fresh installs

image

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. pnpm create expo my-expo && cd my-expo
  2. pnpm create storybook@<canary>
    a. Select RN and make sure it installs RN
    b. Select RNW and make sure it installs RNW
    c. Pass --yes to the CLI and make sure it installs RN

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.6 MB 80.6 MB 0 B 0.9 0%
initSize 80.6 MB 80.6 MB 0 B 0.9 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.29 MB 7.32 MB 26.1 kB 0.8 0.4%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 1.36 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 1.36 0%
buildPreviewSize 3.32 MB 3.34 MB 26.1 kB 0.33 0.8%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 7.8s 20.6s 12.7s 1.14 61.9%
generateTime 23.5s 20.1s -3s -443ms 0.03 -17.1%
initTime 5.9s 4.6s -1s -345ms -0.31 -29%
buildTime 11s 8.6s -2s -373ms -0.92 -27.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.6s 6s 426ms 0.57 7%
devManagerResponsive 5.3s 5.7s 375ms 0.51 6.5%
devManagerHeaderVisible 793ms 799ms 6ms 0.43 0.8%
devManagerIndexVisible 808ms 812ms 4ms 0.16 0.5%
devStoryVisibleUncached 2.2s 2.2s -6ms 1.29 -0.3%
devStoryVisible 829ms 879ms 50ms 0.88 5.7%
devAutodocsVisible 858ms 761ms -97ms -0.09 -12.7%
devMDXVisible 805ms 977ms 172ms 3.76 🔺17.6%
buildManagerHeaderVisible 1s 914ms -106ms 0.78 -11.6%
buildManagerIndexVisible 1.1s 988ms -137ms 0.94 -13.9%
buildStoryVisible 982ms 890ms -92ms 0.87 -10.3%
buildAutodocsVisible 713ms 662ms -51ms 0.55 -7.7%
buildMDXVisible 784ms 779ms -5ms 1.54 -0.6%

Greptile Summary

Added a user prompt during Storybook initialization to choose between React Native and React Native Web frameworks, improving the setup experience for React Native projects.

  • Added prompt in code/lib/create-storybook/src/initiate.ts to select between React Native (device/simulator) and React Native Web (web-based)
  • Maintains default to React Native when using --yes flag for CI environments
  • Ensures proper framework installation based on user selection (@storybook/react-native or @storybook/react-native-web-vite)
  • Includes clear descriptions in prompt to help users understand the differences between options

Sorry, something went wrong.

@shilman shilman added maintenance User-facing maintenance tasks cli ci:normal labels Feb 23, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Feb 23, 2025

View your CI Pipeline Execution ↗ for commit fc74615.

Command Status Duration Result
nx affected -t check -c production --parallel=7 ✅ Succeeded <1s View ↗
nx run-many -t build -c production --parallel=3 ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-24 15:53:44 UTC

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@valentinpalkovic valentinpalkovic merged commit ab752f0 into next Feb 24, 2025
62 checks passed
@valentinpalkovic valentinpalkovic deleted the shilman/cli-prompt-rnw branch February 24, 2025 13:17
@github-actions github-actions bot mentioned this pull request Feb 24, 2025
9 tasks
@valentinpalkovic valentinpalkovic restored the shilman/cli-prompt-rnw branch February 24, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:normal cli maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants