[Unified Recorder] Load the env file by default#19139
[Unified Recorder] Load the env file by default#19139HarshaNalluru merged 7 commits intoAzure:mainfrom
Conversation
… harshan/load-env-by-default
timovv
left a comment
There was a problem hiding this comment.
Looks good.
Getting a bit of deja vu here :)
| export { relativeRecordingsPath } from "./utils/relativePathCalculator"; | ||
| export { SanitizerOptions, RecorderStartOptions } from "./utils/utils"; | ||
| export { NoOpCredential } from "./recorderAADCredential"; | ||
| export { env } from "@azure-tools/test-recorder"; |
There was a problem hiding this comment.
Why do we need to export env from the old recorder?
There was a problem hiding this comment.
Think this should be exporting from ./utils/env instead
There was a problem hiding this comment.
I can redeclare env.
| import * as dotenv from "dotenv"; | ||
|
|
||
| // Initialize the environment | ||
| dotenv.config(); |
There was a problem hiding this comment.
how is this executed? Is the intent that users do import "@azure-tools/recorder-new" to get this loaded?
There was a problem hiding this comment.
yes, that's the intention.
Or when you import anything from recorder-new
jeremymeng
left a comment
There was a problem hiding this comment.
Looks good! Nice to not having to load env by myself
|
|
||
| // In the browser, we load the env variables with the help of karma.conf.js | ||
|
|
||
| export const env = (window as any).__env__; |
There was a problem hiding this comment.
Should this throw with a descriptive message if karma config did not load the env vars?
There was a problem hiding this comment.
This file shouldn't know if the karma.conf has loaded the variables or not.
There was a problem hiding this comment.
If a certain variable is undefined, we'll know from the test failure anyways.
As the title says, loads the .env file for the packages by default.
Fixes #19140