Skip to content

Commit

Permalink
fix: breake cycle in dependencies (#119)
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <dgolovin@redhat.com>
  • Loading branch information
dgolovin authored Apr 23, 2024
1 parent f97815d commit ebf5eae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/

import { beforeAll, beforeEach, expect, suite, test, vi } from 'vitest';
import { TelemetryLogger as ExtensionTelemetryLogger, activate } from './extension';
import { beforeEach, expect, suite, test, vi } from 'vitest';
import { activate } from './extension';
import {
AuthenticationGetSessionOptions,
TelemetryLogger,
ExtensionContext,
AuthenticationSession,
ProgressLocation,
configuration,
} from '@podman-desktop/api';
import { authentication, commands } from '@podman-desktop/api';
import * as podmanCli from './podman-cli';
import { exec } from 'child_process';
import { ExtensionTelemetryLogger } from './telemetry';

vi.mock('@podman-desktop/api', async () => {
return {
Expand Down
3 changes: 1 addition & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import {
import { SubscriptionManagerClient } from '@redhat-developer/rhsm-client';
import { isLinux } from './util';
import { SSOStatusBarItem } from './status-bar-item';

export const TelemetryLogger = extensionApi.env.createTelemetryLogger();
import { ExtensionTelemetryLogger as TelemetryLogger } from './telemetry';

let authenticationServicePromise: Promise<RedHatAuthenticationService>;
let currentSession: extensionApi.AuthenticationSession | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/podman-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
***********************************************************************/
import { isMac, isWindows } from './util';
import * as extensionApi from '@podman-desktop/api';
import { TelemetryLogger } from './extension';
import { ExtensionTelemetryLogger as TelemetryLogger } from './telemetry';

const macosExtraPath = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';

Expand Down
21 changes: 21 additions & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**********************************************************************
* Copyright (C) 2024 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/

import { env } from '@podman-desktop/api';

export const ExtensionTelemetryLogger = env.createTelemetryLogger();

0 comments on commit ebf5eae

Please sign in to comment.