Skip to content

Commit

Permalink
[PM-16838] Fix bad imports for shared and platform code (#12743)
Browse files Browse the repository at this point in the history
Imports containing /src/ are forbidden.
  • Loading branch information
Hinton authored Jan 8, 2025
1 parent 244539c commit 3949aae
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion apps/browser/src/background/runtime.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { ProcessReloadServiceAbstraction } from "@bitwarden/common/key-managemen
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { MessageListener, isExternalMessage } from "@bitwarden/common/platform/messaging";
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { CipherType } from "@bitwarden/common/vault/enums";
import { BiometricsCommands } from "@bitwarden/key-management";

import { MessageListener, isExternalMessage } from "../../../../libs/common/src/platform/messaging";
import {
closeUnlockPopout,
openSsoAuthResultPopout,
Expand Down
2 changes: 1 addition & 1 deletion apps/browser/src/popup/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from "@bitwarden/angular/auth/guards";
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
import { extensionRefreshSwap } from "@bitwarden/angular/utils/extension-refresh-swap";
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
import {
AnonLayoutWrapperComponent,
Expand Down Expand Up @@ -49,7 +50,6 @@ import {
VaultIcons,
} from "@bitwarden/vault";

import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
import { fido2AuthGuard } from "../auth/guards/fido2-auth.guard";
import { AccountSwitcherComponent } from "../auth/popup/account-switching/account-switcher.component";
import { EnvironmentComponent } from "../auth/popup/environment.component";
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
unauthGuardFn,
} from "@bitwarden/angular/auth/guards";
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
import { twofactorRefactorSwap } from "@bitwarden/angular/utils/two-factor-component-refactor-route-swap";
import { NewDeviceVerificationNoticeGuard } from "@bitwarden/angular/vault/guards";
import {
AnonLayoutWrapperComponent,
Expand Down Expand Up @@ -46,7 +47,6 @@ import {
VaultIcons,
} from "@bitwarden/vault";

import { twofactorRefactorSwap } from "../../../../libs/angular/src/utils/two-factor-component-refactor-route-swap";
import { AccessibilityCookieComponent } from "../auth/accessibility-cookie.component";
import { maxAccountsGuardFn } from "../auth/guards/max-accounts.guard";
import { HintComponent } from "../auth/hint.component";
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/platform/services/electron-key.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
BiometricStateService,
} from "@bitwarden/key-management";

import { DesktopBiometricsService } from "src/key-management/biometrics/desktop.biometrics.service";
import { DesktopBiometricsService } from "../../key-management/biometrics/desktop.biometrics.service";

export class ElectronKeyService extends DefaultKeyService {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { By } from "@angular/platform-browser";
import { mock } from "jest-mock-extended";
import { of } from "rxjs";

import { SharedModule } from "@bitwarden/components/src/shared";
import { IntegrationCardComponent } from "@bitwarden/web-vault/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component";
import { IntegrationGridComponent } from "@bitwarden/web-vault/app/admin-console/organizations/shared/components/integrations/integration-grid/integration-grid.component";
import {} from "@bitwarden/web-vault/app/shared";

import { SYSTEM_THEME_OBSERVABLE } from "../../../../../../libs/angular/src/services/injection-tokens";
import { I18nService } from "../../../../../../libs/common/src/platform/abstractions/i18n.service";
import { ThemeType } from "../../../../../../libs/common/src/platform/enums";
import { ThemeStateService } from "../../../../../../libs/common/src/platform/theming/theme-state.service";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { SYSTEM_THEME_OBSERVABLE } from "@bitwarden/angular/services/injection-tokens";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { ThemeType } from "@bitwarden/common/platform/enums";
import { ThemeStateService } from "@bitwarden/common/platform/theming/theme-state.service";
import { IntegrationCardComponent } from "@bitwarden/web-vault/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component";
import { IntegrationGridComponent } from "@bitwarden/web-vault/app/admin-console/organizations/shared/components/integrations/integration-grid/integration-grid.component";

import { IntegrationsComponent } from "./integrations.component";

Expand All @@ -34,7 +34,7 @@ describe("IntegrationsComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [IntegrationsComponent, MockHeaderComponent, MockNewMenuComponent],
imports: [IntegrationGridComponent, IntegrationCardComponent, SharedModule],
imports: [JslibModule, IntegrationGridComponent, IntegrationCardComponent],
providers: [
{
provide: I18nService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { mock } from "jest-mock-extended";
import { firstValueFrom, Observable } from "rxjs";

// FIXME: remove `/apps` import from `/libs`
// eslint-disable-next-line import/no-restricted-paths
import { flushPromises } from "@bitwarden/browser/src/autofill/spec/testing-utils";

import { Fido2CredentialView } from "../../../vault/models/view/fido2-credential.view";

import { Fido2ActiveRequestManager } from "./fido2-active-request-manager";

// Duplicated from `apps/browser/src/autofill/spec/testing-utils.ts`.
const scheduler = typeof setImmediate === "function" ? setImmediate : setTimeout;
function flushPromises() {
return new Promise(function (resolve) {
scheduler(resolve);
});
}

jest.mock("rxjs", () => {
const rxjs = jest.requireActual("rxjs");
const { firstValueFrom } = rxjs;
Expand Down

0 comments on commit 3949aae

Please sign in to comment.