Skip to content

Commit 84b6a7c

Browse files
authored
refactor(main): grouping tasks related files (podman-desktop#8472)
Signed-off-by: axel7083 <[email protected]>
1 parent d28e31e commit 84b6a7c

12 files changed

+29
-30
lines changed

packages/main/src/plugin/configuration-registry.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { ApiSenderType } from '/@/plugin/api.js';
2525
import type { IConfigurationNode } from './configuration-registry.js';
2626
import { ConfigurationRegistry } from './configuration-registry.js';
2727
import type { Directories } from './directories.js';
28-
import type { NotificationRegistry } from './notification-registry.js';
28+
import type { NotificationRegistry } from './tasks/notification-registry.js';
2929
import type { Disposable } from './types/disposable.js';
3030

3131
let configurationRegistry: ConfigurationRegistry;

packages/main/src/plugin/extension-loader.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ import type { InputQuickPickRegistry } from './input-quickpick/input-quickpick-r
5757
import type { KubernetesClient } from './kubernetes-client.js';
5858
import type { MenuRegistry } from './menu-registry.js';
5959
import type { MessageBox } from './message-box.js';
60-
import type { NotificationRegistry } from './notification-registry.js';
6160
import type { OnboardingRegistry } from './onboarding-registry.js';
62-
import type { ProgressImpl } from './progress-impl.js';
6361
import type { ProviderRegistry } from './provider-registry.js';
6462
import type { Proxy } from './proxy.js';
6563
import type { ExtensionSecretStorage, SafeStorageRegistry } from './safe-storage/safe-storage-registry.js';
6664
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
65+
import type { NotificationRegistry } from './tasks/notification-registry.js';
66+
import type { ProgressImpl } from './tasks/progress-impl.js';
6767
import type { Telemetry } from './telemetry/telemetry.js';
6868
import type { TrayMenuRegistry } from './tray-menu-registry.js';
6969
import type { IDisposable } from './types/disposable.js';

packages/main/src/plugin/extension-loader.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ import { InputBoxValidationSeverity, QuickPickItemKind } from './input-quickpick
5959
import type { KubernetesClient } from './kubernetes-client.js';
6060
import type { MessageBox } from './message-box.js';
6161
import { ModuleLoader } from './module-loader.js';
62-
import type { NotificationRegistry } from './notification-registry.js';
6362
import type { OnboardingRegistry } from './onboarding-registry.js';
64-
import type { ProgressImpl } from './progress-impl.js';
65-
import { ProgressLocation } from './progress-impl.js';
6663
import type { ProviderRegistry } from './provider-registry.js';
6764
import type { Proxy } from './proxy.js';
6865
import { createHttpPatchedModules } from './proxy-resolver.js';
@@ -74,6 +71,9 @@ import {
7471
StatusBarItemImpl,
7572
} from './statusbar/statusbar-item.js';
7673
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
74+
import type { NotificationRegistry } from './tasks/notification-registry.js';
75+
import type { ProgressImpl } from './tasks/progress-impl.js';
76+
import { ProgressLocation } from './tasks/progress-impl.js';
7777
import type { Telemetry } from './telemetry/telemetry.js';
7878
import type { TrayMenuRegistry } from './tray-menu-registry.js';
7979
import type { IDisposable } from './types/disposable.js';

packages/main/src/plugin/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import type { Menu } from '/@/plugin/menu-registry.js';
5656
import { MenuRegistry } from '/@/plugin/menu-registry.js';
5757
import { NavigationManager } from '/@/plugin/navigation/navigation-manager.js';
5858
import type { ExtensionBanner, RecommendedRegistry } from '/@/plugin/recommendations/recommendations-api.js';
59-
import { TaskManager } from '/@/plugin/task-manager.js';
59+
import { TaskManager } from '/@/plugin/tasks/task-manager.js';
6060
import { Updater } from '/@/plugin/updater.js';
6161
import type { CliToolInfo } from '/@api/cli-tool-info.js';
6262
import type { ColorInfo } from '/@api/color-info.js';
@@ -153,16 +153,16 @@ import { LibpodApiInit } from './libpod-api-enable/libpod-api-init.js';
153153
import type { MessageBoxOptions, MessageBoxReturnValue } from './message-box.js';
154154
import { MessageBox } from './message-box.js';
155155
import { NavigationItemsInit } from './navigation-items-init.js';
156-
import { NotificationRegistry } from './notification-registry.js';
157156
import { OnboardingRegistry } from './onboarding-registry.js';
158157
import { OpenDevToolsInit } from './open-devtools-init.js';
159-
import { ProgressImpl } from './progress-impl.js';
160158
import { ProviderRegistry } from './provider-registry.js';
161159
import { Proxy } from './proxy.js';
162160
import { RecommendationsRegistry } from './recommendations/recommendations-registry.js';
163161
import { SafeStorageRegistry } from './safe-storage/safe-storage-registry.js';
164162
import type { StatusBarEntryDescriptor } from './statusbar/statusbar-registry.js';
165163
import { StatusBarRegistry } from './statusbar/statusbar-registry.js';
164+
import { NotificationRegistry } from './tasks/notification-registry.js';
165+
import { ProgressImpl } from './tasks/progress-impl.js';
166166
import { PAGE_EVENT_TYPE, Telemetry } from './telemetry/telemetry.js';
167167
import { TerminalInit } from './terminal-init.js';
168168
import { TrayIconColor } from './tray-icon-color.js';

packages/main/src/plugin/notification-registry.spec.ts packages/main/src/plugin/tasks/notification-registry.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2023 Red Hat, Inc.
2+
* Copyright (C) 2023-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the 'License');
55
* you may not use this file except in compliance with the License.
@@ -18,10 +18,10 @@
1818

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

