diff --git a/src/components/ContractDashboard.tsx b/src/components/ContractDashboard.tsx index dfc0ec9..7ae8832 100644 --- a/src/components/ContractDashboard.tsx +++ b/src/components/ContractDashboard.tsx @@ -1,4 +1,5 @@ import React, { useState } from "react"; +import { logger } from "../utils/logger"; /** * Multi-Network Contract Management Dashboard diff --git a/src/env.d.ts b/src/env.d.ts index 366ee3b..52f56c8 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,3 +1,9 @@ +/// + +interface ImportMetaEnv { + readonly VITE_API_URL?: string; +} + declare module "monaco-editor" { export type editor = typeof import("monaco-editor").editor; export namespace editor { diff --git a/src/pages/BatchMultiCall.tsx b/src/pages/BatchMultiCall.tsx index 10f4369..70e8417 100644 --- a/src/pages/BatchMultiCall.tsx +++ b/src/pages/BatchMultiCall.tsx @@ -404,12 +404,6 @@ export default function BatchMultiCall() { > Export as JSON - - diff --git a/src/services/sandbox-api.ts b/src/services/sandbox-api.ts index 93ca5f0..41cebc5 100644 --- a/src/services/sandbox-api.ts +++ b/src/services/sandbox-api.ts @@ -1,12 +1,5 @@ import { SandboxFile } from "./webcontainer"; -declare global { - interface ImportMeta { - readonly env: { - readonly VITE_API_URL?: string; - }; - } -} const API_BASE = import.meta.env.VITE_API_URL || "http://localhost:3001"; diff --git a/tsconfig.json b/tsconfig.json index 1bb3d89..d252fea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,11 @@ "jsx": "react-jsx", "strict": true, "noEmit": true, - "skipLibCheck": true + "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } }, "include": ["src"] } diff --git a/vite.config.ts b/vite.config.ts index 6cd1e3c..cc3b827 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,7 @@ +/// import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; +import path from "path"; import monacoEditorPluginPkg from "vite-plugin-monaco-editor"; const monacoEditorPlugin = monacoEditorPluginPkg.default || monacoEditorPluginPkg; @@ -103,9 +105,22 @@ export default defineConfig({ }, }, server: { proxy: { "/api": "http://localhost:3001" } }, + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + }, + }, test: { environment: "jsdom", globals: true, setupFiles: ["./test/setup.ts"], + coverage: { + provider: "v8", + reporter: ["text", "json", "html"], + statements: 80, + branches: 80, + functions: 80, + lines: 80, + }, }, }); diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index 5c61dbb..0000000 --- a/vitest.config.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { defineConfig } from "vitest/config"; -import react from "@vitejs/plugin-react"; -import path from "path"; - -export default defineConfig({ - plugins: [react()], - test: { - globals: true, - environment: "jsdom", - setupFiles: "./vitest.setup.ts", - coverage: { - provider: "v8", - reporter: ["text", "json", "html"], - statements: 80, - branches: 80, - functions: 80, - lines: 80, - }, - }, - resolve: { - alias: { - "@": path.resolve(__dirname, "./src"), - }, - }, -}); diff --git a/vitest.setup.ts b/vitest.setup.ts deleted file mode 100644 index f7c6f92..0000000 --- a/vitest.setup.ts +++ /dev/null @@ -1,7 +0,0 @@ -import "@testing-library/jest-dom"; -import { afterEach } from "vitest"; -import { cleanup } from "@testing-library/react"; - -afterEach(() => { - cleanup(); -});