-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into releases/0.0.18
- Loading branch information
Showing
18 changed files
with
304 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Vite timestamp | ||
vite.config.ts.timestamp-*.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export enum IdeType { | ||
VS_CODE = 'VSCode', | ||
CURSOR = 'Cursor', | ||
} | ||
|
||
export class IDE { | ||
static readonly VS_CODE = new IDE('VSCode', IdeType.VS_CODE, 'vscode'); | ||
static readonly CURSOR = new IDE('Cursor', IdeType.CURSOR, 'cursor'); | ||
|
||
private constructor( | ||
public readonly displayName: string, | ||
public readonly type: IdeType, | ||
public readonly command: string, | ||
) {} | ||
|
||
toString() { | ||
return this.displayName; | ||
} | ||
|
||
static fromType(type: IdeType): IDE { | ||
switch (type) { | ||
case IdeType.VS_CODE: | ||
return IDE.VS_CODE; | ||
case IdeType.CURSOR: | ||
return IDE.CURSOR; | ||
default: | ||
throw new Error(`Unknown IDE type: ${type}`); | ||
} | ||
} | ||
|
||
static getAll(): IDE[] { | ||
return [IDE.VS_CODE, IDE.CURSOR]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { IdeType } from '../ide'; | ||
|
||
export interface UserSettings { | ||
id?: string; | ||
enableAnalytics?: boolean; | ||
ideType?: IdeType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import { ipcMain } from 'electron'; | ||
import { readUserSettings } from '../storage'; | ||
import { listenForAnalyticsMessages } from './analytics'; | ||
import { listenForCodeMessages } from './code'; | ||
import { listenForSettingMessages } from './settings'; | ||
import { listenForTunnelMessages } from './tunnel'; | ||
import { MainChannels } from '/common/constants'; | ||
|
||
export function listenForIpcMessages() { | ||
listenForTunnelMessages(); | ||
listenForAnalyticsMessages(); | ||
listenForCodeMessages(); | ||
listenForSettingMessages(); | ||
} | ||
|
||
function listenForSettingMessages() { | ||
ipcMain.handle(MainChannels.GET_USER_SETTINGS, (e: Electron.IpcMainInvokeEvent) => { | ||
return readUserSettings(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ipcMain } from 'electron'; | ||
import { readUserSettings, updateUserSettings } from '../storage'; | ||
import { MainChannels } from '/common/constants'; | ||
|
||
export function listenForSettingMessages() { | ||
ipcMain.handle(MainChannels.GET_USER_SETTINGS, (e: Electron.IpcMainInvokeEvent) => { | ||
return readUserSettings(); | ||
}); | ||
|
||
ipcMain.handle(MainChannels.UPDATE_USER_SETTINGS, (e: Electron.IpcMainInvokeEvent, args) => { | ||
updateUserSettings(args); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.