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: Automatically extract componentPath #24396

Merged
merged 12 commits into from
Jun 9, 2024
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Oct 5, 2023

Closes N/A

What I did

  • Automatically extract rawComponentPath for index
  • Add componentPath to index
  • Resolve TS config path aliases
  • Automatically add parameters.componentPath

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

Create a sandbox in this branch and then view its /index.json. Verify that rawComponentPath is set correctly in the index for various cases (e.g. relative path, absolute path, alias, package import):

Example: https://630511d655df72125520f051-hyyhhtkyeo.chromatic.com/index.json

🦋 Canary release

This pull request has been released as version 0.0.0-pr-24396-sha-51edf4aa. Install it by pinning all your Storybook dependencies to that version.

More information
Published version 0.0.0-pr-24396-sha-51edf4aa
Triggered by @yannbf
Repository storybookjs/storybook
Branch shilman/auto-component-path
Commit 51edf4aa
Datetime Wed Oct 11 07:16:57 UTC 2023 (1697008617)
Workflow run 6479231542

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

@yannbf
Copy link
Member

yannbf commented Dec 1, 2023

As much as I love this PR, I guess given its limitations we might need to park it. 😢

@sulco
Copy link

sulco commented Mar 18, 2024

Hi friends! 👋 Just noticed this PR and it's super exciting for us at StackBlitz, so I'm happy to chime in with our use case:

We have an addon that allows opening the source of a story in a browser IDE with a git support. This enables Storybook instance maintainers to easily adjust things when they're off or need other updates: they can just click a link on a given story and get the source files and Storybook running live in a dev server in a browser separate tab. They make a change and commit.

For this, when setting up the addon, one has to

  1. globally set up a URL to the repository (in preview.js),
  2. and then in every story file, they have to provide the path to this file (see the the addon docs).

With programmatic access to componentPath, this second setting can be made optional, turning the whole experience into a "set it and forget it" scenario, which would make a world of difference!

Copy link

nx-cloud bot commented Jun 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a57e45c. 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.

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

code LGTM, but needs to update API docs as well.

@shilman shilman merged commit b64489c into next Jun 9, 2024
13 checks passed
@shilman shilman deleted the shilman/auto-component-path branch June 9, 2024 10:46
@shilman
Copy link
Member Author

shilman commented Jun 9, 2024

@sulco Sorry for the delay -- coming soon to 8.2! ❤️

@github-actions github-actions bot mentioned this pull request Jun 9, 2024
12 tasks
@valentinpalkovic valentinpalkovic added needs qa Indicates that this needs manual QA during the upcoming minor/major release and removed needs qa Indicates that this needs manual QA during the upcoming minor/major release labels Jul 5, 2024
@sulco
Copy link

sulco commented Jul 17, 2024

Oh wow, I've almost missed it 😅 This is awesome, thanks everyone!! 😍

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.

7 participants