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

Merged
merged 5 commits into from
Sep 23, 2024

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

@Josh-Walker-GM Josh-Walker-GM added the release:fix This PR is a fix label Sep 23, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the next-release-patch milestone Sep 23, 2024
@Josh-Walker-GM Josh-Walker-GM enabled auto-merge (squash) September 23, 2024 20:25
@Josh-Walker-GM Josh-Walker-GM merged commit 87f6441 into redwoodjs:main Sep 23, 2024
50 checks passed
Josh-Walker-GM pushed a commit that referenced this pull request Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

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