fix: add biome overrides for embed-core to prevent auto-import of node:process (#27387)
* fix: use import.meta.env instead of process.env in embed.ts Using import.meta.env is Vite's native way to handle environment variables in browser bundles. This prevents biome from auto-adding 'import process from node:process' which breaks the embed.js in browsers. Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com> * Remove unncessar comment * fix: migrate remaining process.env to import.meta.env in embed.ts Complete the migration started by @hariombalhara by also converting process.env usages at lines 1681, 1682, and 1700 to import.meta.env. Update env.d.ts to include EMBED_PUBLIC_EMBED_FINGER_PRINT, EMBED_PUBLIC_EMBED_VERSION, and INTEGRATION_TEST_MODE types. This ensures no process.env references remain in embed.ts, fully preventing Biome from auto-adding import process from node:process. Co-Authored-By: unknown <> * fix: add biome overrides for embed-core to prevent auto-import of node:process Reverts import.meta.env back to process.env since API V2's tsconfig uses module: commonjs which doesn't support import.meta. Instead, adds biome overrides for embed-core to disable useNodejsImportProtocol, noProcessEnv, and noProcessGlobal rules that were causing biome to auto-add 'import process from node:process' on save. Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
2 files changed
+17
-4
No files matched your search
+14
@@ -177,6 +177,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"includes": ["packages/embeds/embed-core/**/*.{ts,tsx,js,jsx}"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"style": {
|
||||
"useNodejsImportProtocol": "off",
|
||||
"noProcessEnv": "off"
|
||||
},
|
||||
"correctness": {
|
||||
"noProcessGlobal": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"includes": ["apps/api/v2/**/*.ts", "apps/api/v2/**/*.controller.ts"],
|
||||
"linter": {
|
||||
|
||||
@@ -236,7 +236,7 @@ export class Cal {
|
||||
/**
|
||||
* Commands for which the queue persists across iframe resets
|
||||
*/
|
||||
commandsPersistAcrossIframeResets: DoInIframeArg['method'][] = ["ui"];
|
||||
commandsPersistAcrossIframeResets: DoInIframeArg["method"][] = ["ui"];
|
||||
|
||||
isPrerendering?: boolean;
|
||||
|
||||
@@ -374,7 +374,7 @@ export class Cal {
|
||||
|
||||
// Very Important: Reset iframe ready flag and clear queue, as iframe might load a fresh URL and we need to check correctly when it is ready.
|
||||
this.iframeReset();
|
||||
|
||||
|
||||
if (iframe.src === urlInstance.toString()) {
|
||||
// Ensure reload occurs even if the url is same - Though browser normally does it, but would be better to ensure it
|
||||
// This param has no other purpose except to ensure forced reload.
|
||||
@@ -414,7 +414,7 @@ export class Cal {
|
||||
|
||||
resetQueue() {
|
||||
// Only keep UI related instructions in the queue, as we want to ensure that newly loaded iframe has the same UI configuration applied automatically
|
||||
this.iframeDoQueue = this.iframeDoQueue.filter((doInIframeArg) =>
|
||||
this.iframeDoQueue = this.iframeDoQueue.filter((doInIframeArg) =>
|
||||
this.commandsPersistAcrossIframeResets.includes(doInIframeArg.method)
|
||||
);
|
||||
}
|
||||
@@ -1500,7 +1500,6 @@ class CalApi {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
this.cal.doInIframe({ method: "ui", arg: uiConfig });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user