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

CSF: Rename preview.js globals to initialGlobals #27517

Merged
merged 17 commits into from
Jun 11, 2024
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Jun 3, 2024

Closes N/A

What I did

CSF updates to implement Story globals per #23347 (comment)

  • Add preview.js initialGlobals to replace globals
  • Deprecate preview.js globals
  • Add globals to component/story annotations
  • Add automigration
  • Add MIGRATION.md notes
  • Bugfix for ConfigFile.removeField common case

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. Build this branch
  2. Create a sandbox or a random storybook project
  3. Add a globals annotation to preview.js
  4. Verify that the initial value of globals are set correctly and a deprecation warning is shown
  5. In the project directory run: /path/to/code/lib/cli/bin/index.js automigrate initial-globals
  6. Verify that the prompts make sense and that preview.js has been updated to initialGlobals
  7. Verify that the initial value of globals are still set correctly

Documentation

Interestingly, could not find globals documented on https://storybook.js.org/docs/get-started cc @kylegach

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

🦋 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>

@shilman shilman added maintenance User-facing maintenance tasks core ci:normal labels Jun 3, 2024
@shilman shilman self-assigned this Jun 3, 2024
@shilman shilman added the csf label Jun 3, 2024
Copy link

nx-cloud bot commented Jun 3, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8dbd2d3. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@shilman shilman requested a review from tmeasday June 3, 2024 11:29
@shilman shilman requested a review from tmeasday June 5, 2024 08:11
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Can I get a test on normalizeProjectAnnotations please?

code/lib/preview-api/src/modules/store/StoryStore.ts Outdated Show resolved Hide resolved
@shilman shilman requested a review from tmeasday June 11, 2024 22:07
@shilman
Copy link
Member Author

shilman commented Jun 11, 2024

Self-merging @tmeasday

@shilman shilman merged commit 29f649b into next Jun 11, 2024
59 of 61 checks passed
@shilman shilman deleted the shilman/initial-globals branch June 11, 2024 23:33
@github-actions github-actions bot mentioned this pull request Jun 11, 2024
11 tasks
@valentinpalkovic valentinpalkovic added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 5, 2024
@ghengeveld ghengeveld removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:normal core csf maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants