Add deno support to findConfigurationFlag #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @lorenzofox3!
Thanks for such a great project. I've been using
zora
with ESBuild and it's such a breath of fresh air using tools that are so clean and so fast!What this PR does
Adds support for loading configuration flags from environment variables when running
zora
in Deno.Why
I've been using
zora
on a few projects and I really love it as a way to run tests that work in any JS environment.For one of my projects (still private, unfortunately), I'm supporting Deno.
zora
itself has been working great with Deno -- at least when using a bundler; I haven't tried running it from e.g. unpkg -- but I'd like to be able to set configuration flags using environment variables.Note that the change in this PR is just a minor DX improvement for packages that only target Node and Deno. It's not strictly necessary because Deno's supports using
window
as a global object, so doing something like this does work:It's relatively minor bit of boilerplate, and it's required when targeting browsers anyway, but I still wish I didn't need it for packages that don't intend to be run in browsers.
AFAIK, outside
findConfigurationFlags
, the rest ofzora
is Just JavaScript (:sparkles:), so I don't think Deno requires any additional changes to work withzora
. However, I totally understand that you might not want to add the burden of having to support an additional runtime. Maybe this this could be a first step towards something like "experimental support for Deno"? 🤷Anyway, thanks again for such a great project! Let me know if you have any questions.
Related
Deno.env
API