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: Fix printing of selected features #30605

Merged
merged 4 commits into from
Feb 21, 2025

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Feb 20, 2025

There's this [object Set] being printed right here:

Screenshot 2025-02-20 at 17 01 15

What I did

Fixed printing of the selected features by replacing the overloaded toString method (which only applies to the original Set) with a regular function.

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

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-30605-sha-3a6ed43c. Try it out in a new sandbox by running npx storybook@0.0.0-pr-30605-sha-3a6ed43c sandbox or in an existing project with npx storybook@0.0.0-pr-30605-sha-3a6ed43c upgrade.

More information
Published version 0.0.0-pr-30605-sha-3a6ed43c
Triggered by @ghengeveld
Repository storybookjs/storybook
Branch fix-printing-selected-features
Commit 3a6ed43c
Datetime Thu Feb 20 16:27:11 UTC 2025 (1740068831)
Workflow run 13439969490

To request a new release of this pull request, mention the @storybookjs/core team.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.5 MB 80.5 MB 0 B -0.62 0%
initSize 80.5 MB 80.5 MB 0 B -0.62 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 0 B 1.4 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B -0.78 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 1.11 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.3 0%
buildPreviewSize 3.34 MB 3.34 MB 0 B 1.11 0%
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.3s 15.8s 8.4s 0.91 53.6%
generateTime 20.3s 19.4s -838ms -0.64 -4.3%
initTime 4.6s 4.6s 48ms -0.39 1%
buildTime 9.6s 9.1s -495ms -0.52 -5.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 9.2s 5.2s -3s -959ms -0.55 -75.5%
devManagerResponsive 8.6s 4.9s -3s -668ms 0.15 -73.5%
devManagerHeaderVisible 686ms 768ms 82ms -0.41 10.7%
devManagerIndexVisible 746ms 775ms 29ms -0.58 3.7%
devStoryVisibleUncached 1.6s 1.6s -19ms -1.41 -1.2%
devStoryVisible 775ms 851ms 76ms -0.16 8.9%
devAutodocsVisible 761ms 700ms -61ms -1.06 -8.7%
devMDXVisible 647ms 735ms 88ms -0.55 12%
buildManagerHeaderVisible 738ms 669ms -69ms -1.17 -10.3%
buildManagerIndexVisible 741ms 682ms -59ms -1.23 -8.7%
buildStoryVisible 725ms 647ms -78ms -1.12 -12.1%
buildAutodocsVisible 672ms 673ms 1ms 0.02 0.1%
buildMDXVisible 584ms 540ms -44ms -1.42 🔰-8.1%

Greptile Summary

Improved the printing of selected features in the CLI by replacing the Set's toString() method with a dedicated printFeatures() function for better readability and formatting.

  • Added printFeatures() function in code/lib/create-storybook/src/initiate.ts to properly format feature output
  • Fixed display of empty feature sets to show "none" instead of "[object Set]"
  • Improved readability of multiple selected features by using proper comma separation
  • Extracted feature formatting logic into a dedicated function for better maintainability

Sorry, something went wrong.

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 20, 2025

View your CI Pipeline Execution ↗ for commit 86a900c.

Command Status Duration Result
nx affected -t check -c production --parallel=7 ✅ Succeeded 8s View ↗
nx run-many -t build -c production --parallel=3 ✅ Succeeded 4m 20s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-21 11:26:11 UTC

ghengeveld and others added 3 commits February 20, 2025 17:26
@valentinpalkovic valentinpalkovic merged commit fea7c5d into next Feb 21, 2025
65 of 67 checks passed
@valentinpalkovic valentinpalkovic deleted the fix-printing-selected-features branch February 21, 2025 11:58
@github-actions github-actions bot mentioned this pull request Feb 21, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants