Merge branch 'main' into add-npm-clean-script
This commit is contained in:
@@ -9,10 +9,34 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|||||||
const distPath = join(__dirname, "../dist");
|
const distPath = join(__dirname, "../dist");
|
||||||
|
|
||||||
const server = http.createServer((request, response) => {
|
const server = http.createServer((request, response) => {
|
||||||
return handler(request, response, {
|
const handlerOptions = {
|
||||||
public: distPath,
|
public: distPath,
|
||||||
rewrites: [{ source: "/**", destination: "/index.html" }],
|
rewrites: [{ source: "/**", destination: "/index.html" }],
|
||||||
});
|
headers: [
|
||||||
|
{
|
||||||
|
// Ensure index.html is never cached
|
||||||
|
source: "index.html",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "Cache-Control",
|
||||||
|
value: "no-cache, no-store, max-age=0",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Allow long-term caching for hashed assets
|
||||||
|
source: "assets/**",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "Cache-Control",
|
||||||
|
value: "public, max-age=31536000, immutable",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
return handler(request, response, handlerOptions);
|
||||||
});
|
});
|
||||||
|
|
||||||
const port = process.env.PORT || 6274;
|
const port = process.env.PORT || 6274;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { JsonValue } from "@/utils/jsonUtils";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { Copy, CheckCheck } from "lucide-react";
|
import { Copy, CheckCheck } from "lucide-react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import { getDataType, tryParseJson } from "@/utils/jsonUtils";
|
import { getDataType, tryParseJson } from "@/utils/jsonUtils";
|
||||||
|
|
||||||
interface JsonViewProps {
|
interface JsonViewProps {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";
|
|||||||
import { InspectorOAuthClientProvider } from "../lib/auth";
|
import { InspectorOAuthClientProvider } from "../lib/auth";
|
||||||
import { SESSION_KEYS } from "../lib/constants";
|
import { SESSION_KEYS } from "../lib/constants";
|
||||||
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
||||||
import { useToast } from "@/hooks/use-toast.ts";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import {
|
import {
|
||||||
generateOAuthErrorDescription,
|
generateOAuthErrorDescription,
|
||||||
parseOAuthCallbackParams,
|
parseOAuthCallbackParams,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
} from "@modelcontextprotocol/sdk/types.js";
|
} from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { PendingRequest } from "./SamplingTab";
|
import { PendingRequest } from "./SamplingTab";
|
||||||
import DynamicJsonForm from "./DynamicJsonForm";
|
import DynamicJsonForm from "./DynamicJsonForm";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
|
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
|
||||||
|
|
||||||
export type SamplingRequestProps = {
|
export type SamplingRequestProps = {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
} from "@modelcontextprotocol/sdk/types.js";
|
} from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { InspectorConfig } from "@/lib/configurationTypes";
|
import { InspectorConfig } from "@/lib/configurationTypes";
|
||||||
import { ConnectionStatus } from "@/lib/constants";
|
import { ConnectionStatus } from "@/lib/constants";
|
||||||
import useTheme from "../lib/useTheme";
|
import useTheme from "../lib/hooks/useTheme";
|
||||||
import { version } from "../../../package.json";
|
import { version } from "../../../package.json";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { InspectorConfig } from "@/lib/configurationTypes";
|
|||||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||||
|
|
||||||
// Mock theme hook
|
// Mock theme hook
|
||||||
jest.mock("../../lib/useTheme", () => ({
|
jest.mock("../../lib/hooks/useTheme", () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
default: () => ["light", jest.fn()],
|
default: () => ["light", jest.fn()],
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import {
|
import {
|
||||||
Toast,
|
Toast,
|
||||||
ToastClose,
|
ToastClose,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ jest.mock("@modelcontextprotocol/sdk/client/auth.js", () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// Mock the toast hook
|
// Mock the toast hook
|
||||||
jest.mock("@/hooks/use-toast", () => ({
|
jest.mock("@/lib/hooks/useToast", () => ({
|
||||||
useToast: () => ({
|
useToast: () => ({
|
||||||
toast: jest.fn(),
|
toast: jest.fn(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import {
|
|||||||
} from "@modelcontextprotocol/sdk/types.js";
|
} from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/lib/hooks/useToast";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { ConnectionStatus } from "../constants";
|
import { ConnectionStatus } from "../constants";
|
||||||
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
|
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
|
||||||
|
|||||||
Reference in New Issue
Block a user