21-
import type { ApiSenderType } from './api.js';
21+
import type { ApiSenderType } from '../api.js';
22+
import { Disposable } from '../types/disposable.js';
2223
import { NotificationRegistry } from './notification-registry.js';
2324
import type { TaskManager } from './task-manager.js';
24-
import { Disposable } from './types/disposable.js';
2525

2626
let notificationRegistry: NotificationRegistry;
2727
const extensionId = 'myextension.id';

packages/main/src/plugin/notification-registry.ts packages/main/src/plugin/tasks/notification-registry.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2023 Red Hat, Inc.
2+
* Copyright (C) 2023-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@ import { Notification } from 'electron';
2222

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

25-
import type { ApiSenderType } from './api.js';
25+
import type { ApiSenderType } from '../api.js';
26+
import { Disposable } from '../types/disposable.js';
2627
import type { TaskManager } from './task-manager.js';
27-
import { Disposable } from './types/disposable.js';
2828

2929
export class NotificationRegistry {
3030
private notificationId = 0;

packages/main/src/plugin/progress-impl.spec.ts packages/main/src/plugin/tasks/progress-impl.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2023 Red Hat, Inc.
2+
* Copyright (C) 2023-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import { beforeEach, expect, test, vi } from 'vitest';
2323
import type { CommandRegistry } from '/@/plugin/command-registry.js';
2424
import type { StatusBarRegistry } from '/@/plugin/statusbar/statusbar-registry.js';
2525

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

packages/main/src/plugin/progress-impl.ts packages/main/src/plugin/tasks/progress-impl.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2022 Red Hat, Inc.
2+
* Copyright (C) 2022-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,10 +17,9 @@
1717
***********************************************************************/
1818
import type * as extensionApi from '@podman-desktop/api';
1919

20-
import type { TaskManager } from '/@/plugin/task-manager.js';
21-
22-
import { findWindow } from '../util.js';
23-
import { CancellationTokenImpl } from './cancellation-token.js';
20+
import { findWindow } from '../../util.js';
21+
import { CancellationTokenImpl } from '../cancellation-token.js';
22+
import type { TaskManager } from './task-manager.js';
2423

2524
export enum ProgressLocation {
2625
/**

packages/main/src/plugin/task-manager.spec.ts packages/main/src/plugin/tasks/task-manager.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2023 Red Hat, Inc.
2+
* Copyright (C) 2023-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import { beforeEach, expect, test, vi } from 'vitest';
2121
import type { CommandRegistry } from '/@/plugin/command-registry.js';
2222
import type { StatusBarRegistry } from '/@/plugin/statusbar/statusbar-registry.js';
2323

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

2727
const apiSenderSendMock = vi.fn();

packages/main/src/plugin/task-manager.ts packages/main/src/plugin/tasks/task-manager.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************
2-
* Copyright (C) 2023 Red Hat, Inc.
2+
* Copyright (C) 2023-2024 Red Hat, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
1919
import type { NotificationInfo } from '/@api/notification.js';
2020
import type { NotificationTask, StatefulTask, Task } from '/@api/task.js';
2121

22-
import type { ApiSenderType } from './api.js';
23-
import type { CommandRegistry } from './command-registry.js';
24-
import type { StatusBarRegistry } from './statusbar/statusbar-registry.js';
22+
import type { ApiSenderType } from '../api.js';
23+
import type { CommandRegistry } from '../command-registry.js';
24+
import type { StatusBarRegistry } from '../statusbar/statusbar-registry.js';
2525

2626
/**
2727
* Contribution manager to provide the list of external OCI contributions

packages/main/src/plugin/updater.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { Updater } from '/@/plugin/updater.js';
3232
import * as util from '/@/util.js';
3333
import type { StatefulTask } from '/@api/task.js';
3434

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

3737
vi.mock('electron', () => ({
3838
app: {

packages/main/src/plugin/updater.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { Disposable } from '/@/plugin/types/disposable.js';
3434
import { isLinux } from '/@/util.js';
3535
import type { StatefulTask } from '/@api/task.js';
3636

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

3939
/**
4040
* Represents an updater utility for Podman Desktop.

0 commit comments

Comments
 (0)