* chore: remove dead/unreferenced files across ui, vscode Remove 59 unused source files (components, hooks, lib utils, stores, barrels, and orphaned vscode github modules) that are not imported by any entry-reachable code. Also drop a stale test mock for the removed execCommands module. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * refactor: remove unused exported symbols (types, functions, consts, hooks) Remove exported symbols whose identifier is referenced nowhere in the repository (verified via repo-wide search), across ui types/contracts, lib utilities, sync layer, stores, and components. Also drop the few imports/private helpers orphaned by these removals. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * refactor: remove more unused exports (desktop, shortcuts, worktree, vscode) Continue removing repo-wide unreferenced exported functions, consts and types across lib/desktop, shortcuts, worktreeSessionCreator, sync, and vscode gitService, with cascading orphaned helpers/imports cleaned up. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * chore: add dead-code cleanup tooling * refactor: checkpoint dead-code cleanup * refactor: remove dead-code suppressions --------- Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
52 lines
2.1 KiB
TypeScript
52 lines
2.1 KiB
TypeScript
export type OpenInApp = {
|
|
id: string;
|
|
label: string;
|
|
appName: string;
|
|
};
|
|
|
|
export const OPEN_IN_APPS: OpenInApp[] = [
|
|
{ id: 'finder', label: 'Finder', appName: 'Finder' },
|
|
{ id: 'terminal', label: 'Terminal', appName: 'Terminal' },
|
|
{ id: 'iterm2', label: 'iTerm2', appName: 'iTerm' },
|
|
{ id: 'ghostty', label: 'Ghostty', appName: 'Ghostty' },
|
|
{ id: 'vscode', label: 'VS Code', appName: 'Visual Studio Code' },
|
|
{ id: 'intellij', label: 'IntelliJ', appName: 'IntelliJ IDEA' },
|
|
{ id: 'visual-studio', label: 'Visual Studio', appName: 'Visual Studio' },
|
|
{ id: 'cursor', label: 'Cursor', appName: 'Cursor' },
|
|
{ id: 'android-studio', label: 'Android Studio', appName: 'Android Studio' },
|
|
{ id: 'pycharm', label: 'PyCharm', appName: 'PyCharm' },
|
|
{ id: 'xcode', label: 'Xcode', appName: 'Xcode' },
|
|
{ id: 'sublime-text', label: 'Sublime', appName: 'Sublime Text' },
|
|
{ id: 'webstorm', label: 'WebStorm', appName: 'WebStorm' },
|
|
{ id: 'rider', label: 'Rider', appName: 'Rider' },
|
|
{ id: 'zed', label: 'Zed', appName: 'Zed' },
|
|
{ id: 'phpstorm', label: 'PhpStorm', appName: 'PhpStorm' },
|
|
{ id: 'eclipse', label: 'Eclipse', appName: 'Eclipse' },
|
|
{ id: 'windsurf', label: 'Windsurf', appName: 'Windsurf' },
|
|
{ id: 'vscodium', label: 'VSCodium', appName: 'VSCodium' },
|
|
{ id: 'rustrover', label: 'RustRover', appName: 'RustRover' },
|
|
{ id: 'kiro', label: 'Kiro', appName: 'Kiro' },
|
|
{ id: 'antigravity', label: 'Antigravity', appName: 'Antigravity' },
|
|
{ id: 'trae', label: 'Trae', appName: 'Trae' },
|
|
];
|
|
|
|
export const DEFAULT_OPEN_IN_APP_ID = 'finder';
|
|
export const OPEN_IN_ALWAYS_AVAILABLE_APP_IDS = new Set(['finder', 'terminal']);
|
|
|
|
export const getPlatformOpenInApp = (app: OpenInApp): OpenInApp => {
|
|
if (typeof window !== 'undefined' && window.__OPENCHAMBER_PLATFORM__ === 'win32') {
|
|
if (app.id === 'finder') {
|
|
return { ...app, label: 'Explorer', appName: 'File Explorer' };
|
|
}
|
|
}
|
|
return app;
|
|
};
|
|
|
|
export const getOpenInAppById = (id: string | null | undefined): OpenInApp | null => {
|
|
if (!id) {
|
|
return null;
|
|
}
|
|
const app = OPEN_IN_APPS.find((candidate) => candidate.id === id) ?? null;
|
|
return app ? getPlatformOpenInApp(app) : null;
|
|
};
|