diff --git a/.env.example b/.env.example index 3905dc2c8f..cb1f6860d2 100644 --- a/.env.example +++ b/.env.example @@ -26,7 +26,8 @@ BUZZ_DEV_VIEWER= # Optional public Builderlab URL, exposed as import.meta.env.VITE_BUZZ_BUILDERLAB_URL. # Read by Vite from .env.local or the build process environment (process wins, -# including empty). Unset means empty; no deployment URL is supplied by the repo. +# including empty). Defaults to https://app.builderlab.xyz; set an empty value +# to disable Builderlab sign-in and the bundled plugin's native grants. # Packaging embeds the value; changing the launched app's environment has no effect. # Restart Vite for development changes; rebuild/repackage for distributed apps. # BUZZ_BUILDERLAB_URL=https://builderlab.example.com diff --git a/browser-host/vite-config.test.mjs b/browser-host/vite-config.test.mjs index 78406b929e..5f5f1e45ba 100644 --- a/browser-host/vite-config.test.mjs +++ b/browser-host/vite-config.test.mjs @@ -139,6 +139,21 @@ it("loads the broker's Vite config without native-compatibility warnings", () => ); } delete process.env.BUZZ_DATABRICKS_HOST; + // A fresh checkout uses production for both dev and packaged frontends. + // Explicit empty values retain the deployment opt-out. + for (const local of ['', 'BUZZ_BUILDERLAB_URL=']) { + writeFileSync('.env.local', local); + delete process.env.BUZZ_BUILDERLAB_URL; + for (const command of ['serve', 'build']) { + const result = await loadConfigFromFile( + { command, mode: command === 'serve' ? 'development' : 'production' }, configFile, + ); + assert.equal( + result.config.define['import.meta.env.VITE_BUZZ_BUILDERLAB_URL'], + JSON.stringify(local ? '' : 'https://app.builderlab.xyz'), + ); + } + } // Desktop shares .env.local/process inputs with the native build. // An explicit empty process value clears the frontend URL too. writeFileSync('.env.local', 'BUZZ_BUILDERLAB_URL=https://app.builderlab.xyz/'); diff --git a/crates/plugin-manager/build.rs b/crates/plugin-manager/build.rs index 73647367d8..e5902ec728 100644 --- a/crates/plugin-manager/build.rs +++ b/crates/plugin-manager/build.rs @@ -10,7 +10,7 @@ fn builderlab_origin(local: &Path, process: Option) -> Result + expect(screen.getByRole("option", { selected: true })).toHaveFocus(), + ); await user.keyboard("{End}{Enter}"); fireEvent.change(screen.getByLabelText("Reminder date"), { target: { value: "" }, diff --git a/vite.config.ts b/vite.config.ts index a0b36b7e01..872901c8cd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -86,7 +86,7 @@ export default defineConfig(async ({ command, mode }) => { ), "import.meta.env.VITE_BUZZ_COMMUNITY_ALIASES": JSON.stringify(aliases), "import.meta.env.VITE_BUZZ_BUILDERLAB_URL": JSON.stringify( - env.BUZZ_BUILDERLAB_URL ?? "", + env.BUZZ_BUILDERLAB_URL ?? "https://app.builderlab.xyz", ), "import.meta.env.VITE_BUZZ_OPEN_RELAY": JSON.stringify(openOrigin), "import.meta.env.VITE_BUZZ_DATABRICKS_HOST":