Skip to content

Commit

Permalink
refactor(main): grouping tasks related files (podman-desktop#8472)
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 authored Aug 14, 2024
1 parent d28e31e commit 84b6a7c
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/plugin/configuration-registry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { ApiSenderType } from '/@/plugin/api.js';
import type { IConfigurationNode } from './configuration-registry.js';
import { ConfigurationRegistry } from './configuration-registry.js';
import type { Directories } from './directories.js';
import type { NotificationRegistry } from './notification-registry.js';
import type { NotificationRegistry } from './tasks/notification-registry.js';
import type { Disposable } from './types/disposable.js';

let configurationRegistry: ConfigurationRegistry;
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/plugin/extension-loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ import type { InputQuickPickRegistry } from './input-quickpick/input-quickpick-r
import type { KubernetesClient } from './kubernetes-client.js';
import type { MenuRegistry } from './menu-registry.js';
import type { MessageBox } from './message-box.js';
import type { NotificationRegistry } from './notification-registry.js';
import type { OnboardingRegistry } from './onboarding-registry.js';
import type { ProgressImpl } from './progress-impl.js';
import type { ProviderRegistry } from './provider-registry.js';
import type { Proxy } from './proxy.js';
import type { ExtensionSecretStorage, SafeStorageRegistry } from './safe-storage/safe-storage-registry.js';
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
import type { NotificationRegistry } from './tasks/notification-registry.js';
import type { ProgressImpl } from './tasks/progress-impl.js';
import type { Telemetry } from './telemetry/telemetry.js';
import type { TrayMenuRegistry } from './tray-menu-registry.js';
import type { IDisposable } from './types/disposable.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/plugin/extension-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ import { InputBoxValidationSeverity, QuickPickItemKind } from './input-quickpick
import type { KubernetesClient } from './kubernetes-client.js';
import type { MessageBox } from './message-box.js';
import { ModuleLoader } from './module-loader.js';
import type { NotificationRegistry } from './notification-registry.js';
import type { OnboardingRegistry } from './onboarding-registry.js';
import type { ProgressImpl } from './progress-impl.js';
import { ProgressLocation } from './progress-impl.js';
import type { ProviderRegistry } from './provider-registry.js';
import type { Proxy } from './proxy.js';
import { createHttpPatchedModules } from './proxy-resolver.js';
Expand All @@ -74,6 +71,9 @@ import {
StatusBarItemImpl,
} from './statusbar/statusbar-item.js';
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
import type { NotificationRegistry } from './tasks/notification-registry.js';
import type { ProgressImpl } from './tasks/progress-impl.js';
import { ProgressLocation } from './tasks/progress-impl.js';
import type { Telemetry } from './telemetry/telemetry.js';
import type { TrayMenuRegistry } from './tray-menu-registry.js';
import type { IDisposable } from './types/disposable.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import type { Menu } from '/@/plugin/menu-registry.js';
import { MenuRegistry } from '/@/plugin/menu-registry.js';
import { NavigationManager } from '/@/plugin/navigation/navigation-manager.js';
import type { ExtensionBanner, RecommendedRegistry } from '/@/plugin/recommendations/recommendations-api.js';
import { TaskManager } from '/@/plugin/task-manager.js';
import { TaskManager } from '/@/plugin/tasks/task-manager.js';
import { Updater } from '/@/plugin/updater.js';
import type { CliToolInfo } from '/@api/cli-tool-info.js';
import type { ColorInfo } from '/@api/color-info.js';
Expand Down Expand Up @@ -153,16 +153,16 @@ import { LibpodApiInit } from './libpod-api-enable/libpod-api-init.js';
import type { MessageBoxOptions, MessageBoxReturnValue } from './message-box.js';
import { MessageBox } from './message-box.js';
import { NavigationItemsInit } from './navigation-items-init.js';
import { NotificationRegistry } from './notification-registry.js';
import { OnboardingRegistry } from './onboarding-registry.js';
import { OpenDevToolsInit } from './open-devtools-init.js';
import { ProgressImpl } from './progress-impl.js';
import { ProviderRegistry } from './provider-registry.js';
import { Proxy } from './proxy.js';
import { RecommendationsRegistry } from './recommendations/recommendations-registry.js';
import { SafeStorageRegistry } from './safe-storage/safe-storage-registry.js';
import type { StatusBarEntryDescriptor } from './statusbar/statusbar-registry.js';
import { StatusBarRegistry } from './statusbar/statusbar-registry.js';
import { NotificationRegistry } from './tasks/notification-registry.js';
import { ProgressImpl } from './tasks/progress-impl.js';
import { PAGE_EVENT_TYPE, Telemetry } from './telemetry/telemetry.js';
import { TerminalInit } from './terminal-init.js';
import { TrayIconColor } from './tray-icon-color.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-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.
Expand All @@ -18,10 +18,10 @@

import { beforeEach, expect, test, vi } from 'vitest';

import type { ApiSenderType } from './api.js';
import type { ApiSenderType } from '../api.js';
import { Disposable } from '../types/disposable.js';
import { NotificationRegistry } from './notification-registry.js';
import type { TaskManager } from './task-manager.js';
import { Disposable } from './types/disposable.js';

let notificationRegistry: NotificationRegistry;
const extensionId = 'myextension.id';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-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.
Expand All @@ -22,9 +22,9 @@ import { Notification } from 'electron';

import type { NotificationCard, NotificationCardOptions } from '/@api/notification.js';

import type { ApiSenderType } from './api.js';
import type { ApiSenderType } from '../api.js';
import { Disposable } from '../types/disposable.js';
import type { TaskManager } from './task-manager.js';
import { Disposable } from './types/disposable.js';

export class NotificationRegistry {
private notificationId = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-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.
Expand All @@ -23,7 +23,7 @@ import { beforeEach, expect, test, vi } from 'vitest';
import type { CommandRegistry } from '/@/plugin/command-registry.js';
import type { StatusBarRegistry } from '/@/plugin/statusbar/statusbar-registry.js';

import type { ApiSenderType } from './api.js';
import type { ApiSenderType } from '../api.js';
import { ProgressImpl, ProgressLocation } from './progress-impl.js';
import { TaskManager } from './task-manager.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2022 Red Hat, Inc.
* Copyright (C) 2022-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.
Expand All @@ -17,10 +17,9 @@
***********************************************************************/
import type * as extensionApi from '@podman-desktop/api';

import type { TaskManager } from '/@/plugin/task-manager.js';

import { findWindow } from '../util.js';
import { CancellationTokenImpl } from './cancellation-token.js';
import { findWindow } from '../../util.js';
import { CancellationTokenImpl } from '../cancellation-token.js';
import type { TaskManager } from './task-manager.js';

export enum ProgressLocation {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-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.
Expand All @@ -21,7 +21,7 @@ import { beforeEach, expect, test, vi } from 'vitest';
import type { CommandRegistry } from '/@/plugin/command-registry.js';
import type { StatusBarRegistry } from '/@/plugin/statusbar/statusbar-registry.js';

import type { ApiSenderType } from './api.js';
import type { ApiSenderType } from '../api.js';
import { TaskManager } from './task-manager.js';

const apiSenderSendMock = vi.fn();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
* Copyright (C) 2023-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.
Expand All @@ -19,9 +19,9 @@
import type { NotificationInfo } from '/@api/notification.js';
import type { NotificationTask, StatefulTask, Task } from '/@api/task.js';

import type { ApiSenderType } from './api.js';
import type { CommandRegistry } from './command-registry.js';
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
import type { ApiSenderType } from '../api.js';
import type { CommandRegistry } from '../command-registry.js';
import type { StatusBarRegistry } from '../statusbar/statusbar-registry.js';

/**
* Contribution manager to provide the list of external OCI contributions
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/plugin/updater.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { Updater } from '/@/plugin/updater.js';
import * as util from '/@/util.js';
import type { StatefulTask } from '/@api/task.js';

import type { TaskManager } from './task-manager.js';
import type { TaskManager } from './tasks/task-manager.js';

vi.mock('electron', () => ({
app: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/plugin/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Disposable } from '/@/plugin/types/disposable.js';
import { isLinux } from '/@/util.js';
import type { StatefulTask } from '/@api/task.js';

import type { TaskManager } from './task-manager.js';
import type { TaskManager } from './tasks/task-manager.js';

/**
* Represents an updater utility for Podman Desktop.
Expand Down

0 comments on commit 84b6a7c

Please sign in to comment.