12 Commits
1.0.3 ... main

28 changed files with 591 additions and 760 deletions

58
.gitignore vendored
View File

@@ -1,44 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
pnpm-debug.log*
lerna-debug.log*
# env files (can opt-in for committing if needed)
.env*
node_modules
dist
dist-ssr
*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
# vscode project settings
.vscode/settings.json
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

668
bun.lock

File diff suppressed because it is too large Load Diff

23
eslint.config.js Normal file
View File

@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2024,
globals: globals.browser,
},
},
])

View File

@@ -1,18 +0,0 @@
import { defineConfig, globalIgnores } from 'eslint/config'
import nextVitals from 'eslint-config-next/core-web-vitals'
import nextTs from 'eslint-config-next/typescript'
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
'.next/**',
'out/**',
'build/**',
'next-env.d.ts'
])
])
export default eslintConfig

11
index.html Normal file
View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -1,14 +0,0 @@
import type { NextConfig } from 'next'
const isProd = process.env.NODE_ENV === 'production'
const internalHost = process.env.TAURI_DEV_HOST || 'localhost'
const nextConfig: NextConfig = {
output: 'export',
images: {
unoptimized: true
},
assetPrefix: isProd ? undefined : `http://${internalHost}:3000`,
devIndicators: false
}
export default nextConfig

View File

@@ -1,36 +1,42 @@
{
"name": "lncvrt-games-launcher-loader",
"private": true,
"version": "1.0.3",
"version": "1.1.0",
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "2.9.1",
"@tauri-apps/plugin-dialog": "2.4.2",
"@tauri-apps/plugin-fs": "2.4.4",
"@tauri-apps/plugin-opener": "2.5.2",
"@fontsource/lexend": "5.2.11",
"@tailwindcss/vite": "4.1.18",
"@tauri-apps/api": "2.10.1",
"@tauri-apps/plugin-dialog": "2.6.0",
"@tauri-apps/plugin-fs": "2.4.5",
"@tauri-apps/plugin-opener": "2.5.3",
"@tauri-apps/plugin-os": "2.3.2",
"axios": "1.13.2",
"next": "16.1.1",
"react": "19.2.3",
"react-dom": "19.2.3"
"axios": "1.13.5",
"react": "19.2.4",
"react-dom": "19.2.4",
"tailwindcss": "4.1.18"
},
"devDependencies": {
"@tauri-apps/cli": "2.9.6",
"typescript": "5.9.3",
"@types/node": "25.0.3",
"@types/react": "19.2.7",
"@eslint/js": "10.0.1",
"@tauri-apps/cli": "2.10.0",
"@types/node": "25.2.3",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"@tailwindcss/postcss": "4.1.18",
"tailwindcss": "4.1.18",
"@vitejs/plugin-react": "5.1.4",
"babel-plugin-react-compiler": "1.0.0",
"eslint": "9.39.2",
"eslint-config-next": "16.1.1",
"@eslint/eslintrc": "3.3.3"
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "0.5.0",
"globals": "17.3.0",
"typescript": "5.9.3",
"typescript-eslint": "8.56.0",
"vite": "7.3.1"
}
}

View File

