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

Essentials: Fix addon-essentials not working when used with getAbsolutePath #30557

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Feb 17, 2025

Closes #

What I did

We recently introduced an internal structure change to @storybook/addon-essentials, that would mean that it would no longer get applied when used with the getAbsolutePath() wrapper that we automatically write when detecting monorepos. This is because the main field in the package.json no longer points to the preset, so we instead have to rely on the presence of the root preset.js instead.

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

Greptile Summary

Added a root-level preset.js file to ensure @storybook/addon-essentials works correctly with getAbsolutePath() wrapper in monorepo setups.

  • Added code/addons/essentials/preset.js to maintain compatibility when using monorepo path resolution
  • Fixed issue where addon-essentials would not get applied due to package.json main field no longer pointing to preset directly
  • Ensures proper functionality when using getAbsolutePath() wrapper that Storybook automatically writes for monorepos

The change is minimal but crucial for maintaining compatibility in monorepo environments where path resolution needs to work consistently with the addon-essentials package.

Copy link

nx-cloud bot commented Feb 17, 2025

View your CI Pipeline Execution ↗ for commit e22c83c.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 2m 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-17 13:14:35 UTC

@JReinhold JReinhold marked this pull request as ready for review February 17, 2025 13:14
@JReinhold JReinhold requested a review from ndelangen February 17, 2025 13:14
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

@JReinhold JReinhold merged commit 72337e0 into next Feb 18, 2025
11 of 20 checks passed
@JReinhold JReinhold deleted the jeppe/fix-essentials-in-absolute-paths branch February 18, 2025 12:06
@github-actions github-actions bot mentioned this pull request Feb 18, 2025
5 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.

2 participants