Repository: electron/fiddle
Pull request #623 (2021-03-27 04:34:06)

refactor: remove unused 'export' declarations
Another cleanup PR. Does what it says on the tin: if something we `export` isn't used anywhere else, remove the `export` key.

In a few cases the item wasn't used _interally_ either, so remove those pieces altogether.

No functional changes.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/38302291/badge)](https://coveralls.io/builds/38302291)

Coverage increased (+0.1%) to 93.452% when pulling **d36efc0cc2cfe9eee7138decd21c28c52a7a3df2 on refactor/remove-unused-exports** into **c6edb73f35b4ea06cc6adcac075acf7953ad4581 on master**.


Patch:
diff --git a/src/interfaces.ts b/src/interfaces.ts
index 2c572c58..16b29198 100644
--- a/src/interfaces.ts
+++ b/src/interfaces.ts
@@ -1,5 +1,3 @@
-export type WindowNames = 'main';
-
 export type Files = Map<string, string>;
 
 export type FileTransform = (files: Files) => Promise<Files>;
diff --git a/src/main/ipc.ts b/src/main/ipc.ts
index 9b94c633..270013ba 100644
--- a/src/main/ipc.ts
+++ b/src/main/ipc.ts
@@ -16,7 +16,7 @@ import { getOrCreateMainWindow } from './windows';
  * @class IpcManager
  * @extends {EventEmitter}
  */
-export class IpcMainManager extends EventEmitter {
+class IpcMainManager extends EventEmitter {
   public readyWebContents = new WeakSet<Electron.WebContents>();
   private messageQueue = new WeakMap<
     Electron.WebContents,
diff --git a/src/main/protocol.ts b/src/main/protocol.ts
index 01c985a1..fe8de429 100644
--- a/src/main/protocol.ts
+++ b/src/main/protocol.ts
@@ -68,7 +68,7 @@ const handlePotentialProtocolLaunch = (url: string) => {
   }
 };
 
-export const scanArgv = (argv: Array<string>) => {
+const scanArgv = (argv: Array<string>) => {
   const protocolArg = argv.find((arg) => arg.startsWith(`${PROTOCOL}://`));
   if (protocolArg) {
     console.info('Found protocol arg in argv:', protocolArg);
@@ -76,7 +76,7 @@ export const scanArgv = (argv: Array<string>) => {
   }
 };
 
-export const scanNpmArgv = (argv: string) => {
+const scanNpmArgv = (argv: string) => {
   const parsedArgv = JSON.parse(argv);
   const { original: args } = parsedArgv;
   scanArgv(args);
diff --git a/src/preload/preload.ts b/src/preload/preload.ts
index 81bf9ccd..41244dd2 100644
--- a/src/preload/preload.ts
+++ b/src/preload/preload.ts
@@ -2,7 +2,7 @@
 import { IpcEvents } from '../ipc-events';
 import { ipcRendererManager } from '../renderer/ipc';
 
-export async function preload() {
+async function preload() {
   setupGlobalWindow();
   await setupPaths();
 }
diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx
index 3b6b39cd..62e3b2a0 100644
--- a/src/renderer/app.tsx
+++ b/src/renderer/app.tsx
@@ -18,7 +18,7 @@ import { getEditorValue } from '../utils/editor-value';
 import { getPackageJson, PackageJsonOptions } from '../utils/get-package';
 import { getTitle } from '../utils/get-title';
 import { isEditorBackup } from '../utils/type-checks';
-import { EMPTY_EDITOR_CONTENT } from './constants';
+import { EMPTY_EDITOR_CONTENT, SORTED_EDITORS } from './constants';
 import { FileManager } from './file-manager';
 import { RemoteLoader } from './remote-loader';
 import { Runner } from './runner';
@@ -64,33 +64,16 @@ export class App {
       }
     }
 
-    // display all editors that have content
-    const visibleEditors = [];
-
-    // ensure consistent sorting of mosaics
-    const sortedEditors = Object.keys(editorValues).sort((a, b) => {
-      const order: Array<string> = [
-        'main',
-        'renderer',
-        'html',
-        'preload',
-        'css',
-      ];
-
-      return order.indexOf(a) - order.indexOf(b);
-    });
-
-    for (const id of sortedEditors) {
-      const content = editorValues[id];
-
-      // if the gist content is empty or matches the empty file output, don't show it
-      if (
-        content.length > 0 &&
-        !Object.values(EMPTY_EDITOR_CONTENT).includes(content)
-      ) {
-        visibleEditors.push(id as EditorId);
-      }
-    }
+    // if the gist content is empty or matches the empty file output, don't show it
+    const EMPTIES = Object.values(EMPTY_EDITOR_CONTENT);
+    const shouldShowContent = (content?: string) =>
+      content && content.length > 0 && !EMPTIES.includes(content);
+
+    // sort and display all editors that have content
+    const visibleEditors: EditorId[] = Object.entries(editorValues)
+      .filter(([_id, content]) => shouldShowContent(content))
+      .map(([id]) => id as EditorId)
+      .sort((a, b) => SORTED_EDITORS.indexOf(a) - SORTED_EDITORS.indexOf(b));
 
     this.state.gistId = gistId || '';
     this.state.localPath = filePath;
diff --git a/src/renderer/components/chrome-mac.tsx b/src/renderer/components/chrome-mac.tsx
index 70237e0e..2b9d20cb 100644
--- a/src/renderer/components/chrome-mac.tsx
+++ b/src/renderer/components/chrome-mac.tsx
@@ -6,7 +6,7 @@ import { getTitle } from '../../utils/get-title';
 import { ipcRendererManager } from '../ipc';
 import { AppState } from '../state';
 
-export interface ChromeMacProps {
+interface ChromeMacProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/commands-action-button.tsx b/src/renderer/components/commands-action-button.tsx
index ac91ab57..9935d3f9 100644
--- a/src/renderer/components/commands-action-button.tsx
+++ b/src/renderer/components/commands-action-button.tsx
@@ -26,7 +26,7 @@ import { EMPTY_EDITOR_CONTENT } from '../constants';
 import { ipcRendererManager } from '../ipc';
 import { AppState } from '../state';
 
-export interface GistActionButtonProps {
+interface GistActionButtonProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/commands-address-bar.tsx b/src/renderer/components/commands-address-bar.tsx
index 452ae6d9..898be51e 100644
--- a/src/renderer/components/commands-address-bar.tsx
+++ b/src/renderer/components/commands-address-bar.tsx
@@ -10,11 +10,11 @@ import { idFromUrl, urlFromId } from '../../utils/gist';
 import { ipcRendererManager } from '../ipc';
 import { AppState } from '../state';
 
-export interface AddressBarProps {
+interface AddressBarProps {
   appState: AppState;
 }
 
-export interface AddressBarState {
+interface AddressBarState {
   value: string;
   loaders: {
     gist: any;
diff --git a/src/renderer/components/commands-editors.tsx b/src/renderer/components/commands-editors.tsx
index 3aa1b78f..b89e673f 100644
--- a/src/renderer/components/commands-editors.tsx
+++ b/src/renderer/components/commands-editors.tsx
@@ -14,11 +14,11 @@ import { getVisibleMosaics } from '../../utils/editors-mosaic-arrangement';
 import { AppState } from '../state';
 import { TITLE_MAP } from './editors';
 
-export interface EditorDropdownState {
+interface EditorDropdownState {
   value: string;
 }
 
-export interface EditorDropdownProps {
+interface EditorDropdownProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/commands-runner.tsx b/src/renderer/components/commands-runner.tsx
index dd0e1759..6b8bb608 100644
--- a/src/renderer/components/commands-runner.tsx
+++ b/src/renderer/components/commands-runner.tsx
@@ -5,7 +5,7 @@ import * as React from 'react';
 import { VersionState } from '../../interfaces';
 import { AppState } from '../state';
 
-export interface RunnerProps {
+interface RunnerProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/commands-version-chooser.tsx b/src/renderer/components/commands-version-chooser.tsx
index 27d11f4c..4f7c049b 100644
--- a/src/renderer/components/commands-version-chooser.tsx
+++ b/src/renderer/components/commands-version-chooser.tsx
@@ -5,7 +5,7 @@ import * as React from 'react';
 import { AppState } from '../state';
 import { VersionSelect } from './version-select';
 
-export interface VersionChooserProps {
+interface VersionChooserProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/commands.tsx b/src/renderer/components/commands.tsx
index c0461c81..96aa6f08 100644
--- a/src/renderer/components/commands.tsx
+++ b/src/renderer/components/commands.tsx
@@ -10,7 +10,7 @@ import { GistActionButton } from './commands-action-button';
 import { Runner } from './commands-runner';
 import { VersionChooser } from './commands-version-chooser';
 
-export interface CommandsProps {
+interface CommandsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/dialog-add-theme.tsx b/src/renderer/components/dialog-add-theme.tsx
index 4024709e..9a6032d5 100644
--- a/src/renderer/components/dialog-add-theme.tsx
+++ b/src/renderer/components/dialog-add-theme.tsx
@@ -11,11 +11,11 @@ import { GenericDialogType } from '../../../src/interfaces';
 import { AppState } from '../state';
 import { defaultDark, LoadedFiddleTheme } from '../themes-defaults';
 
-export interface AddThemeDialogProps {
+interface AddThemeDialogProps {
   appState: AppState;
 }
 
-export interface AddThemeDialogState {
+interface AddThemeDialogState {
   file?: File;
 }
 
diff --git a/src/renderer/components/dialog-add-version.tsx b/src/renderer/components/dialog-add-version.tsx
index 3f5776ae..755485df 100644
--- a/src/renderer/components/dialog-add-version.tsx
+++ b/src/renderer/components/dialog-add-version.tsx
@@ -18,11 +18,11 @@ import { getIsDownloaded } from '../binary';
 import { ipcRendererManager } from '../ipc';
 import { AppState } from '../state';
 
-export interface AddVersionDialogProps {
+interface AddVersionDialogProps {
   appState: AppState;
 }
 
-export interface AddVersionDialogState {
+interface AddVersionDialogState {
   isValidElectron: boolean;
   isValidVersion: boolean;
   folderPath?: string;
diff --git a/src/renderer/components/dialog-bisect.tsx b/src/renderer/components/dialog-bisect.tsx
index 12647cc4..89ab95ad 100644
--- a/src/renderer/components/dialog-bisect.tsx
+++ b/src/renderer/components/dialog-bisect.tsx
@@ -7,11 +7,11 @@ import { Bisector } from '../bisect';
 import { AppState } from '../state';
 import { VersionSelect } from './version-select';
 
-export interface BisectDialogProps {
+interface BisectDialogProps {
   appState: AppState;
 }
 
-export interface BisectDialogState {
+interface BisectDialogState {
   startIndex: number;
   endIndex: number;
   allVersions: Array<RunnableVersion>;
diff --git a/src/renderer/components/dialog-generic.tsx b/src/renderer/components/dialog-generic.tsx
index 0c0427a8..226c15c1 100644
--- a/src/renderer/components/dialog-generic.tsx
+++ b/src/renderer/components/dialog-generic.tsx
@@ -5,7 +5,7 @@ import * as React from 'react';
 import { GenericDialogType } from '../../../src/interfaces';
 import { AppState } from '../state';
 
-export interface GenericDialogProps {
+interface GenericDialogProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/dialog-token.tsx b/src/renderer/components/dialog-token.tsx
index 12575924..549dc9fe 100644
--- a/src/renderer/components/dialog-token.tsx
+++ b/src/renderer/components/dialog-token.tsx
@@ -6,11 +6,11 @@ import * as React from 'react';
 import { getOctokit } from '../../utils/octokit';
 import { AppState } from '../state';
 
-export interface TokenDialogProps {
+interface TokenDialogProps {
   appState: AppState;
 }
 
-export interface TokenDialogState {
+interface TokenDialogState {
   tokenInput: string;
   verifying: boolean;
   error: boolean;
diff --git a/src/renderer/components/dialogs.tsx b/src/renderer/components/dialogs.tsx
index 8062f845..dfb525b9 100644
--- a/src/renderer/components/dialogs.tsx
+++ b/src/renderer/components/dialogs.tsx
@@ -9,7 +9,7 @@ import { GenericDialog } from './dialog-generic';
 import { TokenDialog } from './dialog-token';
 import { Settings } from './settings';
 
-export interface DialogsProps {
+interface DialogsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/editor.tsx b/src/renderer/components/editor.tsx
index 51eebda6..7238f005 100644
--- a/src/renderer/components/editor.tsx
+++ b/src/renderer/components/editor.tsx
@@ -8,7 +8,7 @@ import { EditorId } from '../../interfaces';
 import { getContent } from '../content';
 import { AppState } from '../state';
 
-export interface EditorProps {
+interface EditorProps {
   appState: AppState;
   monaco: typeof MonacoType;
   monacoOptions: MonacoType.editor.IEditorOptions;
diff --git a/src/renderer/components/editors-toolbar-button.tsx b/src/renderer/components/editors-toolbar-button.tsx
index a8720396..d0f9c415 100644
--- a/src/renderer/components/editors-toolbar-button.tsx
+++ b/src/renderer/components/editors-toolbar-button.tsx
@@ -10,12 +10,12 @@ import {
 import { DocsDemoPage, MosaicId } from '../../interfaces';
 import { AppState } from '../state';
 
-export interface ToolbarButtonProps {
+interface ToolbarButtonProps {
   appState: AppState;
   id: MosaicId;
 }
 
-export abstract class ToolbarButton extends React.PureComponent<ToolbarButtonProps> {
+abstract class ToolbarButton extends React.PureComponent<ToolbarButtonProps> {
   public static contextType = MosaicWindowContext;
   public context: MosaicWindowContext;
 
diff --git a/src/renderer/components/editors.tsx b/src/renderer/components/editors.tsx
index 32c99f1e..7558ff52 100644
--- a/src/renderer/components/editors.tsx
+++ b/src/renderer/components/editors.tsx
@@ -52,11 +52,11 @@ export const TITLE_MAP: Record<MosaicId, string> = {
   [PanelId.docsDemo]: 'Docs & Demos',
 };
 
-export interface EditorsProps {
+interface EditorsProps {
   appState: AppState;
 }
 
-export interface EditorsState {
+interface EditorsState {
   monaco?: typeof MonacoType;
   isMounted?: boolean;
   monacoOptions: MonacoType.editor.IEditorOptions;
diff --git a/src/renderer/components/header.tsx b/src/renderer/components/header.tsx
index 14cae1c6..93101d12 100644
--- a/src/renderer/components/header.tsx
+++ b/src/renderer/components/header.tsx
@@ -5,7 +5,7 @@ import { ChromeMac } from './chrome-mac';
 import { Commands } from './commands';
 import { WelcomeTour } from './tour-welcome';
 
-export interface HeaderProps {
+interface HeaderProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/output-editors-wrapper.tsx b/src/renderer/components/output-editors-wrapper.tsx
index bfa0a0f1..34d4fd5a 100644
--- a/src/renderer/components/output-editors-wrapper.tsx
+++ b/src/renderer/components/output-editors-wrapper.tsx
@@ -5,11 +5,11 @@ import { AppState } from '../state';
 import { Editors } from './editors';
 import { Output } from './output';
 
-export interface WrapperProps {
+interface WrapperProps {
   appState: AppState;
 }
 
-export interface WrapperState {
+interface WrapperState {
   mosaicArrangement: MosaicNode<WrapperMosaicId>;
 }
 
diff --git a/src/renderer/components/output.tsx b/src/renderer/components/output.tsx
index 5ad4f6ab..87dbd00a 100644
--- a/src/renderer/components/output.tsx
+++ b/src/renderer/components/output.tsx
@@ -8,7 +8,7 @@ import { OutputEntry } from '../../interfaces';
 import { AppState } from '../state';
 import { WrapperMosaicId } from './output-editors-wrapper';
 
-export interface CommandsProps {
+interface CommandsProps {
   appState: AppState;
   // Used to keep testing conform
   renderTimestamp?: (ts: number) => string;
diff --git a/src/renderer/components/settings-credits.tsx b/src/renderer/components/settings-credits.tsx
index 37c3bc59..3c72c461 100644
--- a/src/renderer/components/settings-credits.tsx
+++ b/src/renderer/components/settings-credits.tsx
@@ -6,15 +6,15 @@ import * as React from 'react';
 
 import { AppState } from '../state';
 
-export interface CreditsSettingsProps {
+interface CreditsSettingsProps {
   appState: AppState;
 }
 
-export interface CreditsSettingsState {
+interface CreditsSettingsState {
   contributors: Array<Contributor>;
 }
 
-export interface Contributor {
+interface Contributor {
   url: string;
   api: string;
   login: string;
diff --git a/src/renderer/components/settings-electron.tsx b/src/renderer/components/settings-electron.tsx
index 1eaf63f8..7d0404c7 100644
--- a/src/renderer/components/settings-electron.tsx
+++ b/src/renderer/components/settings-electron.tsx
@@ -19,11 +19,11 @@ import { sortedElectronMap } from '../../utils/sorted-electron-map';
 import { AppState } from '../state';
 import { ElectronReleaseChannel, getReleaseChannel } from '../versions';
 
-export interface ElectronSettingsProps {
+interface ElectronSettingsProps {
   appState: AppState;
 }
 
-export interface ElectronSettingsState {
+interface ElectronSettingsState {
   isDownloadingAll: boolean;
   isDeletingAll: boolean;
 }
diff --git a/src/renderer/components/settings-execution.tsx b/src/renderer/components/settings-execution.tsx
index 67ff9420..f805cd4f 100644
--- a/src/renderer/components/settings-execution.tsx
+++ b/src/renderer/components/settings-execution.tsx
@@ -12,7 +12,7 @@ import * as React from 'react';
 import { IPackageManager } from '../npm';
 import { AppState } from '../state';
 
-export interface ExecutionSettingsProps {
+interface ExecutionSettingsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/settings-general-appearance.tsx b/src/renderer/components/settings-general-appearance.tsx
index 12b1f524..4f029263 100644
--- a/src/renderer/components/settings-general-appearance.tsx
+++ b/src/renderer/components/settings-general-appearance.tsx
@@ -64,12 +64,12 @@ export const renderItem: ItemRenderer<LoadedFiddleTheme> = (
   );
 };
 
-export interface AppearanceSettingsProps {
+interface AppearanceSettingsProps {
   appState: AppState;
   toggleHasPopoverOpen: () => void;
 }
 
-export interface AppearanceSettingsState {
+interface AppearanceSettingsState {
   themes: Array<LoadedFiddleTheme>;
   selectedTheme?: LoadedFiddleTheme;
 }
diff --git a/src/renderer/components/settings-general-block-accelerators.tsx b/src/renderer/components/settings-general-block-accelerators.tsx
index 8f306e00..803ac851 100644
--- a/src/renderer/components/settings-general-block-accelerators.tsx
+++ b/src/renderer/components/settings-general-block-accelerators.tsx
@@ -5,7 +5,7 @@ import { BlockableAccelerator } from '../../interfaces';
 
 import { AppState } from '../state';
 
-export interface BlockAcceleratorsSettingsProps {
+interface BlockAcceleratorsSettingsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/settings-general-console.tsx b/src/renderer/components/settings-general-console.tsx
index a68b3a36..dea4fdce 100644
--- a/src/renderer/components/settings-general-console.tsx
+++ b/src/renderer/components/settings-general-console.tsx
@@ -4,7 +4,7 @@ import * as React from 'react';
 
 import { AppState } from '../state';
 
-export interface ConsoleSettingsProps {
+interface ConsoleSettingsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/settings-general-github.tsx b/src/renderer/components/settings-general-github.tsx
index 09c36c2b..aeb6955d 100644
--- a/src/renderer/components/settings-general-github.tsx
+++ b/src/renderer/components/settings-general-github.tsx
@@ -4,7 +4,7 @@ import * as React from 'react';
 
 import { AppState } from '../state';
 
-export interface GitHubSettingsProps {
+interface GitHubSettingsProps {
   appState: AppState;
 }
 
diff --git a/src/renderer/components/settings-general.tsx b/src/renderer/components/settings-general.tsx
index a6cf5781..3687e95f 100644
--- a/src/renderer/components/settings-general.tsx
+++ b/src/renderer/components/settings-general.tsx
@@ -8,7 +8,7 @@ import { BlockAcceleratorsSettings } from './settings-general-block-accelerators
 import { ConsoleSettings } from './settings-general-console';
 import { GitHubSettings } from './settings-general-github';
 
-export interface GeneralSettingsProps {
+interface GeneralSettingsProps {
   appState: AppState;
   toggleHasPopoverOpen: () => void;
 }
diff --git a/src/renderer/components/settings.tsx b/src/renderer/components/settings.tsx
index 06d35054..47e37424 100644
--- a/src/renderer/components/settings.tsx
+++ b/src/renderer/components/settings.tsx
@@ -22,11 +22,11 @@ const settingsSections = [
   SettingsSections.Credits,
 ];
 
-export interface SettingsProps {
+interface SettingsProps {
   appState: AppState;
 }
 
-export interface SettingsState {
+interface SettingsState {
   section: SettingsSections;
   hasPopoverOpen: boolean;
 }
diff --git a/src/renderer/components/tour-welcome.tsx b/src/renderer/components/tour-welcome.tsx
index d6b46c0b..dbc4da13 100644
--- a/src/renderer/components/tour-welcome.tsx
+++ b/src/renderer/components/tour-welcome.tsx
@@ -5,11 +5,11 @@ import * as React from 'react';
 import { AppState } from '../state';
 import { Tour, TourScriptStep, TourStepGetButtonParams } from './tour';
 
-export interface WelcomeTourProps {
+interface WelcomeTourProps {
   appState: AppState;
 }
 
-export interface WelcomeTourState {
+interface WelcomeTourState {
   isTourStarted: boolean;
 }
 
diff --git a/src/renderer/components/tour.tsx b/src/renderer/components/tour.tsx
index 19e59c84..54556929 100644
--- a/src/renderer/components/tour.tsx
+++ b/src/renderer/components/tour.tsx
@@ -11,12 +11,12 @@ export interface TourScriptStep {
   getButtons?: (handlers: TourStepGetButtonParams) => Array<JSX.Element>;
 }
 
-export interface TourProps {
+interface TourProps {
   tour: Set<TourScriptStep>;
   onStop: () => void;
 }
 
-export interface TourState {
+interface TourState {
   tour: IterableIterator<Array<TourScriptStep>>;
   step: TourScriptStep | null;
   i: number;
diff --git a/src/renderer/components/version-select.tsx b/src/renderer/components/version-select.tsx
index 7b056937..b74b1dff 100644
--- a/src/renderer/components/version-select.tsx
+++ b/src/renderer/components/version-select.tsx
@@ -98,11 +98,11 @@ export const renderItem: ItemRenderer<RunnableVersion> = (
   );
 };
 
-export interface VersionSelectState {
+interface VersionSelectState {
   value: string;
 }
 
-export interface VersionSelectProps {
+interface VersionSelectProps {
   appState: AppState;
   disabled?: boolean;
   currentVersion: RunnableVersion;
diff --git a/src/renderer/constants.ts b/src/renderer/constants.ts
index e21488f8..fb5aa4e6 100644
--- a/src/renderer/constants.ts
+++ b/src/renderer/constants.ts
@@ -10,17 +10,25 @@ export const CONFIG_PATH = path.join(
   '.electron-fiddle',
 );
 
+export const SORTED_EDITORS = Object.freeze([
+  EditorId.main,
+  EditorId.renderer,
+  EditorId.html,
+  EditorId.preload,
+  EditorId.css,
+]);
+
 export const DEFAULT_MOSAIC_ARRANGEMENT: MosaicNode<MosaicId> = {
   direction: 'row',
   first: {
     direction: 'column',
-    first: EditorId.main,
-    second: EditorId.renderer,
+    first: SORTED_EDITORS[0],
+    second: SORTED_EDITORS[1],
   },
   second: {
     direction: 'column',
-    first: EditorId.preload,
-    second: EditorId.html,
+    first: SORTED_EDITORS[2],
+    second: SORTED_EDITORS[3],
   },
 };
 
diff --git a/src/renderer/ipc.ts b/src/renderer/ipc.ts
index 67c70c4b..ac3802f5 100644
--- a/src/renderer/ipc.ts
+++ b/src/renderer/ipc.ts
@@ -10,7 +10,7 @@ import { IpcEvents, ipcRendererEvents } from '../ipc-events';
  * @class IpcManager
  * @extends {EventEmitter}
  */
-export class IpcRendererManager extends EventEmitter {
+class IpcRendererManager extends EventEmitter {
   constructor() {
     super();
 
diff --git a/src/renderer/npm.ts b/src/renderer/npm.ts
index e71d4bae..49d9c58b 100644
--- a/src/renderer/npm.ts
+++ b/src/renderer/npm.ts
@@ -11,8 +11,8 @@ export interface PMOperationOptions {
   packageManager: IPackageManager;
 }
 
-export let isNpmInstalled: boolean | null = null;
-export let isYarnInstalled: boolean | null = null;
+let isNpmInstalled: boolean | null = null;
+let isYarnInstalled: boolean | null = null;
 
 /* add other modules to automatically ignore here */
 /* perhaps we can expose this to the settings module?*/
@@ -162,7 +162,7 @@ export function packageRun(
   return exec(dir, `${packageManager} run ${command}`);
 }
 
-export function decommentWithWorker(input: string): Promise<string> {
+function decommentWithWorker(input: string): Promise<string> {
   return new Promise((resolve, reject) => {
     const worker = new Worker('../utils/decomment.ts');
     worker.onmessage = function (event: MessageEvent<string>) {
diff --git a/src/renderer/themes.ts b/src/renderer/themes.ts
index 56298327..2a3bd543 100644
--- a/src/renderer/themes.ts
+++ b/src/renderer/themes.ts
@@ -117,9 +117,7 @@ export async function getTheme(
  * @param {FiddleTheme} theme
  * @returns {string}
  */
-export async function getCssStringForTheme(
-  theme: FiddleTheme,
-): Promise<string> {
+async function getCssStringForTheme(theme: FiddleTheme): Promise<string> {
   let cssContent = '';
 
   Object.keys(theme.common).forEach((key) => {
diff --git a/src/renderer/versions.ts b/src/renderer/versions.ts
index 493d0cf7..6ddeeb54 100644
--- a/src/renderer/versions.ts
+++ b/src/renderer/versions.ts
@@ -227,7 +227,7 @@ export function getKnownVersions(): Array<Version> {
  *
  * @param {Array<Version>} versions
  */
-export function saveKnownVersions(versions: Array<Version>) {
+function saveKnownVersions(versions: Array<Version>) {
   return saveVersions(VersionKeys.known, versions);
 }
 
@@ -283,7 +283,7 @@ export async function fetchVersions() {
  * @param {Array<any>} input
  * @returns {boolean}
  */
-export function isExpectedFormat(input: Array<any>): boolean {
+function isExpectedFormat(input: Array<any>): boolean {
   return input.every((entry) => !!entry.version);
 }
 
@@ -293,7 +293,7 @@ export function isExpectedFormat(input: Array<any>): boolean {
  * @param {Array<any>} input
  * @returns {Array<Version>}
  */
-export function migrateVersions(input: Array<any> = []): Array<Version> {
+function migrateVersions(input: Array<any> = []): Array<Version> {
   return input
     .filter((item) => !!item)
     .map((item) => {
@@ -310,7 +310,7 @@ export function migrateVersions(input: Array<any> = []): Array<Version> {
     .filter((item) => !!item) as Array<Version>;
 }
 
-export function isElectronVersion(
+function isElectronVersion(
   input: Version | RunnableVersion,
 ): input is RunnableVersion {
   return (input as RunnableVersion).source !== undefined;
diff --git a/src/shared-constants.ts b/src/shared-constants.ts
index 2181d0f0..3bbc7fe7 100644
--- a/src/shared-constants.ts
+++ b/src/shared-constants.ts
@@ -1,3 +1,5 @@
+import { EditorId } from './interfaces';
+
 export const INDEX_HTML_NAME = 'index.html';
 export const MAIN_JS_NAME = 'main.js';
 export const RENDERER_JS_NAME = 'renderer.js';
@@ -6,9 +8,9 @@ export const STYLES_CSS_NAME = 'styles.css';
 export const PACKAGE_NAME = 'package.json';
 
 export const FILENAME_KEYS = Object.freeze({
-  [INDEX_HTML_NAME]: 'html',
-  [MAIN_JS_NAME]: 'main',
-  [PRELOAD_JS_NAME]: 'preload',
-  [RENDERER_JS_NAME]: 'renderer',
-  [STYLES_CSS_NAME]: 'css',
+  [INDEX_HTML_NAME]: EditorId.html,
+  [MAIN_JS_NAME]: EditorId.main,
+  [PRELOAD_JS_NAME]: EditorId.preload,
+  [RENDERER_JS_NAME]: EditorId.renderer,
+  [STYLES_CSS_NAME]: EditorId.css,
 });
diff --git a/src/utils/nice-greeting.ts b/src/utils/nice-greeting.ts
deleted file mode 100644
index 1149303a..00000000
--- a/src/utils/nice-greeting.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { getRandomNumber } from './random';
-
-/**
- * Get a random nice greeting
- *
- * @export
- * @returns
- */
-export function getNiceGreeting() {
-  const greetings = [
-    '👋 Go build a great app',
-    '💖 You got this',
-    `💖 We think you're great`,
-    '🤘 Your app will rock, we know it',
-    '🙇‍♀️ Thanks for trying out Electron & Fiddle',
-    '🐕 Go pet a dog today',
-    '🐈 Go pet a cat today',
-    '💧 Stay hydrated',
-  ];
-
-  const min = 0;
-  const max = greetings.length;
-
-  return greetings[getRandomNumber(min, max)];
-}
diff --git a/src/utils/position-for-rect.ts b/src/utils/position-for-rect.ts
index 76c157b8..706d8670 100644
--- a/src/utils/position-for-rect.ts
+++ b/src/utils/position-for-rect.ts
@@ -1,6 +1,6 @@
 import { ArrowPosition } from '../interfaces';
 
-export interface PositionResult {
+interface PositionResult {
   top: number;
   left: number;
   type: ArrowPosition;
diff --git a/src/utils/random.ts b/src/utils/random.ts
deleted file mode 100644
index 604f418d..00000000
--- a/src/utils/random.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Dumb helper: Get a random number between two numbers
- *
- * @param {number} [min=0]
- * @param {number} [max=1]
- * @returns {number}
- */
-export function getRandomNumber(min = 0, max = 1): number {
-  return Math.floor(Math.random() * max) + min;
-}


Test patch:
diff --git a/tests/mocks/app.ts b/tests/mocks/app.ts
index 7e85adbc..7d4839bf 100644
--- a/tests/mocks/app.ts
+++ b/tests/mocks/app.ts
@@ -4,7 +4,6 @@ import { RunnerMock } from './runner';
 
 export class AppMock {
   public setup = jest.fn();
-  public setupUnsavedOnChangeListener = jest.fn();
   public replaceFiddle = jest.fn();
   public setEditorValues = jest.fn();
   public getEditorValues = jest.fn().mockResolvedValue({
diff --git a/tests/mocks/exec.ts b/tests/mocks/exec.ts
deleted file mode 100644
index 57466b29..00000000
--- a/tests/mocks/exec.ts
+++ /dev/null
@@ -1,1 +0,0 @@
-export const execMock = jest.fn();
diff --git a/tests/renderer/state-spec.ts b/tests/renderer/state-spec.ts
index 79791803..bf9ac40b 100644
--- a/tests/renderer/state-spec.ts
+++ b/tests/renderer/state-spec.ts
@@ -17,7 +17,10 @@ import {
   setupBinary,
 } from '../../src/renderer/binary';
 import { Bisector } from '../../src/renderer/bisect';
-import { DEFAULT_MOSAIC_ARRANGEMENT } from '../../src/renderer/constants';
+import {
+  DEFAULT_MOSAIC_ARRANGEMENT,
+  SORTED_EDITORS,
+} from '../../src/renderer/constants';
 import { getTemplate, isContentUnchanged } from '../../src/renderer/content';
 import { ipcRendererManager } from '../../src/renderer/ipc';
 import { AppState } from '../../src/renderer/state';
@@ -603,15 +606,15 @@ describe('AppState', () => {
     it('hides a given editor and creates a backup', () => {
       appState.mosaicArrangement = DEFAULT_MOSAIC_ARRANGEMENT;
       appState.closedPanels = {};
-      appState.hideAndBackupMosaic(EditorId.main);
+      appState.hideAndBackupMosaic(SORTED_EDITORS[0]);
 
       expect(appState.mosaicArrangement).toEqual({
         direction: 'row',
-        first: EditorId.renderer,
+        first: SORTED_EDITORS[1],
         second: {
           direction: 'column',
-          first: EditorId.preload,
-          second: EditorId.html,
+          first: SORTED_EDITORS[2],
+          second: SORTED_EDITORS[3],
         },
       });
       expect(appState.closedPanels[EditorId.main]).toBeTruthy();
@@ -635,15 +638,15 @@ describe('AppState', () => {
 
   describe('resetEditorLayout()', () => {
     it('Puts editors in default arrangement', () => {
-      appState.hideAndBackupMosaic(EditorId.main);
+      appState.hideAndBackupMosaic(SORTED_EDITORS[0]);
 
       expect(appState.mosaicArrangement).toEqual({
         direction: 'row',
-        first: EditorId.renderer,
+        first: SORTED_EDITORS[1],
         second: {
           direction: 'column',
-          first: EditorId.preload,
-          second: EditorId.html,
+          first: SORTED_EDITORS[2],
+          second: SORTED_EDITORS[3],
         },
       });
 
diff --git a/tests/utils/editors-mosaic-arrangement-spec.ts b/tests/utils/editors-mosaic-arrangement-spec.ts
index cd9225d1..90651118 100644
--- a/tests/utils/editors-mosaic-arrangement-spec.ts
+++ b/tests/utils/editors-mosaic-arrangement-spec.ts
@@ -1,5 +1,8 @@
 import { EditorId } from '../../src/interfaces';
-import { DEFAULT_MOSAIC_ARRANGEMENT } from '../../src/renderer/constants';
+import {
+  DEFAULT_MOSAIC_ARRANGEMENT,
+  SORTED_EDITORS,
+} from '../../src/renderer/constants';
 import {
   createMosaicArrangement,
   getVisibleMosaics,
@@ -27,12 +30,7 @@ describe('Mosaic Arrangement Utilities', () => {
     });
 
     it('creates the correct arrangement for the default visible panels', () => {
-      const result = createMosaicArrangement([
-        EditorId.main,
-        EditorId.renderer,
-        EditorId.preload,
-        EditorId.html,
-      ]);
+      const result = createMosaicArrangement(SORTED_EDITORS.slice(0, 4));
 
       expect(result).toEqual(DEFAULT_MOSAIC_ARRANGEMENT);
     });
@@ -64,7 +62,7 @@ describe('Mosaic Arrangement Utilities', () => {
     it('returns the correct array for the default mosaic', () => {
       const result = getVisibleMosaics(DEFAULT_MOSAIC_ARRANGEMENT);
 
-      expect(result).toEqual(['main', 'renderer', 'preload', 'html']);
+      expect(result).toEqual(SORTED_EDITORS.slice(0, 4));
     });
   });
 });
diff --git a/tests/utils/random-spec.ts b/tests/utils/random-spec.ts
deleted file mode 100644
index a146f363..00000000
--- a/tests/utils/random-spec.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { getRandomNumber } from '../../src/utils/random';
-
-describe('random', () => {
-  it('returns a random number', () => {
-    const min = 1;
-    const max = 999999;
-    const a = getRandomNumber(min, max);
-    const b = getRandomNumber(min, max);
-
-    expect(a).toBeLessThanOrEqual(max);
-    expect(b).toBeLessThanOrEqual(max);
-    expect(a).toBeGreaterThanOrEqual(min);
-    expect(b).toBeGreaterThanOrEqual(min);
-    expect(a === b).toBe(false);
-  });
-
-  it('handles no input', () => {
-    const result = getRandomNumber();
-    expect(result === 0 || result === 1).toBeTruthy();
-  });
-});