mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 23:11:56 +00:00
move type checking to other workflow, fix TS errors, add TSC checking
This commit is contained in:
@@ -11,23 +11,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2 # Check out the repository first.
|
- uses: actions/checkout@v2 # Check out the repository first.
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Install TypeScript dependencies
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
[ -f requirements.txt ] && pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: Install JavaScript dependencies
|
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: |
|
run: |
|
||||||
npm i -g pnpm
|
npm i -g pnpm
|
||||||
pnpm i --frozen-lockfile
|
pnpm i --frozen-lockfile
|
||||||
|
|
||||||
- name: Run pyright (Python)
|
- name: Run prettier (TypeScript)
|
||||||
uses: jakebailey/pyright-action@v1
|
|
||||||
with:
|
|
||||||
python-version: "3.10.6"
|
|
||||||
no-comments: true
|
|
||||||
|
|
||||||
- name: Run prettier (JavaScript & TypeScript)
|
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
run: pnpm run lint
|
run: pnpm run lint
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: Type check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
typecheck:
|
||||||
|
name: Run type checkers
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2 # Check out the repository first.
|
||||||
|
|
||||||
|
- name: Install Python dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
[ -f requirements.txt ] && pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Install TypeScript dependencies
|
||||||
|
working-directory: frontend
|
||||||
|
run: |
|
||||||
|
npm i -g pnpm
|
||||||
|
pnpm i --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run pyright (Python)
|
||||||
|
uses: jakebailey/pyright-action@v1
|
||||||
|
with:
|
||||||
|
python-version: "3.10.6"
|
||||||
|
no-comments: true
|
||||||
|
|
||||||
|
- name: Run tsc (TypeScript)
|
||||||
|
working-directory: frontend
|
||||||
|
run: $(pnpm bin)/tsc --noEmit
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
} from 'decky-frontend-lib';
|
} from 'decky-frontend-lib';
|
||||||
import { filesize } from 'filesize';
|
import { filesize } from 'filesize';
|
||||||
import { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react';
|
import { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { FileIcon, defaultStyles } from 'react-file-icon';
|
import { DefaultExtensionType, FileIcon, defaultStyles } from 'react-file-icon';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FaArrowUp, FaFolder } from 'react-icons/fa';
|
import { FaArrowUp, FaFolder } from 'react-icons/fa';
|
||||||
|
|
||||||
@@ -316,7 +316,12 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
|
|||||||
) : (
|
) : (
|
||||||
<div style={iconStyles}>
|
<div style={iconStyles}>
|
||||||
{file.realpath.includes('.') ? (
|
{file.realpath.includes('.') ? (
|
||||||
<FileIcon {...defaultStyles[extension]} {...styleDefObj[extension]} extension={''} />
|
<FileIcon
|
||||||
|
{...defaultStyles[extension as DefaultExtensionType]}
|
||||||
|
// @ts-expect-error
|
||||||
|
{...styleDefObj[extension]}
|
||||||
|
extension={''}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<FileIcon />
|
<FileIcon />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ const BranchSelect: FunctionComponent<{}> = () => {
|
|||||||
<Field label={t('BranchSelect.update_channel.label')} childrenContainerWidth={'fixed'}>
|
<Field label={t('BranchSelect.update_channel.label')} childrenContainerWidth={'fixed'}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
rgOptions={Object.values(UpdateBranch)
|
rgOptions={Object.values(UpdateBranch)
|
||||||
.filter((branch) => typeof branch == 'string')
|
.filter((branch) => typeof branch == 'number')
|
||||||
.map((branch) => ({
|
.map((branch) => ({
|
||||||
label: tBranches[UpdateBranch[branch]],
|
label: tBranches[branch as number],
|
||||||
data: UpdateBranch[branch],
|
data: branch,
|
||||||
}))}
|
}))}
|
||||||
selectedOption={selectedBranch}
|
selectedOption={selectedBranch}
|
||||||
onChange={async (newVal) => {
|
onChange={async (newVal) => {
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ const StoreSelect: FunctionComponent<{}> = () => {
|
|||||||
<Field label={t('StoreSelect.store_channel.label')} childrenContainerWidth={'fixed'}>
|
<Field label={t('StoreSelect.store_channel.label')} childrenContainerWidth={'fixed'}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
rgOptions={Object.values(Store)
|
rgOptions={Object.values(Store)
|
||||||
.filter((store) => typeof store == 'string')
|
.filter((store) => typeof store == 'number')
|
||||||
.map((store) => ({
|
.map((store) => ({
|
||||||
label: tStores[Store[store]],
|
label: tStores[store as number],
|
||||||
data: Store[store],
|
data: store,
|
||||||
}))}
|
}))}
|
||||||
selectedOption={selectedStore}
|
selectedOption={selectedStore}
|
||||||
onChange={async (newVal) => {
|
onChange={async (newVal) => {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true
|
||||||
|
|||||||
Reference in New Issue
Block a user