1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-24646] Add licensed browser builds (#16252)

* feat: create separate bit licensed browser

* feat: refactor webpack config

* fix: mv2 build not working

* feat: add bit versions of all commands

* feat: add bit CI builds

* fix: scss missing from build
This commit is contained in:
Andreas Coroiu
2025-09-04 08:21:50 +02:00
committed by GitHub
parent 54eb54483f
commit b957a0c28f
20 changed files with 738 additions and 461 deletions

View File

@@ -0,0 +1,9 @@
import OssMainBackground from "@bitwarden/browser/background/main.background";
export default class MainBackground {
private ossMain = new OssMainBackground();
async bootstrap() {
await this.ossMain.bootstrap();
}
}

View File

@@ -0,0 +1,7 @@
import { ConsoleLogService } from "@bitwarden/common/platform/services/console-log.service";
import MainBackground from "../background/main.background";
const logService = new ConsoleLogService(false);
const bitwardenMain = ((self as any).bitwardenMain = new MainBackground());
bitwardenMain.bootstrap().catch((error) => logService.error(error));

View File

@@ -0,0 +1,10 @@
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}

View File

@@ -0,0 +1,14 @@
import { Component, OnInit } from "@angular/core";
import { AppComponent as BaseAppComponent } from "@bitwarden/browser/popup/app.component";
@Component({
selector: "app-root",
templateUrl: "../../../../apps/browser/src/popup/app.component.html",
standalone: false,
})
export class AppComponent extends BaseAppComponent implements OnInit {
ngOnInit() {
return super.ngOnInit();
}
}

View File

@@ -0,0 +1,39 @@
import { OverlayModule } from "@angular/cdk/overlay";
import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router";
import { JslibModule } from "@bitwarden/angular/jslib.module";
// import { AppRoutingAnimationsModule } from "@bitwarden/browser/popup/app-routing-animations";
import { AppRoutingModule as OssRoutingModule } from "@bitwarden/browser/popup/app-routing.module";
import { AppModule as OssModule } from "@bitwarden/browser/popup/app.module";
// import { WildcardRoutingModule } from "@bitwarden/browser/popup/wildcard-routing.module";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
/**
* This is the AppModule for the commercial version of Bitwarden.
* `apps/browser/app.module.ts` contains the OSS version.
*
* You probably do not want to modify this file. Consider editing `oss.module.ts` instead.
*/
@NgModule({
imports: [
CommonModule,
OverlayModule,
OssModule,
JslibModule,
// BrowserAnimationsModule,
// FormsModule,
// ReactiveFormsModule,
// CoreModule,
// DragDropModule,
AppRoutingModule,
OssRoutingModule,
RouterModule,
// WildcardRoutingModule, // Needs to be last to catch all non-existing routes
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}

View File

@@ -0,0 +1,26 @@
import { enableProdMode } from "@angular/core";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { PopupSizeService } from "@bitwarden/browser/platform/popup/layout/popup-size.service";
import { BrowserPlatformUtilsService } from "@bitwarden/browser/platform/services/platform-utils/browser-platform-utils.service";
import { AppModule } from "./app.module";
import "@bitwarden/browser/popup/scss";
// We put these first to minimize the delay in window changing.
PopupSizeService.initBodyWidthFromLocalStorage();
// Should be removed once we deprecate support for Safari 16.0 and older. See Jira ticket [PM-1861]
if (BrowserPlatformUtilsService.shouldApplySafariHeightFix(window)) {
document.documentElement.classList.add("safari_height_fix");
}
if (process.env.ENV === "production") {
enableProdMode();
}
function init() {
void platformBrowserDynamic().bootstrapModule(AppModule);
}
init();