-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(env): setup env prefix and typescript for client-side #584
Conversation
@jacobhq can you write few lines about why you needed to export a type from |
Sure thing! Vite provides some stuff (including env vars) on an object called Without this change, typescript had no idea about what was inside /// <reference types="vite/client" /> This works in vite projects, because vite exists as a dependency, but in tuono projects, vite is a dependency of tuono, so this doesn't work. I fixed this by importing client in Hope that was useful. I had a long session last night trying to fix this, so it is fresh in my mind :) |
TL;DR; By adding
Check The major benefit of this is that we avoid users creating this kind of file inside their apps. Kudos to @jacobhq for resolving this using this approach! |
Thanks @jacobhq for the explanation. Great work with that! |
No worries :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Checklist
Related issue
Fixes #587
Overview
Vite env prefix (
TUONO_PUBLIC_
), and set up support for env clientside (no extra work apart from fixing TS issues that exist at the moment), and write tests (fixing also the typescript errors)