Skip to content

Only define catalog.yaml in one place #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/extension/ui/src/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { S3_CATALOG_URL } from '../urls';

export const MCP_POLICY_NAME = 'MCP=*';
export const DD_BUILD_WITH_SECRET_SUPPORT = 184396;
// export const CATALOG_URL = "http://localhost:9911/catalog.yaml";
export const CATALOG_URL = import.meta.env.DEV
? '/catalog'
: 'https://desktop.docker.com/mcp/catalog/catalog.yaml';
export const CATALOG_URL = import.meta.env.DEV ? '/catalog' : S3_CATALOG_URL;

export const getUnsupportedSecretMessage = (ddVersion: {
version: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extension/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src"],
"include": ["src", "./urls.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
}
2 changes: 1 addition & 1 deletion src/extension/ui/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
"include": ["vite.config.ts", "./urls.ts"]
}
1 change: 1 addition & 0 deletions src/extension/ui/urls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const S3_CATALOG_URL = "";
2 changes: 2 additions & 0 deletions src/extension/ui/urls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const S3_CATALOG_URL =
'https://desktop.docker.com/mcp/catalog/catalog.yaml';
4 changes: 3 additions & 1 deletion src/extension/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

import { S3_CATALOG_URL } from './urls';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
Expand Down Expand Up @@ -28,7 +30,7 @@ export default defineConfig({
port: 3000,
proxy: {
'/catalog': {
target: 'https://desktop.docker.com/mcp/catalog/catalog.yaml',
target: S3_CATALOG_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/catalog/, ''),
},
Expand Down