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

Fix storybook-vite not starting when auth.ts contains named imports after createAuth #11593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Sep 19, 2024

Fixes #11588

@arimendelow
Copy link
Contributor

Thanks for putting this together!! Tested it out with https://regexr.com:

Screenshot 2024-09-19 at 16 31 07 Screenshot 2024-09-19 at 16 30 50

Ideally this would:

  • Not have an extra space in the first case
  • Remove the comma in the second case

However, nobody should be seeing the output of this, so it's only a nit — I don't believe either of these would cause any issues :)

@ahaywood, any thoughts? This is all good from my end!

@Philzen
Copy link
Contributor Author

Philzen commented Sep 20, 2024

Ideally this would:

  • Not have an extra space in the first case
  • Remove the comma in the second case

@arimendelow Completely agree, and for a split second i was aiming for that. But then realized it increases the RegEx's complexity and really no one ever sees this (i wouldn't even know where to look for the actual generated file).

Then again, i'm surprised the transpiler stumbles over leading commas, but is fine with trailing ones. No clue if that is allowed by any leniency setting somewhere in the stack config, whether it's actually allowed by the language spec, and what the potential risk that a future RW upgrade can make the issue reappear is.

Thus, by any means, i'm happy for anyone to improve this PR in that case.

@arimendelow
Copy link
Contributor

Yup, agreed with everything you said!! I think you'd need to look at the transpiled code, ie if you turn off source maps you should see it. But yeah, nobody expects that to be pretty anyway :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: Bug in mock-auth plugin's RegEx breaks storybook-vite
2 participants