@@ -1,7 +0,0 @@
const config = {
plugins: {
'@tailwindcss/postcss': {}
}
}
export default config

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,6 +1,6 @@
[package]
name = "lncvrt-games-launcher-loader"
version = "1.0.3"
version = "1.1.0"
authors = ["Lncvrt"]
edition = "2024"
@@ -9,21 +9,24 @@ name = "lncvrt_games_launcher_loader_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.5.3", features = [] }
tauri-build = { version = "2.5.5", features = [] }
[dependencies]
tauri = { version = "2.9.5", features = [] }
tauri = { version = "2.10.2", features = [] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
tauri-plugin-fs = "2.4.4"
tauri-plugin-fs = "2.4.5"
tokio = "1.49.0"
zip = "7.0.0"
zip = "8.1.0"
tauri-plugin-os = "2.3.2"
reqwest = { version = "0.13.1", default-features = false, features = ["stream", "rustls"] }
tauri-plugin-opener = "2.5.2"
tauri-plugin-dialog = "2.4.2"
reqwest = { version = "0.13.2", default-features = false, features = ["stream", "rustls"] }
tauri-plugin-opener = "2.5.3"
tauri-plugin-dialog = "2.6.0"
sha2 = "0.10.9"
tauri-plugin-decorum = "1.1.1"
tauri-plugin-prevent-default = "4.0.3"
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-single-instance = "2.3.6"
tauri-plugin-single-instance = "2.4.0"
tauri-plugin-window-state = "2.4.1"

View File

@@ -7,12 +7,22 @@
],
"permissions": [
"core:default",
"core:window:allow-close",
"core:window:allow-center",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-set-size",
"core:window:allow-set-focus",
"core:window:allow-is-maximized",
"core:window:allow-start-dragging",
"core:window:allow-toggle-maximize",
"decorum:allow-show-snap-overlay",
"fs:default",
"os:default",
"opener:default",
"dialog:default",
"fs:allow-write-text-file",
"fs:allow-create",
{
"identifier": "fs:scope",
"allow": [{ "path": "$APPLOCALDATA/.version" }]

View File

@@ -1,33 +1,80 @@
use sha2::{Digest, Sha512};
use std::fs::remove_dir_all;
use std::io::Cursor;
use std::{
fs::{self, remove_dir_all},
io::Cursor,
fs::{File, create_dir_all},
io::copy,
path::PathBuf,
process::Command,
};
use tauri::{AppHandle, Manager};
use tauri_plugin_os::platform;
use tauri_plugin_prevent_default::Flags;
use zip::ZipArchive;
fn unzip_to_dir(bytes: &[u8], target: &PathBuf) -> std::io::Result<()> {
#[cfg(target_os = "windows")]
use tauri_plugin_decorum::WebviewWindowExt;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
fn should_skip(name: &str) -> bool {
name.starts_with("__MACOSX/")
|| name == "__MACOSX"
|| name.ends_with("/.DS_Store")
|| name.ends_with(".DS_Store")
}
async fn unzip_to_dir(bytes: &[u8], target: &PathBuf) -> String {
let bytes = bytes.to_vec();
let target = target.clone();
let res = tauri::async_runtime::spawn_blocking(move || -> Result<(), String> {
let reader = Cursor::new(bytes);
let mut zip = ZipArchive::new(reader).unwrap();
let mut archive = ZipArchive::new(reader).map_err(|e| e.to_string())?;
for i in 0..zip.len() {
let mut file = zip.by_index(i).unwrap();
let outpath = target.join(file.mangled_name());
for i in 0..archive.len() {
let mut entry = archive.by_index(i).map_err(|e| e.to_string())?;
let name = entry.name();
if file.name().ends_with('/') {
fs::create_dir_all(&outpath)?;
if should_skip(name) {
continue;
}
let outpath = target.join(name);
if entry.is_dir() {
create_dir_all(&outpath).map_err(|e| e.to_string())?;
#[cfg(unix)]
if let Some(mode) = entry.unix_mode() {
std::fs::set_permissions(&outpath, std::fs::Permissions::from_mode(mode))
.map_err(|e| e.to_string())?;
}
} else {
if let Some(p) = outpath.parent() {
fs::create_dir_all(p)?;
if let Some(parent) = outpath.parent() {
create_dir_all(parent).map_err(|e| e.to_string())?;
}
let mut outfile = fs::File::create(&outpath)?;
std::io::copy(&mut file, &mut outfile)?;
let mut outfile = File::create(&outpath).map_err(|e| e.to_string())?;
copy(&mut entry, &mut outfile).map_err(|e| e.to_string())?;
#[cfg(unix)]
if let Some(mode) = entry.unix_mode() {
std::fs::set_permissions(&outpath, std::fs::Permissions::from_mode(mode))
.map_err(|e| e.to_string())?;
}
}
}
Ok(())
})
.await;
match res {
Ok(Ok(())) => "1".into(),
_ => "-1".into(),
}
}
fn get_sha512_hash(data: &[u8]) -> String {
@@ -54,60 +101,54 @@ async fn download(app: AppHandle, url: String, hash: String) -> String {
return "-2".to_string();
}
let bin_path = app.path().app_local_data_dir().unwrap().join("bin");
let bin_path = match app.path().app_local_data_dir() {
Ok(p) => p.join("bin"),
Err(_) => return "-1".to_string(),
};
let _ = tokio::fs::create_dir_all(&bin_path).await;
if let Err(_) = unzip_to_dir(&bytes, &bin_path) {
return "-3".to_string();
let unzip_res = unzip_to_dir(&bytes, &bin_path).await;
if unzip_res == "-1" {
return "-1".to_string();
}
drop(bytes);
#[cfg(any(target_os = "linux", target_os = "macos"))]
{
use std::{fs, os::unix::fs::PermissionsExt};
let executable_path = if cfg!(target_os = "linux") {
bin_path.join("lncvrt-games-launcher")
} else {
bin_path
.join("Lncvrt Games Launcher.app")
.join("Contents")
.join("MacOS")
.join("lncvrt-games-launcher")
};
let mut perms = fs::metadata(&executable_path).unwrap().permissions();
perms.set_mode(0o755);
fs::set_permissions(&executable_path, perms).unwrap();
}
return "1".to_string();
}
#[allow(unused_variables)]
#[tauri::command]
fn load(app: AppHandle) {
let bin_path = app.path().app_local_data_dir().unwrap().join("bin");
let bin_path = match app.path().app_local_data_dir() {
Ok(p) => p.join("bin"),
Err(_) => return,
};
if !bin_path.exists() {
return;
}
if platform() == "macos" {
Command::new("open")
if let Err(_) = Command::new("open")
.arg("Lncvrt Games Launcher.app")
.current_dir(&bin_path)
.spawn()
.unwrap();
{
eprintln!("Failed to launch game on macOS");
}
} else if platform() == "linux" {
Command::new("./lncvrt-games-launcher")
if let Err(_) = Command::new("./lncvrt-games-launcher")
.current_dir(&bin_path)
.spawn()
.unwrap();
{
eprintln!("Failed to launch game on macOS");
}
} else if platform() == "windows" {
Command::new(&bin_path.join("lncvrt-games-launcher.exe"))
if let Err(_) = Command::new(&bin_path.join("lncvrt-games-launcher.exe"))
.current_dir(&bin_path)
.spawn()
.unwrap();
{
eprintln!("Failed to launch game on macOS");
}
}
app.exit(0);
@@ -116,8 +157,48 @@ fn load(app: AppHandle) {
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(
tauri_plugin_prevent_default::Builder::new()
.with_flags(
Flags::FIND
| Flags::CARET_BROWSING
| Flags::DEV_TOOLS
| Flags::DOWNLOADS
| Flags::FOCUS_MOVE
| Flags::RELOAD
| Flags::SOURCE
| Flags::OPEN
| Flags::PRINT
| Flags::CONTEXT_MENU,
)
.build(),
)
.plugin(tauri_plugin_window_state::Builder::new().build())
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
let _ = app
.get_webview_window("main")
.expect("no main window")
.set_focus();
}))
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_decorum::init())
.plugin(tauri_plugin_os::init())
.setup(|app| {
let app_local_data_dir = app.path().app_local_data_dir().unwrap();
#[cfg(target_os = "windows")]
{
if let Some(main_window) = app.get_webview_window("main") {
if let Err(e) = main_window.create_overlay_titlebar() {
eprintln!("Failed to create overlay titlebar: {:?}", e);
}
}
}
let app_local_data_dir = match app.path().app_local_data_dir() {
Ok(p) => p,
Err(_) => return Ok(()),
};
let downloads_dir = app_local_data_dir.join("downloads");
let updates_dir = app_local_data_dir.join("updates");
let bin_dir = app_local_data_dir.join("bin");
@@ -138,16 +219,6 @@ pub fn run() {
Ok(())
})
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
let _ = app
.get_webview_window("main")
.expect("no main window")
.set_focus();
}))
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_fs::init())
.invoke_handler(tauri::generate_handler![download, load])
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher",
"version": "1.0.3",
"version": "1.1.0",
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
"build": {
"beforeDevCommand": "next dev",
"devUrl": "http://localhost:3000",
"beforeBuildCommand": "next build",
"frontendDist": "../out"
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:5173",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"withGlobalTauri": true,

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher",
"version": "1.0.3",
"version": "1.1.0",
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
"build": {
"beforeDevCommand": "next dev",
"devUrl": "http://localhost:3000",
"beforeBuildCommand": "next build",
"frontendDist": "../out"
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:5173",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"withGlobalTauri": true,
@@ -26,7 +26,7 @@
},
"bundle": {
"active": true,
"targets": ["deb", "rpm", "appimage"],
"targets": ["deb", "rpm"],
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png"]
}
}

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher",
"version": "1.0.3",
"version": "1.1.0",
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
"build": {
"beforeDevCommand": "next dev",
"devUrl": "http://localhost:3000",
"beforeBuildCommand": "next build",
"frontendDist": "../out"
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:5173",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"withGlobalTauri": true,
@@ -29,7 +29,7 @@
"active": true,
"targets": ["dmg"],
"macOS": {
"minimumSystemVersion": "13.7.8"
"minimumSystemVersion": "13.0"
},
"icon": ["icons/icon.icns"]
}

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher",
"version": "1.0.3",
"version": "1.1.0",
"identifier": "xyz.lncvrt.lncvrt-games-launcher-loader",
"build": {
"beforeDevCommand": "next dev",
"devUrl": "http://localhost:3000",
"beforeBuildCommand": "next build",
"frontendDist": "../out"
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:5173",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"withGlobalTauri": true,
@@ -15,9 +15,13 @@
{
"title": "Lncvrt Games Launcher",
"width": 300,
"height": 300,
"height": 332,
"resizable": false,
"maximizable": false
"maximizable": false,
"titleBarStyle": "Overlay",
"hiddenTitle": true,
"decorations": false,
"shadow": true
}
],
"security": {

17
src/App.css Normal file
View File

@@ -0,0 +1,17 @@
@import "tailwindcss";
body {
@apply bg-(--col0) text-white select-none;
font-family: 'Lexend', sans-serif;
--col0: rgb(8, 8, 8);
--col1: rgb(16, 16, 16);
--col2: rgb(32, 32, 32);
--col3: rgb(48, 48, 48);
--col4: rgb(64, 64, 64);
--col6: rgb(96, 96, 96);
}
button {
@apply bg-(--col2) hover:bg-(--col4) border border-(--col4) hover:border-(--col6) transition-colors px-2 py-1 rounded-md cursor-pointer;
}

View File

@@ -1,12 +1,9 @@
'use client'
import Image from 'next/image'
import Icon from './assets/Icon.png'
import { useEffect, useState } from 'react'
import axios from 'axios'
import { app } from '@tauri-apps/api'
import { invoke } from '@tauri-apps/api/core'
import { LauncherUpdate } from './types/LauncherUpdate'
import { openUrl } from '@tauri-apps/plugin-opener'
import { arch, platform } from '@tauri-apps/plugin-os'
import {
@@ -16,9 +13,21 @@ import {
readTextFile,
writeTextFile
} from '@tauri-apps/plugin-fs'
import { message } from '@tauri-apps/plugin-dialog'
export default function Home () {
import '@fontsource/lexend'
import './App.css'
interface LauncherUpdate {
id: string
releaseDate: number
downloadUrl: string
sha512sum: string
}
export default function App () {
const [state, setState] = useState<string>('Loading...')
const [error, setError] = useState<string>('')
useEffect(() => {
;(async () => {
@@ -35,8 +44,9 @@ export default function Home () {
launcherLatestRequest = await axios.get(
'https://games.lncvrt.xyz/api/launcher/latest'
)
} catch {
} catch (e: unknown) {
setState('Failed. Check internet connection.')
setError('e0001 / ' + String(e))
return
}
@@ -45,6 +55,7 @@ export default function Home () {
launcherLatestRequest.status !== 200
) {
setState('Failed. Try again later.')
setError('e0002')
return
}
@@ -71,12 +82,14 @@ export default function Home () {
`https://games.lncvrt.xyz/api/launcher/loader/update-data?platform=${platform()}&arch=${arch()}`
)
launcherUpdateData = launcherUpdateRequest.data
} catch {
} catch (e: unknown) {
setState('Failed. Check internet connection.')
setError('e0003 / ' + String(e))
return
}
if (!launcherUpdateData) {
setState('Failed. Check internet connection.')
setError('e0004')
return
}
const downloadResult = await invoke('download', {
@@ -85,6 +98,7 @@ export default function Home () {
})
if (downloadResult == '-1') {
setState('Failed. Check internet connection.')
setError('e0005 / ' + downloadResult)
return
} else if (downloadResult == '-2') {
setState('File integrity check failed.')
@@ -104,11 +118,21 @@ export default function Home () {
return (
<>
<div className='absolute left-1/2 top-[20%] -translate-x-1/2 flex flex-col items-center'>
<Image src={Icon} width={128} height={128} alt='' draggable={false} />
<div
className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)'
hidden={platform() != 'windows'}
/>
<div className={`absolute left-1/2 ${platform() == 'windows' ? 'top-18' : 'top-10'} -translate-x-1/2 flex flex-col items-center`}>
<img
src='/Icon.png'
width={128}
height={128}
alt=''
draggable={false}
/>
<div
className={`${
state !== 'Loader update required' ? 'mt-10' : 'mt-4'
state == 'Loader update required' || error != '' ? 'mt-4' : 'mt-10'
} text-center`}
>
<p className='whitespace-nowrap'>{state}</p>
@@ -121,6 +145,15 @@ export default function Home () {
>
Update
</button>
<button
hidden={error == ''}
className='mt-4'
onClick={async () =>
await message(error, { title: 'Error', kind: 'error' })
}
>
Show error
</button>
</div>
</div>
</>

View File

@@ -1,9 +0,0 @@
@import "tailwindcss";
body {
@apply bg-[rgb(24,24,24)] text-white select-none;
}
button {
@apply bg-[rgb(48,48,48)] hover:bg-[rgb(72,72,72)] border border-[rgb(72,72,72)] hover:border-[rgb(96,96,96)] transition-colors px-2 py-1 rounded-md cursor-pointer;
}

View File

@@ -1,35 +0,0 @@
'use client'
import { Lexend } from 'next/font/google'
import './globals.css'
import { getCurrentWindow } from '@tauri-apps/api/window'
import { useEffect } from 'react'
const lexend = Lexend({
subsets: ['latin']
})
export default function RootLayout ({
children
}: Readonly<{
children: React.ReactNode
}>) {
const handleMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {
if ((e.target as HTMLElement).closest('button')) return
getCurrentWindow().startDragging()
}
useEffect(() => {
document.body.addEventListener('mousedown', handleMouseDown as any)
return () =>
document.body.removeEventListener('mousedown', handleMouseDown as any)
}, [])
return (
<html lang='en'>
<body className={lexend.className}>
<div className='w-max h-screen'>{children}</div>
</body>
</html>
)
}

View File

@@ -1,6 +0,0 @@
export interface LauncherUpdate {
id: string
releaseDate: number
downloadUrl: string
sha512sum: string
}

1
src/declarations.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module '@fontsource/lexend'

9
src/main.tsx Normal file
View File

@@ -0,0 +1,9 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>
)

28
tsconfig.app.json Normal file
View File

@@ -0,0 +1,28 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2022",
"useDefineForClassFields": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
"types": ["vite/client"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
}

View File

@@ -1,34 +1,7 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

26
tsconfig.node.json Normal file
View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

15
vite.config.ts Normal file
View File

@@ -0,0 +1,15 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
babel: {
plugins: [['babel-plugin-react-compiler']],
},
}),
tailwindcss(),
],
})