Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.

Commit 6a9c291

Browse files
authored
merge(#247): NodiumMC/next
2 parents f5ca114 + e978819 commit 6a9c291

File tree

129 files changed

+1938
-1329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1938
-1329
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nodium-launcher",
33
"private": true,
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"moduleDirectories": [
66
"node_modules",
77
"src"
@@ -24,11 +24,11 @@
2424
"@fortawesome/free-regular-svg-icons": "6.2.1",
2525
"@fortawesome/free-solid-svg-icons": "6.2.1",
2626
"@fortawesome/react-fontawesome": "0.2.0",
27+
"@nodium/tsyringe": "^1.0.0",
2728
"@tauri-apps/api": "1.2.0",
2829
"@types/stack-trace": "0.0.30",
2930
"@types/styled-components": "5.1.26",
3031
"axios": "^1.1.2",
31-
"class-transformer": "0.5.1",
3232
"country-flag-icons": "1.5.5",
3333
"dotenv-cli": "6.0.0",
3434
"eventemitter3": "5.0.0",
@@ -57,7 +57,7 @@
5757
"styled-components": "5.3.6",
5858
"swr": "2.0.0",
5959
"tauri-plugin-fs-watch-api": "github:tauri-apps/tauri-plugin-fs-watch",
60-
"tsyringe": "4.7.0",
60+
"url-parse": "^1.5.10",
6161
"use-debounce": "^9.0.2"
6262
},
6363
"devDependencies": {
@@ -85,6 +85,7 @@
8585
"@types/react-dom": "18.0.9",
8686
"@types/testing-library__jest-dom": "5.14.5",
8787
"@types/throttle-debounce": "5.0.0",
88+
"@types/url-parse": "^1.4.8",
8889
"@types/webfontloader": "1.6.35",
8990
"@typescript-eslint/eslint-plugin": "5.47.0",
9091
"@typescript-eslint/parser": "5.47.0",

rust/commands/src/compat/download.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ async fn download_file<F: Fn(u64, u64, u64)>(url: &Url, to: &PathBuf, on: Option
9999
#[allow(unused)]
100100
#[command]
101101
pub async fn download<R: Runtime, 'a>(app_handle: AppHandle<R>, item: DownloadItem) -> Result<String, DownloadError> {
102+
tfs::create_dir_all(&item.local.parent().unwrap()).await?;
102103
if let Some(hash) = check_match(item.hash, &item.local) {
103104
return Ok(hash);
104105
}

rust/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "Nodium Launcher",
11-
"version": "0.2.0"
11+
"version": "0.2.1"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/App.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { Header } from 'components/organisms/header'
55
import { useThemeToggleHotkey } from 'hooks'
66
import { PopupContainer, UpfallConatiner } from 'notifications'
77
import { Fonts, Style } from 'style'
8-
import { ThemeService } from 'theme'
9-
import { Updater } from 'updater'
8+
import { ThemeModule } from 'theme'
9+
import { UpdaterModule } from 'updater'
1010
import { Routes } from 'Routes'
1111
import 'utils/loadIcons'
1212
import { useDebugHotkey } from 'hooks/useDebug'
1313
import { AceStyle } from 'debug/commander'
14-
import { ErrorBoundary } from 'debug/ErrorBoundary'
14+
import { ErrorBoundary } from 'components/organisms/ErrorBoundary'
1515
import { useMod } from 'hooks/useMod'
1616
import { observer } from 'mobx-react'
1717
import { toJS } from 'mobx'
@@ -35,17 +35,17 @@ const View = styled.div`
3535
`
3636

3737
export const App: FC = observer(() => {
38-
const theme = useMod(ThemeService)
39-
useMod(Updater)
38+
const theme = useMod(ThemeModule)
39+
useMod(UpdaterModule)
4040
useThemeToggleHotkey()
4141
useDebugHotkey()
4242
return (
4343
<>
44-
<ThemeProvider theme={toJS(theme.theme)}>
44+
<ThemeProvider theme={toJS(theme.target)}>
4545
<Style />
4646
<Fonts />
4747
<AceStyle />
48-
<AppRoot>
48+
<AppRoot onContextMenu={e => e.preventDefault()}>
4949
<Header />
5050
<ErrorBoundary>
5151
<View>

src/components/molecules/Dropdown.tsx

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/components/organisms/AppPreloader/AppPreloader.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components'
33
import { Empty } from 'components/utils/Empty'
44
import { Preloader } from 'components/atoms/Preloader'
55
import { font } from 'style'
6-
import { Preloader as PreloaderService } from 'preload'
6+
import { PreloaderModule } from 'preload'
77
import { AnimatePresence, motion } from 'framer-motion'
88
import { useMod } from 'hooks/useMod'
99
import { observer } from 'mobx-react'
@@ -78,11 +78,11 @@ const StageWrapper = styled.div`
7878
// `
7979

8080
export const AppPreloader: FC = observer(() => {
81-
const { inProcess, currentTaskName } = useMod(PreloaderService)
81+
const { progress, taskName } = useMod(PreloaderModule)
8282

8383
return (
8484
<AnimatePresence>
85-
{inProcess && (
85+
{progress && (
8686
<AppPreloaderWrapper
8787
initial={{ opacity: 1, scale: 1 }}
8888
animate={{ opacity: 1, scale: 1 }}
@@ -97,7 +97,7 @@ export const AppPreloader: FC = observer(() => {
9797
<StageWrapper>
9898
<Stage>
9999
<AbsolutePreloader />
100-
{currentTaskName}
100+
{taskName}
101101
</Stage>
102102
</StageWrapper>
103103
</AppPreloaderWrapper>

src/components/organisms/CrashOverlay.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { FC, useEffect, useState } from 'react'
22
import styled from 'styled-components'
33
import { Text } from 'components/atoms/Text'
4-
import { ReportService } from 'debug/report.service'
54
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
65
import { parse } from 'stack-trace'
76
import { transition } from 'style'
87
import { useMod } from 'hooks/useMod'
98
import { observer } from 'mobx-react'
109
import { useI18N } from 'hooks'
10+
import { ReportModule } from 'debug/report.module'
1111

1212
const StyledOverlay = styled.div`
1313
position: absolute;
@@ -54,7 +54,7 @@ const ProgressInner = styled.div.attrs<ExtraProps.Value<number>>(({ value }) =>
5454
`
5555

5656
export const CrashOverlay: FC = observer(() => {
57-
const report = useMod(ReportService)
57+
const report = useMod(ReportModule)
5858
const i18n = useI18N()
5959
const [progress, setProgress] = useState(0)
6060

src/debug/ErrorBoundary.tsx renamed to src/components/organisms/ErrorBoundary.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { error } from 'debug'
22
import { PureComponent } from 'react'
3-
import { ReportService } from 'debug/report.service'
43
import { CrashOverlay } from 'components/organisms/CrashOverlay'
5-
import { container } from 'tsyringe'
4+
import { container } from '@nodium/tsyringe'
5+
import { ReportModule } from 'debug/report.module'
66

77
export class ErrorBoundary extends PureComponent<any, { hasError: boolean }> {
88
constructor(props: any) {
@@ -16,7 +16,7 @@ export class ErrorBoundary extends PureComponent<any, { hasError: boolean }> {
1616

1717
componentDidCatch(err: Error) {
1818
error(err)
19-
container.resolve(ReportService).report(err)
19+
container.resolve(ReportModule).report(err)
2020
}
2121

2222
render() {

0 commit comments

Comments
 (0)