mirror of
https://github.com/shadps4-emu/shadPS4-launcher.git
synced 2026-01-31 00:55:20 +01:00
lint: fix linting issues after biome upgrade
This commit is contained in:
2
.github/workflows/deploy.yaml
vendored
2
.github/workflows/deploy.yaml
vendored
@@ -34,6 +34,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Biome
|
- name: Setup Biome
|
||||||
uses: biomejs/setup-biome@v2
|
uses: biomejs/setup-biome@v2
|
||||||
|
with:
|
||||||
|
version: "2.3.8"
|
||||||
|
|
||||||
- name: Run Biome
|
- name: Run Biome
|
||||||
run: biome ci .
|
run: biome ci .
|
||||||
|
|||||||
4
.github/workflows/linting.yaml
vendored
4
.github/workflows/linting.yaml
vendored
@@ -14,9 +14,11 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Setup Biome
|
- name: Setup Biome
|
||||||
uses: biomejs/setup-biome@v2
|
uses: biomejs/setup-biome@v2
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: "2.3.8"
|
||||||
|
|
||||||
- name: Run Biome
|
- name: Run Biome
|
||||||
run: biome ci .
|
run: biome ci .
|
||||||
|
|||||||
95
biome.jsonc
95
biome.jsonc
@@ -1,28 +1,28 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://next.biomejs.dev/schemas/2.0.0-beta/schema.json",
|
"$schema": "https://next.biomejs.dev/schemas/2.3.8/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
"useIgnoreFile": true,
|
"useIgnoreFile": true
|
||||||
},
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"ignoreUnknown": false,
|
"ignoreUnknown": false,
|
||||||
"includes": ["**/*", "!dist/**", "!src-tauri"],
|
"includes": ["**/*", "!dist", "!src-tauri"]
|
||||||
},
|
},
|
||||||
"assist": {
|
"assist": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"actions": {
|
"actions": {
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"source": {
|
"source": {
|
||||||
"useSortedAttributes": "on",
|
"useSortedAttributes": "on"
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"indentStyle": "space",
|
"indentStyle": "space",
|
||||||
"indentWidth": 4,
|
"indentWidth": 4,
|
||||||
"lineEnding": "lf",
|
"lineEnding": "lf"
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
@@ -34,43 +34,42 @@
|
|||||||
"useArrowFunction": "off",
|
"useArrowFunction": "off",
|
||||||
"useLiteralKeys": "error",
|
"useLiteralKeys": "error",
|
||||||
"useOptionalChain": "error",
|
"useOptionalChain": "error",
|
||||||
|
"noArguments": "warn"
|
||||||
},
|
},
|
||||||
"correctness": {
|
"correctness": {
|
||||||
"noConstAssign": "error",
|
"noConstAssign": "error",
|
||||||
"noGlobalObjectCalls": "off",
|
"noGlobalObjectCalls": "error",
|
||||||
"noInvalidBuiltinInstantiation": "off",
|
"noInvalidBuiltinInstantiation": "error",
|
||||||
"noInvalidConstructorSuper": "off",
|
"noInvalidConstructorSuper": "error",
|
||||||
"noNewSymbol": "off",
|
"noSetterReturn": "error",
|
||||||
"noSetterReturn": "off",
|
"noUndeclaredVariables": "error",
|
||||||
"noUndeclaredVariables": "off",
|
"noUnreachable": "warn",
|
||||||
"noUnreachable": "off",
|
"noUnreachableSuper": "error",
|
||||||
"noUnreachableSuper": "off",
|
|
||||||
"noUnusedVariables": "error",
|
"noUnusedVariables": "error",
|
||||||
"noUnusedImports": "error",
|
"noUnusedImports": "error",
|
||||||
"useArrayLiterals": "off",
|
"useExhaustiveDependencies": "error",
|
||||||
"useExhaustiveDependencies": "warn",
|
"useHookAtTopLevel": "error"
|
||||||
"useHookAtTopLevel": "error",
|
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"noArguments": "error",
|
|
||||||
"noInferrableTypes": "error",
|
"noInferrableTypes": "error",
|
||||||
"noNamespace": "error",
|
"noNamespace": "error",
|
||||||
"useAsConstAssertion": "error",
|
"useAsConstAssertion": "error",
|
||||||
"useBlockStatements": "warn",
|
"useBlockStatements": "error",
|
||||||
"useConsistentArrayType": "error",
|
"useConsistentArrayType": "error",
|
||||||
"useConst": "error",
|
"useConst": "error",
|
||||||
"useForOf": "error",
|
"useForOf": "error",
|
||||||
"useImportType": "error",
|
"useImportType": "error",
|
||||||
"useShorthandFunctionType": "error",
|
"useShorthandFunctionType": "error",
|
||||||
"useThrowOnlyError": "error",
|
"useThrowOnlyError": "error",
|
||||||
|
"useArrayLiterals": "warn",
|
||||||
"useFilenamingConvention": {
|
"useFilenamingConvention": {
|
||||||
"level": "error",
|
"level": "error",
|
||||||
"options": {
|
"options": {
|
||||||
"strictCase": true,
|
"strictCase": true,
|
||||||
"requireAscii": true,
|
"requireAscii": true,
|
||||||
"filenameCases": ["kebab-case"],
|
"filenameCases": ["kebab-case"]
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
"suspicious": {
|
"suspicious": {
|
||||||
"noClassAssign": "off",
|
"noClassAssign": "off",
|
||||||
@@ -89,28 +88,32 @@
|
|||||||
"noUnsafeNegation": "off",
|
"noUnsafeNegation": "off",
|
||||||
"useAwait": "error",
|
"useAwait": "error",
|
||||||
"useGetterReturn": "off",
|
"useGetterReturn": "off",
|
||||||
"useNamespaceKeyword": "error",
|
"useNamespaceKeyword": "error"
|
||||||
},
|
},
|
||||||
"nursery": {
|
"nursery": {
|
||||||
"useSortedClasses": "warn",
|
"useSortedClasses": "error"
|
||||||
},
|
},
|
||||||
"a11y": {
|
"a11y": {
|
||||||
"useKeyWithClickEvents": "off",
|
"useKeyWithClickEvents": "off",
|
||||||
},
|
"useSemanticElements": "off"
|
||||||
},
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"javascript": {
|
"javascript": {
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"quoteStyle": "double",
|
"quoteStyle": "double",
|
||||||
"semicolons": "always",
|
"semicolons": "always",
|
||||||
"trailingCommas": "all",
|
"trailingCommas": "all"
|
||||||
},
|
},
|
||||||
"globals": [],
|
"globals": []
|
||||||
},
|
},
|
||||||
"json": {
|
"css": {
|
||||||
"formatter": {
|
"parser": {
|
||||||
"trailingCommas": "all",
|
"tailwindDirectives": true
|
||||||
},
|
},
|
||||||
|
"formatter": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@@ -124,12 +127,12 @@
|
|||||||
"strictCase": true,
|
"strictCase": true,
|
||||||
"requireAscii": true,
|
"requireAscii": true,
|
||||||
"match": "use.*",
|
"match": "use.*",
|
||||||
"filenameCases": ["camelCase"],
|
"filenameCases": ["camelCase"]
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"includes": ["src/lib/hooks/**/*.tsx"],
|
"includes": ["src/lib/hooks/**/*.tsx"],
|
||||||
@@ -139,12 +142,12 @@
|
|||||||
"useFilenamingConvention": {
|
"useFilenamingConvention": {
|
||||||
"level": "error",
|
"level": "error",
|
||||||
"options": {
|
"options": {
|
||||||
"match": "Hook_Should_Use_Ts_Extension!",
|
"match": "Hook_Should_Use_Ts_Extension!"
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
20
bun.lock
20
bun.lock
@@ -62,7 +62,7 @@
|
|||||||
"tailwind-merge": "^3.3.0",
|
"tailwind-merge": "^3.3.0",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.0.0-beta.1",
|
"@biomejs/biome": "2.3.8",
|
||||||
"@tauri-apps/cli": "^2.5.0",
|
"@tauri-apps/cli": "^2.5.0",
|
||||||
"@types/clone-deep": "^4.0.4",
|
"@types/clone-deep": "^4.0.4",
|
||||||
"@types/node": "^22.15.24",
|
"@types/node": "^22.15.24",
|
||||||
@@ -144,23 +144,23 @@
|
|||||||
|
|
||||||
"@babel/types": ["@babel/types@7.27.1", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q=="],
|
"@babel/types": ["@babel/types@7.27.1", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q=="],
|
||||||
|
|
||||||
"@biomejs/biome": ["@biomejs/biome@2.0.0-beta.1", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.0.0-beta.1", "@biomejs/cli-darwin-x64": "2.0.0-beta.1", "@biomejs/cli-linux-arm64": "2.0.0-beta.1", "@biomejs/cli-linux-arm64-musl": "2.0.0-beta.1", "@biomejs/cli-linux-x64": "2.0.0-beta.1", "@biomejs/cli-linux-x64-musl": "2.0.0-beta.1", "@biomejs/cli-win32-arm64": "2.0.0-beta.1", "@biomejs/cli-win32-x64": "2.0.0-beta.1" }, "bin": { "biome": "bin/biome" } }, "sha512-MqRoy9CbTkrS45zW+S4u8p4kQUIFx0mGUWi789W1R3b1kXYIudEqsTKgXKtTGsI0kWOlvnjuKqwTrabjaGchhQ=="],
|
"@biomejs/biome": ["@biomejs/biome@2.3.8", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.8", "@biomejs/cli-darwin-x64": "2.3.8", "@biomejs/cli-linux-arm64": "2.3.8", "@biomejs/cli-linux-arm64-musl": "2.3.8", "@biomejs/cli-linux-x64": "2.3.8", "@biomejs/cli-linux-x64-musl": "2.3.8", "@biomejs/cli-win32-arm64": "2.3.8", "@biomejs/cli-win32-x64": "2.3.8" }, "bin": { "biome": "bin/biome" } }, "sha512-Qjsgoe6FEBxWAUzwFGFrB+1+M8y/y5kwmg5CHac+GSVOdmOIqsAiXM5QMVGZJ1eCUCLlPZtq4aFAQ0eawEUuUA=="],
|
||||||
|
|
||||||
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.0.0-beta.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RaGmpNLl5NFooXaoCwvgvcuU6Am/rMZ3R48pQeCVxjrCcz1BIlKLTai5UosiedazW7JbXAvgXdSNizYG7ITlAQ=="],
|
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-HM4Zg9CGQ3txTPflxD19n8MFPrmUAjaC7PQdLkugeeC0cQ+PiVrd7i09gaBS/11QKsTDBJhVg85CEIK9f50Qww=="],
|
||||||
|
|
||||||
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.0.0-beta.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-sTzSshkne7HKZFNfiIhmAji7gjtCBXvkTujZELCZWIZC7oj1Tjw/gvAzbdFj2UyHd5/i90pND4ybFOLQZm9gpg=="],
|
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.8", "", { "os": "darwin", "cpu": "x64" }, "sha512-lUDQ03D7y/qEao7RgdjWVGCu+BLYadhKTm40HkpJIi6kn8LSv5PAwRlew/DmwP4YZ9ke9XXoTIQDO1vAnbRZlA=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.0.0-beta.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-bxce2O4nooBmp20Ey0+IFIZyy/b0RVnciIQk9euCfAi9evq7SvFtMBYo3YUZej0KIvrau5H7tJk5OqmRJk2l+g=="],
|
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-Uo1OJnIkJgSgF+USx970fsM/drtPcQ39I+JO+Fjsaa9ZdCN1oysQmy6oAGbyESlouz+rzEckLTF6DS7cWse95g=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.0.0-beta.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-0MPUKzz9uBBxAYSJ+OlFi4+yGwiRcZeFqq39H0MxXCQ9MMpKJFH2Ek72fw8sXwG7Prn7EsW/3u1b7najyn1XGQ=="],
|
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-PShR4mM0sjksUMyxbyPNMxoKFPVF48fU8Qe8Sfx6w6F42verbwRLbz+QiKNiDPRJwUoMG1nPM50OBL3aOnTevA=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.0.0-beta.1", "", { "os": "linux", "cpu": "x64" }, "sha512-6P/AtJv4hOH8mu8ez0c4UInUpiet9NEoF25+O7OPyb4w6ZHJMp2qzvayJS7TKrTQzE5KUvSiNsACGRz34DzUkg=="],
|
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.8", "", { "os": "linux", "cpu": "x64" }, "sha512-QDPMD5bQz6qOVb3kiBui0zKZXASLo0NIQ9JVJio5RveBEFgDgsvJFUvZIbMbUZT3T00M/1wdzwWXk4GIh0KaAw=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.0.0-beta.1", "", { "os": "linux", "cpu": "x64" }, "sha512-dFvisnP1hFpVILNw0PZfs8piBwe8+aykO04Tb/4AJDVVzKkGgJfwSefwo4jqzO/Wk/Zruvhcp1nKbjgRXM+vDg=="],
|
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.8", "", { "os": "linux", "cpu": "x64" }, "sha512-YGLkqU91r1276uwSjiUD/xaVikdxgV1QpsicT0bIA1TaieM6E5ibMZeSyjQ/izBn4tKQthUSsVZacmoJfa3pDA=="],
|
||||||
|
|
||||||
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.0.0-beta.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-0C9YSqWHf2cJGnjKDbLi49xv6H9IfqbDsFav7X557PqwY64O6IKWqcmZzi/PkDFHjQM9opU6uhKapeGKGDxziQ=="],
|
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.8", "", { "os": "win32", "cpu": "arm64" }, "sha512-H4IoCHvL1fXKDrTALeTKMiE7GGWFAraDwBYFquE/L/5r1927Te0mYIGseXi4F+lrrwhSWbSGt5qPFswNoBaCxg=="],
|
||||||
|
|
||||||
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.0.0-beta.1", "", { "os": "win32", "cpu": "x64" }, "sha512-o8W6+DX0YRjt1kS8Y3ismq6EkjwiVDv7X0TEpfnFywoVG8HoJ7G7/m9r8LM1yE46WI3maPH2A0MoVpQ1ZNG++A=="],
|
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.8", "", { "os": "win32", "cpu": "x64" }, "sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w=="],
|
||||||
|
|
||||||
"@emotion/is-prop-valid": ["@emotion/is-prop-valid@1.3.1", "", { "dependencies": { "@emotion/memoize": "^0.9.0" } }, "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw=="],
|
"@emotion/is-prop-valid": ["@emotion/is-prop-valid@1.3.1", "", { "dependencies": { "@emotion/memoize": "^0.9.0" } }, "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw=="],
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
"tailwind-merge": "^3.3.0"
|
"tailwind-merge": "^3.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.0.0-beta.1",
|
"@biomejs/biome": "2.3.8",
|
||||||
"@tauri-apps/cli": "^2.5.0",
|
"@tauri-apps/cli": "^2.5.0",
|
||||||
"@types/clone-deep": "^4.0.4",
|
"@types/clone-deep": "^4.0.4",
|
||||||
"@types/node": "^22.15.24",
|
"@types/node": "^22.15.24",
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export function GameBox({ game }: { game: GameEntry; isFirst?: boolean }) {
|
|||||||
pushModal(<GameDetailsModal gameData={r.game} />);
|
pushModal(<GameDetailsModal gameData={r.game} />);
|
||||||
}
|
}
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
toast.error("Unknown error: " + stringifyError(e));
|
toast.error(`Unknown error: ${stringifyError(e)}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -204,6 +204,8 @@ export function GameBox({ game }: { game: GameEntry; isFirst?: boolean }) {
|
|||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
onDoubleClick={openGame}
|
onDoubleClick={openGame}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
{isPending && (
|
{isPending && (
|
||||||
<div className="center absolute inset-0 bg-black/60">
|
<div className="center absolute inset-0 bg-black/60">
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ function NoGameFound() {
|
|||||||
<div
|
<div
|
||||||
className="flex h-[150px] w-[300px] cursor-pointer flex-col items-center justify-center rounded-md border border-dashed text-sm"
|
className="flex h-[150px] w-[300px] cursor-pointer flex-col items-center justify-center rounded-md border border-dashed text-sm"
|
||||||
onClick={() => void openGameFolder()}
|
onClick={() => void openGameFolder()}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<span>No game found :(</span>
|
<span>No game found :(</span>
|
||||||
<span>Click here to open game folder</span>
|
<span>Click here to open game folder</span>
|
||||||
@@ -149,6 +151,7 @@ function Grid({ search }: { search: string }) {
|
|||||||
{Array(itemPerRow - entries.length)
|
{Array(itemPerRow - entries.length)
|
||||||
.fill(0)
|
.fill(0)
|
||||||
.map((_, i) => (
|
.map((_, i) => (
|
||||||
|
// biome-ignore lint/suspicious/noArrayIndexKey: This is a skeleton element, order doesn't matter
|
||||||
<EmptyGameBox key={i} />
|
<EmptyGameBox key={i} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export function LoadingOverlay() {
|
|||||||
const value = useAtomValue(atomDownloadingOverlay);
|
const value = useAtomValue(atomDownloadingOverlay);
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return <></>;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props: LoadingProps = {};
|
const props: LoadingProps = {};
|
||||||
|
|||||||
@@ -333,22 +333,20 @@ export function LogList({ runningGame, levelFilter, classFilter }: Props) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="flex-1 overflow-y-auto rounded-md border contain-strict">
|
||||||
<div className="flex-1 overflow-y-auto rounded-md border contain-strict">
|
<DataEditor
|
||||||
<DataEditor
|
columns={columns}
|
||||||
columns={columns}
|
drawHeader={() => false}
|
||||||
drawHeader={() => false}
|
getCellContent={getCellContent}
|
||||||
getCellContent={getCellContent}
|
getCellsForSelection={getCellForSelection}
|
||||||
getCellsForSelection={getCellForSelection}
|
headerHeight={8}
|
||||||
headerHeight={8}
|
onColumnResize={onColumnResize}
|
||||||
onColumnResize={onColumnResize}
|
onVisibleRegionChanged={onVisibleRegionChanged}
|
||||||
onVisibleRegionChanged={onVisibleRegionChanged}
|
ref={dataGridRef}
|
||||||
ref={dataGridRef}
|
rows={rowCount}
|
||||||
rows={rowCount}
|
theme={isDark ? darkTheme : theme}
|
||||||
theme={isDark ? darkTheme : theme}
|
width="100%"
|
||||||
width="100%"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function ModalOverlay() {
|
|||||||
const { modalStack } = useNavigator();
|
const { modalStack } = useNavigator();
|
||||||
|
|
||||||
if (modalStack.length === 0) {
|
if (modalStack.length === 0) {
|
||||||
return <></>;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = modalStack[modalStack.length - 1];
|
const modal = modalStack[modalStack.length - 1];
|
||||||
|
|||||||
@@ -138,13 +138,11 @@ export function FolderConfigModal() {
|
|||||||
const { popModal } = useNavigator();
|
const { popModal } = useNavigator();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Dialog onOpenChange={() => popModal()} open>
|
||||||
<Dialog onOpenChange={() => popModal()} open>
|
<DialogTitle className="hidden">Configuration</DialogTitle>
|
||||||
<DialogTitle className="hidden">Configuration</DialogTitle>
|
<DialogContent aria-describedby={undefined}>
|
||||||
<DialogContent aria-describedby={undefined}>
|
<PathConfig />
|
||||||
<PathConfig />
|
</DialogContent>
|
||||||
</DialogContent>
|
</Dialog>
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export function RunningGameModal({
|
|||||||
toast.success("Log saved");
|
toast.success("Log saved");
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
console.error("Error saving log", e);
|
console.error("Error saving log", e);
|
||||||
toast.error("Error saving log: " + stringifyError(e));
|
toast.error(`Error saving log: ${stringifyError(e)}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ function AddCustom({ reset }: { reset: Callback }) {
|
|||||||
path: binaryPath,
|
path: binaryPath,
|
||||||
name,
|
name,
|
||||||
repo: "Local",
|
repo: "Local",
|
||||||
date: new Date().getTime(),
|
date: Date.now(),
|
||||||
};
|
};
|
||||||
setInstalledVersions((prev) => [...prev, data]);
|
setInstalledVersions((prev) => [...prev, data]);
|
||||||
reset();
|
reset();
|
||||||
@@ -374,7 +374,7 @@ function RepoEdit() {
|
|||||||
name = name.slice(dotCom + 5);
|
name = name.slice(dotCom + 5);
|
||||||
setNewRepo(name);
|
setNewRepo(name);
|
||||||
}
|
}
|
||||||
return /^[\w\-]+\/[\w\-]+$/.test(name) ? name : null;
|
return /^[\w-]+\/[\w-]+$/.test(name) ? name : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const addRepo = () => {
|
const addRepo = () => {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export function PatchPanel({ gameData }: { gameData: GameEntry }) {
|
|||||||
setPatchLines(file.getPatchLines());
|
setPatchLines(file.getPatchLines());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to parse patch file", e);
|
console.error("Failed to parse patch file", e);
|
||||||
toast.error("Failed to parse patch file. " + stringifyError(e));
|
toast.error(`Failed to parse patch file. ${stringifyError(e)}`);
|
||||||
setPatchFile(null);
|
setPatchFile(null);
|
||||||
setPatchLines([]);
|
setPatchLines([]);
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ export function PatchPanel({ gameData }: { gameData: GameEntry }) {
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error("Failed to save patch file", e);
|
console.error("Failed to save patch file", e);
|
||||||
toast.error("Failed to save patch file. " + e.message);
|
toast.error(`Failed to save patch file. ${e.message}`);
|
||||||
});
|
});
|
||||||
}, [patchFile]);
|
}, [patchFile]);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ function SingleGameIcon({
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
pushModal(<RunningGameModal runningGame={runningGame} />)
|
pushModal(<RunningGameModal runningGame={runningGame} />)
|
||||||
}
|
}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<div className="absolute top-0 right-0 size-2">
|
<div className="absolute top-0 right-0 size-2">
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export function Navigable({
|
|||||||
const navField = useGamepadNavField();
|
const navField = useGamepadNavField();
|
||||||
|
|
||||||
useImperativeHandle(parentRef, () => {
|
useImperativeHandle(parentRef, () => {
|
||||||
return ref.current!;
|
return ref.current as HTMLElement;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onSelect = useCallback(
|
const onSelect = useCallback(
|
||||||
@@ -47,7 +47,9 @@ export function Navigable({
|
|||||||
if (!e.isPreventingDefault) {
|
if (!e.isPreventingDefault) {
|
||||||
document
|
document
|
||||||
.querySelectorAll("*[data-gamepad-focus]")
|
.querySelectorAll("*[data-gamepad-focus]")
|
||||||
.forEach((el) => el.removeAttribute("data-gamepad-focus"));
|
.forEach((el) => {
|
||||||
|
el.removeAttribute("data-gamepad-focus");
|
||||||
|
});
|
||||||
const el = ref.current;
|
const el = ref.current;
|
||||||
if (el) {
|
if (el) {
|
||||||
el.setAttribute("data-gamepad-focus", "true");
|
el.setAttribute("data-gamepad-focus", "true");
|
||||||
@@ -102,10 +104,8 @@ export function Navigable({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Slot ref={ref} tabIndex={tabIndex ?? 0} {...props}>
|
||||||
<Slot ref={ref} tabIndex={tabIndex ?? 0} {...props}>
|
{children}
|
||||||
{children}
|
</Slot>
|
||||||
</Slot>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function UpdateIcon() {
|
|||||||
const availableUpdate = useAtomValue(atomAvailableUpdate);
|
const availableUpdate = useAtomValue(atomAvailableUpdate);
|
||||||
|
|
||||||
if (!availableUpdate) {
|
if (!availableUpdate) {
|
||||||
return <></>;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return createPortal(
|
return createPortal(
|
||||||
@@ -19,6 +19,8 @@ export function UpdateIcon() {
|
|||||||
<div
|
<div
|
||||||
className="animate-bounce cursor-pointer rounded-full bg-green-100 p-4"
|
className="animate-bounce cursor-pointer rounded-full bg-green-100 p-4"
|
||||||
onClick={installUpdate}
|
onClick={installUpdate}
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<DownloadIcon className="h-5 w-5 text-green-700" />
|
<DownloadIcon className="h-5 w-5 text-green-700" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ function TomlInput({
|
|||||||
value={value}
|
value={value}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
case "number":
|
case "number":
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
@@ -54,7 +53,6 @@ function TomlInput({
|
|||||||
value={String(value)}
|
value={String(value)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
case "boolean":
|
case "boolean":
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
@@ -76,7 +74,6 @@ function TomlInput({
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export async function installUpdate() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let progress = 0;
|
let progress = 0;
|
||||||
let totalSize: number | undefined = undefined;
|
let totalSize: number | undefined;
|
||||||
await update.downloadAndInstall((ev) => {
|
await update.downloadAndInstall((ev) => {
|
||||||
switch (ev.event) {
|
switch (ev.event) {
|
||||||
case "Started":
|
case "Started":
|
||||||
@@ -80,6 +80,6 @@ export async function installUpdate() {
|
|||||||
await relaunch();
|
await relaunch();
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
console.error("download update error", e);
|
console.error("download update error", e);
|
||||||
toast.error("Error downloading update: " + stringifyError(e));
|
toast.error(`Error downloading update: ${stringifyError(e)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ export function downloadCheats(repo: CheatRepository, store: JotaiStore) {
|
|||||||
.map((line) => {
|
.map((line) => {
|
||||||
const [key] = line.trim().split("=", 1);
|
const [key] = line.trim().split("=", 1);
|
||||||
if (!key) {
|
if (!key) {
|
||||||
return errAsync("invalid key line: " + line);
|
return errAsync(`invalid key line: ${line}`);
|
||||||
}
|
}
|
||||||
return fetchSafe(createUrl(key))
|
return fetchSafe(createUrl(key))
|
||||||
.map((e) => e.arrayBuffer())
|
.map((e) => e.arrayBuffer())
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export function handleGameProcess(
|
|||||||
})
|
})
|
||||||
.catch((e: unknown) => {
|
.catch((e: unknown) => {
|
||||||
console.error("Unknown restart error", e);
|
console.error("Unknown restart error", e);
|
||||||
toast.error("Unknown restart error: " + stringifyError(e));
|
toast.error(`Unknown restart error: ${stringifyError(e)}`);
|
||||||
store.set(state.atomRunning, -1);
|
store.set(state.atomRunning, -1);
|
||||||
store.set(state.atomError, stringifyError(e));
|
store.set(state.atomError, stringifyError(e));
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -376,7 +376,9 @@ export function GamepadNavField({
|
|||||||
);
|
);
|
||||||
document
|
document
|
||||||
.querySelectorAll("*[data-gamepad-focus]")
|
.querySelectorAll("*[data-gamepad-focus]")
|
||||||
.forEach((el) => el.removeAttribute("data-gamepad-focus"));
|
.forEach((el) => {
|
||||||
|
el.removeAttribute("data-gamepad-focus");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
window.addEventListener("mousedown", c);
|
window.addEventListener("mousedown", c);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export function useDebounceAction<T extends () => void>(
|
|||||||
action();
|
action();
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: useEffectEvent is untracked
|
|
||||||
return useCallback(() => {
|
return useCallback(() => {
|
||||||
clearTimeout(lastTimeout.current);
|
clearTimeout(lastTimeout.current);
|
||||||
lastTimeout.current = setTimeout(() => {
|
lastTimeout.current = setTimeout(() => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function forwardConsole(
|
|||||||
const original = console[fnName];
|
const original = console[fnName];
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: This is the original signature
|
// biome-ignore lint/suspicious/noExplicitAny: This is the original signature
|
||||||
console[fnName] = function (...data: any[]) {
|
console[fnName] = function (...data: any[]) {
|
||||||
let callFrame: ErrorStackParser.StackFrame | undefined = undefined;
|
let callFrame: ErrorStackParser.StackFrame | undefined;
|
||||||
try {
|
try {
|
||||||
callFrame = ErrorStackParser.parse(new Error())?.[1];
|
callFrame = ErrorStackParser.parse(new Error())?.[1];
|
||||||
} catch (_e) {
|
} catch (_e) {
|
||||||
@@ -78,6 +78,8 @@ function forwardConsole(
|
|||||||
}
|
}
|
||||||
case "undefined":
|
case "undefined":
|
||||||
return "undefined";
|
return "undefined";
|
||||||
|
default:
|
||||||
|
throw new Error("UNREACHABLE");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.join(" "),
|
.join(" "),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { type Atom, atom } from "jotai";
|
|||||||
import { loadable } from "jotai/utils";
|
import { loadable } from "jotai/utils";
|
||||||
|
|
||||||
export function atomKeepLast<T>(src: Atom<T>): Atom<T> {
|
export function atomKeepLast<T>(src: Atom<T>): Atom<T> {
|
||||||
let prevData: T | undefined = undefined;
|
let prevData: T | undefined;
|
||||||
const srcLoadable = loadable(src);
|
const srcLoadable = loadable(src);
|
||||||
return atom((get) => {
|
return atom((get) => {
|
||||||
const value = get(srcLoadable);
|
const value = get(srcLoadable);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ async function loadGameData(path: string): Promise<GameEntry> {
|
|||||||
return {
|
return {
|
||||||
id: -1,
|
id: -1,
|
||||||
path: path,
|
path: path,
|
||||||
cusa: ("N/A - " + base) as CUSA,
|
cusa: `N/A - ${base}` as CUSA,
|
||||||
title: base,
|
title: base,
|
||||||
version: "N/A",
|
version: "N/A",
|
||||||
fw_version: "N/A",
|
fw_version: "N/A",
|
||||||
@@ -111,10 +111,7 @@ async function registerGamePath(workPath: string) {
|
|||||||
gameRegisterQueueIsUse = false;
|
gameRegisterQueueIsUse = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unregisterGamePathPrefix(
|
function unregisterGamePathPrefix(pathPrefix: string, knownPaths: Set<string>) {
|
||||||
pathPrefix: string,
|
|
||||||
knownPaths: Set<string>,
|
|
||||||
) {
|
|
||||||
defaultStore.set(atomGameLibrary, (prev) =>
|
defaultStore.set(atomGameLibrary, (prev) =>
|
||||||
prev.filter((e) => {
|
prev.filter((e) => {
|
||||||
const toRemove = e.path.startsWith(pathPrefix);
|
const toRemove = e.path.startsWith(pathPrefix);
|
||||||
@@ -169,10 +166,7 @@ async function scanDirectory(
|
|||||||
}
|
}
|
||||||
|
|
||||||
tempKnownPaths.forEach((path) => {
|
tempKnownPaths.forEach((path) => {
|
||||||
unregisterGamePathPrefix(
|
unregisterGamePathPrefix(path, knownPaths);
|
||||||
path,
|
|
||||||
knownPaths,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
console.error(`Error discovering game at "${path}"`, e);
|
console.error(`Error discovering game at "${path}"`, e);
|
||||||
@@ -280,7 +274,7 @@ async function scanDirectory(
|
|||||||
}
|
}
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
console.error("error watching path", stringifyError(e));
|
console.error("error watching path", stringifyError(e));
|
||||||
toast.error("Error watching games path: " + stringifyError(e));
|
toast.error(`Error watching games path: ${stringifyError(e)}`);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
cancel = () => {
|
cancel = () => {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export const atomAvailableVersions = atomWithQuery((get) => ({
|
|||||||
}),
|
}),
|
||||||
(err) =>
|
(err) =>
|
||||||
new Error(
|
new Error(
|
||||||
"GitHub API Error: " + stringifyError(err),
|
`GitHub API Error: ${stringifyError(err)}`,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
10000,
|
10000,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import path from "node:path";
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import path from "path";
|
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
const host = process.env.TAURI_DEV_HOST;
|
const host = process.env.TAURI_DEV_HOST;
|
||||||
|
|||||||
Reference in New Issue
Block a user