Skip to content

Commit e3fbf5b

Browse files
committed
Only define catalog.yaml in one place
Signed-off-by: Trung Nguyen <[email protected]>
1 parent c96fad4 commit e3fbf5b

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

src/extension/ui/src/Constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { S3_CATALOG_URL } from '../urls';
2+
13
export const MCP_POLICY_NAME = 'MCP=*';
24
export const DD_BUILD_WITH_SECRET_SUPPORT = 184396;
35
// export const CATALOG_URL = "http://localhost:9911/catalog.yaml";
4-
export const CATALOG_URL = import.meta.env.DEV
5-
? '/catalog'
6-
: 'https://desktop.docker.com/mcp/catalog/catalog.yaml';
6+
export const CATALOG_URL = import.meta.env.DEV ? '/catalog' : S3_CATALOG_URL;
77

88
export const getUnsupportedSecretMessage = (ddVersion: {
99
version: string;

src/extension/ui/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"noEmit": true,
1717
"jsx": "react-jsx"
1818
},
19-
"include": ["src"],
19+
"include": ["src", "./urls.ts"],
2020
"references": [{ "path": "./tsconfig.node.json" }]
2121
}

src/extension/ui/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"moduleResolution": "Node",
66
"allowSyntheticDefaultImports": true
77
},
8-
"include": ["vite.config.ts"]
8+
"include": ["vite.config.ts", "./urls.ts"]
99
}

src/extension/ui/urls.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const S3_CATALOG_URL = "";

src/extension/ui/urls.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const S3_CATALOG_URL =
2+
'https://desktop.docker.com/mcp/catalog/catalog.yaml';

src/extension/ui/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import react from '@vitejs/plugin-react';
22
import { defineConfig } from 'vite';
33

4+
import { S3_CATALOG_URL } from './urls';
5+
46
// https://vitejs.dev/config/
57
export default defineConfig({
68
plugins: [react()],
@@ -28,7 +30,7 @@ export default defineConfig({
2830
port: 3000,
2931
proxy: {
3032
'/catalog': {
31-
target: 'https://desktop.docker.com/mcp/catalog/catalog.yaml',
33+
target: S3_CATALOG_URL,
3234
changeOrigin: true,
3335
rewrite: (path) => path.replace(/^\/catalog/, ''),
3436
},

0 commit comments

Comments
 (0)