Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(@storybook/angular): add fileURLToPath for preview annotation paths #32812

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

Open
brandonroberts wants to merge 1 commit into storybookjs:next
base: next
Choose a base branch
Loading
from brandonroberts:fix-angular-preview-annotations

Conversation

@brandonroberts
Copy link

@brandonroberts brandonroberts commented Oct 23, 2025
edited by coderabbitai bot
Loading

Closes #

What I did

When using the previewAnnotations with the @storybook/builder-vite its unable to resolve the preview and docs config files because they aren't mapped correctly. The @analogjs/storybook-angular package re-exports the previewAnnotations from the @storybook/angular package.

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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Improved path resolution handling in Angular framework preset for preview and documentation configuration paths.

Copy link
Contributor

coderabbitai bot commented Oct 23, 2025
edited
Loading

📝 Walkthrough

Walkthrough

Path resolution in the Angular preset is updated to wrap import.meta.resolve() calls with fileURLToPath() for two paths: preview-prod and docs/config. This converts URL strings to filesystem path strings without altering control flow or error handling.

Changes

Cohort / File(s) Summary
Path Resolution Wrapping
code/frameworks/angular/src/preset.ts
Wraps two import.meta.resolve() calls with fileURLToPath() to convert URL strings to filesystem paths for preview-prod and docs/config paths

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b68fa4a and f32297a.

📒 Files selected for processing (1)
  • code/frameworks/angular/src/preset.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier formatting on changed files before committing
Run ESLint on changed files and fix all errors/warnings before committing (use yarn lint:js:cmd <file>)

Files:

  • code/frameworks/angular/src/preset.ts
**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions from modules when they need to be unit-tested

Files:

  • code/frameworks/angular/src/preset.ts
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

In application code, use Storybook loggers instead of console.* (client code: storybook/internal/client-logger; server code: storybook/internal/node-logger)

Files:

  • code/frameworks/angular/src/preset.ts
{code/**,scripts/**}/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/frameworks/angular/src/preset.ts
🔇 Additional comments (2)
code/frameworks/angular/src/preset.ts (2)

19-19: LGTM! Path resolution fixed for preview-prod.

The addition of fileURLToPath() correctly converts the URL string to a filesystem path, fixing resolution issues with @storybook/builder-vite. This change is consistent with the existing pattern used for other imports in this file (lines 7, 8, 15).


26-26: LGTM! Path resolution fixed for docs config.

The addition of fileURLToPath() correctly converts the URL string to a filesystem path, matching the pattern established throughout this file and fixing resolution with Vite.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /