Skip to content

Commit

Permalink
Menu refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Specy committed Apr 16, 2024
1 parent ea4501d commit 3345a2d
Show file tree
Hide file tree
Showing 116 changed files with 922 additions and 756 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can use the scripts `npm run build:genshin` and `npm run build:sky` which wi

# How to build desktop app

The app uses tauri for the desktop bundle which is a sandboxed webview. You can build it by using `npm run build-tauri:genshin`, `npm run build-tauri:sky`, `npm run build-tauri:all`. The config is premade to allow for updates, if you dont have a signing key, the build will fail. If you want to build without updates, go to `src-tauri/tauri.conf.json` and set `updater` to false
The app uses tauri for the desktop bundle which is a sandboxed webview. You can build it by using `npm run build-tauri:genshin`, `npm run build-tauri:sky`, `npm run build-tauri:all`. The config is premade to allow for changelog, if you dont have a signing key, the build will fail. If you want to build without changelog, go to `src-tauri/tauri.conf.json` and set `updater` to false


# Documentation
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"fs-extra": "^11.1.1",
"next-pwa": "^5.6.0",
"sass": "^1.68.0",
"typescript": "^5.4.3",
"typescript": "^5.4.5",
"url-join": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion public/service-worker.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions scripts/buildAndPrepareTauriRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async function run() {
.replace("{zip-name}", buildZip),
signature: buildSignature
}
//saves the results to both the folder of the build data and updates the repository one
//saves the results to both the folder of the build data and changelog the repository one
await fs.writeFile(`./src-tauri/tauri-${app}.update.json`, JSON.stringify(appUpdate, null, 2))
//copies all the built files to the final release folder
await fs.mkdir(folders.windowsRelease, { recursive: true })
Expand Down Expand Up @@ -148,7 +148,7 @@ async function run() {
.replace("{zip-name}", buildZip),
signature: buildSignature
}
//saves the results to both the folder of the build data and updates the repository one
//saves the results to both the folder of the build data and changelog the repository one
await fs.writeFile(`./src-tauri/tauri-${app}.update.json`, JSON.stringify(appUpdate, null, 2))
//copies all the update files
await fs.mkdir(folders.macosRelease, { recursive: true })
Expand Down Expand Up @@ -201,7 +201,7 @@ async function run() {
.replace("{zip-name}", buildZip),
signature: buildSignature
}
//saves the results to both the folder of the build data and updates the repository one
//saves the results to both the folder of the build data and changelog the repository one
await fs.writeFile(`./src-tauri/tauri-${app}.update.json`, JSON.stringify(appUpdate, null, 2))
//copies all the update files
await fs.mkdir(folders.linuxRelease, { recursive: true })
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ fn main() {
let context = tauri::generate_context!();
tauri::Builder::default()
.menu(if cfg!(target_os = "macos") {
tauri::Menu::os_default(&context.package_info().name)
tauri::MenuContext::os_default(&context.package_info().name)
} else {
tauri::Menu::default()
tauri::MenuContext::default()
})
.run(context)
.expect("error while running tauri application");
Expand Down
2 changes: 1 addition & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const UPDATE_MESSAGE = (APP_NAME === 'Genshin'
`).trim()

export const UPDATE_URL = process.env.NODE_ENV === 'development'
? '/updates.json'
? '/changelog.json'
: 'https://raw.githubusercontent.com/Specy/genshin-music/main/public/updates.json'


Expand Down
2 changes: 1 addition & 1 deletion src/lib/updates.ts → src/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Update = {
changes: string[]
}

export const updates: Update[] = [
export const CHANGELOG: Update[] = [
{
version: '3.3.0',
title: "Audio/Video transcription, reverb",
Expand Down
10 changes: 5 additions & 5 deletions src/components/AppBase.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {useCallback, useEffect, useState} from 'react';
import Analytics from '$lib/Stats';
import Analytics from '$lib/Analytics';
import Home from '$cmp/pages/Index/Home';
import {homeStore} from '$stores/HomeStore';
import {logger} from '$stores/LoggerStore';
import {delay} from "$lib/Utilities"
import {delay} from "$lib/utils/Utilities"
import {APP_NAME, APP_VERSION, UPDATE_MESSAGE} from "$config"
import rotateImg from "$/assets/icons/rotate.svg"
import {historyTracker} from '$stores/History';
import {browserHistory} from '$stores/BrowserHistory';
import {FaExpandAlt} from 'react-icons/fa';
import {checkIfneedsUpdate} from '$lib/needsUpdate';
import {settingsService} from '$lib/Services/SettingsService';
import {linkServices} from '$stores/globalLink';
import {linkServices} from '$lib/Services/globalServices';
import {useRouter} from 'next/router';
import Image from 'next/image';
import isMobile from 'is-mobile';
Expand Down Expand Up @@ -138,7 +138,7 @@ function AppBase() {
Analytics.pageView({
page_title: path.pathName as string
})
historyTracker.addPage(path.pathName)
browserHistory.addPage(path.pathName)
})
}, [router])
return <>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Composer/ComposerCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CACHE_DATA, NOTES_PER_COLUMN, TEMPO_CHANGERS} from "$config"
import Color from "color"
import {LINE_SCALE_MODE, settings, SmoothGraphics as Graphics} from '@pixi/graphics-smooth';
import {Application, Rectangle, SCALE_MODES, Texture} from 'pixi.js'
import {NoteLayer} from "$lib/Layer";
import {NoteLayer} from "$lib/Songs/Layer";

settings.LINE_SCALE_MODE = LINE_SCALE_MODE.NORMAL
const {horizontalLineBreak, standards, layersCombination, breakpoints} = CACHE_DATA
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Composer/ComposerCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {ComposerCache} from "$cmp/pages/Composer/ComposerCache"
import {APP_NAME} from "$config"
import Memoized from '$cmp/shared/Utility/Memoized';
import {ThemeProvider} from '$stores/ThemeStore/ThemeProvider';
import {clamp, colorToRGB, nearestEven} from '$lib/Utilities';
import {clamp, colorToRGB, nearestEven} from '$lib/utils/Utilities';
import type {NoteColumn} from '$lib/Songs/SongClasses';
import type {ComposerSettingsDataType} from '$lib/BaseSettings';
import {isColumnVisible, RenderColumn} from '$cmp/pages/Composer/RenderColumn';
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Composer/ComposerKeyboard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ComposerNote from "$cmp/pages/Composer/ComposerNote"
import {NoteColumn, InstrumentData} from "$lib/Songs/SongClasses"
import {NoteNameType, Pitch, TEMPO_CHANGERS} from "$config"
import {Instrument, ObservableNote} from "$lib/Instrument"
import {Instrument, ObservableNote} from "$lib/audio/Instrument"
import {ComposerSettingsDataType} from "$lib/BaseSettings"
import {FaChevronLeft, FaChevronRight} from "react-icons/fa"
import {useTheme} from "$lib/Hooks/useTheme"
Expand Down
Loading

0 comments on commit 3345a2d

Please sign in to comment.