Skip to content

Commit

Permalink
refactor: move wails generated code to ui src
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Mar 23, 2024
1 parent 5359b7f commit 0b78d29
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"eslint.workingDirectories": [
"./frontend/"
"./ui/"
],
"cSpell.words": [
"DOCKERHUB"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/app/api/browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BrowserOpenURL } from '$wailsjs/runtime'
import { BrowserOpenURL } from '$wails/runtime'

export function openBrowser (url: string) {
BrowserOpenURL(url)
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/app/api/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetAppSettings, SetAppSettings } from '$wailsjs/go/usecase/SettingsUsecase'
import { GetAppSettings, SetAppSettings } from '$wails/go/usecase/SettingsUsecase'

import type { AppSettings } from '../model/types'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/app/api/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CheckUpdates, GetVersion } from '$wailsjs/go/usecase/EnvironmentUsecase'
import { CheckUpdates, GetVersion } from '$wails/go/usecase/EnvironmentUsecase'

export async function getVersion () {
const version = await GetVersion()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/device/api/firmware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetFirmware } from '$wailsjs/go/usecase/DeviceUsecase'
import { GetFirmware } from '$wails/go/usecase/DeviceUsecase'

export async function getFirmware (): Promise<string> {
const version = await GetFirmware()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/device/api/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestoreDefaultState, RestoreState, SaveState } from '$wailsjs/go/usecase/DeviceUsecase'
import { RestoreDefaultState, RestoreState, SaveState } from '$wails/go/usecase/DeviceUsecase'

export async function saveState (): Promise<void> {
return await SaveState()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/device/api/supports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetSupports } from '$wailsjs/go/usecase/DeviceUsecase'
import { GetSupports } from '$wails/go/usecase/DeviceUsecase'

import type { Supports } from '../model/types'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/keys/api/groups.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetKeyGroups } from '$wailsjs/go/usecase/KeysUsecase'
import { GetKeyGroups } from '$wails/go/usecase/KeysUsecase'

import type { KeyGroup } from '../model'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/keys/api/layout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetDefaultKeys, GetKeys, SetKeys } from '$wailsjs/go/usecase/KeysUsecase'
import { GetDefaultKeys, GetKeys, SetKeys } from '$wails/go/usecase/KeysUsecase'

import type { KeyMap } from '../model'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/lights/api/color.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetBacklightColors, SetBacklightColor } from '$wailsjs/go/usecase/LightsUsecase'
import { GetBacklightColors, SetBacklightColor } from '$wails/go/usecase/LightsUsecase'

import type { LightBacklightColors, SetBacklightColorParams } from '../model/types'
import { rgbToHex } from '../utils/hex'
Expand Down
4 changes: 2 additions & 2 deletions ui/src/entities/lights/api/mode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { light } from '$wailsjs/go/models'
import { GetLightModes } from '$wailsjs/go/usecase/LightsUsecase'
import type { light } from '$wails/go/models'
import { GetLightModes } from '$wails/go/usecase/LightsUsecase'

import type { LightModes } from '../model/types'
import { parseModes } from '../utils'
Expand Down
4 changes: 2 additions & 2 deletions ui/src/entities/lights/api/state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dto } from '$wailsjs/go/models'
import { GetLightState, SetLightState } from '$wailsjs/go/usecase/LightsUsecase'
import { dto } from '$wails/go/models'
import { GetLightState, SetLightState } from '$wails/go/usecase/LightsUsecase'

import { defaultDomainState } from '../model/const'
import type { LightState } from '../model/types'
Expand Down
2 changes: 1 addition & 1 deletion ui/src/entities/lights/utils/parse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { capitalize } from '$shared/lib'
import type { light } from '$wailsjs/go/models'
import type { light } from '$wails/go/models'

import type { LightColorIndex, LightDomainMode, LightDomainState, LightEffectParams, LightStateValue } from '../model/types'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/api/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Restart } from '$wailsjs/go/usecase/EnvironmentUsecase'
import { Restart } from '$wails/go/usecase/EnvironmentUsecase'

export async function restartApp () {
await Restart()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/api/connection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Connect, Disconnect, GetPath, SimulateConnection } from '$wailsjs/go/usecase/DeviceUsecase'
import { Connect, Disconnect, GetPath, SimulateConnection } from '$wails/go/usecase/DeviceUsecase'

import type { ConnectionDescription } from '../model'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/api/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetMode, SetMode } from '$wailsjs/go/usecase/SettingsUsecase'
import { GetMode, SetMode } from '$wails/go/usecase/SettingsUsecase'

import type { OSMode } from '../model/types'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/shared/lib/from-wails-event.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createEvent, type Event } from 'effector'

import { EventsOn } from '$wailsjs/runtime'
import { EventsOn } from '$wails/runtime'

type WailsEventHandlerFn<T> = (...params: any[]) => T

Expand Down
4 changes: 2 additions & 2 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"$widgets": ["src/widgets"],
"$entities/*": ["src/entities/*"],
"$pages": ["src/pages"],
"$wailsjs/runtime": ["wailsjs/runtime/runtime"],
"$wailsjs/go/*": ["wailsjs/go/*"]
"$wails/runtime": ["src/wailsjs/runtime/runtime"],
"$wails/go/*": ["src/wailsjs/go/*"]
},
"outDir": "dist"
},
Expand Down
4 changes: 2 additions & 2 deletions ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default defineConfig({
$entities: resolve(__dirname, './src/entities'),
$widgets: resolve(__dirname, './src/widgets'),
$pages: resolve(__dirname, './src/pages'),
'$wailsjs/runtime': resolve(__dirname, './wailsjs/runtime/runtime'),
'$wailsjs/go': resolve(__dirname, './wailsjs/go')
'$wails/runtime': resolve(__dirname, './src/wailsjs/runtime/runtime'),
'$wails/go': resolve(__dirname, './src/wailsjs/go')
}
},
plugins: [svelte()]
Expand Down
3 changes: 2 additions & 1 deletion wails.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"frontend:build": "pnpm run build",
"frontend:dev:watcher": "pnpm run dev",
"frontend:dev:serverUrl": "auto",
"wailsjsdir": "ui/src",
"author": {
"name": "mishamyrt",
"email": "[email protected]"
},
"info": {
"productVersion": "2.1.0",
"comments": "NuPhy(R) keyboard configurator",
"copyright": "Copyright 2023 The Nuga Project Authors (https://github.com/mishamyrt/Nuga/blob/master/AUTHORS)"
"copyright": "Copyright 2024 The Nuga Project Authors (https://github.com/mishamyrt/Nuga/blob/master/AUTHORS)"
}
}

0 comments on commit 0b78d29

Please sign in to comment.