i so want to see all ts

This commit is contained in:
lda
2026-04-12 02:22:00 +07:00 Unverified
parent a3389fa8a1
commit d2838ffdca
8 changed files with 67 additions and 9 deletions
+1
View File
@@ -14,6 +14,7 @@
"react-dom": "^18.3.1" "react-dom": "^18.3.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.10.2",
"@types/react": "^18.3.11", "@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1", "@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
+21 -5
View File
@@ -15,6 +15,9 @@ importers:
specifier: ^18.3.1 specifier: ^18.3.1
version: 18.3.1([email protected]) version: 18.3.1([email protected])
devDependencies: devDependencies:
'@types/node':
specifier: ^22.10.2
version: 22.19.17
'@types/react': '@types/react':
specifier: ^18.3.11 specifier: ^18.3.11
version: 18.3.28 version: 18.3.28
@@ -23,13 +26,13 @@ importers:
version: 18.3.7(@types/[email protected]) version: 18.3.7(@types/[email protected])
'@vitejs/plugin-react': '@vitejs/plugin-react':
specifier: ^4.3.1 specifier: ^4.3.1
version: 4.7.0([email protected]) version: 4.7.0([email protected](@types/[email protected]))
typescript: typescript:
specifier: ^5.6.3 specifier: ^5.6.3
version: 5.9.3 version: 5.9.3
vite: vite:
specifier: ^5.4.8 specifier: ^5.4.8
version: 5.4.21 version: 5.4.21(@types/[email protected])
packages: packages:
@@ -413,6 +416,9 @@ packages:
'@types/[email protected]': '@types/[email protected]':
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
'@types/[email protected]':
resolution: {integrity: sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==}
'@types/[email protected]': '@types/[email protected]':
resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==}
@@ -551,6 +557,9 @@ packages:
engines: {node: '>=14.17'} engines: {node: '>=14.17'}
hasBin: true hasBin: true
[email protected]:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
[email protected]: [email protected]:
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
hasBin: true hasBin: true
@@ -893,6 +902,10 @@ snapshots:
'@types/[email protected]': {} '@types/[email protected]': {}
'@types/[email protected]':
dependencies:
undici-types: 6.21.0
'@types/[email protected]': {} '@types/[email protected]': {}
'@types/[email protected](@types/[email protected])': '@types/[email protected](@types/[email protected])':
@@ -904,7 +917,7 @@ snapshots:
'@types/prop-types': 15.7.15 '@types/prop-types': 15.7.15
csstype: 3.2.3 csstype: 3.2.3
'@vitejs/[email protected]([email protected])': '@vitejs/[email protected]([email protected](@types/[email protected]))':
dependencies: dependencies:
'@babel/core': 7.29.0 '@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected]) '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
@@ -912,7 +925,7 @@ snapshots:
'@rolldown/pluginutils': 1.0.0-beta.27 '@rolldown/pluginutils': 1.0.0-beta.27
'@types/babel__core': 7.20.5 '@types/babel__core': 7.20.5
react-refresh: 0.17.0 react-refresh: 0.17.0
vite: 5.4.21 vite: 5.4.21(@types/[email protected])
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@@ -1052,18 +1065,21 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]: {}
[email protected]([email protected]): [email protected]([email protected]):
dependencies: dependencies:
browserslist: 4.28.2 browserslist: 4.28.2
escalade: 3.2.0 escalade: 3.2.0
picocolors: 1.1.1 picocolors: 1.1.1
[email protected]: [email protected](@types/[email protected]):
dependencies: dependencies:
esbuild: 0.21.5 esbuild: 0.21.5
postcss: 8.5.9 postcss: 8.5.9
rollup: 4.60.1 rollup: 4.60.1
optionalDependencies: optionalDependencies:
'@types/node': 22.19.17
fsevents: 2.3.3 fsevents: 2.3.3
[email protected]: {} [email protected]: {}
+1 -1
View File
@@ -10,7 +10,7 @@ import {
fetchAlertHistory, fetchAlertHistory,
fetchAudit, fetchAudit,
runCommand, runCommand,
} from "./api"; } from "@/api";
type LoadState = "idle" | "loading" | "ready" | "error"; type LoadState = "idle" | "loading" | "ready" | "error";
+1 -1
View File
@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { App } from "./App"; import { App } from "@/App";
import "./styles.css"; import "./styles.css";
createRoot(document.getElementById("root")!).render( createRoot(document.getElementById("root")!).render(
+3
View File
@@ -0,0 +1,3 @@
/// <reference types="vite/client" />
declare module "*.css";
+7 -2
View File
@@ -3,8 +3,12 @@
"target": "ES2020", "target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"], "lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext", "module": "ESNext",
"skipLibCheck": true, "ignoreDeprecations": "5.0",
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"paths": {
"@/*": ["./src/*"]
},
"skipLibCheck": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
@@ -14,5 +18,6 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true "noFallthroughCasesInSwitch": true
}, },
"include": ["src"] "include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
} }
+11
View File
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"],
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
},
"include": ["vite.config.ts"]
}
+22
View File
@@ -1,7 +1,29 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
function sourcemapEnabled(): boolean {
const explicit = process.env.UI_SOURCEMAP?.toLowerCase();
if (explicit) {
return explicit === "1" || explicit === "true" || explicit === "yes";
}
const rustLog = (process.env.RUST_LOG || "").toLowerCase();
return rustLog.includes("debug") || rustLog.includes("trace");
}
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
base: "/ui/", base: "/ui/",
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
build: {
sourcemap: sourcemapEnabled(),
},
}); });