-
Notifications
You must be signed in to change notification settings - Fork 432
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(cli): add support for import.meta.env
#5617
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Full Report@sanity/migrate
@sanity/diff
@sanity/block-tools
@sanity/types
sanity/desk
@sanity/portable-text-editor
@sanity/mutator
@sanity/cli
@sanity/util/legacyDateFormat
@sanity/schema/_internal
@sanity/util/paths
sanity/router
@sanity/schema
sanity/structure
sanity/cli
@sanity/vision
@sanity/util/fs
sanity/_internal
@sanity/util/createSafeJsonParser
sanity/_internalBrowser
@sanity/util/content
sanity
|
Component Testing Report Updated Jan 30, 2024 9:14 PM (UTC)
|
Eh may not be the best idea to release this without properly populating |
import.meta.env
import.meta.env
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.
I think that should work, yeah?
// define the `process.env` global | ||
...getStudioEnvironmentVariables({prefix: 'process.env.', jsonEncode: true}), |
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.
Not actually sure if this one is needed, given we're already in an environment with process.env
defined - maybe if the .env
files and such is not already loaded?
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.
added as a safety mechanism, since process.env
is not a browser thing right?
Description
The following adds minimal support for
import.meta.env
inside of the mock browser environment used in the CLI.What to review
Does it work?
Testing
I added an import.meta.env usage in the test-studio and ran the command.
Notes for release
import.meta.env
to break the mock browser environment used in the CLI.