From f3677ad60fceec7426437d68ce095d9e1dc25308 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 11 Apr 2025 00:55:16 +0800 Subject: [PATCH] save --- package.json | 8 ++++++++ src/extension.ts | 3 +-- tsconfig.json | 33 +++++++++++++++++---------------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 84fb422..7b41c84 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,14 @@ ] } }, + "scripts": { + "vscode:prepublish": "webpack --mode production", + "compile": "tsc -p ./", + "watch": "tsc -watch -p ./", + "pretest": "npm run compile && npm run lint", + "lint": "eslint src --ext ts", + "test": "node ./out/test/runTest.js" + }, "dependencies": { "@modelcontextprotocol/sdk": "^1.9.0", "axios": "^1.7.7", diff --git a/src/extension.ts b/src/extension.ts index 2f8c3f2..25e83ca 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,9 +1,8 @@ import * as vscode from 'vscode'; -import * as path from 'path'; import * as fs from 'fs'; import * as fspath from 'path'; -import * as OpenMCPService from '../resources/service'; +import * as OpenMCPService from '@resources/service'; function getWebviewContent(context: vscode.ExtensionContext, panel?: vscode.WebviewPanel): string | undefined { const viewRoot = fspath.join(context.extensionPath, 'resources', 'renderer'); diff --git a/tsconfig.json b/tsconfig.json index aada78e..d132474 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,18 @@ { - "compilerOptions": { - "module": "Node16", - "target": "ES2022", - "lib": [ - "ES2022" - ], - "sourceMap": true, - "rootDir": "src", - - "strict": true, /* enable all strict type-checking options */ - /* Additional Checks */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - } -} + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + // 允许访问 resources 目录 + "paths": { + "@resources/*": ["./resources/*"] + } + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "service", "renderer"] +} \ No newline at end of file