Skip to content
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
12 changes: 6 additions & 6 deletions .github/workflows/frontend-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ jobs:
- name: Install dependencies
run: npm install --legacy-peer-deps # Using legacy-peer-deps to handle React 19 compatibility

- name: Run ESLint
run: npm run lint
# No continue-on-error - let it fail naturally
# - name: Run ESLint
# run: npm run lint
# # No continue-on-error - let it fail naturally

- name: Run TypeScript type check
run: npm run type-check
Expand Down Expand Up @@ -113,9 +113,9 @@ jobs:
- name: Install dependencies
run: npm install --legacy-peer-deps # Using legacy-peer-deps to handle React 19 compatibility

- name: Run ESLint
run: npm run lint
# No continue-on-error - let it fail naturally
# - name: Run ESLint
# run: npm run lint
# # No continue-on-error - let it fail naturally

- name: Create check summary
if: always()
Expand Down
10 changes: 10 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

# 检查前端子目录的 diff 文件
echo "🔍 Linting frontend diff files..."
cd himarket-web/himarket-frontend && npx lint-staged

# 检查管理后台子目录的 diff 文件
echo "🔍 Linting admin diff files..."
cd ../himarket-admin && npx lint-staged

Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private String convertToMCPConfig(

// 设置 MCP Server 配置
MCPConfigResult.MCPServerConfig serverConfig = new MCPConfigResult.MCPServerConfig();
serverConfig.setPath("/" + data.getName());
serverConfig.setPath("/mcp-servers/" + data.getName());

// 获取网关实例访问信息并设置域名信息
List<DomainResult> domains = getGatewayAccessDomains(data.getGwInstanceId(), config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private String convertToMCPConfig(

// 设置MCP Server配置
MCPConfigResult.MCPServerConfig serverConfig = new MCPConfigResult.MCPServerConfig();
serverConfig.setPath("/" + data.getName());
serverConfig.setPath("/mcp-servers/" + data.getName());

// 获取网关实例访问信息并设置域名信息
List<DomainResult> domains = getGatewayAccessDomains(gwInstanceId, config);
Expand Down
7 changes: 7 additions & 0 deletions himarket-web/himarket-admin/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
build/
dist/
**/*.min.js
**/*-min.js
**/*.bundle.js
tailwind.config.js
10 changes: 10 additions & 0 deletions himarket-web/himarket-admin/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "avoid"
}
43 changes: 19 additions & 24 deletions himarket-web/himarket-admin/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
// import js from '@eslint/js'
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";

export default [
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
ignores: ['dist'],
},
js.configs.recommended,
{
files: ['**/*.{js,jsx}'],
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
// 允许在 effect 中调用异步函数,只要状态更新在异步回调中
"react-hooks/set-state-in-effect": "off",
},
languageOptions: {
globals: globals.browser,
},
},
]
];
16 changes: 15 additions & 1 deletion himarket-web/himarket-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,27 @@
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"lint-staged": "^16.2.7",
"prettier": "^3.7.4",
"express": "^4.21.2",
"globals": "^16.3.0",
"path": "^0.12.7",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "^5.6.3",
"url": "^0.11.4",
"typescript-eslint": "^8.35.1",
"vite": "^4.5.14"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{css,scss,json,md}": [
"prettier --write"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ export function ApiProductLinkApi({ apiProduct, linkedService, onLinkedServiceUp
const baseUrl = `${domain.protocol}://${formattedDomain}`;
let fullUrl = `${baseUrl}${path || '/'}`;

if (apiProduct.mcpConfig?.meta?.source === 'ADP_AI_GATEWAY' ||
apiProduct.mcpConfig?.meta?.source === 'APSARA_GATEWAY') {
fullUrl = `${baseUrl}/mcp-servers${path || '/'}`;
}

if (protocolType === 'SSE') {
// 仅生成SSE配置,不追加/sse
const sseConfig = {
Expand Down
7 changes: 7 additions & 0 deletions himarket-web/himarket-frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
build/
dist/
**/*.min.js
**/*-min.js
**/*.bundle.js
tailwind.config.js
1 change: 0 additions & 1 deletion himarket-web/himarket-frontend/.husky/pre-commit

This file was deleted.

10 changes: 10 additions & 0 deletions himarket-web/himarket-frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "avoid"
}
23 changes: 13 additions & 10 deletions himarket-web/himarket-frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
// import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";

export default [
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
// 允许在 effect 中调用异步函数,只要状态更新在异步回调中
"react-hooks/set-state-in-effect": "off",
},
languageOptions: {
globals: globals.browser,
},
},
]

];
13 changes: 13 additions & 0 deletions himarket-web/himarket-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,28 @@
"babel-plugin-react-compiler": "^1.0.0",
"compression": "^1.8.1",
"eslint": "^9.30.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"postcss": "^8.5.6",
"prettier": "^3.7.4",
"tailwindcss": "^3.4.3",
"terser": "^5.43.1",
"typescript": "~5.8.3",
"typescript-eslint": "^8.35.1",
"vite": "^6.4.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{css,scss,json,md}": [
"prettier --write"
]
}
}
4 changes: 0 additions & 4 deletions himarket-web/himarket-frontend/src/pages/McpDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ function McpDetail() {
const baseUrl = `${domain.protocol}://${formattedDomain}`;
let endpoint = `${baseUrl}${path}`;

if (mcpConfig?.meta?.source === 'ADP_AI_GATEWAY' || mcpConfig?.meta?.source === 'APSARA_GATEWAY') {
endpoint = `${baseUrl}/mcp-servers${path}`;
}

if (protocolType === 'SSE') {
// 仅生成SSE配置,不追加/sse
const sseConfig = `{
Expand Down
Loading