Skip to content

Commit d9c8dca

Browse files
authored
chore: remove dead task runner code (#1938)
1 parent 0c58bfc commit d9c8dca

10 files changed

Lines changed: 0 additions & 359 deletions

File tree

src/ambient.d.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type * as MonacoType from 'monaco-editor';
22

33
import {
4-
BisectRequest,
54
BlockableAccelerator,
65
DownloadVersionParams,
76
EditorValues,
@@ -13,17 +12,14 @@ import {
1312
InstallStateEvent,
1413
MessageOptions,
1514
NodeTypes,
16-
OutputEntry,
1715
PMOperationOptions,
1816
PackageJsonOptions,
1917
ProgressObject,
2018
ReleaseInfo,
21-
RunResult,
2219
RunnableVersion,
2320
SelectedLocalVersion,
2421
SemVer,
2522
StartFiddleParams,
26-
TestRequest,
2723
Version,
2824
} from './interfaces';
2925
import { App } from './renderer/app';
@@ -39,11 +35,6 @@ declare global {
3935
listener: () => void,
4036
options?: { signal: AbortSignal },
4137
): void;
42-
addEventListener(
43-
type: 'bisect-task',
44-
listener: (request: BisectRequest) => void,
45-
options?: { signal: AbortSignal },
46-
): void;
4738
addEventListener(
4839
type: 'execute-monaco-command',
4940
listener: (commandId: string, opts?: Partial<{ all: boolean }>) => void,
@@ -78,11 +69,6 @@ declare global {
7869
type: 'saved-local-fiddle',
7970
listener: (filePath: string) => void,
8071
): void;
81-
addEventListener(
82-
type: 'test-task',
83-
listener: (request: TestRequest) => void,
84-
options?: { signal: AbortSignal },
85-
): void;
8672
addEventListener(
8773
type: 'toggle-monaco-option',
8874
listener: (path: string) => void,
@@ -157,7 +143,6 @@ declare global {
157143
command: string,
158144
): Promise<string>;
159145
platform: string;
160-
pushOutputEntry(entry: OutputEntry): void;
161146
readThemeFile(name: string): Promise<LoadedFiddleTheme | null>;
162147
reloadWindows(): void;
163148
removeAllListeners(type: FiddleEvent): void;
@@ -171,7 +156,6 @@ declare global {
171156
showWindow(): void;
172157
startFiddle(params: StartFiddleParams): Promise<void>;
173158
stopFiddle(): void;
174-
taskDone(result: RunResult): void;
175159
themePath: string;
176160
uncacheTypes(ver: RunnableVersion): Promise<void>;
177161
unwatchElectronTypes(): Promise<void>;

src/interfaces.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,6 @@ export interface SetupRequest {
8989
useObsolete?: boolean;
9090
}
9191

92-
export interface BisectRequest {
93-
setup: SetupRequest;
94-
goodVersion: string;
95-
badVersion: string;
96-
}
97-
98-
export interface TestRequest {
99-
setup: SetupRequest;
100-
}
101-
10292
export interface OutputEntry {
10393
text: string;
10494
timeString: string;
@@ -175,7 +165,6 @@ export interface SelectedLocalVersion {
175165

176166
export type FiddleEvent =
177167
| 'before-quit'
178-
| 'bisect-task'
179168
| 'clear-console'
180169
| 'electron-types-changed'
181170
| 'execute-monaco-command'
@@ -197,7 +186,6 @@ export type FiddleEvent =
197186
| 'select-all-in-editor'
198187
| 'set-show-me-template'
199188
| 'show-welcome-tour'
200-
| 'test-task'
201189
| 'toggle-bisect'
202190
| 'toggle-monaco-option'
203191
| 'undo-in-editor'

src/ipc-events.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ export enum IpcEvents {
2626
BLOCK_ACCELERATORS = 'BLOCK_ACCELERATORS',
2727
SET_SHOW_ME_TEMPLATE = 'SET_SHOW_ME_TEMPLATE',
2828
CLICK_TITLEBAR_MAC = 'CLICK_TITLEBAR_MAC',
29-
TASK_BISECT = 'TASK_BISECT',
30-
TASK_TEST = 'TASK_TEST',
31-
TASK_DONE = 'TASK_DONE',
32-
OUTPUT_ENTRY = 'OUTPUT_ENTRY',
3329
RELOAD_WINDOW = 'RELOAD_WINDOW',
3430
SET_NATIVE_THEME = 'SET_NATIVE_THEME',
3531
SHOW_WINDOW = 'SHOW_WINDOW',
@@ -94,8 +90,6 @@ export const ipcMainEvents = [
9490
IpcEvents.SET_SHOW_ME_TEMPLATE,
9591
IpcEvents.BLOCK_ACCELERATORS,
9692
IpcEvents.CLICK_TITLEBAR_MAC,
97-
IpcEvents.OUTPUT_ENTRY,
98-
IpcEvents.TASK_DONE,
9993
IpcEvents.RELOAD_WINDOW,
10094
IpcEvents.SET_NATIVE_THEME,
10195
IpcEvents.SHOW_WINDOW,

src/preload/preload.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import {
99
Files,
1010
IPackageManager,
1111
MessageOptions,
12-
OutputEntry,
1312
PMOperationOptions,
1413
PackageJsonOptions,
15-
RunResult,
1614
RunnableVersion,
1715
StartFiddleParams,
1816
Version,
@@ -22,7 +20,6 @@ import { FiddleTheme } from '../themes-defaults';
2220

2321
const channelMapping: Record<FiddleEvent, IpcEvents> = {
2422
'before-quit': IpcEvents.BEFORE_QUIT,
25-
'bisect-task': IpcEvents.TASK_BISECT,
2623
'clear-console': IpcEvents.CLEAR_CONSOLE,
2724
'electron-types-changed': IpcEvents.ELECTRON_TYPES_CHANGED,
2825
'execute-monaco-command': IpcEvents.MONACO_EXECUTE_COMMAND,
@@ -44,7 +41,6 @@ const channelMapping: Record<FiddleEvent, IpcEvents> = {
4441
'select-all-in-editor': IpcEvents.SELECT_ALL_IN_EDITOR,
4542
'set-show-me-template': IpcEvents.SET_SHOW_ME_TEMPLATE,
4643
'show-welcome-tour': IpcEvents.SHOW_WELCOME_TOUR,
47-
'test-task': IpcEvents.TASK_TEST,
4844
'toggle-bisect': IpcEvents.BISECT_COMMANDS_TOGGLE,
4945
'toggle-monaco-option': IpcEvents.MONACO_TOGGLE_OPTION,
5046
'undo-in-editor': IpcEvents.UNDO_IN_EDITOR,
@@ -205,9 +201,6 @@ export async function setupFiddleGlobal() {
205201
);
206202
},
207203
platform: process.platform,
208-
pushOutputEntry(entry: OutputEntry) {
209-
ipcRenderer.send(IpcEvents.OUTPUT_ENTRY, entry);
210-
},
211204
reloadWindows() {
212205
ipcRenderer.send(IpcEvents.RELOAD_WINDOW);
213206
},
@@ -252,9 +245,6 @@ export async function setupFiddleGlobal() {
252245
stopFiddle() {
253246
ipcRenderer.send(IpcEvents.STOP_FIDDLE);
254247
},
255-
taskDone(result: RunResult) {
256-
ipcRenderer.send(IpcEvents.TASK_DONE, result);
257-
},
258248
themePath: await ipcRenderer.sendSync(IpcEvents.GET_THEME_PATH),
259249
async uncacheTypes(ver: RunnableVersion) {
260250
await ipcRenderer.invoke(IpcEvents.UNCACHE_TYPES, ver);

src/renderer/app.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { FileManager } from './file-manager';
66
import { RemoteLoader } from './remote-loader';
77
import { Runner } from './runner';
88
import { AppState } from './state';
9-
import { TaskRunner } from './task-runner';
109
import { activateTheme, getCurrentTheme, getTheme } from './themes';
1110
import { getPackageJson } from './utils/get-package';
1211
import {
@@ -34,7 +33,6 @@ export class App {
3433
public fileManager: FileManager;
3534
public remoteLoader: RemoteLoader;
3635
public runner: Runner;
37-
public readonly taskRunner: TaskRunner;
3836
public readonly electronTypes: ElectronTypes;
3937

4038
constructor() {
@@ -46,8 +44,6 @@ export class App {
4644
this.runner = new Runner(this.state);
4745
this.getEditorValues = this.getEditorValues.bind(this);
4846

49-
this.taskRunner = new TaskRunner(this);
50-
5147
this.electronTypes = new ElectronTypes(window.monaco);
5248
}
5349

src/renderer/state.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,6 @@ export class AppState {
10941094
text: strData.trim(),
10951095
timeString: this.timeFmt.format(new Date()),
10961096
};
1097-
window.ElectronFiddle.pushOutputEntry(entry);
10981097
this.output.push(entry);
10991098
}
11001099

src/renderer/task-runner.ts

Lines changed: 0 additions & 134 deletions
This file was deleted.

tests/mocks/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ export class AppMock {
2020
public runner = new RunnerMock();
2121
public setup = vi.fn();
2222
public state = new StateMock();
23-
public taskRunner = {};
2423
}

tests/mocks/electron-fiddle.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export class ElectronFiddleMock {
3737
public openThemeFolder = vi.fn();
3838
public packageRun = vi.fn();
3939
public platform = process.platform;
40-
public pushOutputEntry = vi.fn();
4140
public reloadWindows = vi.fn();
4241
public removeAllListeners = vi.fn();
4342
public removeVersion = vi.fn();
@@ -50,7 +49,6 @@ export class ElectronFiddleMock {
5049
public showWindow = vi.fn();
5150
public startFiddle = vi.fn();
5251
public stopFiddle = vi.fn();
53-
public taskDone = vi.fn();
5452
public readThemeFile = vi.fn();
5553
public themePath = '~/.electron-fiddle/themes';
5654
public uncacheTypes = vi.fn();

0 commit comments

Comments
 (0)